ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 26 Feb 2012 06:25:21 +0100Strange result of a relational expressionhttps://ask.sagemath.org/question/8725/strange-result-of-a-relational-expression/Tried the following in sage. The answer is False, which is apparently incorrect. Anyone ever encountered this before? Any idea on what happened here?
---------------
forget()
assume(x >= 0)
expr = sin(x) <= x
print(bool(expr))
---------------
Tue, 21 Feb 2012 03:43:00 +0100https://ask.sagemath.org/question/8725/strange-result-of-a-relational-expression/Answer by parzan for <p>Tried the following in sage. The answer is False, which is apparently incorrect. Anyone ever encountered this before? Any idea on what happened here?</p>
<hr/>
<pre><code>forget()
assume(x >= 0)
expr = sin(x) <= x
print(bool(expr))
</code></pre>
<hr/>
https://ask.sagemath.org/question/8725/strange-result-of-a-relational-expression/?answer=13284#post-id-13284See here: http://ask.sagemath.org/question/1144/simplification-of-boolean-values
and here: http://ask.sagemath.org/question/605/bool-gives-another-unexpected-result
Quoting from DSM's answer:
> "False" doesn't necessarily mean
> false, it might only mean "Sage
> couldn't figure out how to prove it
> was true.
Tue, 21 Feb 2012 05:27:05 +0100https://ask.sagemath.org/question/8725/strange-result-of-a-relational-expression/?answer=13284#post-id-13284Comment by kcrisman for <p>See here: <a href="http://ask.sagemath.org/question/1144/simplification-of-boolean-values">http://ask.sagemath.org/question/1144...</a>
and here: <a href="http://ask.sagemath.org/question/605/bool-gives-another-unexpected-result">http://ask.sagemath.org/question/605/...</a></p>
<p>Quoting from DSM's answer:</p>
<blockquote>
<p>"False" doesn't necessarily mean
false, it might only mean "Sage
couldn't figure out how to prove it
was true.</p>
</blockquote>
https://ask.sagemath.org/question/8725/strange-result-of-a-relational-expression/?comment=20270#post-id-20270To elaborate, it is not possible to always prove something is false or true on a computer (at least not in the age of the universe...). Different programs might return different things in different logics, but Sage sticks with Python and returns only True or False to booleans.Tue, 21 Feb 2012 09:12:10 +0100https://ask.sagemath.org/question/8725/strange-result-of-a-relational-expression/?comment=20270#post-id-20270Comment by seflyer for <p>See here: <a href="http://ask.sagemath.org/question/1144/simplification-of-boolean-values">http://ask.sagemath.org/question/1144...</a>
and here: <a href="http://ask.sagemath.org/question/605/bool-gives-another-unexpected-result">http://ask.sagemath.org/question/605/...</a></p>
<p>Quoting from DSM's answer:</p>
<blockquote>
<p>"False" doesn't necessarily mean
false, it might only mean "Sage
couldn't figure out how to prove it
was true.</p>
</blockquote>
https://ask.sagemath.org/question/8725/strange-result-of-a-relational-expression/?comment=20238#post-id-20238I kind of get it, still I would say, whatever the evaluation algorithm is, a bug just showed itself and it might not be a good choice just treat it as something inevitable.Sun, 26 Feb 2012 06:25:21 +0100https://ask.sagemath.org/question/8725/strange-result-of-a-relational-expression/?comment=20238#post-id-20238