[Maxima] is(equal(x,y)) and infinities
rswarbrick at gmail.com
Sat Jun 2 02:43:20 CDT 2012
I've been hunting through some core Maxima code to try to work out where
one could insert hooks to make simplifications etc. work sensibly with
bare objects. I noticed that MEQP, used for implementing is(equal(...)),
contains the following test (line 1000 or so of compar.lisp):
((or (like a b)) (not (member a indefinites)))
((or (member a indefinites) (member b indefinites)
(member a infinities) (member b infinities)) nil)
.... more tests ....
INDEFINITES contains $UND and $IND, so the first bit makes sense (LIKE
is checking for syntactic equality). But the next bit seems strange to
me. It has the effect that
(%i1) is(equal(inf, inf));
(%i2) is(equal(inf, 1+inf));
The first happens because of the LIKE test, the second because 1+inf
isn't an atom equal to inf.
This seems really odd to me. Is there a reason we have this behaviour?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 315 bytes
Desc: not available
More information about the Maxima