1 Jun 2012 18:50
Re: Implicit: Taylor, Poiseux and Newton's diagram
Stavros Macrakis <macrakis <at> alum.mit.edu>
2012-06-01 16:50:58 GMT
2012-06-01 16:50:58 GMT
On Fri, Jun 1, 2012 at 3:29 AM, Oliver Kullmann <O.Kullmann <at> swansea.ac.uk> wrote:
By the way, how would one actually check in Maxima for identity, so that"1+1" is only identical to "1+1" and nothing else? It seems the evaluation
(rewriting) of 1+1 to 2 is hard to avoid?
In Maxima, it is important to distinguish between "evaluation" (substitution of values, calling of imperative routines) and "simplification" (rewriting).
Almost every part of Maxima dealing with mathematical objects depends on its input being in simplified form. For example, almost nothing in Maxima recognizes the unsimplified quotient a/b -- internally, it is always handled as a*b^-1. So for instance with simp=false, diff(x/x,x) => 'diff(x/x,x), though diff(x*x^-1,x) => x^-1*(x^-1*(-1)+log(x)*0)*x+1*x^-1 (which simplifies to 0).
Normally, simplification is on or off globally, so it is not easy to avoid simplification (rewriting) while also dealing with normal (simplifying) operations. However, it is possible to construct unsimplified expressions and force Maxima to treat them as if they were simplified -- see simpfunmake in my package simplifying.lisp (cf. http://www.ma.utexas.edu/pipermail/maxima/2011/024588.html). Some operations on these pseudo-simplified expressions will force simplification, and what exactly other operations perform on them is not easy to guess:
(%i20) foo: simpfunmake(verbify("*"),[2,3,a,a]);
((MTIMES SIMP) 2 3 $A $A)
(%o22) 3*a*a <<< the 2 is cancelled
(%o23) 2*3*a*a/3 <<< the 3 is not...
(%o24) 2*3*a <<< the a is cancelled
(%o25) 2*3*a/a <<< one a is cancelled, but not the other...
(%o28) true <<< "is" performs "mathematical" equality, not formal equality
(%i31) bar: simpfunmake(verbify("*"),[a,2,a]);
(%i43) bqz: simpfunmake(verbify("*"),[b,a,2,a,b]);
It's not clear to me exactly what problem you're trying to solve, but perhaps that helps?
Of course, another approach is simply to use your own functions/operators. Maxima is perfectly happy to deal with undefined functions in prefix or infix form:
(%i47) a %% b;
(%o47) a %% b
for which you can define your own rewrite rules (?? patterns) to apply automatically or only on demand.
_______________________________________________ Maxima mailing list Maxima <at> math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima