Skip to content

Throw SolverException when interpolation fails - #701

Merged
daniel-raffler merged 15 commits into
masterfrom
solver-exceptions
Aug 10, 2026
Merged

Throw SolverException when interpolation fails#701
daniel-raffler merged 15 commits into
masterfrom
solver-exceptions

Conversation

@daniel-raffler

Copy link
Copy Markdown
Contributor

Hello,

this PR changes some runtime exceptions to SolverExceptions so that they can be better caught by the user. Specifically, we now throw a SolverException if interpolation fails in Bitwuzla or Yices. This is in line with how interpolation failures are handled in MathSAT, which also only has partial interpolation support for some theories. In addition we throw a SolverException in OpenSMT when model generation or interpolation are not available for the selected logic

Closes #643

OpenSMT doesn't support model generation for arrays and will only return abstract values when evaluting array variables. We therefore can't return a model when arrays were used in the constraints
…for the selected logic

OpenSMT only supports interpolation for QF_UF, QF_LIA and QF_LRA and the logic needs to be explicitly set with `solver.opensmt.logic`

@baierd baierd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Only minor points to work on.

Comment thread src/org/sosy_lab/java_smt/solvers/bitwuzla/BitwuzlaInterpolatingProver.java Outdated
Comment thread src/org/sosy_lab/java_smt/solvers/opensmt/OpenSmtInterpolatingProver.java Outdated
Comment thread src/org/sosy_lab/java_smt/solvers/yices2/Yices2InterpolatingProver.java Outdated
Comment thread src/org/sosy_lab/java_smt/solvers/opensmt/OpenSmtModel.java Outdated
Comment thread src/org/sosy_lab/java_smt/solvers/bitwuzla/BitwuzlaInterpolatingProver.java Outdated
Comment thread src/org/sosy_lab/java_smt/solvers/opensmt/OpenSmtModel.java Outdated
OpenSMT doesn't support extraction of array values for the model. We abort model generation when the constraints contain formulas over arrays and print this message
@baierd

baierd commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

I can approve the PR once Checkstyle is fixed ;D

@daniel-raffler

Copy link
Copy Markdown
Contributor Author

I can approve the PR once Checkstyle is fixed ;D

Sorry about that. The format is fixed now

baierd added 2 commits August 10, 2026 12:56
…atch block, so that we don't catch exceptions from the vector creation accidentally
@daniel-raffler
daniel-raffler merged commit 6815ff9 into master Aug 10, 2026
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Investigate Bitwuzla Interpolation Crash

2 participants