You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docstring of sage.symbolic.expression.__bool__ says that a relation f(x) op g(x) will evaluate to True if it is satisfied for all values of x, and will evaluate to False otherwise. ("We cannot return undecidable or throw an exception at the moment so False is returned for unknown outcomes.") But that is not how inequality behaves:
sage: bool(x != 1) # false for `x = 1`, so should be `False`
True
The doctest for this behavior passes because inequality does behave as described if an assumption is added (and a previous doctest added an assumption):
I fixed the doctest in src/sage/symbolic/expression.pyx (by adding forget()), so a doctest fails now, because of the problem in the ticket description. (Sorry, I forgot to do "git commit" before my first push, but I think the branch is ok now.)
The docstring of
sage.symbolic.expression.__bool__
says that a relationf(x) op g(x)
will evaluate toTrue
if it is satisfied for all values ofx
, and will evaluate toFalse
otherwise. ("We cannot return undecidable or throw an exception at the moment soFalse
is returned for unknown outcomes.") But that is not how inequality behaves:The doctest for this behavior passes because inequality does behave as described if an assumption is added (and a previous doctest added an assumption):
We need to either change the docstring or change the behaviour of inequality. Also, adding an assumption should not change the behaviour.
Related tickets:
False
for unknown outcomes.Component: symbolics
Branch/Commit: public/33698r1 @
245a3fc
Issue created by migration from https://trac.sagemath.org/ticket/33698
The text was updated successfully, but these errors were encountered: