-
Notifications
You must be signed in to change notification settings - Fork 109
Solve quadratic constraints #2619
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
Closed
Closed
Conversation
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
It seems figuring out |
Oh, maybe it could work using "only known constant is known"-mode |
Closed
d60c989
to
03c0abc
Compare
Superseded by #2659 |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 23, 2025
Adds a quick-and-dirty way to return bit constraints when running `QuadraticSymbolicExpression::solve()`, by looking for a specific expression (`X * (X - 1)`). As far as I can see, this is orthogonal to #2619, which would return a `Branch` effect instead of a range constraint. With this PR, we remove the need for "global range constraints". This will help progressing on the new solver (#2651), which tries to rely only on `QuadraticSymbolicExpression`. Then, we can have a bit decomposition example even before implementing machine calls. --------- Co-authored-by: chriseth <[email protected]>
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.
Strategy to solve
X * Y = 0
:Go into both branches, figure out that we can solve both for
var_8
, on the left we havevar_8 = L
and the right we havevar_8 = R
. We figure out thatL - R
is a constant that is at least as large as the range constraint ofvar_8
. This means thatL
andR
cannot both fall into the allowed range forvar_8
at the same time. and thus we generate a branch:if L in_range_for var_8 { var_8 = L } else { var_8 = R}