Skip to content

Commit 2c14481

Browse files
Princess: Add another case to the testDivisionByZero to check that (/ a 0) is still a function
(This part breaks if we use just `div` in Princess)
1 parent 1e3ef7e commit 2c14481

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ public void testDivisionByZero() throws SolverException, InterruptedException {
216216
nmgr.equal(nmgr.divide(b, zero), nmgr.makeNumber(4)));
217217

218218
assertThatFormula(f).isSatisfiable();
219+
220+
// Division by zero is still a function. So, if (/0 a) = b and (/0 a) = c, then b=c must hold
221+
BooleanFormula g =
222+
bmgr.and(
223+
nmgr.equal(nmgr.divide(a, zero), nmgr.makeNumber(2)),
224+
nmgr.equal(nmgr.divide(a, zero), nmgr.makeNumber(4)));
225+
226+
assertThatFormula(g).isUnsatisfiable();
219227
}
220228

221229
@Test

0 commit comments

Comments
 (0)