Skip to content

Commit d66d096

Browse files
committed
CVC5: set default logic ALL for CVC5.
While most features of CVC5 would also set logic ALL internally by default, some features, such as separation logic, do not and require an explicit setting upfront.
1 parent 3ad393c commit d66d096

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/org/sosy_lab/java_smt/basicimpl/AbstractProver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
public abstract class AbstractProver<T> implements BasicProverEnvironment<T> {
3131

32-
private final boolean generateModels;
32+
protected final boolean generateModels;
3333
private final boolean generateAllSat;
3434
protected final boolean generateUnsatCores;
3535
private final boolean generateUnsatCoresOverAssumptions;

src/org/sosy_lab/java_smt/solvers/cvc5/CVC5AbstractProver.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ abstract class CVC5AbstractProver<T> extends AbstractProverWithAllSat<T> {
5050
protected final Deque<PersistentMap<String, Term>> assertedTerms = new ArrayDeque<>();
5151

5252
// TODO: does CVC5 support separation logic in incremental mode?
53+
// --> No, CVC5 aborts on addConstraint.
5354
protected final boolean incremental;
5455

5556
protected CVC5AbstractProver(
@@ -84,15 +85,10 @@ protected void setSolverOptions(
8485
throw new AssertionError("Unexpected exception", e);
8586
}
8687

87-
if (incremental) {
88-
pSolver.setOption("incremental", "true");
89-
}
90-
if (pOptions.contains(ProverOptions.GENERATE_MODELS)) {
91-
pSolver.setOption("produce-models", "true");
92-
}
93-
if (pOptions.contains(ProverOptions.GENERATE_UNSAT_CORE)) {
94-
pSolver.setOption("produce-unsat-cores", "true");
95-
}
88+
pSolver.setOption("incremental", incremental ? "true" : "false");
89+
pSolver.setOption("produce-models", generateModels ? "true" : "false");
90+
pSolver.setOption("produce-unsat-cores", generateUnsatCores ? "true" : "false");
91+
9692
pSolver.setOption("produce-assertions", "true");
9793
pSolver.setOption("dump-models", "true");
9894

@@ -105,6 +101,15 @@ protected void setSolverOptions(
105101

106102
// Enable more complete quantifier solving (for more info see CVC5QuantifiedFormulaManager)
107103
pSolver.setOption("full-saturate-quant", "true");
104+
105+
// if no logic is set in CVC5, select the broadest logic available: "ALL"
106+
if (!solver.isLogicSet()) {
107+
try {
108+
solver.setLogic("ALL");
109+
} catch (CVC5ApiException e) {
110+
throw new AssertionError("Unexpected exception", e);
111+
}
112+
}
108113
}
109114

110115
@Override

0 commit comments

Comments
 (0)