In the document of expression.pyx
bool method is described as
Return ``True`` unless this symbolic expression can be shown by Sage
to be zero. Note that deciding if an expression is zero is
undecidable in general.
In this definition, because we define eq as this function and we do not
have _ne_. so python will translate a!=b is not a==b.
In check_maxima_relation method in relation.py
Return ``True`` if this (in)equality is definitely true. Return ``False``
if it is false or the algorithm for testing (in)equality is inconclusive.
But in check_relation_maxima, maxima will actually check a!=b is really
unequal at any time, will return true if a!=b at any time. will return
False if a==b, otherwise return unknown, but in check_relation_maxima we
consider it as False, they have different semantic or we can say they are
contradict in mathematics in bool system(two state: True and False). It
will cause some strange behavior like
sage: y = SR.var("y")
sage: bool(y != 0)
True --do not fall back into check_relation_maxima, other method just
use != is not == so it is True
sage: y = SR.var("y", domain="real")
sage: bool(y != 0)
False --fall back into check_relation_maxima because of assumptions
maxima said y can be zero, so it is False
I think True is needed in the bool method to make the bool method semantic
in the document is consistent.
Proposal solution:
I will try to create a function that check_relation_maxima_neq_as_not_eq as
the PR Fix inconsistency of != with is_zero() and matrix symmetry by
cxzhong · Pull Request #41212 · sagemath/sage
<https://github.com/sagemath/sage/pull/41212>
Then we use this function in bool method in expression.pyx
--
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/sage-devel/0b48e0e6-ea59-4498-bdd1-01eb03cdc71fn%40googlegroups.com.