gcfac and scifac



Edwin Woollett wrote:
> 
> Raymond Toy wrote on February 13, 2008
> 
>>> (%i1) load (scifac);
>>>
>>> Load failed for
>>>
>>> C:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.lisp 
>>>
>>>  -- an error.  To debug this try debugmode(true);
>>
>> Near the top of that file, change the "(declare ...") to "(declaim 
>> ..."). It loads for me now.  Don't know if it works or not....
>>
>> Ray
> 
> I changed line two of scifac.lisp from
> " (declare (special $negdistrib)) "
> to
> "(declaim (special $negdistrib))"
> --------------
> package scifac.lisp now loads ok but get error first time scifac.dem 
> calls gcfac:
> 
> (%i1) demo(scifac)$
> batching 
> #pC:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.dem 
> 
> 
> At the _ prompt, type ';' followed by enter to get next demo
> (%i2)             if properties(gcfac) = [] then load(scifac)
> _;
> (%i3)                    exp1 : a v s x + a t r + a u
> (%o3)                        a s v x + a u + a r t
> _;
> (%i4)                             gcfac(exp1)
> Maxima encountered a Lisp error:
> 
> Error in COND [or a callee]: The function FIXP is undefined.
> 
> Automatically continuing.
> To reenable the Lisp debugger set *debugger-hook* to nil.
> (%i5)                            factor(exp1)
> (%o5)                         a (s v x + u + r t)

As a temporary solution, add the following to scifac.lisp, near the top:

(defun fixp (n)
   (typep n 'fixnum))

(defun $min (x y)
   (min x y))

(defun add1 (x)
   (1+ x))

These are wild guesses,  based on looking at the code for a few seconds.
fixp and add1 are probably safe since I don'tt seem them defined 
anywhere else in maxima  But $min might be suspect since maxima already 
has some kind of $min function.

But with these changes demo(scifac) finishes.

Ray