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

improper inequality reduction #10237

Closed
smichr opened this Issue Dec 11, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@smichr
Copy link
Member

smichr commented Dec 11, 2015

>>> reduce_inequalities([x < oo, x >= 0, -oo < x])
And(-oo < x, x < oo)  <--- wrong
>>> And(*[x < oo, x >= 0, -oo < x]).as_set().as_relational(x)
And(0 <= x, x < oo)  <--- right

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

Correct logic of reduce_rational_inequalities
We must use Intersection instead of Union, of course.

XXX: Not sure about reduce_rational_inequalities([], x) == False

Fixes sympy/sympy#10237
@khannavansh

This comment has been minimized.

Copy link

khannavansh commented Dec 12, 2015

Can you elaborate on the issue a little more

@smichr

This comment has been minimized.

Copy link
Member

smichr commented Dec 15, 2015

I indicated in the OP that the wrong answer is obtained when the inequalities are run through reduce_inequalities and showed what the right answer should be. I see that @skirpichev was able to find a solution.

skirpichev added a commit to diofant/diofant that referenced this issue Dec 16, 2015

Correct logic of reduce_rational_inequalities
We must use Intersection instead of Union, of course.

XXX: Not sure about reduce_rational_inequalities([], x) == False

Fixes sympy/sympy#10237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment