On Apr 30, 9:44 am, Tom Bachmann <ness...@googlemail.com> wrote:
> On 29 Apr., 23:16, "Aaron S. Meurer" <asmeu...@gmail.com> wrote:
>
> > So Ondřej, Christian, and I talked about this before GSoC, but I forgot to 
> > mention it on the list.  We need to figure out, as a community, how to 
> > remove the old assumptions system and merge in the new one.  We have 
> > already had several branches attempting to do it, and we couldn't even get 
> > a GSoC to do it because we don't really have a clear strategy on how to do 
> > it.
>
> Can you describe what went wrong with these branches? In particular,
> why can the following naive strategy not work:
>
> 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.

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.

> 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