> > 1. Make the new system at least as good as the old one. That is
> > whenever I can write foo.is_bar I can write ask(foo, Q.bar) and I will
> > get at least as good an answer.
>
> I think the only problem could be that ask() is much slower for
> trivial queries, needs to be verified. This should be not too hard to
> fix though.
>
> > In particular Symbol('x',
> > positive=True) should register automatically in the global assumptions
> > that x > 0 (if I understand correctly how the new system works...).
>
> That is is not that easy, because this approach does not work with
> global assumptions. Symbol('x', positive) only affects local symbols,
> global assumptions affect *all* symbols.
>
> In other words, you have to manually clean the global assumptions, so
> this can't be used as a drop-in replacement for Symbol('x',
> positive=True). Imagine running the test suite and global_assumptions
> being spammed with hundreds of assumptions.
>

Couldn't symbol.__del__ just remove all global assumptions involving
the about-to-be-deleted symbol? I suppose assumptions would have to
store weak references for this to work.

Note: I come from a background of explicit memory allocation, so this
might either not be feasible or not pythonic.

> A solution would be to implement local assumptions, imitating Python's
> local scoping. I tried this approach some time ago, it is quite
> hackish, but I got it working for Symbol(), but not really for
> symbols() or var(). See my local_assump branch.
>

That would of course still be handy to have.

> > 2. Replace all queries foo.is_bar by ask(foo, Q.bar).
>
> I we fix the two things I mentioned above, we could still have
> foo.is_bar as a (maybe deprecated) shortcut.
>
> > 3. Remove all implementations of the is_bar properties.
> > 4. Remove all remaining remnants of the old system.
>
> Vinzent

-- 
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