Skip to content

Use subsolver in get-value when necessary#12002

Merged
ajreynol merged 26 commits intocvc5:mainfrom
ajreynol:getValueSubsolver
Jul 24, 2025
Merged

Use subsolver in get-value when necessary#12002
ajreynol merged 26 commits intocvc5:mainfrom
ajreynol:getValueSubsolver

Conversation

@ajreynol
Copy link
Copy Markdown
Member

@ajreynol ajreynol commented Jun 20, 2025

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, 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.

@ajreynol ajreynol added normal Priority moderate Complexity labels Jul 8, 2025
@ajreynol ajreynol enabled auto-merge July 24, 2025 14:48
@ajreynol ajreynol added this pull request to the merge queue Jul 24, 2025
Merged via the queue into cvc5:main with commit da72dc1 Jul 24, 2025
13 checks passed
@ajreynol ajreynol deleted the getValueSubsolver branch July 24, 2025 15:59
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

moderate Complexity normal Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get-value fails on Boolean constant in UFLIA Problem

3 participants