Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ SPDX-License-Identifier: Apache-2.0

<dependencies>
<!-- SoSy-Lab Common Library -->
<dependency org="org.sosy_lab" name="common" rev="0.3000-585-g7a5f95c1" conf="core->runtime; contrib->sources"/>
<dependency org="org.sosy_lab" name="common" rev="0.3000-609-g90a352c" conf="core->runtime; contrib->sources"/>

<!-- Google Core Libraries for Java
Contains a lot of helpful data structures. -->
<dependency org="com.google.guava" name="guava" rev="33.2.1-jre" conf="core->default; contrib->sources"/>
<dependency org="com.google.guava" name="guava" rev="33.3.1-jre" conf="core->default; contrib->sources"/>

<!-- Guava-testlib contains many useful testing utilities -->
<dependency org="com.google.guava" name="guava-testlib" rev="33.2.1-jre" conf="test->default; contrib->sources"/>
<dependency org="com.google.guava" name="guava-testlib" rev="33.3.1-jre" conf="test->default; contrib->sources"/>

<!-- Dependency on Ivy itself so that we can ugprade it easily.
Change version number in build/build-ivy.xml for upgrading. -->
Expand All @@ -102,7 +102,7 @@ SPDX-License-Identifier: Apache-2.0
<dependency org="com.google.auto.value" name="auto-value-annotations" rev="1.11.0" conf="build->default; contrib->sources"/>

<!-- Annotations we use for @Nullable etc. -->
<dependency org="org.checkerframework" name="checker-qual" rev="3.44.0" conf="core->default; contrib->sources"/>
<dependency org="org.checkerframework" name="checker-qual" rev="3.48.1" conf="core->default; contrib->sources"/>

<!-- JUnit
Testing framework. -->
Expand All @@ -119,8 +119,8 @@ SPDX-License-Identifier: Apache-2.0

<!-- Truth
Library for writing literal assertions. -->
<dependency org="com.google.truth" name="truth" rev="1.4.2" conf="test->default; contrib->sources"/>
<dependency org="com.google.truth.extensions" name="truth-java8-extension" rev="1.4.2" conf="test->default; contrib->sources"/>
<dependency org="com.google.truth" name="truth" rev="1.4.4" conf="test->default; contrib->sources"/>
<dependency org="com.google.truth.extensions" name="truth-java8-extension" rev="1.4.4" conf="test->default; contrib->sources"/>

<!-- Google error-prone
Compiler adaptor with some useful checks for common errors. -->
Expand All @@ -129,11 +129,11 @@ SPDX-License-Identifier: Apache-2.0

<!-- Eclipse JDT Compiler
For additional compiler warnings. -->
<dependency org="org.eclipse.jdt.core.compiler" name="ecj" rev="4.29" conf="build->default"/>
<dependency org="org.eclipse.jdt.core.compiler" name="ecj" rev="4.32-sosy0" conf="build->default"/>

<!-- google-java-format
A source-code formatter for Java -->
<dependency org="com.google.googlejavaformat" name="google-java-format" rev="1.22.0" conf="format-source->default"/>
<dependency org="com.google.googlejavaformat" name="google-java-format" rev="1.24.0" conf="format-source->default"/>

<!-- SpotBugs -->
<dependency org="com.github.spotbugs" name="spotbugs-ant" rev="4.8.6" conf="spotbugs->default"/>
Expand All @@ -143,7 +143,7 @@ SPDX-License-Identifier: Apache-2.0

<!-- Checkstyle -->
<dependency org="com.github.sevntu-checkstyle" name="sevntu-checks" rev="1.44.1" conf="checkstyle->default"/>
<dependency org="com.puppycrawl.tools" name="checkstyle" rev="10.17.0" conf="checkstyle->default"/>
<dependency org="com.puppycrawl.tools" name="checkstyle" rev="10.19.0" conf="checkstyle->default"/>

<!-- SmtInterpol -->
<dependency org="de.uni-freiburg.informatik.ultimate" name="smtinterpol" rev="2.5-1242-g5c50fb6d" conf="runtime-smtinterpol->master; contrib->sources"/>
Expand All @@ -160,14 +160,14 @@ SPDX-License-Identifier: Apache-2.0
<dependency org="edu.tum.cs" name="java-cup" rev="11b-20160615" conf="runtime-princess->runtime"/>

<!-- Solver Binaries -->
<dependency org="org.sosy_lab" name="javasmt-solver-mathsat" rev="5.6.10" conf="runtime-mathsat->solver-mathsat" />
<dependency org="org.sosy_lab" name="javasmt-solver-z3" rev="4.12.5" conf="runtime-z3->solver-z3; contrib->sources,javadoc" />
<dependency org="org.sosy_lab" name="javasmt-solver-mathsat" rev="5.6.11-glibc2.27" conf="runtime-mathsat->solver-mathsat" />
<dependency org="org.sosy_lab" name="javasmt-solver-z3" rev="4.13.0" conf="runtime-z3->solver-z3; contrib->sources,javadoc" />
<dependency org="org.sosy_lab" name="javasmt-solver-opensmt" rev="2.6.0-g2f72cc0e" conf="runtime-opensmt->solver-opensmt; contrib->sources,javadoc" />
<dependency org="org.sosy_lab" name="javasmt-solver-optimathsat" rev="1.7.1-sosy0" 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="1.0.5-g4cb2ab9eb" conf="runtime-cvc5->solver-cvc5" />
<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.6.0-gab3db0e6" conf="runtime-bitwuzla->solver-bitwuzla; contrib->sources,javadoc"/>
<dependency org="org.sosy_lab" name="javasmt-solver-bitwuzla" rev="0.6.0-g2b3d69a7" conf="runtime-bitwuzla->solver-bitwuzla; contrib->sources,javadoc"/>

<!-- additional JavaSMT components with Solver Binaries -->
<dependency org="org.sosy_lab" name="javasmt-yices2" rev="4.1.1-734-g3732f7e08" conf="runtime-yices2->runtime; contrib->sources" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public final FormulaManager getFormulaManager() {
return fmgr;
}

@SuppressWarnings("resource")
@Override
public final ProverEnvironment newProverEnvironment(ProverOptions... options) {
ProverEnvironment out = newProverEnvironment0(toSet(options));
Expand Down
2 changes: 1 addition & 1 deletion src/org/sosy_lab/java_smt/example/FormulaClassifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public Integer visitFunction(
nonLinearArithmetic = true;
return allArgLevel + 1;
}
// $FALL-THROUGH$
// $FALL-THROUGH$
default:
if (pFunctionDeclaration.getType().isBooleanType()) {
if (EnumSet.of(
Expand Down
41 changes: 14 additions & 27 deletions src/org/sosy_lab/java_smt/test/BitvectorFormulaManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static com.google.common.truth.Truth.assert_;
import static com.google.common.truth.TruthJUnit.assume;
import static org.junit.Assert.assertThrows;
import static org.sosy_lab.java_smt.test.ProverEnvironmentSubject.assertThat;
Expand Down Expand Up @@ -534,11 +533,9 @@ public void bvInRange() throws SolverException, InterruptedException {
@SuppressWarnings("CheckReturnValue")
public void bvOutOfRange() {
for (int[] sizeAndValue : new int[][] {{4, 32}, {4, -9}, {8, 300}, {8, -160}}) {
try {
bvmgr.makeBitvector(sizeAndValue[0], sizeAndValue[1]);
assert_().fail();
} catch (IllegalArgumentException expected) {
}
assertThrows(
IllegalArgumentException.class,
() -> bvmgr.makeBitvector(sizeAndValue[0], sizeAndValue[1]));
}

for (int size : new int[] {4, 6, 8, 10, 16, 32}) {
Expand All @@ -547,16 +544,9 @@ public void bvOutOfRange() {
bvmgr.makeBitvector(size, -(1L << (size - 1)));

// forbitten values
try {
bvmgr.makeBitvector(size, 1L << size);
assert_().fail();
} catch (IllegalArgumentException expected) {
}
try {
bvmgr.makeBitvector(size, -(1L << (size - 1)) - 1);
assert_().fail();
} catch (IllegalArgumentException expected) {
}
assertThrows(IllegalArgumentException.class, () -> bvmgr.makeBitvector(size, 1L << size));
assertThrows(
IllegalArgumentException.class, () -> bvmgr.makeBitvector(size, -(1L << (size - 1)) - 1));
}

for (int size : new int[] {36, 40, 64, 65, 100, 128, 200, 250, 1000, 10000}) {
Expand All @@ -572,17 +562,14 @@ public void bvOutOfRange() {
bvmgr.makeBitvector(size, BigInteger.ONE.shiftLeft(size - 1).negate());

// forbitten values
try {
bvmgr.makeBitvector(size, BigInteger.ONE.shiftLeft(size));
assert_().fail();
} catch (IllegalArgumentException expected) {
}
try {
bvmgr.makeBitvector(
size, BigInteger.ONE.shiftLeft(size - 1).negate().subtract(BigInteger.ONE));
assert_().fail();
} catch (IllegalArgumentException expected) {
}
assertThrows(
IllegalArgumentException.class,
() -> bvmgr.makeBitvector(size, BigInteger.ONE.shiftLeft(size)));
assertThrows(
IllegalArgumentException.class,
() ->
bvmgr.makeBitvector(
size, BigInteger.ONE.shiftLeft(size - 1).negate().subtract(BigInteger.ONE)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static com.google.common.truth.Truth.assert_;
import static com.google.common.truth.TruthJUnit.assume;
import static org.junit.Assert.assertThrows;
import static org.sosy_lab.java_smt.test.ProverEnvironmentSubject.assertThat;

import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -1024,11 +1024,9 @@ public void fpInterpolation() throws SolverException, InterruptedException {
}
}

@SuppressWarnings("CheckReturnValue")
@Test(expected = Exception.class)
@Test
public void failOnInvalidString() {
fpmgr.makeNumber("a", singlePrecType);
assert_().fail();
assertThrows(Exception.class, () -> fpmgr.makeNumber("a", singlePrecType));
}

@Test
Expand Down
16 changes: 7 additions & 9 deletions src/org/sosy_lab/java_smt/test/InterpolatingProverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import static com.google.common.collect.Iterables.getLast;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static com.google.common.truth.Truth.assert_;
import static com.google.common.truth.TruthJUnit.assume;
import static org.junit.Assert.assertThrows;
import static org.sosy_lab.java_smt.test.ProverEnvironmentSubject.assertThat;
Expand Down Expand Up @@ -362,8 +361,7 @@ public <T> void sequentialInterpolationIsNotRepeatedIndividualInterpolation()
}
}

@Test(expected = IllegalArgumentException.class)
@SuppressWarnings("CheckReturnValue")
@Test
public <T> void sequentialInterpolationWithoutPartition()
throws SolverException, InterruptedException {
requireIntegers();
Expand All @@ -373,8 +371,8 @@ public <T> void sequentialInterpolationWithoutPartition()
assertThat(stack).isUnsatisfiable();

// empty list of partition
stack.getSeqInterpolants(ImmutableList.of());
assert_().fail();
assertThrows(
IllegalArgumentException.class, () -> stack.getSeqInterpolants(ImmutableList.of()));
}

@Test
Expand Down Expand Up @@ -973,8 +971,7 @@ public <T> void treeInterpolationMalFormed6() throws SolverException, Interrupte
stack.getTreeInterpolants0(ImmutableList.of(TA, TA, TA), new int[] {0, 2, 0});
}

@Test(expected = IllegalArgumentException.class)
@SuppressWarnings("CheckReturnValue")
@Test
public <T> void treeInterpolationWithoutPartition() throws SolverException, InterruptedException {
requireTreeItp();

Expand All @@ -984,8 +981,9 @@ public <T> void treeInterpolationWithoutPartition() throws SolverException, Inte
assertThat(stack).isUnsatisfiable();

// empty list of partition
stack.getTreeInterpolants(ImmutableList.of(), new int[] {});
assert_().fail();
assertThrows(
IllegalArgumentException.class,
() -> stack.getTreeInterpolants(ImmutableList.of(), new int[] {}));
}

@Test
Expand Down
22 changes: 11 additions & 11 deletions src/org/sosy_lab/java_smt/test/ModelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static com.google.common.truth.Truth.assertWithMessage;
import static com.google.common.truth.Truth.assert_;
import static com.google.common.truth.TruthJUnit.assume;
import static org.junit.Assert.assertThrows;
import static org.sosy_lab.java_smt.api.FormulaType.IntegerType;
import static org.sosy_lab.java_smt.test.ProverEnvironmentSubject.assertThat;

Expand Down Expand Up @@ -184,7 +185,7 @@ public void testGetRationals() throws SolverException, InterruptedException {
/** Test that different names are no problem for Bools in the model. */
@Test
public void testGetBooleans() throws SolverException, InterruptedException {
// Some names are specificly chosen to test the Boolector model
// Some names are specifically chosen to test the Boolector model
for (String name : VARIABLE_NAMES) {
testModelGetters(bmgr.makeVariable(name), bmgr.makeBoolean(true), true, name);
}
Expand Down Expand Up @@ -1207,12 +1208,12 @@ public void testGetArrays4() throws SolverException, InterruptedException {
ImmutableList.of(BigInteger.valueOf(5)));
}

@Test(expected = IllegalArgumentException.class)
@SuppressWarnings("CheckReturnValue")
@Test
public void testGetArrays4invalid() throws SolverException, InterruptedException {
requireParser();
requireArrays();
requireArrayModel();
requireIntegers();

// create formula for "arr[5]==x && x==123"
BooleanFormula f =
Expand All @@ -1229,7 +1230,9 @@ public void testGetArrays4invalid() throws SolverException, InterruptedException
assertThat(prover).isSatisfiable();

try (Model m = prover.getModel()) {
m.evaluate(amgr.makeArray("arr", ARRAY_TYPE_INT_INT));
assertThrows(
IllegalArgumentException.class,
() -> m.evaluate(amgr.makeArray("arr", ARRAY_TYPE_INT_INT)));
}
}
}
Expand Down Expand Up @@ -2306,22 +2309,19 @@ public void modelAfterSolverCloseTest() throws SolverException, InterruptedExcep
}
}

@SuppressWarnings("resource")
@Test(expected = IllegalStateException.class)
@Test
public void testGenerateModelsOption() throws SolverException, InterruptedException {
try (ProverEnvironment prover = context.newProverEnvironment()) { // no option
assertThat(prover).isSatisfiable();
prover.getModel();
assert_().fail();
assertThrows(IllegalStateException.class, () -> prover.getModel());
}
}

@Test(expected = IllegalStateException.class)
@Test
public void testGenerateModelsOption2() throws SolverException, InterruptedException {
try (ProverEnvironment prover = context.newProverEnvironment()) { // no option
assertThat(prover).isSatisfiable();
prover.getModelAssignments();
assert_().fail();
assertThrows(IllegalStateException.class, () -> prover.getModelAssignments());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
package org.sosy_lab.java_smt.test;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static com.google.common.truth.TruthJUnit.assume;
import static org.junit.Assert.assertThrows;

import com.google.common.collect.Iterables;
import java.util.HashSet;
Expand Down Expand Up @@ -139,10 +139,8 @@ protected Boolean visitDefault(Formula pF) {
}
}

@SuppressWarnings("CheckReturnValue")
@Test(expected = Exception.class)
@Test
public void failOnInvalidString() {
rmgr.makeNumber("a");
assert_().fail();
assertThrows(Exception.class, () -> rmgr.makeNumber("a"));
}
}
10 changes: 3 additions & 7 deletions src/org/sosy_lab/java_smt/test/SolverTacticsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package org.sosy_lab.java_smt.test;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static org.junit.Assert.assertThrows;
import static org.sosy_lab.java_smt.api.FormulaType.BooleanType;
import static org.sosy_lab.java_smt.api.FormulaType.IntegerType;

Expand Down Expand Up @@ -199,7 +199,7 @@ public void ufEliminationNestedUfsTest() throws SolverException, InterruptedExce
}

@Test
public void ufEliminationNesteQuantifierTest() throws InterruptedException {
public void ufEliminationNesteQuantifierTest() {
requireIntegers();
requireQuantifiers();
// f := exists v1,v2v,v3,v4 : uf(v1, v3) == uf(v2, v4)
Expand All @@ -216,11 +216,7 @@ public void ufEliminationNesteQuantifierTest() throws InterruptedException {
qmgr.exists(
ImmutableList.of(variable1, variable2, variable3, variable4), bmgr.equivalence(f1, f2));

try {
mgr.applyTactic(f, Tactic.ACKERMANNIZATION);
assert_().fail();
} catch (IllegalArgumentException expected) {
}
assertThrows(IllegalArgumentException.class, () -> mgr.applyTactic(f, Tactic.ACKERMANNIZATION));
}

private static class CNFChecker implements BooleanFormulaVisitor<Void> {
Expand Down
8 changes: 2 additions & 6 deletions src/org/sosy_lab/java_smt/test/UfEliminationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

package org.sosy_lab.java_smt.test;

import static com.google.common.truth.Truth.assert_;
import static com.google.common.truth.TruthJUnit.assume;
import static org.junit.Assert.assertThrows;
import static org.sosy_lab.java_smt.api.FormulaType.BooleanType;
import static org.sosy_lab.java_smt.api.FormulaType.IntegerType;

Expand Down Expand Up @@ -238,11 +238,7 @@ public void quantifierTest() {
qmgr.exists(
ImmutableList.of(variable1, variable2, variable3, variable4), bmgr.equivalence(f1, f2));

try {
ackermannization.eliminateUfs(f);
assert_().fail();
} catch (IllegalArgumentException expected) {
}
assertThrows(IllegalArgumentException.class, () -> ackermannization.eliminateUfs(f));
}

@Test
Expand Down