Errors in the testsuite



Am Dienstag, den 30.03.2010, 21:56 -0400 schrieb Raymond Toy:
> On 3/30/10 8:56 PM, Dieter Kaiser wrote:
> > Am Dienstag, den 30.03.2010, 20:17 -0400 schrieb Raymond Toy:
> >   
> >> On 3/30/10 3:01 PM, Dieter Kaiser wrote:
> >>     
> >>> I get errors in testsuite with the current CVS version. The error is
> >>> triggered in the routine res after a call from the routine unitcir.
> >>>
> >>> This is a trace for the functions unitcir and res for one example:
> >>>
> >>> (%i8) integrate(1/(2+cos(x)),x,0,%pi);
> >>>   0: (UNITCIR
> >>>       ((MTIMES SIMP) 2
> >>>        ((MEXPT SIMP)
> >>>         ((MPLUS SIMP) 1 ((MTIMES SIMP RATSIMP) 4 YY)
> >>>          ((MEXPT SIMP RATSIMP) YY 2))
> >>>         -1))
> >>>       YY)
> >>>     1: (RES 2
> >>>             ((MPLUS SIMP) 1 ((MTIMES SIMP RATSIMP) 4 YY)
> >>>              ((MEXPT SIMP RATSIMP) YY 2))
> >>>             #<FUNCTION (LAMBDA #) {B20D885}> #<FUNCTION (LAMBDA #)
> >>> {B20D9ED}>)
> >>> Maxima encountered a Lisp error:
> >>>
> >>>  The value $NEG is not of type LIST.
> >>>   
> >>>       
> >> Although I sometimes forget to run the testsuite, I did run the
> >> testsuite before checking in this change.  I ran it again and cmucl and
> >> clozure cl both handle the integrals just fine.
> >>
> >> The backtrace above seems to indicate that the error is in RES.  But RES
> >> doesn't call region or region1.  
> >>
> >> Can you run it again but start maxima with the -g flag so you get dumped
> >> into the Lisp debugger?  That will produce a better backtrace and
> >> perhaps also give the offending source line.
> >>     
> > Hello Ray,
> >
> > this is a complete backtrace I have got for the example from above:
> >
> > (%i3) integrate(1/(2+cos(x)),x,0,%pi);
> >
> > debugger invoked on a TYPE-ERROR in thread #<THREAD "initial thread"
> > RUNNING {C2BBBA1}>:
> >   The value $NEG is not of type LIST.
> >
> > Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
> >
> > restarts (invokable by number or by possibly-abbreviated name):
> >   0: [MACSYMA-QUIT] Maxima top-level
> >   1: [CONTINUE    ] Ignore runtime option --eval "(cl-user::run)".
> >   2: [ABORT       ] Skip rest of --eval and --load options.
> >   3:                Skip to toplevel READ/EVAL/PRINT loop.
> >   4: [QUIT        ] Quit SBCL (calling #'QUIT, killing the process).
> >
> > (RES1
> >  2
> >  #<unavailable argument>
> >  (((MPLUS SIMP) -2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2))) . $NEG))
> > 0] backtrace
> >
> > 0: (RES1
> >     2
> >     #<unavailable argument>
> >     (((MPLUS SIMP) -2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2))) . $NEG))
> >   
> 
> This backtrace doesn't make any sense to me.  How did that $NEG get
> there?  Can you trace polelist and tell me what polelist returns?  With
> cmucl, polelist returns
> 
>        ((((MPLUS SIMP) -2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2)))
>          ((MPLUS SIMP) 2 ((MTIMES SIMP) -1 ((MEXPT SIMP) 3 ((RAT SIMP) 1
> 2)))
>           YY)
>          ((MPLUS SIMP) -2
>           ((MTIMES SIMP RATSIMP) -1 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2))))
>          ((MPLUS SIMP) 2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2)) YY))
>         NIL (((MPLUS SIMP) -2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2)))) NIL)
> 
> And tracing RES1, we see that RES1 is called
> 
>   0: (RES1 2
>            ((MPLUS SIMP) 4 ((MTIMES SIMP) 2 YY))
>            (((MPLUS SIMP) -2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2)))))
> 
> This matches what you show, except you some have have $NEG tacked on.

Hello Ray,

this is a trace of polelist, res, and res1. polelist returns a cons with
a symbol $neg in it.

(%i4) integrate(1/(2+cos(x)),x,0,%pi);
  0: (RES 2
          ((MPLUS SIMP) 1 ((MTIMES SIMP RATSIMP) 4 YY)
           ((MEXPT SIMP RATSIMP) YY 2))
          #<FUNCTION (LAMBDA #) {B095B2D}> #<FUNCTION (LAMBDA #)
{B095C95}>)
    1: (POLELIST
        ((MPLUS SIMP) 1 ((MTIMES SIMP RATSIMP) 4 YY)
         ((MEXPT SIMP RATSIMP) YY 2))
        #<FUNCTION (LAMBDA #) {B095B2D}> #<FUNCTION (LAMBDA #)
{B095C95}>)
    1: POLELIST returned
         ((((MPLUS SIMP) -2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2)))
           ((MPLUS SIMP) 2 ((MTIMES SIMP) -1 ((MEXPT SIMP) 3 ((RAT SIMP)
1 2)))
            YY)
           ((MPLUS SIMP) -2
            ((MTIMES SIMP RATSIMP) -1 ((MEXPT SIMP) 3 ((RAT SIMP) 1
2))))
           ((MPLUS SIMP) 2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2)) YY))
          NIL (((MPLUS SIMP) -2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2))) .
$NEG) NIL)
    1: (RES1 2 ((MPLUS SIMP) 4 ((MTIMES SIMP) 2 YY))
             (((MPLUS SIMP) -2 ((MEXPT SIMP) 3 ((RAT SIMP) 1 2))) .
$NEG))
Maxima encountered a Lisp error:

 The value $NEG is not of type LIST.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.

Dieter Kaiser