From gray%hilbert@rand-unix.ARPA Mon Apr  4 18:07:16 1988
Received: from ncsa.ncsa.uiuc.edu by spock.ncsa.uiuc.edu (3.2/NCSA-1.2)
	id AA10383; Mon, 4 Apr 88 18:07:11 CDT
Return-Path: <gray%hilbert@rand-unix.ARPA>
Received: from rand.org (rand-unix.arpa) by ncsa.ncsa.uiuc.edu (3.2/NCSA-1.2)
	id AA09483; Mon, 4 Apr 88 18:07:00 CDT
Received: by rand.org; Mon, 4 Apr 88 15:54:14 PDT
Received: by hilbert.arpa; Mon, 4 Apr 88 15:51:44 pdt
From: Joyce Gray <gray%hilbert@rand-unix.ARPA>
Message-Id: <8804042251.AA00293@hilbert.arpa>
To: steve@ncsa.uiuc.edu (Steve Christensen)
Subject: Re: Reduce bugs and patches
In-Reply-To: Your message of Mon, 4 Apr 88 16:44:49 CDT.
             <8804042144.AA10269@spock.ncsa.uiuc.edu>
Date: Mon, 04 Apr 88 14:51:40 PST
Status: R

I am appending below a list of the bugs found in the 15 July 1987 version
of REDUCE 3.3, and the patches necessary to correct them.  If you update
your system with these patches, please change the system date to 15
January 1988.

Please let me know if you'd prefer a hard copy of this material.

Joyce Gray
REDUCE Secretary

_________________________________________________________________________

            15 January 1988 Updates to REDUCE 3.3:  Bugs Fixed

1)  In a definition like

       procedure f1(a); begin scalar b; f2(a); return 23 end;

    the expression f2(a) was not evaluated.

2)  If an expression with free variables was saved using saveas, further
    evaluations of the saved expression were not always in lowest terms.

3)  The code for converting rational to real numbers was inaccurate.

4)  deg(<constant>,x) returned NIL instead of 0.

5)  With div off, an undefined function NIL could be called.

6)  An expression replacing a part of another expression (using part)
    was not evaluated.

7)  In rare cases, denominators of inverses of bigfloats were not always 1.

8)  It was not possible in some systems to use an equation in a solve
    statement.

9)  In solving overdetermined sets of linear equations in which the user
    specified variables that did not occur in the equations, a wrong sign
    could be generated.

10) Eigenvectors of a matrix with a row of zero elements could have an
    element with the wrong sign. E.g.,

	 v := mat((0,0,0),(0,u^2,u),(0,u,1)); mateigen(v,eta);

11) The sign of a resultant calculation did not always follow the rules
    given in the manual.

12) A trivial resultant calculation (e.g., resultant(x,0,y))
    could abort with a system error.

13) Replacement rules involving powers of high energy physics scalar
    products did not work.

14) An undeclared vector in a high energy physics expression would cause
    the erroneous message "<vector> invalid as list".

15) Indices were not always contracted fully if nospur was used.

16) In rare circumstances, some polynomials would not factor fully.

17) Integrals of expressions involving error functions were sometimes wrong.

18) Integration of expressions involving surds sometimes gave an
    erroneous "zero denominator" message.

19) With the algebraic integrator loaded, integrals of simple things
    like sqrt(x) were not always evaluated.

20) In Excalc, errors could arise in the exterior multiplication of
    a 0-form by another exterior product, or in assigning a value to an
    indexed expression which is not just an indexed variable.

21) In some systems, some Gentran calls could abort with an error.

22) With groebopt on, Groebner basis calculations could produce results
    with variables interchanged.

_________________________________________________________________________

        January 1988 Updates to 15 July 1987 Version of REDUCE 3.3


In the file ALG1:

Replace line 785, which reads

   if null cdr u or null cddr u or cddddr u then typerr(u,"equation")

by

   if null cdr u or null cddr u or cdddr u then typerr(u,"equation")

After line 967, which reads

          then if getrtype(x := apply1(x,cdr u)) then typerr(u,"scalar")

add the line

		else if x=u then return !*ssave(!*k2q x,u)

After line 1704, which reads

        then if abs u=1 then return u

add the line

       else if null dmode!* then return mkrn(1,u)

Replace line 1978, which reads

	until y < prec*z;
by

	until u*x < prec*z;
      z := y + z;

Replace lines 3887 and 3888, which read

		  if eqcar(ws,'!*sq) and smemql(frlis!*,cadr ws)
		    then prepsq cadr ws
by

		  if eqcar(ws,'!*sq)
		     and smemql(for each x in frasc!* collect car x,
				cadr ws)
		    then list('!*sq,cadr ws,nil)

________________________________

In the file ALG2:

Replace line 3509, which reads

      if domainp u then return nil

by

      if domainp u then return 0

Replace line 4065, which reads

      return  revalsetp1(y,reverse cdr x,car x)

by

      return  revalsetp1(y,reverse cdr x,reval car x)

________________________________

In the file BFLOAT:

Replace line 93, which reads

   % allow for roundup of two in the last place.

by

   % allow for roundup of four in the last place.

Replace line 98, which reads

      return (x<=0 and x>=-2)
by
      return (x<=0 and x>=-4)

________________________________

In the file EXCALC:

Replace line 717, which reads

   if car u = 1 then list caar v .* multsq(cdr u,cdr v) .+ nil

by

   if car u = 1 then car v .* multsq(cdr u,cdr v) .+ nil

Replace line 1875, which reads

     z1 := cdr u;

by

     z1 := allindk u;

Replace line 1993, which reads

     y := flatindxl cdr v;

by

     y := flatindxl allindk v;

________________________________

In the file EZGCD:

Replace line 4811, which reads

    coefftbd:=max(110,lc poly*get!-coefft!-bound(poly,ldeg poly));

by

    coefftbd:=max(110,p+1,lc poly*get!-coefft!-bound(poly,ldeg poly));

Replace line 5113, which reads

      then return hensel!-exit(m,old!.mod,p,vset,w);

by

      then <<putv(fvec,1,current!-factor!-product:=poly);
	     return hensel!-exit(m,old!.mod,p,vset,w)>>;

________________________________

In the file GENTRAN:

Replace line 189, which reads

car form eq 'break$

by

   eqcar(form,'break);

Replace line 212, which reads

car form eq !*for!*$

by

   eqcar(form,!*for!*);

Replace line 215, which reads

car form eq 'go$

by

   eqcar(form,'go);

Replace line 221, which reads

car form eq 'write$

by

   eqcar(form,'write);

Replace line 224, which reads

car form eq 'read$

by

   eqcar(form,'read);

Replace line 227, which reads

car form eq 'repeat$

by

   eqcar(form,'repeat);

Replace line 245, which reads

car form eq 'stop$

by

   eqcar(form,'stop);

Replace line 248, which reads

car form eq 'while$

by

   eqcar(form,'while);

After line 664, which reads

procedure formgentran1(u, vars, mode);

add the lines

if pairp u and not listp u then
    gentranerr('e, u, "SCALAR DEFINITIONS CANNOT BE TRANSLATED", nil)
else

Replace lines 874 through 877, which read

prog1(!*currin!*,
      if cdr !*currin!* then close cdr !*currin!*,
      !*instk!* := cdr !*instk!* or list !*stdin!*,
      !*currin!* := car !*instk!*)$

by

begin scalar x;
x := !*currin!*;
if cdr !*currin!* then close cdr !*currin!*;
!*instk!* := cdr !*instk!* or list !*stdin!*;
!*currin!* := car !*instk!*;
return x
end$

Replace line 1082, which reads

			       "OVERWRITE FILE?");
by
			       "CONTINUE?");

Replace line 1761, which reads

  gpid1p car cddddr exp and gpstmtp cadr cddddr exp$

by

  gpid1p car cddddr exp and gpstmtp cadr cddddr exp
   and not idp cadr cddddr exp$

After line 2437, which reads

procedure toolongstmtp stmt;

add the line

if atom stmt then nil else

________________________________

In the file GROEBNER:

Delete line 1907, which reads

	dipvars!* := olddipvars;

________________________________

In the file INT:

Move lines 1116 through 1127, which read

    if !*algint
      then <<intvar:=variable;           % until fix JHD code
	 % Start a clean slate (in terms of SQRTSAVE) for this integral
	 sqrt!-intvar:=!*q2f simpsqrti variable;
	 if (red sqrt!-intvar) or (lc sqrt!-intvar neq 1)
	     or (ldeg sqrt!-intvar neq 1)
	   then interr "Sqrt(x) not properly formed"
	   else sqrt!-intvar:=mvar sqrt!-intvar;
	 basic!-listofallsqrts:=listofallsqrts;
	 basic!-listofnewsqrts:=listofnewsqrts;
	 sqrtsave(basic!-listofallsqrts,basic!-listofnewsqrts,
		      list(variable . variable))>>;

to after line 1137, which reads

       dmode!* := nil;

Replace line 3923, which reads

	    w:=diffsq(simp z,svar);
by
	    w:=subs2 diffsq(simp z,svar);

Replace line 3927, which reads

			./ multf(gg,denr integrand));
by
			./ !*multf(gg,denr integrand));

After line 3987, which reads

      rhs!*:=multbyarbpowers f2df dfu;

add the line

      if checkdffail(rhs!*,svar) then interr "Simplification failure";

After line 3990, which reads

      lhs!*:=f2df dflogs;

add the line

      if checkdffail(lhs!*,svar) then interr "Simplification failure";

After line 4073, which reads

   end;

add the lines

symbolic procedure checkdffail(u,v);
   u and (depends(lc u,v) or checkdffail(red u,v));

________________________________

In the file MATR:

Replace line 666, which reads

   begin scalar arbvars,exu,sgn,r,s,x,y,z,eivec;

by

   begin scalar arbvars,exu,sgn,q,r,s,x,y,z,eivec;

Replace line 684, which reads

	z := c!:extmult(x,z);
by
	z := c!:extmult(if null red x then <<
	       q := (if p then (car p  . (cdr p + 1)) . delete(p,q)
		      else (lc x  . 1) . q) where p = assoc(lc x,q);
			!*p2f lpow x>> else x,z);

After line 688, which reads

     kord!* := eival . kord!*;

add the line

     if domainp r then s := 1 else

After line 694, which reads

     else r := (!*k2f eival . ldeg s) . r;

add the line

     for each j in q do r := (absf reorder car j . cdr j) . r;

Replace line 707, which reads

	  if null(k member lpow y) then
by
	  if (y=1) or null(k member lpow y) then

Replace lines 709 through 711, which read

       sgn := evenp length lpow y;
       eivec := 'mat . for each k in lpow z collect list prepsq!*
	      mkgleig(k,y,sgn := not sgn,arbvars);

by

       sgn := (y=1) or evenp length lpow y;
       eivec := 'mat . for each k in lpow z collect list
			   if x := assoc(k,arbvars)
			      then mvar cdr x
			    else prepsq!* mkgleig(k,y,
				    sgn := not sgn,arbvars);

Delete line 795, which reads

     if x := assoc(u,arbvars) then return !*f2q cdr x;

________________________________

In the file RLISP:

Replace line 664, which reads

				       t, '!*backtrace)
by
				       t,!*backtrace)

Replace lines 1581 through 1583, which read

       % next two FORM1 used to be FORMC
     then form1(cadar u,vars,caar u) . formprog1(cdr u,vars,mode)
    else form1(car u,vars,mode) . formprog1(cdr u,vars,mode);

by

     then formc(cadar u,vars,caar u) . formprog1(cdr u,vars,mode)
    else formc(car u,vars,mode) . formprog1(cdr u,vars,mode);

Replace lines 1832 and 1833, which read

	 and car u memq '(setel setk setq)
%        and flagp(car u,'nochange) and not(car u eq 'getel)

by

	 and flagp(car u,'nochange) and not(car u eq 'getel)

Replace line 2235, which reads

	 form1(car cddddr u,   % was FORMC
by

	 formc(car cddddr u,

Replace line 2297, which reads

	body := form1(car u,(var . mode) . vars,mode); % was FORMC
by
	body := formc(car u,(var . mode) . vars,mode);

Replace lines 2418 and 2419, which read

   % next line used to use FORMC
   list('repeat,form1(cadr u,vars,mode),formbool(caddr u,vars,mode));

by

   list('repeat,formc(cadr u,vars,mode),formbool(caddr u,vars,mode));

Replace lines 2448 and 2449, which read

   % next line used to use FORMC
   list('while,formbool(cadr u,vars,mode),form1(caddr u,vars,mode));

by

   list('while,formbool(cadr u,vars,mode),formc(caddr u,vars,mode));

Replace line 2812, which reads

	then return mk!*sq simpdot u

by

	then return prepsq simpdot u

________________________________

In the file RSLTNT:

Replace line 37, which reads

	       return if mvar v eq w then exptf(u,ldeg v)
by
	       return if not domainp v and mvar v eq w
			then exptf(u,ldeg v)

Replace line 48, which reads

	    ep := b!:extmult(!*sf2exb(u,w),ep)>>
by
	      ep := b!:extmult(!*sf2exb(multd((-1)**(-n*ldeg u),u),
					w),
			       ep)>>

________________________________

In the file SOLVE:

Replace line 619, which reads

     return for each j in v collect mkglsol(j,x,sgn := not sgn,arbvars)

by

     return for each j in v collect if y := atsoc(j,arbvars)
				       then !*f2q cdr y
		      else mkglsol(j,x,sgn := not sgn,arbvars)

Delete line 627, which reads

     if x := atsoc(u,arbvars) then return !*f2q cdr x;

_________________________________________________________________________

--------

Your message was received as:


Received: by rand.org; Mon, 4 Apr 88 14:46:48 PDT
Received: from ncsa.ncsa.uiuc.edu
	by uxc.cso.uiuc.edu with SMTP (UIUC-5.52/9.7)
	id AA22373; Mon, 4 Apr 88 16:45:09 CDT
Received: from spock.ncsa.uiuc.edu by ncsa.ncsa.uiuc.edu (3.2/NCSA-1.2)
	id AA09099; Mon, 4 Apr 88 16:44:59 CDT
Received: by spock.ncsa.uiuc.edu (3.2/NCSA-1.2)
	id AA10269; Mon, 4 Apr 88 16:44:49 CDT
Date: Mon, 4 Apr 88 16:44:49 CDT
From: steve@ncsa.uiuc.edu (Steve Christensen)
Message-Id: <8804042144.AA10269@spock.ncsa.uiuc.edu>
To: reduce@rand-unix.ARPA
Subject: Reduce bugs and patches


