mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 04:56:03 +00:00
Add basic mod sign axiom for all mod operations
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
096a249ab5
commit
3bfc01f875
2 changed files with 13 additions and 0 deletions
|
@ -168,6 +168,13 @@ namespace arith {
|
|||
add_clause(eqz, mod_ge_0);
|
||||
add_clause(eqz, mod_lt_q);
|
||||
|
||||
// Add basic mod axiom for abs handling
|
||||
// (mod x y) = (mod x -y) when y != 0 - fundamental property for divisibility
|
||||
expr_ref neg_q(a.mk_uminus(q), m);
|
||||
expr_ref mod_neg(a.mk_mod(p, neg_q), m);
|
||||
literal mod_eq_mod_neg = mk_literal(m.mk_eq(mod, mod_neg));
|
||||
add_clause(eqz, mod_eq_mod_neg);
|
||||
|
||||
#if 0
|
||||
/*literal div_ge_0 = */ mk_literal(a.mk_ge(div, zero));
|
||||
/*literal div_le_0 = */ mk_literal(a.mk_le(div, zero));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue