New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`x**2 < oo` returns `True` but `x < oo` un-evaluated for real `x` #9832

Open
gxyd opened this Issue Aug 15, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@gxyd
Copy link
Member

gxyd commented Aug 15, 2015

As explained by @aktech

In [2]: x = Symbol('x', real=True)

In [3]: x < oo
Out[3]: x < oo

In [4]: x**2 < oo
Out[4]: True

In this, both the evaluations should comply with one another

This leads to a few problems like this:

>>> solveset(x**2 < oo, x, S.Reals)
AttributeError                            Traceback (most recent call last)
<ipython-input-15-49e5605f0c10> in <module>()
----> 1 solveset(x**2 < oo, x, S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset(f, symbol, domain)
    887                                       "setting domain=S.Reals")
    888         return solve_univariate_inequality(
--> 889             f, symbol, relational=False).intersection(domain)
    890 
    891     if isinstance(f, (Expr, Number)):

/home/gxyd/Public/sympy/sympy/solvers/inequalities.py in solve_univariate_inequality(expr, gen, relational)
    407     gen = d
    408 
--> 409     e = expr.lhs - expr.rhs
    410     parts = n, d = e.as_numer_denom()
    411     if all(i.is_polynomial(gen) for i in parts):

AttributeError: 'BooleanTrue' object has no attribute 'lhs'

skirpichev added a commit to diofant/diofant that referenced this issue Aug 18, 2015

skirpichev added a commit to diofant/diofant that referenced this issue Sep 12, 2015

skirpichev added a commit to diofant/diofant that referenced this issue Sep 13, 2015

Redo Add._eval_is_positive/negative handlers
Correct also broken test test_Add_is_pos_neg (finite doesn't
imply real!).  Fixes sympy/sympy#9832.

skirpichev added a commit to diofant/diofant that referenced this issue Sep 13, 2015

Redo Add._eval_is_positive/negative handlers
Correct also broken test test_Add_is_pos_neg (finite doesn't
imply real!).  Fixes sympy/sympy#9832.

skirpichev added a commit to diofant/diofant that referenced this issue Sep 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment