3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-11 03:33:35 +00:00
This commit is contained in:
Nikolaj Bjorner 2021-09-04 18:03:15 -07:00
parent 976c0a391c
commit 9c91698201
6 changed files with 19 additions and 9 deletions

View file

@ -570,7 +570,7 @@ namespace array {
expr* e2 = var2expr(v2);
if (e1->get_sort() != e2->get_sort())
continue;
if (have_different_model_values(v1, v2))
if (must_have_different_model_values(v1, v2))
continue;
if (ctx.get_egraph().are_diseq(var2enode(v1), var2enode(v2)))
continue;
@ -600,7 +600,7 @@ namespace array {
r->mark1();
to_unmark.push_back(r);
}
TRACE("array", tout << "collecting shared vars...\n" << unsigned_vector(roots.size(), (unsigned*)roots.data()) << "\n";);
TRACE("array", tout << "collecting shared vars...\n"; for (auto v : roots) tout << ctx.bpp(var2enode(v)) << "\n";);
for (auto* n : to_unmark)
n->unmark1();
}

View file

@ -24,7 +24,7 @@ namespace array {
out << "array\n";
for (unsigned i = 0; i < get_num_vars(); ++i) {
auto& d = get_var_data(i);
out << var2enode(i)->get_expr_id() << " " << (d.m_prop_upward?"up":"fx") << " " << mk_bounded_pp(var2expr(i), m, 2) << "\n";
out << "v" << i << ": " << var2enode(i)->get_expr_id() << " " << (d.m_prop_upward?"up":"fx") << " " << mk_bounded_pp(var2expr(i), m, 2) << "\n";
display_info(out, "parent lambdas", d.m_parent_lambdas);
display_info(out, "parent select", d.m_parent_selects);
display_info(out, "lambdas", d.m_lambdas);

View file

@ -75,10 +75,11 @@ namespace array {
}
void solver::internalize_lambda(euf::enode* n) {
set_prop_upward(n);
if (!a.is_store(n->get_expr()))
push_axiom(default_axiom(n));
add_lambda(n->get_th_var(get_id()), n);
SASSERT(is_lambda(n->get_expr()) || a.is_const(n->get_expr()) || a.is_as_array(n->get_expr()));
theory_var v = n->get_th_var(get_id());
push_axiom(default_axiom(n));
add_lambda(v, n);
set_prop_upward(v);
}
void solver::internalize_select(euf::enode* n) {

View file

@ -116,7 +116,7 @@ namespace array {
}
bool solver::have_different_model_values(theory_var v1, theory_var v2) {
bool solver::must_have_different_model_values(theory_var v1, theory_var v2) {
euf::enode* else1 = nullptr, * else2 = nullptr;
euf::enode* n1 = var2enode(v1), *n2 = var2enode(v2);
euf::enode* r1 = n1->get_root(), * r2 = n2->get_root();

View file

@ -222,7 +222,7 @@ namespace array {
euf::enode_vector m_defaults; // temporary field for model construction
ptr_vector<expr> m_else_values; //
svector<int> m_parents; // temporary field for model construction
bool have_different_model_values(theory_var v1, theory_var v2);
bool must_have_different_model_values(theory_var v1, theory_var v2);
void collect_defaults();
void mg_merge(theory_var u, theory_var v);
theory_var mg_find(theory_var n);
@ -262,6 +262,7 @@ namespace array {
euf::theory_var mk_var(euf::enode* n) override;
void apply_sort_cnstr(euf::enode* n, sort* s) override;
bool is_shared(theory_var v) const override;
bool enable_self_propagate() const override { return true; }
void merge_eh(theory_var, theory_var, theory_var v1, theory_var v2);
void after_merge_eh(theory_var r1, theory_var r2, theory_var v1, theory_var v2) {}

View file

@ -90,6 +90,14 @@ namespace q {
univ.append(residue);
add_projection_functions(mdl, univ);
for (unsigned i = mdl.get_num_functions(); i-- > 0; ) {
func_decl* f = mdl.get_function(i);
func_interp* fi = mdl.get_func_interp(f);
if (fi->is_partial())
fi->set_else(fi->get_max_occ_result());
if (fi->is_partial())
fi->set_else(mdl.get_some_value(f->get_range()));
}
TRACE("q", tout << "end: " << mdl << "\n";);
}