Waldek,

I have a compiled FriCAS on top of b29704530432ef7c8de7dae5.

The attached file is not finished, but the error message shows $ instead of %.

It eems you still have missed some places and $ still survived somehow.

Ralf


   compiling exported - : $ -> $
****** comp fails at level 5 with expression: ******
error in function -

(SEQ (|:=| (|:| |c| C) (- 1))
     (|exit| 1
      (|pretend|
       (@ | << | (|construct| |c| |x|) | >> |
        (|Union|
         (|:| |bin|
              (|Record| (|:| |fun| (|Mapping| B B B)) (|:| |fst| $)
                        (|:| |snd| $)))
         (|:| |cmul| (|Record| (|:| |const| C) (|:| |el| $)))
         (|:| |expn|
(|Record| (|:| |base| $) (|:| |expo| (|NonNegativeInteger|))))
         (|:| |elem| B)))
       $)))
****** level 5  ******
$x:= (construct c x)
$m:= (Union (: bin (Record (: fun (Mapping B B B)) (: fst $) (: snd $))) (: cmul (Record (: const C) (: el $))) (: expn (Record (: base $) (: expo (NonNegativeInteger)))) (: elem B))
$f:=
((((|c| # #) (|x| # #) (|case| #) (|elt| #) ...)))

   >> Apparent user error:
   NoValueMode
    is an unknown mode

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/c1a5a85f-bf03-223c-fb1a-0e0a4966e81a%40hemmecke.org.
)abbrev domain QLAZYALG QEtaLazyAlgebra
++ The domain QEtaLazyAlgebra(C, B) behaves like the C-algebra B, but
++ all arithmetic operations are stored as a tree and only performed
++ when the element is coerced back into an element of B.
QEtaLazyAlgebra(_
    C: CommutativeRing,_
    B: Join(Monoid, AbelianGroup) with (_*: (C, %) -> %)_
  ): Join(Monoid, AbelianGroup) with
    _*: (C, %) -> %
      ++ c*x create a new data structure for the multiplication of c
      ++ with x.
    coerce: B -> %
      ++ coerce(b) embeds element b into this domain.
    coerce: % -> B
      ++ coerc(x) turns the lazy data structure back into an element
      ++ of B.
 == add
    rep x ==> (x@%) pretend Rep
    per x ==> (x@Rep) pretend %
    NN ==> NonNegativeInteger
    BIN ==> Record(fun: (B, B) -> B, fst: %, snd: %)
    CMUL ==> Record(const: C, el: %)
    EXPN ==> Record(base: %, expo: NN)
    Rep ==> Union(bin: BIN, cmul: CMUL, expn: EXPN, elem: B)
    import from Rep
    coerce(x: %): OutputForm == x::B::OutputForm
    coerce(x: %): B ==
        r: Rep := rep x
        r case bin =>
            rbin := r.bin
            (rbin.fun)((rbin.fst)::B, (rbin.snd)::B)
        r case cmul =>
            cm := r.cmul
            cm.const * ((cm.el)::B)
        r case expn =>
            ex := r.expn
            ((ex.base)::B) ^ ex.expo
        r case elem => r.elem
        error "QEtaLazyAlgebra: unknown element"
    coerce(b: B): % == per [b]
    0: % == (0$B)::%
    1: % == (1$B)::%
    zero?(x: %): Boolean == zero?(x::B)
    _-(x: %): % ==
        c: C := -1
        per [c, x]
    ((x: %) + (y: %)): % == per [_+$B, x, y]
    ((x: %) - (y: %)): % == per [_-$B, x, y]
    ((x: %) * (y: %)): % == per [_*$B, x, y]

    ((c: C) * (x: %)): % == per [c, x]
    ((x: %) ^ (n: NN)): % == per [x, n]

Reply via email to