Skip to content

Commit ccc8cbe

Browse files
Princess: Use variables to make the test for zero division more general
1 parent 3141539 commit ccc8cbe

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ public void testDivisionByZero() throws SolverException, InterruptedException {
208208

209209
T a = nmgr.makeVariable("a");
210210
T b = nmgr.makeVariable("b");
211+
T c = nmgr.makeVariable("c");
212+
211213
T zero = nmgr.makeNumber(0);
212214

213215
BooleanFormula f =
@@ -220,8 +222,9 @@ public void testDivisionByZero() throws SolverException, InterruptedException {
220222
// Division by zero is still a function. So, if (/0 a) = b and (/0 a) = c, then b=c must hold
221223
BooleanFormula g =
222224
bmgr.and(
223-
nmgr.equal(nmgr.divide(a, zero), nmgr.makeNumber(2)),
224-
nmgr.equal(nmgr.divide(a, zero), nmgr.makeNumber(4)));
225+
nmgr.equal(nmgr.divide(a, zero), b),
226+
nmgr.equal(nmgr.divide(a, zero), c),
227+
bmgr.not(nmgr.equal(b, c)));
225228

226229
assertThatFormula(g).isUnsatisfiable();
227230
}

0 commit comments

Comments
 (0)