-
-
Notifications
You must be signed in to change notification settings - Fork 674
Description
A failing example is taken from
http://ask.sagemath.org/question/10388/testing-inequalities-in-sage/
var('a','b')
bool( abs(a+b) <= abs(a) + abs(b) ) # False, expected True or 'Unknown'
assert (not False == bool( abs(a+b) <= abs(a) + abs(b) ) ) #fails
The documentation of bool() says "Returns True when the argument x is true, False otherwise."
Formally this includes returning False in case the answer is unknown and it seems
that bool() was specified to behave like it does. But I find that is very unfortunate
and even improving the documentation (explicitly mention the 'answer is unknown' case) is not sufficient.
see also discussion at
https://groups.google.com/d/msg/sage-devel/vNxnHSeRBW4/0OpeL0yv9YUJ
In that thread the exception variant is preferred in case of 'don't know'
Please also take into consideration Tristate variants
( A sandbox for a Tristate class:
https://github.com/jakobkroeker/Tristate.py )
See also https://groups.google.com/forum/?hl=en#!topic/sage-devel/4DUsgt670MA
Dependencies: pynac-0.3.9.3/-0.4.3
CC: @eviatarbach @sagetrac-tmonteil @slel @videlec
Component: symbolics
Stopgaps: todo
Issue created by migration from https://trac.sagemath.org/ticket/17700