In the released version (0.7.6.1), the systems are independent. In
master, the new assumptions (ask(), Q) read the old assumptions on
Symbols (is_positive, positive=True).

For performance purposes, this was done in a way that prevents the new
assumptions from noticing contradictions (it was added to the old ask
handler system instead of the new satask handler system). This will
hopefully change in the future, but there are some performance issues
that need to be worked out with the satask system.

For now, I would recommend using the old assumptions. However, you can
play with the new assumptions. The goal in making the new assumptions
read the old was to make this easier to do.

Aaron Meurer

On Fri, Jan 15, 2016 at 6:50 AM, Oscar Benjamin
<[email protected]> wrote:
> What exactly is that status of the old and new assumptions systems in
> sympy? I've read a few things including
> https://github.com/sympy/sympy/wiki/Assumptions but I'm still a little
> confused.
>
> Are the two systems properly independent of one another? When I use
> Symbol('x', positive=True) will that positive flag be ignored when
> using ask(x,...)? Actually I think I can answer that question myself:
>
> (using master)
>>>> from sympy import *
>>>> x = Symbol('x', positive=True)
>>>> y = Symbol('y')
>>>> simplify(abs(x))
> x
>>>> refine(abs(x))
> x
>>>> simplify(abs(y))
> Abs(y)
>>>> refine(abs(y))
> Abs(y)
>>>> ask(Q.positive(x))
> True
>>>> ask(Q.positive(x), Q.negative(x))
> True
>>>> ask(Q.positive(y), Q.negative(y))
> False
>>>> print(ask(Q.positive(y)))
> None
>
> So it seems that the new system uses the positive attribute on x even
> if it contradicts the explicit assumptions passed to ask. Presumably
> then as a user I need to be disciplined in not using both systems.
> Should I future-proof my own code by sticking to the new system?
>
> But what are the plans for this in future? It seems that sympy is
> about to release version 1.0 but isn't this exactly the kind of thing
> that would normally be resolved before a 1.0 release?
>
> This isn't a criticism: I'm just trying to understand where sympy's going.
>
> --
> Oscar
>
> --
> 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 https://groups.google.com/group/sympy.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/CAHVvXxTAqUOVUOzUa1PfH-7m-7eMLZJrjTd9PiPsd_%3D_xEMkyg%40mail.gmail.com.
> 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 https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6KgiPh2_SP%3Dav4RQYBy5fAa2CCa6cWWTso4BW6Hs-J0%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to