Hi,

In Sage 6.10.beta7:
sage: bool(x == 0)
False
sage: bool(x != 0)
True
sage: x = SR.var('x', domain='real')
sage: bool(x == 0)
False
sage: bool(x != 0)
False
The latest output differs from what one would get from Sage 6.10.beta6 (and 
any previous version of Sage), which would have been True, i.e. consistent 
with the second output. 
It seems that this change has been introduced in #19312 
<http://trac.sagemath.org/ticket/19312>. This introduces a kind of 
non-binary logic for undecidable expressions. A priori I am not against it, 
but IMHO this should be fully advertised, since having x != 0 different 
from not (x==0), i.e. having
sage: bool(x != 0) is bool(not (x == 0))
False
may break a lot of codes (for sure it broke mine!). Also it is quite 
annoying that the last output is not consistent with the second one, simply 
because x has been declared real. Note that declaring x complex does not 
restore the consistency:
sage: forget()
sage: x = SR.var('x', domain='complex')
sage: bool(x != 0)
False
Only having domain equal to None does:
sage: forget()
sage: x = SR.var('x')
sage: bool(x != 0)
True
>From the discussion in #19312 <http://trac.sagemath.org/ticket/19312> and 
in #19040 <http://trac.sagemath.org/ticket/19040>, I understand that this 
change of logic is a feature and not a bug, and I can easily fix my code by 
replacing x != 0 by not (x==0). However, such an important change may 
surprise many users and IMHO  it should be stressed during the release of 
Sage 6.10.

Eric.

-- 
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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to