On Sunday, August 24, 2014 9:46:40 PM UTC+4, Aaron Meurer wrote:
>
> Some of you may have seen Sergey started a pull request to remove uses of 
> the new assumptions in the code, because it's confusing to users who set 
> the old assumptions and it doesn't work.
>

BTW, if we decide to use this approach - I think that change is a good 
candidate for the next release.

So, please help with review.
 

> You make a good point. However, if you are going to spend time on this, it 
> would be better spent improving the new assumptions (and let's finally 
> merge my branch as a start to this), or merging the two. I still maintain 
> that this pull request is a step backwards.
>

We must offer for users a consistent interface.  But if some parts use 
foo.is_real assumption, and some ask(Q.real(foo)) - this is not the case. 
Second, I don't think there are regressions in the functionality of sympy.  
 

> With these changes, the new assumptions aren't used at all, meaning they 
> are tested much less, and more importantly, there is no more motivation to 
> improve them.
>

We still have refine* helpers, we have some code in the unify module.  And 
we have our tests for the assumptions module.  Also, it seems we have bad 
test coverage for the code, changed in my pr.
 

> The old assumptions syntax isn't going away, so why don't we focus on 
> making it so that the new assumptions can read the old assumptions.
>

Yes, but this variant is much more complex then my PR.  Basically, we must 
first make our assumptions identical in both systems.
 

> The first step though will be to go through all the assumptions and make 
> sure they are identical in all systems. This is a good opportunity to clean 
> up some of the contradictory or unexpected assumptions, so it should 
> involve some community input. So I would do it on the mailing list. 
>

I think, first we should cleanup and document (see 
https://github.com/sympy/sympy/pull/7936) old assumptions.  Then freeze old 
assumptions.  No new facts, no new features - only bugfixes.  First step.
 

> - [ ] Go through all the assumptions facts and make a note of what is 
> different, and also what is confusing. A lot of this is already written 
> down in various places (https://github.com/sympy/sympy/issues/5976, 
> https://github.com/sympy/sympy/pull/2538, probably some of the issues 
> mentioned in https://github.com/sympy/sympy/issues/6730, 
> https://github.com/sympy/sympy/pull/2508/files#diff-e0f95401c86d07d90903363122990de0R172,
>  
> https://github.com/sympy/sympy/wiki/assumptions_handlers), but we should 
> gather them all down in one place. I think the main thing will be how we 
> handle infinity. 
>

We must do all this in the old assumptions first (my first step above).

- [ ] Discuss with the community on the mailing list how we should handle 
> the differences, until we come to a consensus. 
> - [ ] Make the new assumptions call the old assumptions first. Also make 
> the handlers access the old assumptions, so that everything sees 
> `Symbol('x', real=True)` as real. This will be the hard part, and lead to 
> lots of test failures. It might be worth trying this first, to really see 
> what facts are different in the two systems.
>

Second step. We can make the new assumptions call the old assumptions on 
symbols (i.e. ask(Q.real(x)) returns True for x = Symbol('x', real=True)).  
And we can start add new facts in a way, fully compatible with the old 
system.

Only at this stage we can start experimenting with new assumptions in the 
sympy codebase (i.e. not only in sympy.assumptions).

I don't think there's a big issue with this, because already 
> `ask(Q.real(x))` and `x.is_real` are different. My proposal is to have the 
> first call the second but not the other way around.
>

That's impossible now.  Simple example: x.is_real = Q.extended_real(x), not 
Q.real.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/cac2dc56-5021-43ab-ba97-83b3b4699f81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to