Add builtin Refine - #1900
Merged
Merged
Conversation
Some other cleanup done with respect to AlgebraicOptions
Reduce differences
Contributor
|
Awesome! This has been waiting for a long time... |
Move tests already written in ``test.builtin.arithfns.test_assumptions`` to ``test.builtin.assumptions``
Member
Author
|
For reference, there are bugs in SymPy that may be addressed and will help here. See sympy/sympy#30324 What's cool about the PR to fix this, sympy/sympy#30325, is that it is being done in SymPy by improving its SAT solver! Thanks, @tkim601 ! One other thing of interest to me is that while I really like @ad-si Woxi, as best as I can tell, right now it doesn't have access to such a beast yet. It has to do all of the algebraic manipulation inside the Woxi code. Do I have this correct, Adrian? Possibly Woxi can find a similar SAT solver for such purposes? But it shows the differences in approaches right now. (Possibly over time the two projects will converge). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Start adding Built-in Function Refine.
To do this, we make use of SymPy's
sympy.assumptions.assume.AppliedPredictand conversion from WMA to SymPy for this.Currently, we handle relational expressions (==, >, etc.) and element domains (Reals, Integers, etc.).
There is much more to do, but this is a start.
We also start allowing "has_form" to accept a Symbol parameter in addition to a string. Over time, I expect a PR to convert from
str-argumenthas-formto Symbol-argumenthas_form.Assumeand$Assumptionhave been moved from the genericmathics.builtin.arithmetictomathics.builtin.assumptionswhich is where the newRefinelives.The motivation for this work stems from the fact that Rubi uses and calls
Refine.Some type checking was made more stringent.