3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-13 18:54:43 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-01-05 21:51:34 -08:00
parent 2acab46388
commit 63fc62fbe4
6 changed files with 72 additions and 51 deletions

View file

@ -284,4 +284,21 @@ namespace sat {
SASSERT(check_clauses(roots));
TRACE("elim_eqs", tout << "after full cleanup\n"; m_solver.display(tout););
}
void elim_eqs::operator()(union_find<>& uf) {
literal_vector roots(m_solver.num_vars(), null_literal);
bool_var_vector to_elim;
for (unsigned i = m_solver.num_vars(); i-- > 0; ) {
literal l1(i, false);
unsigned idx = uf.find(l1.index());
if (idx != l1.index()) {
roots[i] = to_literal(idx);
to_elim.push_back(i);
}
else {
roots[i] = l1;
}
}
(*this)(roots, to_elim);
}
};