3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

initial overflow test

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-12-09 14:39:00 -08:00
parent 99e2247ccb
commit a4fc63c542
6 changed files with 47 additions and 8 deletions

View file

@ -940,6 +940,22 @@ namespace polysat {
}
}
static void test_quot_rem(unsigned bw = 32) {
scoped_solver s(__func__);
auto a = s.var(s.add_var(bw));
auto quot = s.var(s.add_var(bw));
auto rem = s.var(s.add_var(bw));
auto x = a * 123;
auto y = 123;
// quot = udiv(a*123, 123)
s.add_eq(quot * y + rem - x);
s.add_diseq(a - quot);
s.add_noovfl(quot, y);
// s.add_ult(rem, x);
s.check();
s.expect_sat();
}
// Goal: we probably mix up polysat variables and PDD variables at several points; try to uncover such cases
// NOTE: actually, add_var seems to keep them in sync, so this is not an issue at the moment (but we should still test it later)
@ -1065,6 +1081,9 @@ namespace polysat {
void tst_polysat() {
polysat::test_quot_rem();
return;
polysat::test_ineq_axiom1();
polysat::test_ineq_axiom2();
polysat::test_ineq_axiom3();