Fwd: Question about op, args.



On 7/10/2012 1:13 PM, SoC Stevenson wrote:
> bash-3.2$ maxima
> Maxima 5.26.0 http://maxima.sourceforge.net
> using Lisp SBCL 1.0.57
> Distributed under the GNU Public License. See the file COPYING.
> Dedicated to the memory of William Schelter.
> The function bug_report() provides bug reporting information.
> Good afternoon,
>
> I was exploring my understanding of the internals. My idea was to take
> something apart and put it back together.
>
> (%i1) teste : a + b $
>
> First surprise was that op(teste) is not a symbol but
> nounify(op(teste)) is. That's fine.
um, this is all much easier in lisp, but
you could try  op(teste,0) to get "+".



>
> (%i2) lop : nounify(op(teste));
> (%o2)                                mplus
>
> So here's the second surprise that args(teste) are reversed.

try this:   testf:  a*b;


args(testf).

conventionally, humans expect sums to have reverse ordering from products,
hence x+a   but   a*x.  Go figure.

Maxima has an internal form that is not always reflected in the 
formatted displayed version.

For example, internally there is no quotient.    a/b  is   a*b^(-1).

Depending on what you are really trying to do, my guess is you should 
just learn a little lisp.
and also maybe read this:

http://www.cs.berkeley.edu/~fateman/papers/simplifier.txt

while it is about 33 years old, it is still fairly accurate.