Skip to content

Commit 9e55528

Browse files
authored
Merge pull request #499 from sosy-lab/cvc5/update_2025-07-24
update CVC5 to latest version from 2025-07-24
2 parents 764fe9d + c459c87 commit 9e55528

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

lib/ivy.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ SPDX-License-Identifier: Apache-2.0
193193
<dependency org="org.sosy_lab" name="javasmt-solver-opensmt" rev="2.9.0-gef441e1c" conf="runtime-opensmt-x64->solver-opensmt-x64; runtime-opensmt-arm64->solver-opensmt-arm64; contrib->sources,javadoc"/>
194194
<dependency org="org.sosy_lab" name="javasmt-solver-optimathsat" rev="1.7.3-sosy1" conf="runtime-optimathsat->solver-optimathsat" />
195195
<dependency org="org.sosy_lab" name="javasmt-solver-cvc4" rev="1.8-prerelease-2020-06-24-g7825d8f28" conf="runtime-cvc4->solver-cvc4" />
196-
<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"/>
196+
<dependency org="org.sosy_lab" name="javasmt-solver-cvc5" rev="2025-07-29-6dacfa5" conf="runtime-cvc5-x64->solver-cvc5-x64; runtime-cvc5-arm64->solver-cvc5-arm64"/>
197197
<dependency org="org.sosy_lab" name="javasmt-solver-boolector" rev="3.2.2-g1a89c229" conf="runtime-boolector->solver-boolector" />
198198
<dependency org="org.sosy_lab" name="javasmt-solver-bitwuzla" rev="0.8.1-gc1454189" conf="runtime-bitwuzla-x64->solver-bitwuzla-x64; runtime-bitwuzla-arm64->solver-bitwuzla-arm64; contrib->sources,javadoc"/>
199199

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.google.common.collect.ImmutableList;
1313
import java.util.ArrayDeque;
1414
import java.util.Deque;
15+
import java.util.LinkedHashSet;
1516
import java.util.List;
1617
import java.util.Set;
1718
import org.sosy_lab.common.ShutdownNotifier;
@@ -67,6 +68,7 @@ public <R> R allSat(AllSatCallback<R> callback, List<BooleanFormula> importantPr
6768
private <R> void iterateOverAllModels(
6869
AllSatCallback<R> callback, List<BooleanFormula> importantPredicates)
6970
throws SolverException, InterruptedException {
71+
final Set<ImmutableList<BooleanFormula>> modelEvaluations = new LinkedHashSet<>();
7072
while (!isUnsat()) {
7173
shutdownNotifier.shutdownIfNecessary();
7274

@@ -87,6 +89,11 @@ private <R> void iterateOverAllModels(
8789
}
8890

8991
final ImmutableList<BooleanFormula> values = valuesOfModel.build();
92+
// avoid endless loops in case of repeated models.
93+
Preconditions.checkState(
94+
modelEvaluations.add(values),
95+
"The model evaluation %s was found before. ALLSAT computation did not make progress.",
96+
values);
9097
callback.apply(values);
9198
shutdownNotifier.shutdownIfNecessary();
9299

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,13 @@ public void apply(List<BooleanFormula> pModel) {
149149
assertThat(env.allSat(callback, ImmutableList.of(v1, v2))).isEqualTo(EXPECTED_RESULT);
150150
}
151151

152-
@Test
152+
@Test(timeout = 5_000)
153153
public void allSatTest_xor() throws SolverException, InterruptedException {
154154
requireIntegers();
155155

156+
// We have the following constraint: '(i=1) XOR (i=2)'
157+
// with the predicates b1 and b2 defined as: '(i=1) <=> b1' and '(i=2) <=> b2'.
158+
// We expect exactly two models from ALLSAT: {b1,-b2} and {-b1, b2}.
156159
IntegerFormula a = imgr.makeVariable("i");
157160
IntegerFormula n1 = imgr.makeNumber(1);
158161
IntegerFormula n2 = imgr.makeNumber(2);
@@ -168,9 +171,6 @@ public void allSatTest_xor() throws SolverException, InterruptedException {
168171
env.push(bmgr.equivalence(v1, cond1));
169172
env.push(bmgr.equivalence(v2, cond2));
170173

171-
// ((i=1) XOR (i=2)) & b1 <=> (i=1) & b2 <=> (i=2)
172-
// query ALLSAT for predicates [b1, b2] --> {[b1,-b2], [-b1,b2]}
173-
174174
TestAllSatCallback callback = new TestAllSatCallback();
175175

176176
assertThat(env.allSat(callback, ImmutableList.of(v1, v2))).isEqualTo(EXPECTED_RESULT);

0 commit comments

Comments
 (0)