Excess simplifications (was tail-recursion)



I think that my working hypothesis is that the only
time you know that something has been simplified is
if it has just been returned by  simplifya.

Given the possibility that a change in a global flag
like $logsimp will mean that a simplified expression
may no longer be simplified, I'm not sure you can
say much definitely about simplified "general" expressions.
CRE or rational expressions are essentially always
simplified, at least if ratfac is false.

One possibility, which was originally the intention for
the SIMP  etc flag is to say more about how the
simplifier was set up when the simplification happened.
That is
instead of

((MPLUS SIMP) $X $Y)   or perhaps
((MPLUS SIMP RATSIMP) $X $Y)

you would have something like
((MPLUS SIMP  <<vector of all settings of simplifier flags when simplifya 
called>>)  $X $Y)

and then a resimplification would say:  is the vector the same?  If not,
resimplify.

Also the same expression could be simplified in two different ways, and both 
of them stored.
e.g.
store both  (x+1)*(x-1)   and (x^2-1)   each simplified, as part of a grand 
scheme to
allow fast operations by choosing the best form.  For example the factor 
command could
use the first version, and expand, the second.

There is a (probably unused) feature that keeps around a list of factors 
that have been used
by ratsimp, just in case you later try to factor -- you can try dividing by 
those factors!

RJF


----- Original Message ----- 
From: "Stavros Macrakis" <macrakis at gmail.com>
To: "Richard Fateman" <fateman at cs.berkeley.edu>
Cc: <Maxima at math.utexas.edu>
Sent: Sunday, February 19, 2006 8:48 AM
Subject: Re: [Maxima] Excess simplifications (was tail-recursion)


On 2/17/06, Richard Fateman <fateman at cs.berkeley.edu> wrote:
> [Simplifya] returns quickly if the SIMP flag is set in the CAR of the 
> expression.

Yes, but simplifya still seems to be called in many situations where
the argument should be known to have been simplified.  It is possible
(but I am not sure) that the case blocking tail-recursion is one of
them.  The reason I am not sure is that there is no clear, documented
convention about what is guaranteed to return a simplified expression.
 And even if there was one at some point, I suspect that it is not
obeyed systematically.

           -s