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

fix regressions introduced when modifying macro_util

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-08-22 17:05:40 -07:00
parent e2b46257d6
commit f7ca7409ce
3 changed files with 41 additions and 24 deletions

View file

@ -105,19 +105,19 @@ app * macro_util::mk_zero(sort * s) const {
void macro_util::mk_sub(expr * t1, expr * t2, expr_ref & r) const {
if (is_bv(t1)) {
r = m_bv.mk_bv_sub(t1, t2);
m_bv_rw.mk_sub(t1, t2, r);
}
else {
r = m_arith.mk_sub(t1, t2);
m_arith_rw.mk_sub(t1, t2, r);
}
}
void macro_util::mk_add(expr * t1, expr * t2, expr_ref & r) const {
if (is_bv(t1)) {
r = m_bv.mk_bv_add(t1, t2);
m_bv_rw.mk_add(t1, t2, r);
}
else {
r = m_arith.mk_add(t1, t2);
m_arith_rw.mk_add(t1, t2, r);
}
}
@ -312,9 +312,10 @@ bool macro_util::is_arith_macro(expr * n, unsigned num_decls, app_ref & head, ex
expr_ref tmp(m_manager);
tmp = m_arith.mk_add(args.size(), args.c_ptr());
if (inv)
def = m_arith.mk_sub(tmp, rhs);
mk_sub(tmp, rhs, def);
else
def = m_arith.mk_sub(rhs, tmp);
mk_sub(rhs, tmp, def);
TRACE("macro_util", tout << def << "\n";);
return true;
}

View file

@ -60,8 +60,8 @@ private:
ast_manager & m_manager;
bv_util m_bv;
arith_util m_arith;
arith_rewriter m_arith_rw;
bv_rewriter m_bv_rw;
mutable arith_rewriter m_arith_rw;
mutable bv_rewriter m_bv_rw;
obj_hashtable<func_decl> * m_forbidden_set;
bool is_forbidden(func_decl * f) const { return m_forbidden_set != 0 && m_forbidden_set->contains(f); }