Here is a better example. Much simpler to reproduce. Try
(%i1) kill(all);
(out0) done
(%i1) load(abs_integrate);
<junk deleted>
(out1)
C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac
(%i2) load(simplifying);
(out2)
C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/simplifying.lisp
(%i3) load(unwind_protect);
(out3)
C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/unwind_protect.lisp
(%i4) simpiif(__cnd, __a, __b):=
block(
[prederror:false],
if not member(safe_op(__cnd), [">", "<", ">=", "<=", 'equal, 'notequal, "not"]) then
error("Only relational operators are allowed including equal(), notequal() and not.")
elseif is(__cnd)=true then
__a
elseif is(__cnd)=false then
__b
else
/* simp_assuming does not work right here for some reason, it leaves facts on the facts list
without removing them all. Don't know why. */
simpfuncall('iif, __cnd, simp_assuming(__a, __cnd), simp_assuming(__b, not __cnd))
)$
(%i5) simplifying(iif,simpiif);
(out5) iif
(%i6) iif(x>0,iif(x>2,a,b),iif(x<-2,c,d));
(out6) iif(x > 0, b, d)
(%i7) facts();
(out7) [kind(sinh, one_to_one), kind(log, one_to_one), kind(tanh, one_to_one), kind(log,
increasing), 2 >= x, x >= - 2, 0 >= x]
(%i8)
Output 6 is wrong and facts are left on the list.
--------------------------------------------------
From: "Barton Willis" <willisb at unk.edu>
Sent: Monday, September 20, 2010 10:08 PM
To: "Richard Hennessy" <rich.hennessy at verizon.net>
Cc: "Maxima List" <maxima at math.utexas.edu>
Subject: Re: [Maxima] Possible bug in simp_assuming()
> Does your code load "unwind_protect"? Have you tried tracing forget? Maybe you could post an example.
>
> --Barton
>
> -----maxima-bounces at math.utexas.edu wrote: -----
>
>
>>I have created a simplifying function iif(). The code is below. For some
>>reason if I use simp_assuming() instead of my
>>own concoction it does not work right.