Skip to content
2 changes: 1 addition & 1 deletion lib/ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ SPDX-License-Identifier: Apache-2.0
<dependency org="org.sosy_lab" name="javasmt-solver-opensmt" rev="2.8.0-sosy0-ge831bf23" conf="runtime-opensmt-x64->solver-opensmt-x64; runtime-opensmt-arm64->solver-opensmt-arm64; contrib->sources,javadoc"/>
<dependency org="org.sosy_lab" name="javasmt-solver-optimathsat" rev="1.7.3-sosy1" conf="runtime-optimathsat->solver-optimathsat" />
<dependency org="org.sosy_lab" name="javasmt-solver-cvc4" rev="1.8-prerelease-2020-06-24-g7825d8f28" conf="runtime-cvc4->solver-cvc4" />
<dependency org="org.sosy_lab" name="javasmt-solver-cvc5" rev="2025-04-03-ee76c36" conf="runtime-cvc5-x64->solver-cvc5-x64; runtime-cvc5-arm64->solver-cvc5-arm64"/>
<dependency org="org.sosy_lab" name="javasmt-solver-cvc5" rev="2025-05-16-8aeaa19" conf="runtime-cvc5-x64->solver-cvc5-x64; runtime-cvc5-arm64->solver-cvc5-arm64"/>
<dependency org="org.sosy_lab" name="javasmt-solver-boolector" rev="3.2.2-g1a89c229" conf="runtime-boolector->solver-boolector" />
<dependency org="org.sosy_lab" name="javasmt-solver-bitwuzla" rev="0.7.0-13.1-g595512ae" conf="runtime-bitwuzla-x64->solver-bitwuzla-x64; runtime-bitwuzla-arm64->solver-bitwuzla-arm64; contrib->sources,javadoc"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ public class DebuggingSolverInformation {
Map.of(
Solvers.PRINCESS,
ConcurrentHashMap.newKeySet(),
Solvers.CVC5,
ConcurrentHashMap.newKeySet(),
Solvers.YICES2,
ConcurrentHashMap.newKeySet());

Expand All @@ -60,12 +58,10 @@ public class DebuggingSolverInformation {
Map.of(
Solvers.CVC4,
ConcurrentHashMap.newKeySet(),
Solvers.CVC5,
ConcurrentHashMap.newKeySet(),
Solvers.YICES2,
ConcurrentHashMap.newKeySet());

private Set<Formula> definedFormulas;
private final Set<Formula> definedFormulas;

private final Thread solverThread = Thread.currentThread();

Expand Down
4 changes: 2 additions & 2 deletions src/org/sosy_lab/java_smt/solvers/cvc5/CVC5NativeAPITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void checkFPConversion() throws CVC5ApiException {
() -> termManager.mkFloatingPoint(8, 24, bvOneFourth));
assertThat(e.toString())
.contains(
"invalid argument '((_ int2bv 32) (to_int (/ 1 4)))' for 'val', expected bit-vector"
"invalid argument '((_ int_to_bv 32) (to_int (/ 1 4)))' for 'val', expected bit-vector"
+ " value");
}

Expand Down Expand Up @@ -950,7 +950,7 @@ public void checkQuantifierEliminationBV() throws CVC5ApiException {

Term quantElim = solver.getQuantifierElimination(assertion);

assertThat(quantElim.toString()).isEqualTo("(or (= #b01 (bvneg x_bv)) (= #b01 x_bv))");
assertThat(quantElim.toString()).isEqualTo("(or (= #b01 (bvneg x_bv)) (= x_bv #b01))");
}

@Test
Expand Down
8 changes: 2 additions & 6 deletions src/org/sosy_lab/java_smt/solvers/cvc5/CVC5SolverContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,15 @@ static void setSolverOptions(

@Override
public String getVersion() {
String version = solver.getInfo("version");
if (version.startsWith("\"") && version.endsWith("\"")) {
version = version.substring(1, version.length() - 1);
}
return "CVC5 " + version;
return "CVC5 " + solver.getVersion();
}

@Override
public void close() {
if (creator != null) {
closed = true;
termManager.deletePointer();
solver.deletePointer();
termManager.deletePointer();
creator = null;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/org/sosy_lab/java_smt/test/DebugModeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void noSharedFormulasTest()
BooleanFormula formula = hardProblem.generate(DEFAULT_PROBLEM_SIZE);

// We expect debug mode to throw an exception for all solvers, except CVC4, CVC5 and Yices
if (!List.of(Solvers.CVC4, Solvers.CVC5, Solvers.YICES2).contains(solverToUse())) {
if (!List.of(Solvers.CVC4, Solvers.YICES2).contains(solverToUse())) {
assertThrows(IllegalArgumentException.class, () -> checkFormulaInDebugContext(formula));
} else {
checkFormulaInDebugContext(formula);
Expand Down Expand Up @@ -180,7 +180,7 @@ public void noSharedDeclarationsTest() throws InvalidConfigurationException {
"id", FormulaType.IntegerType, ImmutableList.of(FormulaType.IntegerType));

// We expect debug mode to throw an exception for all solvers, except Princess, CVC4 and Yices
if (!List.of(Solvers.PRINCESS, Solvers.CVC5, Solvers.YICES2).contains(solverToUse())) {
if (!List.of(Solvers.PRINCESS, Solvers.YICES2).contains(solverToUse())) {
assertThrows(IllegalArgumentException.class, () -> checkDeclarationInDebugContext(id));
} else {
checkDeclarationInDebugContext(id);
Expand Down
9 changes: 2 additions & 7 deletions src/org/sosy_lab/java_smt/test/SolverConcurrencyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ public void checkThatSolverIsAvailable() throws InvalidConfigurationException {
.that(solver)
.isNotEqualTo(Solvers.MATHSAT5);
}

assume()
.withMessage("Solver does not support concurrency without concurrent context.")
.that(solver)
.isNotEqualTo(Solvers.CVC5);
}

private void requireConcurrentMultipleStackSupport() {
Expand Down Expand Up @@ -303,7 +298,7 @@ public void testFormulaTranslationWithConcurrentContexts()
assume()
.withMessage("Solver does not support translation of formulas")
.that(solver)
.isNoneOf(Solvers.CVC4, Solvers.PRINCESS);
.isNoneOf(Solvers.CVC4, Solvers.CVC5, Solvers.PRINCESS);

ConcurrentLinkedQueue<ContextAndFormula> contextAndFormulaList = new ConcurrentLinkedQueue<>();

Expand Down Expand Up @@ -540,7 +535,7 @@ public void continuousRunningThreadFormulaTransferTranslateTest() {
assume()
.withMessage("Solver does not support translation of formulas")
.that(solver)
.isNoneOf(Solvers.CVC4, Solvers.PRINCESS);
.isNoneOf(Solvers.CVC4, Solvers.CVC5, Solvers.PRINCESS);

// This is fine! We might access this more than once at a time,
// but that gives only access to the bucket, which is threadsafe.
Expand Down
3 changes: 2 additions & 1 deletion src/org/sosy_lab/java_smt/test/SolverThreadLocalityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ public void wrongContextTest()
Solvers.Z3,
Solvers.PRINCESS,
Solvers.BOOLECTOR,
Solvers.BITWUZLA);
Solvers.BITWUZLA,
Solvers.CVC5);

// FIXME: This test tries to use a formula that was created in a different context. We expect
// this test to fail for most solvers, but there should be a unique error message.
Expand Down
5 changes: 4 additions & 1 deletion src/org/sosy_lab/java_smt/test/TimeoutTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ protected Logics logicToUse() {

@Before
public void setUp() {
// FIXME CVC5 has interruptions, but crashes on Windows, probably due to concurrency issues
// FIXME CVC5 does not support interruption and will segfault once the timeout is reached
// The issue here seems to be that CVC5SolverContext.close() will free the C++ objects while
// the solver is still running. We could consider finding a work-around for this, or maybe
// ask the developers for a way to interrupt the solver.
// TODO Add interruption for Princess
assume()
.withMessage(solverToUse() + " does not support interruption")
Expand Down