On Tue, Nov 15, 2016 at 08:53:43AM +0100, Vincent Delecroix wrote:
> Not currently (though we have "Unknown"). The main problem is the
> interaction with Python booleans and the operators "or", "and", "not"
> (which are *not* logical operators). The Sage "Unknown" is badly
> broken for these reasons
> 
> sage: not Unknown   # waiting for Unknown
> True
> sage: Unknown or False   # waiting for Unknown
> False
> 
> So be careful if you start using it!
> 
> If we would use the correct logical operators ~ (for negation), ^ (for
> xor) and & (for and) then we might be able to come up with something.
> But Sage sort of ignore them.
> 
> This problem has been discussed a lot on this mailing list and there
> even exists a (refused) PEP request in this direction.

For reference, it is https://www.python.org/dev/peps/pep-0335/ (the main
reason for rejecting the proposal was "too much discussions"...).

Perhaps was the proposal too greedy, so i wonder whether there would be a
possibility to have a trool adding an Unknown to bool that does not
perturb the speed when only True and False are used, and so that the
"short-circuiting semantics" remains preserved.

This could indeed be useful in testing equality of overlaping
real-intervals, undecidable problems in groups, equality of symbolic
expressions, ...

Ciao,
Thierry


> Best,
> Vincent
> 
> 
> 
> On 15 November 2016 at 08:22, Thierry Dumont <tdum...@math.univ-lyon1.fr> 
> wrote:
> > When developing a software which aims to prove something, it seems
> > necessary to be able to return something in
> >  {True, False, Indeterminate}.
> >
> > Of course, there are many possibilities to do this, but is there a
> > "canonical" one in Sage ?
> >
> > In C++, for example, there exists the Boost Tribool library
> > (http://www.boost.org/doc/libs/1_62_0/doc/html/tribool.html#tribool.introduction)
> > .
> >
> > t.d.
> >
> > --
> > 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 post to this group, send email to sage-devel@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sage-devel.
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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 post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to