On 12/1/2010 8:51 AM, Chris Sangwin wrote:
>
> Thank you Richard,
>
> Yes, I'm sure my example isn't strictly minimal, but it does
> illustrate the problem in one line...
>
> I know this is an unusual thing to want to do.
Requests about using simp:false occur from time to time. They are
almost always resolved by doing something else.
> Indeed, the who point of what I'm doing is to implement functions
> which will distinguish between expressions such as x-x and 0. So, I
> really need simp:false.
Perhaps, but you should not expect Maxima to do anything useful when
simp:false is the global setting.
>
> The problem seems to reside in the internals of Maxima, in particualar
> the flags such as (mplus SIMP) and (mplus RATSIMP) which are added to
> operators. My understanding of these flags is that they indicate that
> sub-expressions have already been simplified. Is that correct?
That is what the flags mean, but that is not the problem, I think.
>
> I'm no Maxima expert, but I would like to be able to create automatic
> tests using the current system. How can I encode an answer as a
> potential output to one of these tests which has the right flags in it?
What flags do you want? If you insert a SIMP flag in an unsimplified
expression, all that means is you are
breaking the data abstraction.
You haven't described your actual need, just the "derived" need which is
probably off track. so here
are 2 guesses.
1. You can store anything as a string: m: "x-x"
2. You can store stuff inside a function.
foo():=block([simp:off],define(ans(),read()));
x-x;
returns ans():=x-x
Also, you can, if you wish, insert a simp flag. in wxmaxima type
:lisp (defun $hack(r)(cons (append (head r)'(simp)) (rest r)))
but as I said, I doubt that this is really what will help you.
rjf