Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Aug 31, 2021
1 parent ab2baa7 commit 1426390
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/sat/smt/array_axioms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ namespace array {

bool solver::add_interface_equalities() {
sbuffer<theory_var> roots;
collect_defaults();
collect_shared_vars(roots);
bool prop = false;
for (unsigned i = roots.size(); i-- > 0; ) {
Expand Down
36 changes: 8 additions & 28 deletions src/sat/smt/array_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,6 @@ namespace array {

if (!fi->get_else() && get_else(v))
fi->set_else(get_else(v));

#if 0
// this functionality is already taken care of by model_init.

if (!fi->get_else())
for (euf::enode* k : euf::enode_class(n))
if (a.is_const(k->get_expr()))
fi->set_else(values.get(k->get_arg(0)->get_root_id()));

if (!fi->get_else())
for (euf::enode* p : euf::enode_parents(n))
if (a.is_default(p->get_expr()))
fi->set_else(values.get(p->get_root_id()));
#endif

if (!fi->get_else()) {
expr* else_value = nullptr;
Expand Down Expand Up @@ -135,24 +121,16 @@ namespace array {
euf::enode* n1 = var2enode(v1), *n2 = var2enode(v2);
euf::enode* r1 = n1->get_root(), * r2 = n2->get_root();
expr* e1 = n1->get_expr();
expr* e;
if (!a.is_array(e1))
return true;
auto find_else = [&](theory_var v, euf::enode* r) {
var_data& d = get_var_data(find(v));
for (euf::enode* c : d.m_lambdas)
if (a.is_const(c->get_expr(), e))
return expr2enode(e)->get_root();
for (euf::enode* p : euf::enode_parents(r))
for (euf::enode* pe : euf::enode_class(p))
if (a.is_default(pe->get_expr()))
return pe->get_root();
return (euf::enode*)nullptr;
};
else1 = find_else(v1, r1);
else2 = find_else(v2, r2);

else1 = get_default(v1);
else2 = get_default(v2);
if (else1 && else2 && else1->get_root() != else2->get_root() && has_large_domain(e1))
return true;

return false;
#if 0
struct eq {
solver& s;
eq(solver& s) :s(s) {}
Expand Down Expand Up @@ -196,6 +174,8 @@ namespace array {
};

return table_diff(r1, r2, else1) || table_diff(r2, r1, else2);

#endif
}

void solver::collect_defaults() {
Expand Down
2 changes: 1 addition & 1 deletion src/sat/smt/euf_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ namespace euf {
std::ostream& display(std::ostream& out) const override;
std::ostream& display_justification(std::ostream& out, ext_justification_idx idx) const override;
std::ostream& display_constraint(std::ostream& out, ext_constraint_idx idx) const override;
euf::egraph::b_pp bpp(enode* n) { return m_egraph.bpp(n); }
euf::egraph::b_pp bpp(enode* n) const { return m_egraph.bpp(n); }
clause_pp pp(literal_vector const& lits) { return clause_pp(*this, lits); }
void collect_statistics(statistics& st) const override;
extension* copy(sat::solver* s) override;
Expand Down

0 comments on commit 1426390

Please sign in to comment.