Skip to content

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
wants to merge 33 commits into from
Closed

Conversation

chriseth
Copy link
Member

@chriseth chriseth commented Mar 31, 2025

Strategy to solve X * Y = 0:

Go into both branches, figure out that we can solve both for var_8, on the left we have var_8 = L and the right we have var_8 = R. We figure out that L - R is a constant that is at least as large as the range constraint of var_8. This means that L and R cannot both fall into the allowed range for var_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}

@chriseth
Copy link
Member Author

chriseth commented Apr 1, 2025

It seems figuring out L -R is beyond what our current system can do. We would need to add algebraic simplification procedures.

@chriseth
Copy link
Member Author

chriseth commented Apr 1, 2025

Oh, maybe it could work using "only known constant is known"-mode

@chriseth chriseth mentioned this pull request Apr 8, 2025
@chriseth
Copy link
Member Author

Superseded by #2659

@chriseth chriseth closed this Apr 22, 2025
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant