mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
regression fix to ackerman gc and memory smash, perf fix for handling bv2int axioms, perf fix for filtering ackerman
this update addresses some perf regressions introduced when handling axioms for bv2int and a memory smash regression when decoupling bv-ackerman from in-processing. It adds a filter based on bv_eq_axioms for disabling ackerman reductions on disequalities.
This commit is contained in:
parent
ca0a82952f
commit
159026b5e8
7 changed files with 46 additions and 13 deletions
|
@ -49,16 +49,19 @@ namespace bv {
|
|||
update_glue(*other);
|
||||
|
||||
vv::push_to_front(m_queue, other);
|
||||
if (other == n) {
|
||||
bool do_gc = other == n;
|
||||
if (other == n)
|
||||
new_tmp();
|
||||
gc();
|
||||
}
|
||||
|
||||
if (other->m_glue == 0) {
|
||||
do_gc = false;
|
||||
remove(other);
|
||||
add_cc(v1, v2);
|
||||
}
|
||||
else if (other->m_count > 2*m_propagate_high_watermark)
|
||||
propagate();
|
||||
if (do_gc)
|
||||
gc();
|
||||
}
|
||||
|
||||
void ackerman::used_diseq_eh(euf::theory_var v1, euf::theory_var v2) {
|
||||
|
|
|
@ -429,6 +429,8 @@ namespace bv {
|
|||
args.push_back(m.mk_ite(b, m_autil.mk_int(power2(i++)), zero));
|
||||
expr_ref sum(m_autil.mk_add(sz, args.data()), m);
|
||||
sat::literal lit = eq_internalize(n, sum);
|
||||
m_bv2ints.push_back(expr2enode(n));
|
||||
ctx.push(push_back_vector<euf::enode_vector>(m_bv2ints));
|
||||
add_unit(lit);
|
||||
}
|
||||
|
||||
|
|
|
@ -211,9 +211,8 @@ namespace bv {
|
|||
return;
|
||||
}
|
||||
euf::enode* n1 = var2enode(eq.v1());
|
||||
for (euf::enode* bv2int : euf::enode_class(n1)) {
|
||||
if (!bv.is_bv2int(bv2int->get_expr()))
|
||||
continue;
|
||||
|
||||
auto propagate_bv2int = [&](euf::enode* bv2int) {
|
||||
euf::enode* bv2int_arg = bv2int->get_arg(0);
|
||||
for (euf::enode* p : euf::enode_parents(n1->get_root())) {
|
||||
if (bv.is_int2bv(p->get_expr()) && p->get_sort() == bv2int_arg->get_sort() && p->get_root() != bv2int_arg->get_root()) {
|
||||
|
@ -224,6 +223,19 @@ namespace bv {
|
|||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (m_bv2ints.size() < n1->class_size()) {
|
||||
for (auto* bv2int : m_bv2ints) {
|
||||
if (bv2int->get_root() == n1->get_root())
|
||||
propagate_bv2int(bv2int);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (euf::enode* bv2int : euf::enode_class(n1)) {
|
||||
if (bv.is_bv2int(bv2int->get_expr()))
|
||||
propagate_bv2int(bv2int);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,6 +291,8 @@ namespace bv {
|
|||
++m_stats.m_num_ne2bit;
|
||||
s().assign(consequent, mk_ne2bit_justification(undef_idx, v1, v2, consequent, antecedent));
|
||||
}
|
||||
else if (!get_config().m_bv_eq_axioms)
|
||||
;
|
||||
else if (s().at_search_lvl()) {
|
||||
force_push();
|
||||
assert_ackerman(v1, v2);
|
||||
|
|
|
@ -207,8 +207,9 @@ namespace bv {
|
|||
literal_vector m_tmp_literals;
|
||||
svector<propagation_item> m_prop_queue;
|
||||
unsigned_vector m_prop_queue_lim;
|
||||
unsigned m_prop_queue_head { 0 };
|
||||
sat::literal m_true { sat::null_literal };
|
||||
unsigned m_prop_queue_head = 0;
|
||||
sat::literal m_true = sat::null_literal;
|
||||
euf::enode_vector m_bv2ints;
|
||||
|
||||
// internalize
|
||||
void insert_bv2a(bool_var bv, atom * a) { m_bool_var2atom.setx(bv, a, 0); }
|
||||
|
|
|
@ -527,7 +527,7 @@ namespace euf {
|
|||
bool merged = false;
|
||||
for (unsigned i = m_egraph.nodes().size(); i-- > 0; ) {
|
||||
euf::enode* n = m_egraph.nodes()[i];
|
||||
if (!is_shared(n) || !m.is_bool(n->get_expr()))
|
||||
if (!m.is_bool(n->get_expr()) || !is_shared(n))
|
||||
continue;
|
||||
if (n->value() == l_true && !m.is_true(n->get_root()->get_expr())) {
|
||||
m_egraph.merge(n, mk_true(), to_ptr(sat::literal(n->bool_var())));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue