On Tue, Aug 26, 2014 at 10:11 PM, Chris Smith <[email protected]> wrote:
> > On Tuesday, August 26, 2014 1:35:30 PM UTC-5, Aaron Meurer wrote: >> >> I like to use is ask(Q.zero(x*y), Q.zero(x) | Q.zero(y)) > > > When encountering an Or I would have done something like return > all(ask(Q.zero(x*y), clause) for clause in Or.args). > You mean any, not all, right? Anyhow, you're right, that does work. I got the example backwards (because Q.zero(x*y) is equivalent to Q.zero(x) | Q.zero(y)). What it should be is ask(Q.zero(x) | Q.zero(y), Q.zero(x*y)). Simply put, satask lets you ask about things that aren't single predicates. You can imagine this comes in handy. For instance, we might say x**2 is real if x is real or if x is imaginary. So we would ask(Q.real(x) | Q.imaginary(x), assumptions). This is not the same as ask(Q.real(x), assumptions) or ask(Q.imaginary(x), assumptions), because the latter is weaker. For example, if x = I**n where n is an integer, we know that x is real or x is imaginary, but we don't know which, so both ask(Q.real(I**n), Q.integer(n)) and ask(Q.imaginary(I**n), Q.integer(n)) would give None, but ask(Q.real(I**n) | Q.imaginary(I**n), Q.integer(n)), assuming the system is powerful enough, should give True. satask is a system that is powerful enough. 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/090850b0-3667-4fb3-8c8f-825976a8712e%40googlegroups.com > <https://groups.google.com/d/msgid/sympy/090850b0-3667-4fb3-8c8f-825976a8712e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6KmrsuUK2Lb%2Bmyn%2BZ9pPTKmXgUUGZJ2rLX7gTLLZ7VhUg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
