3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-19 09:40:20 +00:00

minor fixes

- ensure mk_extract performs simplification to distribute over extract and removing extract if the range is the entire bit-vector
- ensure bool_rewriter simplifeis disjunctions when applicable.
This commit is contained in:
Nikolaj Bjorner 2022-11-02 08:44:55 -07:00
parent 9fc4015c46
commit 1646a41b2f
9 changed files with 24 additions and 18 deletions

View file

@ -290,7 +290,7 @@ br_status bool_rewriter::mk_flat_or_core(unsigned num_args, expr * const * args,
ast_lt lt;
std::sort(flat_args.begin(), flat_args.end(), lt);
}
result = m().mk_or(flat_args);
result = mk_or_app(flat_args.size(), flat_args.data());
}
return BR_DONE;
}

View file

@ -32,8 +32,15 @@ mk_extract_proc::~mk_extract_proc() {
}
app * mk_extract_proc::operator()(unsigned high, unsigned low, expr * arg) {
unsigned l, h;
while (m_util.is_extract(arg, l, h, arg)) {
low += l;
high += l;
}
ast_manager & m = m_util.get_manager();
sort * s = arg->get_sort();
if (low == 0 && high + 1 == m_util.get_bv_size(arg) && is_app(arg))
return to_app(arg);
if (m_low == low && m_high == high && m_domain == s)
return m.mk_app(m_f_cached, arg);
// m_f_cached has a reference to m_domain, so, I don't need to inc_ref m_domain

View file

@ -47,6 +47,7 @@ public:
expr_ref operator()(expr * n, unsigned num_bindings, expr * const * bindings);
expr_ref mk_app(func_decl* f, unsigned num_args, expr* const* args);
expr_ref mk_app(func_decl* f, ptr_vector<expr> const& args) { return mk_app(f, args.size(), args.data()); }
bool reduce_quantifier(quantifier * old_q,
expr * new_body,