mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
add case for abs (normally simplified, but not with default_tactic=smt).
This commit is contained in:
parent
671d071e54
commit
f1bf660adc
4 changed files with 15 additions and 3 deletions
|
@ -49,6 +49,14 @@ namespace arith {
|
|||
}
|
||||
}
|
||||
|
||||
void solver::mk_abs_axiom(app* n) {
|
||||
expr* x = nullptr;
|
||||
VERIFY(a.is_abs(n, x));
|
||||
literal is_nonneg = mk_literal(a.mk_ge(x, a.mk_numeral(rational::zero(), n->get_sort())));
|
||||
add_clause(~is_nonneg, eq_internalize(n, x));
|
||||
add_clause(is_nonneg, eq_internalize(n, a.mk_uminus(x)));
|
||||
}
|
||||
|
||||
// t = n^0
|
||||
void solver::mk_power0_axioms(app* t, app* n) {
|
||||
expr_ref p0(a.mk_power0(n, t->get_arg(1)), m);
|
||||
|
|
|
@ -237,9 +237,10 @@ namespace arith {
|
|||
if (!is_first) {
|
||||
// skip recursive internalization
|
||||
}
|
||||
else if (a.is_to_int(n, n1)) {
|
||||
mk_to_int_axiom(t);
|
||||
}
|
||||
else if (a.is_to_int(n, n1))
|
||||
mk_to_int_axiom(t);
|
||||
else if (a.is_abs(n))
|
||||
mk_abs_axiom(t);
|
||||
else if (a.is_idiv(n, n1, n2)) {
|
||||
if (!a.is_numeral(n2, r) || r.is_zero()) found_underspecified(n);
|
||||
m_idiv_terms.push_back(n);
|
||||
|
|
|
@ -263,6 +263,7 @@ namespace arith {
|
|||
// axioms
|
||||
void mk_div_axiom(expr* p, expr* q);
|
||||
void mk_to_int_axiom(app* n);
|
||||
void mk_abs_axiom(app* n);
|
||||
void mk_is_int_axiom(expr* n);
|
||||
void mk_idiv_mod_axioms(expr* p, expr* q);
|
||||
void mk_rem_axiom(expr* dividend, expr* divisor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue