Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 12 years ago

DSM gravatar image

It works for me:

sage: var("x, y")
(x, y)
sage: x+y == x+y
x + y == x + y
sage: bool(x+y == x+y)
True
sage: if (x+y == x+y):
....:     print 'yep!'
....:     
yep!

Unless you mean that you want bool to be automatically applied to every equation? Since Sage follows the convention that "False" means "I couldn't see how to prove this was true", this would mean that pretty much every equation would automatically be False from the get-go and so you couldn't do anything with it. For example, (x-2)*(x+3) == 0 would be False (x could be 9, for example).

click to hide/show revision 2
No.2 Revision

It works for me:

sage: var("x, y")
(x, y)
sage: x+y == x+y
x + y == x + y
sage: bool(x+y == x+y)
True
sage: if (x+y == x+y):
....:     print 'yep!'
....:     
yep!

Unless you mean that you want bool to be automatically applied to every equation? Since Sage follows the convention that "False" means "I couldn't see how to prove this was true", this would mean that pretty much every equation would automatically be False from the get-go and so you couldn't do anything with it. For example, (x-2)*(x+3) == 0 would be False (x could be 9, for example). after all).