On Fri, 15 Jul 2011 at 14:18 0400, Ted Kosan wrote:
> This past May I submitted the following question to the Reduce forum
> which was about turning off automatic simplification:
>
> http://sourceforge.net/projects/reducealgebra/forums/forum/899364/topic/4499010
>
> The revalp code that Tony submitted provides a partial solution, but a
> full solution would allow functions like NUM, DEN, and SUB to be used
> on the expression so that it can be analysed and manipulated. At one
> point I thought that I could add this feature myself, but I found that
> I will have to study Rlisp further before I have the skills needed to
> do it properly.
Actually, you have to understand how the simplification process works (basically
what the functions in packages/alg/reval.red do).
The problem here is that things that look similar in function may be quite
different. NUM/DEN are good examples: the argument of these operators is fully
simplified before the actual numerator or denominator is taken. Which is to say
right now that they will not work in "nosimp" (ie. OFF REVALP) mode. The same
goes for SUB: substitution happens by simplifying and converting the expression
into a standard quotient and descending into the constituents of this standard
representation, performing the substitutions on the way.
This is necessary to perform more complicated substitutions, like replacements
for products of several terms. Consider a product like a*b*c in which you want
to replace a*c by something else. Clearly this substitution must happen even if
if there are many factors between a and c.
On the other hand, PART and friends work on an expression "as it is", ie.
without simplifying their arguments. So, accessing parts of an expression is
possible even without simplification. I believe it would be possible to
implement these "syntactical" access functions to work in nosimp mode.
Variants of NUM/DEN could then be defined in terms of these functions:
procedure NUM2 u;
if ARGLENGTH u = 1 then u % number of symbol
else if not (part(u,0)=quotient) then u % toplevel operator is not quotient
else part(u,1);
procedure DEN2 u;
if ARGLENGTH u = 1 then u
else if not (part(u,0)=quotient) then u
else part(u,2);
One could add definitions like these for many of the standard operators, to be
used in nosimp mode, instead of the standard ones. This may be the easiest
solution.
> I am asking for this capability on behalf of the GeoGebra project
> (http://GeoGebra.org) because they are in the process of adopting the
> Java version of Reduce as the CAS computation engine for GeoGebra. By
> the way, GeoGebra has millions of users worldwide and its level of
> adoption continues to increase. They are very excited about the idea
> of using the commercialquality Reduce CAS as the computation engine
> for GeoGebra and their plan is to ship Reduce with the new GeoGebra
> 4.0 in August.
>
> I have asked Simon Weitzhofer, who is a GeoGebra developer, to join
> this email list so that he can provide more information on the
> nosimplification feature that they need for GeoGebra.
That would be very helpful.
> I am hoping
> that this feature can be added to Reduce without too much difficulty.
Well, first of all we need to understand what is actually needed.
Thanks,
Rainer
