-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Modify and fix new assumption facts #21220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Hi, I am the SymPy bot (v161). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.8. Click here to see the pull request description that was parsed.
|
There was some discussion about this before. The difficulty is that the complexity of satask can grow exponentially in the number of predicates. We need a way to translate these predicates into a smaller number before sending them into satask. I think that the way to do it is to have 5 primitive predicates:
Then we have e.g.:
|
Sounds good. There are a lot of discrepancies and awful errors in old and new assumption system. I think the facts in these two systems need thorough reorganization. At least, every key in old assumption system needs its counterpart in new assumption system. |
Implement is_positive_infinite and is_negative_infinite Implement Q.positive_infinite and Q.negative_infinite Fix Q.infinite Make assumptions.sathandlers._old_assump_replacer() simpler
Fix Q.hermitian and Q.antihermitian
@oscarbenjamin I sucessfully implemented |
Does this mean that they all get passed into satask though? |
Make predicates decomposed into primitive predicates This makes the facts used by satask simpler. Since the factbase of satask is simplified, some queries cannot be directly computed by satask() and thus tests for these queries are removed. However, these queries are still computed by ask().
@oscarbenjamin |
Changing anything in the core assumptions can impact performance. Can you run benchmarks comparing performance of this PR with master? |
Add more facts to core/assumptions
Make pure predicates converted to primitives by to_NNF when possible This makes tests from test_satask re-enabled.
This change slowed down the performance. I did benchmarking by running tests for In master, I think speed can be improved by letting |
Have you tried running the benchmarks: |
Here is the highlighted benchmark compare result between master and this branch.
It seems that the difference is due to:
I will do another benchmark to exclude the influence of 1. |
I was asking more about the impact that changing the core assumptions would have from adding |
I will split down the PR and run benchmarks separately. This one is attempting to make too many things to benchmark each change efficiently. |
References to other Issues or PRs
Fixes #21228
Brief description of what is fixed or changed
.is_positive_infinite
and.is_negative_infinite
attributes are introduced.Q.positive_infinite
andQ.negative_infinite
keys are introduced.Facts are now built in more systematical way, based on primitive predicates such as
negative_infinite
,negative
,zero
,positive
,positive_infinite
, andimagniary
.Incorrect result of
Q.infinite
is fixed.Before this change:
After this change:
Also, incorrect results of
Q.hermitian
andQ.antihermitian
are fixed. See #21228.Other comments
Release Notes
assumptions
Q.positive_infinite
andQ.negative_infinite
predicates are introduced.Q.infinite
now correctly evaluates toTrue
foroo
,-oo
, andzoo
.Q.hermitian(x)
now does not imply thatx
is antihermitian, and vice versa.0
is now both hermitian and antihermitian.core
.is_positive_infinite
and.is_negative_infinite
attributes are introduced.