Subject: string comparisons, was: Maxima 5.21.1 release
From: Richard Fateman
Date: Mon, 26 Apr 2010 17:37:21 -0700
Robert Dodier wrote:
> On Mon, Apr 26, 2010 at 9:37 AM, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
>
>
>> You are saying that is(%i>0)=>false is not a bug?
>>
>
> Is it really a problem if a > b and b > a are both false?
>
IEEE 754 standard specifies that NaN > NaN is false. NaN <NaN is
false. NaN=NaN is false.
> (It seems likely that Maxima assumes one is true if the other
> is false, but it doesn't have to be that way, does it?)
>
It certainly should not make this assumption, since it is false. It used
to be that some compilers may assume that a
test not (x>y) is the same as x<=y. This is true for integers, not
floats, not complexes.
> Be that as it may, I would be willing to accept the same behavior
> for is(%i > 0) and is("x" > 0) which is now displayed by
> is(a > 0) where a is a list, matrix, or set, namely, it returns
> unknown when prederror = false and triggers and error when
> prederror = true.
>
It is pretty clearly a TYPE error to ask if %i>0. It is not the same
as x>0 which might be resolved
some time in the future if a value is given to x. While I have not
thought about the repercussions in
Maxima, it seems to me that there is no prospect for future events to
change the question %i>0 to
something that makes sense, and it is an error. Regardless of prederror.
>
>> A related bug is is(%i+1>%i) => true
>>
>
>
We want to be able to use a theorem that x+1 > x. But the problem above
could be argued either way. NaN+1 > NaN is false. inf+1>inf is false.
probably is(x+1>x) ==> if real(x) then true else '(is(x+1>x)) .
RJF