Comment #5 on issue 3635 by mrock...@gmail.com: Backwards compatibility with old assumptions
http://code.google.com/p/sympy/issues/detail?id=3635

Two thoughts

1. It's attractive to completely separate assumptions from expressions. I suspect that some magic will cease to be necessary. Symbol could just be an Atom that contains a string. From a philosophical standpoint I think the separation is also cleaner.

2. However, this separation is inconvenient. In sympy.stats I want expressions to be able to inject their own assumptions. For example with

    X = Normal('x', mu, sigma)
    P(X>0)

I actually need to know that mu is real and sigma is positive and I don't trust that the user will consistently inject this into the assumptions context. Rather, I think that the NormalDistribution should carry a little context around that says `Q.real(mu) & Q.positive(sigma)` and that this context should be merged into the local context whenever any computation involves that NormalDistribution.

In short there are cases when it is convenient for expressions to affect the assumptions context. I don't particularly like it though. If we do go this route I suggest that the context be connected in a very restricted way. Assumptions shouldn't be deeply integrated into something like Symbol. At most an expression should have an attribute that optionally points to a context. How little can we get away with?


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


Reply via email to