[Maxima] Program stack overflow defining infix operator
rich.hennessy at verizon.net
Sat Aug 8 15:29:30 CDT 2009
It is easy to put tellsimp rules on these functions too and get correct results but I guess there are better ways.
(%i1) matchdeclare([aa,bb,cc,dd,nn], true);
(%i2) tellsimp(%if(aa,bb,cc)+%if(aa,dd,nn), %if(aa,bb+dd,cc+nn));
tellsimp: warning: putting rules on '+' or '*' is inefficient, and may not work.
(out2) [+rule1, simplus]
(%i3) remove([aa,bb,cc,dd,nn], matchdeclare);
(out9) %if(x - 1 > 0, 11, 61)
(out10) %if((x - 3 > 0) %or (- (x + 3) > 0), 5, 7) + %if((x - 4 > 0) %or (- (x + 4) > 0), 3, 4)
----- Original Message -----
From: "Barton Willis" <willisb at unk.edu>
To: "Robert Dodier" <robert.dodier at gmail.com>
Cc: <maxima at math.utexas.edu>
Sent: Friday, August 07, 2009 11:06 AM
Subject: Re: [Maxima] Program stack overflow defining infix operator
The file to_poly_solve_extra.lisp has simplifying versions
of and, or, and if (%and, %or, and %if). Some of these functions
include a scheme for simplifying inequalities as well. Maybe
these functions could be a start for standard logical connectives.
-----maxima-bounces at math.utexas.edu wrote: -----
It turns out the Boolean functions have a nonstandard evaluation
scheme. In general Maxima has a 1-time evaluaton policy,
but functions can evaluate their arguments as much they want.
Re-evaluation triggers the stack overflow here.
At present the Boolean functions MAND, MOR, MNOT are
functions which quote their arguments (DEFMSPEC), then they
explicitly call MEVAL. (This situation has existed since before
I arrived on the scene.) It would be better to do away with the
DEFMSPEC and MEVAL and make them simplifying functions
instead. That would avoid this bug, and make the Boolean
functions more like other, mathematical functions in Maxima.
I'll put it on my to-do list, unless someone wants to talk me
out of it. Someone else could do it too, I won't complain.
Maxima mailing list
Maxima at math.utexas.edu
More information about the Maxima