A regression in Maxima 5.17.1 with limits and assumptions?



Raymond Toy wrote:
>>>>>> "Michael" == Michael Abshoff <michael.abshoff at googlemail.com> writes:

Hello folks,

>     Michael> Hi,
>     Michael> I noticed the following:
> 
>     Michael> Maxima 5.16.3 http://maxima.sourceforge.net
>     Michael> (%i1) limit(a*sin(x)/x, x,0);
>     Michael> (%o1)                                  a
> 
> 
>     Michael> In contrast 5.17.1:
> 
>     Michael> Maxima 5.17.1 http://maxima.sourceforge.net
>     Michael> (%i1) limit(a*sin(x)/x, x,0);
>     Michael> Is  a  positive, negative, or zero?
> 
>     Michael> positive;
>     Michael> (%o1)                                  a
> 
> 
> Hmm.  I guess the method used to compute this limit has changed in
> 5.17.  In 5.17, the method eventually calls BEHAVIOR, and it appears
> that this part of the code is responsible for the question:
> 
> 	      ((and (mtimesp exp)
> 		    (prog2 (setq pair (partition exp var 1))
> 			(not (mtimesp (cdr pair)))))
> 	       (setq sign (getsignl (car pair)))
> 	       (if (not (fixnump sign))
> 		   0
> 		   (* sign (behavior (cdr pair) var val))))
> 
> I think PARTITION splits EXP into parts, the first which is
> independent of VAR.  So I don't know why we need to compute the sign
> of that.

Ok, so is this something that you would consider worth fixing?

>     Michael> (%i2) forget();
>     Michael> (%o2)                                 []
>     Michael> (%i3) limit(a*sin(x)/x, x,0);
>     Michael> Is  a  positive, negative, or zero?
> 
>     Michael> zero;
>     Michael> (%o3)                                  a
> 
>     Michael> Since I just told Maxima that a equals zero shouldn't it take that into 
>     Michael> consideration?
> 
> Maxima doesn't normally remember your responses to these questions.
> (I kind of like it this way.  It makes exploration easier.)

Fair enough.

>     Michael> And also:
> 
>     Michael> (%i4) forget();
>     Michael> (%o4)                                 []
>     Michael> (%i5) limit(a*sin(x)/x, x,0);
>     Michael> Is  a  positive, negative, or zero?
> 
>     Michael> Now press CTRL-D and the question is repeated infinitely:
> 
>     Michael> (%i5) limit(a*sin(x)/x, x,0);
>     Michael> Is  a  positive, negative, or zero?
> 
> That appears to be an issue with Clisp.  In CMUCL, it just prints out
> the prompt again.  Gcl does something similar.
> 
> My guess is that Ctrl-D in clisp closes the stream that we're reading
> from and maxima doesn't notice that the stream has been closed and
> keeps asking.  If so, maxima should do something better than that.

Ok. I hit CTRL-D by accident in that situation and was surprised about 
the seemingly endless loop. It doesn't seem like a high priority issue 
from my POV.

> Ray
> 

Cheers,

Michael