3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

euf solver updates

This commit is contained in:
Nikolaj Bjorner 2021-01-07 17:30:15 -08:00
parent 7bf691e1f9
commit 60ef60dff8
8 changed files with 46 additions and 0 deletions

View file

@ -183,4 +183,25 @@ namespace q {
ctx.push(insert_ref2_map<euf::solver, ast_manager, sort, expr>(m, m_unit_table, s, val));
return val;
}
unsigned solver::get_max_generation(expr* e) const {
unsigned g = 0;
expr_fast_mark1 mark;
m_todo.push_back(e);
while (!m_todo.empty()) {
e = m_todo.back();
m_todo.pop_back();
if (mark.is_marked(e))
continue;
mark.mark(e);
euf::enode* n = ctx.get_egraph().find(e);
if (n)
g = std::max(g, n->generation());
else if (is_app(e))
for (expr* arg : *to_app(e))
m_todo.push_back(arg);
}
return g;
}
}