Use subsolver in get-value when necessary#12002
Merged
Conversation
mpreiner
approved these changes
Jun 24, 2025
psaccomani15
pushed a commit
to psaccomani15/cvc5
that referenced
this pull request
Dec 10, 2025
Fixes cvc5#11966. This PR ensures that we always provide a definitive value for terms in `get-value`, including those depending on quantified formulas. In detail, Boolean literals can be eliminated during preprocessing and equated to quantified formulas, for example, if `(= b (forall ((x Int)) (P x)))` is a top-level assertion. Moreover, if `b` does not appear in any further assertion, the solver will avoid reasoning about `(forall ((x Int)) (P x))` altogether. In such cases, the solver answers `sat`/`unsat` soundly but does not know the value of `b`. Previously, we gave a warning in such cases and returned the quantified formula itself. We now *invoke a subsolver* inside the call to `get-value` on the quantified formula in question. This behavior is enabled by default and can be disabled by `--no-check-model-subsolver`. The following changes are made by this PR: - Get value now invokes resource limits in cases where it is possible to invoke a subsolver. - A minor fix to check-models for the case where multiple expand definitions are necessary for evaluating. - Further fixes to the non-closed converter to guard against queries that are illegal (e.g. when check-model would depend on assertions that involve terms that the solver does not support). - Adds the regression and disables `-q` on several regressions that now pass `--check-models` without warnings.
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.
Fixes #11966.
This PR ensures that we always provide a definitive value for terms in
get-value, including those depending on quantified formulas.In detail, Boolean literals can be eliminated during preprocessing and equated to quantified formulas, for example, if
(= b (forall ((x Int)) (P x)))is a top-level assertion. Moreover, ifbdoes not appear in any further assertion, the solver will avoid reasoning about(forall ((x Int)) (P x))altogether. In such cases, the solver answerssat/unsatsoundly but does not know the value ofb.Previously, we gave a warning in such cases and returned the quantified formula itself. We now invoke a subsolver inside the call to
get-valueon the quantified formula in question. This behavior is enabled by default and can be disabled by--no-check-model-subsolver.The following changes are made by this PR:
-qon several regressions that now pass--check-modelswithout warnings.