These are the new assumptions.
>
> On the other hand, I can set some assumptions on the variable when using the
> constructor and then use is_* functions, but
Those are the old assumptions.
>
> a) I cannot find is_positive, is_integer, ... documented anywhere, nor a
> list of all possible assumptions, and
Yeah, see issue http://code.google.com/p/sympy/issues/detail?id=2196.
> b) Setting assumptions after creating the variable seems not to work:
No, you can't do this, because the is_stuff is set using magic
getattr() stuff that is hooked into logical deductions (so e.g., you
can set positive=True and is_real will be True).
>
> >>> pp = Symbol('pp')
> >>> qq = sqrt(pp ** 2)
> >>> print qq
> (pp**2)**(1/2)
> >>> pp.is_positive = True
> [...]
> AttributeError: can't set attribute
> >>> pp = Symbol('pp', positive=True)
> >>> qq = sqrt(pp ** 2)
> >>> print qq
> pp
>
> So my questions are, what is the state of the assumtions system? Which one
> is recommended? Why seems the documentation incomplete at this point? Will
> you mark one of these as deprecated in the near future?
Currently, the code uses the old assumptions. So you will probably
find yourself needing to use that, just because that is what currently
works.
We hope to merge the new assumptions in such a way that it will use
the same interface as the old assumptions. In other words, at some
point, Symbol('x', positive=True) and x.is_positive will be calling
the new assumptions. So you hopefully shouldn't need to worry about
deprecation.
You can play around with using the new assumptions if you want. For
now, they are only non-global, so there is no way to "set" an
assumption on a variable. You just pass around the assumption, like
ask(Q.real(x), Q.positive(x)) (this means, "is x real given that it is
positive?"). You can use global_assumptions, but this does not hook
into anything else yet (except for refine), so it's not really useful.
Aaron Meurer
>
> Thank you in advance,
>
> Juan Luis Cano
>
> [1]: http://docs.sympy.org/dev/modules/assumptions/index.html
> [2]: http://docs.sympy.org/dev/modules/assumptions/refine.html
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.