Chris, the problem is not the presence of the SIMP flag
but rather that ((MMINUS) 1) is not the same as -1.
((MMINUS) 1) simplifies to -1, but simplification is disabled,
so they're considered different by the test.
There isn't any simple answer, I'm afraid. I do see the value of
comparing unsimplified
results in tests. Maybe the simplest thing to do, which could cover
some common cases, is to change the parser so -1 parses to -1.
I'll take a look at it.
best, Robert Dodier
On 12/1/10, Chris Sangwin <sangwinc at for.mat.bham.ac.uk> 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. 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.
>
> 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?
>
> 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?
>
> Chris
>
>
> On Wed, 1 Dec 2010, Richard Fateman wrote:
>
>> The fact that ANYTHING works with simp:false is surprising.
>>
>> I suspect that your (minimal) example isn't minimal at all --
>> gcd(a,b) ignores the simp flag, anyway. It converts a and b to rational
>> form
>> and then computes the gcd. The RESULT of the gcd looks like ((mplus
>> ratsimp)
>> $x -1)
>>
>> The only circumstances in which I sometimes expect expressions to be
>> unsimplified
>> is when they are inside the body of a function, e.g. f(a,b):= a+b-a
>> to test for roundoff. Maybe that is what you need.
>>
>> Clearly checking to see if exp1-exp2 = 0 is not going to work if
>> simp:false.
>>
>> RJF
>>
>>
>> On 12/1/2010 7:09 AM, Chris Sangwin wrote:...
>> ..snip...
>>>
>>> What is the best approach to using the automatic testing with simp:false?
>>>
>> Um, leave simp:true.
>>
>> RJF
>>
>>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>