Skip to content

Commit 5320a50

Browse files
daniel-rafflerbaierd
authored andcommitted
Fixed nonLocalProverTest: To trigger this specific bug in CVC5 we need to create the ProverEnvironment on the thread. The other version also fails, but for different reasons and this somehow got mixed up earlier.
1 parent 34ffe95 commit 5320a50

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

src/org/sosy_lab/java_smt/test/SolverThreadLocalityTest.java

+25-26
Original file line numberDiff line numberDiff line change
@@ -140,32 +140,31 @@ public void nonLocalProverTest() throws InterruptedException, ExecutionException
140140

141141
BooleanFormula formula = hardProblem.generate(DEFAULT_PROBLEM_SIZE);
142142

143-
try (BasicProverEnvironment<?> prover = context.newProverEnvironment()) {
144-
// generate a new prover in another thread, i.e., non-locally
145-
Future<?> task =
146-
executor.submit(
147-
() -> {
148-
try {
149-
// FIXME: Exception for CVC5
150-
// io.github.cvc5.CVC5ApiException:
151-
// Given term is not associated with the node manager of this solver
152-
// at io.github.cvc5.Solver.assertFormula
153-
// (Native Method)
154-
// at io.github.cvc5.Solver.assertFormula
155-
// (Solver.java:1455)
156-
// at org.sosy_lab.java_smt.solvers.cvc5.CVC5AbstractProver.addConstraintImpl
157-
// (CVC5AbstractProver.java:114)
158-
// at org.sosy_lab.java_smt.basicimpl.AbstractProver.addConstraint
159-
// (AbstractProver.java:108)
160-
// at ..
161-
prover.push(formula);
162-
assertThat(prover).isUnsatisfiable();
163-
} catch (SolverException | InterruptedException pE) {
164-
throw new RuntimeException(pE);
165-
}
166-
});
167-
assert task.get() == null;
168-
}
143+
// generate a new prover in another thread, i.e., non-locally
144+
Future<?> task =
145+
executor.submit(
146+
() -> {
147+
try (BasicProverEnvironment<?> prover = context.newProverEnvironment()) {
148+
// FIXME: Exception for CVC5
149+
// io.github.cvc5.CVC5ApiException:
150+
// Given term is not associated with the node manager of this solver
151+
// at io.github.cvc5.Solver.assertFormula
152+
// (Native Method)
153+
// at io.github.cvc5.Solver.assertFormula
154+
// (Solver.java:1455)
155+
// at org.sosy_lab.java_smt.solvers.cvc5.CVC5AbstractProver.addConstraintImpl
156+
// (CVC5AbstractProver.java:114)
157+
// at org.sosy_lab.java_smt.basicimpl.AbstractProver.addConstraint
158+
// (AbstractProver.java:108)
159+
// at ..
160+
prover.push(formula);
161+
assertThat(prover).isUnsatisfiable();
162+
} catch (SolverException | InterruptedException pE) {
163+
throw new RuntimeException(pE);
164+
}
165+
});
166+
167+
assert task.get() == null;
169168
}
170169

171170
@Override

0 commit comments

Comments
 (0)