Bug in parse_expr with -oo

19 views
Skip to first unread message

Casey S. Schroeder

unread,
Oct 14, 2022, 10:40:36 AM10/14/22
to sympy
Hello Sympy,

It appears there is a bug with the parse_expr running under evaluate(0)

mathystuff = "Union(Interval(-oo,0),Interval(-3,oo))"
with evaluate(0):
    frmla0 = parser.parse_expr(mathystuff, local_dict, transformations=transformations)

the error I am getting appears to be 'cannot determine truthvalue of Relational', which seems to me to mean it does not know how to arrange the terms with -oo without reducing it...  It also fails if I replace oo with 30.  But not if I replace -oo with -30.  Hence the issue appears to be with -oo

I am on 1.10.1 so if I need to update let me know, but it was a recent conda install.

Thanks,

Casey

Aaron Meurer

unread,
Oct 14, 2022, 4:26:25 PM10/14/22
to sy...@googlegroups.com
It looks like a bug with the evaluate=False logic. The issue isn't
with parse_expr(). You get the same error running

with evaluate(False):
Union(Interval(-oo,0),Interval(-3,oo))

although I should mention that parse_expr(evaluate=False) ought to
work, but it doesn't. Can you open an issue for this?

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/f611bf26-90f2-4f44-97a3-acb5430fee4fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages