I would structure the Piecewise so that there is no True (otherwise) condition, and the empty set cases fall under that. I think Piecewise already gives nan in such cases.
This is also somewhat related to https://github.com/sympy/sympy/issues/16362. Aaron Meurer On Mon, Aug 26, 2019 at 1:57 PM Chris Smith <[email protected]> wrote: > > In this PR `Range` has been modified to accept symbolic start, stop and step > values, e.g. `Range(x, y, z)`. One of the decisions that needs to be made is > whether such Ranges should return the symbolic logical statement > corresponding to a given attribute or not. > > e.g. the piecewise-folded version of `Range(x, y, z).inf` is > > Piecewise( > (nan, ceiling((-x + y)/z) <= 0), > (x, z > 0), > (x + z*ceiling((-x + y)/z) - z, Ne(x, x + 1)), > (y - z, True)) > > The problem is that the nan result is really not the inf...it is used to > indicate that inf is not defined under conditions that would lead to an > EmptySet, e.g. x=z=1,y=0. Is this of any value or should Range with symbols > just raise a ValueError if a property cannot be given as a simple expression? > > /c > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/6dc89b8f-cf15-4d9e-861c-1ad267df7955%40googlegroups.com. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JffXUmNvD0BbZPM1ssvt4%3DxNAyGq12RyOy7Afkiz7OxA%40mail.gmail.com.
