On 03/17/2011 10:19 AM, Yrogirg wrote:
> I failed to find the answer in axiom books (at least in first few). It
> is only said that "The type Expression Integer (abbreviated EXPR INT)
> is used to represent general symbolic expressions in Axiom".
>
> What is the underlying theory (I guess the one that underlies all
> CAS's)? Is there a technique to avoid this general type? Or why it
> should not be avoided?

Wow! What a question. Browsing through the history of the mailing archive, you'll find that I also don't like "Expression" very much.

The answer for whether "EXPR INT" represents a general expression is true and false in some sense.

True, because it is the way to take general input of a user (which is usually an expression -- actually even only a string of characters) and transforming that into some typed FriCAS object. Since there some guessing is involved and it doesn't succeed all the time, there must be some fallback. EXPR INT is such a fallback. It is somehow a necessary evil for the interpreter. When it however comes to library programming, I am very much for avoiding EXPR altogether.

The answer is false, because, the implementation of EXPR INT is not what perhaps other CAS do or how one would imagine an ordinary expression tree. FriCAS tries to figure out what the smallest units of the expressions are. Such "smallest units" are known by the term "kernel" (see Kernel as the corresponding domain). And then FriCAS tries to represent the expresssion as a rational function with coefficients being from INT (the argument of EXPR) and "variables" being these kernels.

If you look more carefully through the implementation of EXPR, then you find that there is not even just one internal representation.

>grep '^ *Rep' expr.spad.pamphlet
            Rep := Fraction MP
            Rep := MP
          Rep := FreeAbelianGroup K
            Rep := K
    Rep := RF

I hope that helps a bit.

Ralf

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to