> >> I'm not sure what to do if the user requests a comparison that > >> sage can't easily determine: > > >> sage: sqrt(3) + sqrt(8) == sqrt(5) + pi > > >> One idea would be to return a symbolic equation > > >> sqrt(3) + sqrt(8) === sqrt(5) + pi > > >> but probably the best is to raise an exception: if my code is > >> expecting a boolean, then a symbolic equation may confuse it.
after reading the other thread (http://groups.google.com/group/sage-devel/browse_thread/thread/ bcdc671d2791056e/e086a9d59ff4b9ba), i like simon king's proposal. this sort of thing just begs for trivalent logic with values of true, false, and unknown (and a comparison that makes no sense could throw an exception). > Of course, bool(some equation) returning False does not necessarily mean > that the two expressions are not equal; it only means that we couldn't > prove them to be equal using some simple simplifications. > > From the docstring for _nonzero_ from equation.py (used to implement > bool()): > > Return True if this (in)equality is definitely true. Return False if it > is false or the algorithm for testing (in)equality is inconclusive. this asymmetry between true and false seems bad. shouldn't "is_true(x) == is_false(!x)" always be true? "true" should mean provably true and "false" should mean provably false. (i'll take this opportunity to urge careful distinction between "provably" and "probably", a distinction often blurred by all of the following: my keyboard, my spanish speaking friends, and some computer algebra systems.) > > Thanks, > > Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---