Comment #50 on issue 1047 by asmeurer: Suggested new assumption system
http://code.google.com/p/sympy/issues/detail?id=1047

I think you need to rebase over the latest master.  For example, one of the  
failures:

…
    
File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/logic/boolalg.py",  
line 51, in eval
     sargs = sorted(flatten(out_args, cls=cls))
TypeError: __nonzero__ should return bool or int, returned StrictInequality

Is caused by things like Assume(x, Q.real) < Assume(y, Q.imaginary)  
returning a StrictInequality instead of a
bool.  But this works (or at least it returns a bool, is that right?) in  
master, due to this commit:

commit b3f7e6bbae92ee0cf7c286a7d26ce0df899e62c6
Author: Chris Smith <[email protected]>
Date:   Fri Oct 16 08:32:59 2009 +0545

     1634: better comparisons and minor code edit

         == sympy\core\basic.py
            o Smarter comparison for relationals implemented:

              Here is an interesting example where one thing works
              and one doesn't, even though they are (to the human)
              almost the same:

                 In [124]: pi < 0
                 Out[124]: False

                 In [125]: pi > 0
                 Out[125]: -pi < 0

               pi<0 is recognized as a number comparison and goes to
               lt of numbers.py whereas -pi is an expression and calls
               up the basic.py lt routine.

               This patch makes the basic relational operators return
               a True or False if the sign of the quantities involved
               can be determined. This will result in more answers
               rather than restatments ('True" instead of "-pi < 0").

            o In as_coeff, "expr" was changed to "args" to avoid confusion

         == sympy\core\tests\test_basic.py
            test smarter relational tests

In a_removal:

In [1]: Assume(x, Q.real) < Assume(y, Q.imaginary)
Out[1]: Assume(x, 'real', True) < Assume(y, 'imaginary', True)

In [2]: type(Assume(x, Q.real) < Assume(y, Q.imaginary))
Out[2]: <class 'sympy.core.relational.StrictInequality'>

In master:

In [1]: Assume(x, Q.real) < Assume(y, Q.imaginary)
Out[1]: False

I tried rebasing over master, but it is non-trivial and someone with  
knowledge of the changes in a_removal
needs to do it.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--

You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.


Reply via email to