Skip to content

Update Yices to version 2.8.0#524

Open
daniel-raffler wants to merge 97 commits intomasterfrom
yices-2.7.0
Open

Update Yices to version 2.8.0#524
daniel-raffler wants to merge 97 commits intomasterfrom
yices-2.7.0

Conversation

@daniel-raffler
Copy link
Contributor

@daniel-raffler daniel-raffler commented Sep 11, 2025

Hello,
this PR updates Yices to version 2.7.0 and closes #402. Other than that the new version mainly includes improvements to the MCSat solver, which we're not using at the moment. Here is a full changelog.

Yices2 has some additional features that we may want to include:

  • Nonlinear arithmetic is supported with the MCSat solver
  • MCSat also support interpolation (link), but not unsat core (yet?)
  • Dpll (which we currently use) has unsat core, but no interpolation or non-linear arithmetic
  • Only Dpll can be compiled with the --thread-safety option that allows multiple solver instances to run in parallel
  • Arrays have been added separately, see here for the other pull request
  • Yices can use Cadical/Kissat/CryptoMiniSat as backend for SAT solving. This could be significantly faster, but is currently limited to QF_BV logic

In this PR I stuck with Dpll as solver and just enabled the --thread-safety option. We could still add MCSat support and maybe even the external SAT solvers. Yices then picks the solver based on the logic, which would give us the best feature set. The big downside is that MCSat is not compatible with --thread-safety, which means that multiple parallel solver instances are not possible

Update

The thread-safety issues in MCSAT have been fixed, and unsat core is now also supported in MCSAT. We therefore switched to MCSAT as the default solver

  • A new option solver.yices2.solverType=dpllt has been added to use dpllt instead
  • Interpolation is now supported, thanks to the MCSAT solver
  • Nonlinear arithmetics and division by zero are also working now

We also switched the entire backend to the official Java bindings for Yices. In addition, a new build script has been added, and Windows binaries are now available

This PR is currently waiting on SRI-CSL/yices2#614, but should be ready to merge otherwise

Linked issues:

@daniel-raffler
Copy link
Contributor Author

@kfriedberger
I can try uploading the binaries this time. What architecture should I compile for? Yices2 seems to use --march=znver3 when I compile it on my laptop. Is that OK, or should I try to pick something else?

@kfriedberger
Copy link
Member

@daniel-raffler
We did use the Ubuntu docker image (18.04 if possible without further overhead, else the 22.04) for building binary solvers.
The steps for publication are documented in https://github.com/sosy-lab/java-smt/blob/master/doc/Developers-How-to-Release-into-Ivy.md#publishing-yices2 ... wait ... that seems quite outdated for Yices2. I will have a deeper look the next days.

Copy link
Member

@kfriedberger kfriedberger left a comment

Choose a reason for hiding this comment

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

Overall looks good. I will make a deeper test the next days.

*/
DEFINE_FUNC(int, 1has_1mcsat) WITHOUT_ARGS
CALL0(int, has_mcsat)
INT_RETURN
Copy link
Member

Choose a reason for hiding this comment

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

We could maybe add BOOL_RETURN for such methods.

@daniel-raffler
Copy link
Contributor Author

@daniel-raffler We did use the Ubuntu docker image (18.04 if possible without further overhead, else the 22.04) for building binary solvers. The steps for publication are documented in https://github.com/sosy-lab/java-smt/blob/master/doc/Developers-How-to-Release-into-Ivy.md#publishing-yices2 ... wait ... that seems quite outdated for Yices2. I will have a deeper look the next days.

Thanks! I've been able to build the binaries in the 18.04 image

Should I build with --thread-safety or --enable-mcsat? Unfortunately these options can't be combined and I'm not quite sure which one is more important to us

# Conflicts:
#	lib/ivy.xml
#	src/org/sosy_lab/java_smt/solvers/yices2/Yices2FormulaCreator.java
#	src/org/sosy_lab/java_smt/solvers/yices2/Yices2Model.java
#	src/org/sosy_lab/java_smt/test/SolverConcurrencyTest.java
#	src/org/sosy_lab/java_smt/test/VariableNamesTest.java
@disteph
Copy link

disteph commented Mar 2, 2026

Yices2 has some additional features that we may want to include:

* Nonlinear arithmetic is supported with the MCSat solver

* MCSat also support interpolation ([link](https://yices.csl.sri.com/doc/context-operations.html#c.yices_check_context_with_interpolation)), but not `unsat core` ([yet?](https://github.com/SRI-CSL/yices2/pull/578))

Just FYI, support for unsat cores in MCSAT has been merged into master (both through SMTLib2 input and through API calls): SRI-CSL/yices2#578.

It will be part of the upcoming Yices release 2.8.

@baierd
Copy link
Contributor

baierd commented Mar 2, 2026

Thank you for that info! Both features are actually requested by users that i talk to a lot currently!
@daniel-raffler we should focus on finishing this PR. It will most likely not make 6.0.0, but we can just publish 6.1 once this is done.

@baierd baierd self-requested a review March 2, 2026 08:19
# Conflicts:
#	src/org/sosy_lab/java_smt/test/ProverEnvironmentTest.java
#	src/org/sosy_lab/java_smt/test/SolverConcurrencyTest.java
#	src/org/sosy_lab/java_smt/test/SolverFormulaWithAssumptionsTest.java
@daniel-raffler daniel-raffler added this to the Release after 6.0.0 milestone Mar 2, 2026
@daniel-raffler
Copy link
Contributor Author

Some benchmark results:

Screenshot From 2026-03-18 09-56-02

From left to right: Yices old, Yices new (with dpllt), MathSAT (for reference)

Comparison between dpllt and mcsat:

Screenshot From 2026-03-18 09-55-37

We get significantly better results with dpllt (light brown), then with mcsat. Part of this is due to some open issues that cause segfaults in mcsat. However, this can't explain the difference entirely, and dpllt does currently seem to outperform mcsat at least on some tasks. (Note that interpolation always has to be done with mcsat, even when the dpllt option is used. So the comparison isn't entirely fair, and we would get much worse results for dpllt if it wasn't for this fallback)

@daniel-raffler daniel-raffler changed the title Update Yices to version 2.7.0 Update Yices to version 2.8.0 Mar 18, 2026
@daniel-raffler
Copy link
Contributor Author

I've added binaries for Windows. They seem to be working in Wine, but we may need some more testing

Yices has github actions (link) to build the solver on MacOS. We could probably start from there if we also want to support that platform

@daniel-raffler
Copy link
Contributor Author

@kfriedberger Just a heads up: If you want to build the binaries, we need the issue-613-mcsat-curried-function-model branch

You can download yices like this:

ant download-yices2

Then go to downloads/yices2 and change the branch:

cd downloads/yices2
git checkout issue-613-mcsat-curried-function-model

After that, just follow the build instructions

@kfriedberger
Copy link
Member

Is there a plan to integrate https://github.com/daniel-raffler/yices2_java_bindings.git into its original? Just asking, not urgent.

@daniel-raffler
Copy link
Contributor Author

Is there a plan to integrate https://github.com/daniel-raffler/yices2_java_bindings.git into its original? Just asking, not urgent.

Yes, I've open a PR last week: SRI-CSL/yices2_java_bindings#8

@ThomasHaas
Copy link
Contributor

Yices has github actions (link) to build the solver on MacOS. We could probably start from there if we also want to support that platform

I would love Yices2 support on MacOS (ARM). It usually outperforms Z3 (and others) by quite a lot on our QF_BV encoding in Dartagnan (sometimes by a whole order of magnitude). It seems to do some serious black magic there :)

@daniel-raffler
Copy link
Contributor Author

Hello Thomas,

I've been able to build the MacOS (Arm) binaries with a github runner. We still have to figure out to sign and ship the binaries, but I can at least include the build script. It's not too complicated to run and the binaries can then just be copied over

Yices has github actions (link) to build the solver on MacOS. We could probably start from there if we also want to support that platform

I would love Yices2 support on MacOS (ARM). It usually outperforms Z3 (and others) by quite a lot on our QF_BV encoding in Dartagnan (sometimes by a whole order of magnitude). It seems to do some serious black magic there :)

Is this with the default solver, or would we need one of these delegates? So far we only have the internal solver, but we might still add one of the delegates

@ThomasHaas
Copy link
Contributor

I've been able to build the MacOS (Arm) binaries with a github runner. We still have to figure out to sign and ship the binaries, but I can at least include the build script. It's not too complicated to run and the binaries can then just be copied over

Sounds great.

I would love Yices2 support on MacOS (ARM). It usually outperforms Z3 (and others) by quite a lot on our QF_BV encoding in Dartagnan (sometimes by a whole order of magnitude). It seems to do some serious black magic there :)

Is this with the default solver, or would we need one of these delegates? So far we only have the internal solver, but we might still add one of the delegates

The default internal solver. Funnily enough, that one outpeforms Kissat and Cadical on our benchmarks.
To test that, we generated QF_BV encodings, used Yices2 to bitblast them into DIMACS and then re-parsed the file with Yices2 but different SAT solver backends (internal/kissat/cadical). The internal SAT solver was the fastest!
Also, Kissat does not support incremental solving, so it's not so interesting in the first place I think.
Similarly, MCSAT is extremely bad on bitvector arithmetic and I think multi-threaded solving is also quite bad...
Basically, we only care about the default setting for now :)

@kfriedberger
Copy link
Member

kfriedberger commented Mar 23, 2026

Thanks for the input, everyone. A couple of thoughts on the direction of the latest discussion here:

First, I think it's important that we keep JavaSMT vendor-independent when it comes to our build process. We should avoid being tied too closely to GitHub Actions for publishing; the goal is to ensure any user can still build the library reliably on their own local machine. Apple is kind of special here, maybe we find a way with tools like osxcross/ldid/rcodesign in the future.

Regarding the macOS-specific points, there are multiple solvers waiting for macOS:

Should we move that conversation over to a separate issue? It feels like it deserves its own space for discussion and debugging without cluttering the Yices update.

@kfriedberger
Copy link
Member

kfriedberger commented Mar 23, 2026

@daniel-raffler :
The current state looks good. 👍
Do you see anything blocking a merge? If not, let's merge. ⏩
Further updates can be applied in another PR, e.g., after merging SRI-CSL/yices2_java_bindings#8 and the "final" release of Yices 2.8.0. Version 2.7.0+X is sufficient for today.
You have done great work in updating these solver bindings. 🥇

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.

Yices2 produces invalid SMTLIB output when dumping formulas

5 participants