Add on-demand zero lemmas for MCSAT-supplement nonlinear relaxation#648
Open
ahmed-irfan wants to merge 5 commits into
Open
Add on-demand zero lemmas for MCSAT-supplement nonlinear relaxation#648ahmed-irfan wants to merge 5 commits into
ahmed-irfan wants to merge 5 commits into
Conversation
Each nonlinear monomial abstracted for simplex (mcsat_relax_pprod) now also gets on-demand "zero lemma" clauses relating the abstraction variable to its factors (z=0 <-> some factor=0), checked against live simplex values from propagate/final_check and gated by the existing mcsat-supplement-check parameter. Atoms are pre-built once at abstraction time (base level), since simplex only supports creating new atoms there, not mid-search; the on-demand check only ever combines those cached literals into new clauses.
The reverse clause (z=0 -> some factor=0) was firing whenever z=0 alone, without checking the factors, which is sound (the clause is a tautology) but looser than intended. Only fire it when z=0 and every factor is confirmed nonzero, matching the documented precondition.
Split the mid-search checking logic (mcsat_relax_check_zero_lemma, context_check_mcsat_relax_zero_lemmas) out of context.c into its own file, following the existing context_solver.c/context_simplifier.c pattern of sharing context_t internals via context_utils.h. Only the atom/monomial construction logic (mcsat_relax_pprod and friends) stays in context.c, since it's tightly coupled to the rest of the internalization pass there. Required exposing three previously-static context.c helpers via context_utils.h: context_mcsat_relaxation_enabled, context_get_mcsat_relax_zero_lemma_done, translate_code_to_arith.
Collateral damage from an earlier edit that used this comment's text as an anchor and never restored it.
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.
Summary
mcsat_relax_pprod) now also gets on-demand "zero lemma" clauses relating the abstraction variablezto its factors (z=0 <-> some factor=0), checked against live simplex values frompropagate/final_check:xi=0whilez≠0→not(xi=0) or (z=0)z=0while every factor is confirmed nonzero →not(z=0) or (x1=0) or ... or (xk=0)mcsat-supplement-checkparameter (both/final-only), same as the expensive nested-MCSAT check it complements — no new config surface.context_mcsat_relax.c, following the existingcontext_solver.c/context_simplifier.cpattern of sharingcontext_tinternals viacontext_utils.h. Only the atom/monomial construction logic (mcsat_relax_pprodand friends) stays incontext.c, since it's tightly coupled to the rest of the internalization pass there.Test plan
make MODE=debug bin— clean buildmake mcsat-check— 700/700 passmake check— 1731/1731 passtests/api/test_cdclt_mcsat_supplement.c— passesx²y³z), including undermcsat-supplement-check=final-only