There are a whole bunch of issues raised in the context of   bool(x>0) and 
some mention of what
Maxima does, in that thread from 4 years ago.

But the description of what Maxima* actually does* was essentially missing 
from the discussion.

As is often the case when several different conflicting opinions emerged in 
the design community
for Macsyma/ Maxima , a flag is available to choose a design

Thus
is (a>0)    returns unknown.

prederror:true;
is(a>0)   produces an error  "unable to evaluate predicate a>0"


There are  probably other options that have to do with domain:real or 
domain:complex,
and assumptions on individual names.  It is also possible for the system to
return an unevaluated conditional as

if (a>=0 then 1 else 2    
  returns unevaluated.   (though  is (a>0)   returns unknown  )

[note difference between is()   and if..... ]

I suppose (but have not observed this) that the unevaluated 'if' could be 
simplified. e.g.

if (a^2=a) then 1 else 2     might be simplified to

if  (a=1)or(a=0) then 1 else 2

Now if you wanted to have a program that evaluated a boolean expression 
where
each value was a canonical True or False, and objected somehow otherwise,
that might be a different functionality, and certainly WAY simpler than 
what 
people seem to expect in a computer algebra system.

You could also have a 3 way branching if:   yes/no/unknown.  if a then be 
else c otherwise d.

Perhaps related,

Note also that for IEEE standard floats with  NaNs  (Not a numbers), of 
which there
are a huge number ..all comparisons return false.  That
is for N a NaN and X a float,  all these are false:
N>x
N<x
N=x    even if x is, as a binary string the same NaN, a float comparison 
returns false

This line of reasoning would suggest that all comparisons between
numbers and things that are not-a-number,  as for example symbols, or 
formulas, or complex numbers
should return false.  But that is perhaps pushing the paradigm of
floats dominating everything  too far.  [  the idea would be that
everything is a floating-point computation by default, but other stuff,
like symbols, can be represented via NaNs.  Matlab could have done
this, maybe,  but instead, last I looked, used what amounted to strings
for non-numbers.  Maybe that's changed to be object-oriented structure
stuff.  Maybe they use NaNs for structures?? I doubt it...]

RJF






On Sunday, February 19, 2017 at 9:07:19 AM UTC-8, Jakob Kroeker wrote:
>
> In my opinion not this only particular case but the current bool() design 
> in sage is a tremendous failure.
> This was already discussed on sage-devel several times. 
>
> Here is one of that threads:
> https://groups.google.com/d/msg/sage-devel/vNxnHSeRBW4/UkaBOPGYT0QJ
>
> Jakob
>
> Am Sonntag, 19. Februar 2017 12:56:49 UTC+1 schrieb Daniel Krenn:
>>
>> Dear all, 
>>
>> I am surprised by 
>>   sage: bool(I < 1) 
>>   True 
>>
>> Best Daniel 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to