You are right of course (my bad): bool(expr) could be considered as
being True according to these specifications (and anyway "True" is
always a good answer). Though these are specifications for SR and does
not apply to the entire library. It is not clear to me what global
specification we could have for bool(algebraic expression).

On Tue, 27 Sept 2022 at 12:49, 'Martin R' via sage-devel
<sage-devel@googlegroups.com> wrote:
>
> I am reading this differently, but that may be my lack of knowledge of 
> English.
>
> I thought "Return True, unless provably zero" would give true, if something 
> cannot be shown to be zero.
>
> Martin
>
> On Tuesday, 27 September 2022 at 12:21:12 UTC+2 vdelecroix wrote:
>>
>> On Tue, 27 Sept 2022 at 11:58, 'Martin R' via sage-devel
>> <sage-...@googlegroups.com> wrote:
>> >
>> >
>> >
>> > On Friday, 23 September 2022 at 20:09:55 UTC+2 Nils Bruin wrote:
>> >>
>> >> On Friday, 23 September 2022 at 10:37:01 UTC-7 axio...@yahoo.de wrote:
>> >>>
>> >>> OK, this is off topic, but: shouldn't it be this convention? At least: 
>> >>> shouldn't there be some convention? Maybe it would be good to discuss 
>> >>> this in a separate thread. Thus, I repeat the question:
>> >>>
>> >>> Is there, or should there be a convention about x._bool_ returning False 
>> >>> only when x is provably False?
>> >>>
>> >> No, quite the opposite. Certainly in SR, equalities that can't be proven 
>> >> correct (for "proof" used in the loose sense of what the various symbolic 
>> >> engines are willing to confirm), will return "False" when converted to 
>> >> "bool" value. The key is: _bool_ cannot really error out (that would 
>> >> break too much in python) and does not allow for "unknown" outcomes, so 
>> >> some choice must be made.
>> >
>> >
>> > The doc of Expression.__bool__ says:
>> >
>> > 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.
>> >
>> > which seems to be in agreement with what I thought. Or am I missing 
>> > something?
>> >
>> > It seems really strange to me that "not O(x^7)" should be True.
>>
>> According to this symbolic specification,O(x^7) is not provably an
>> exact zero so it is reasonable to evaluate it to False. Which means
>> that "not O(x^7)" ought to be True.
>
> --
> 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 sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/a4a00641-0b8d-4fd4-8690-7e75bb860c74n%40googlegroups.com.

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAGEwAA%3DQ0ZEP82hSKFq7Sx4r7qraO7aZ5L005xzabr19QJSp%3Dw%40mail.gmail.com.

Reply via email to