Le mercredi 07 décembre 2011 à 20:36 +0100, krastanov.ste...@gmail.com a
écrit :
> How should assumptions be used? More precisely why the following code
> does what it does
> 
> In [18]: global_assumptions.clear()
> 
> In [19]: x = Symbol('x', positive=True)
> 
> In [20]: ask(Q.positive(x)) # Why does it return None?
> 
> In [21]: x > 0
> Out[21]: True
> 
> In [22]: global_assumptions # It's empty but I already declared x as
> positive
> Out[22]: AssumptionsContext()
> 
> In [23]: ask(Q.positive(x))
> 
> In [24]: global_assumptions.add(Q.positive(x))
> 
> In [25]: ask(Q.positive(x))
> Out[25]: True
> 
> Why setting a symbol to positive does not create a global assumption?
> What are assumption used for actually when there are all the
> is_something flags?

The is_foo flags are part of the old assumption system, while ask() and
global_assumptions belong to the new one. The two systems ignore each
other and your session demonstrates precisely this.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to