3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00
fix performance bottleneck in static features
This commit is contained in:
Nikolaj Bjorner 2021-11-11 13:28:57 -08:00
parent b5deba8426
commit b28a8013fe

View file

@ -406,12 +406,25 @@ void static_features::process(expr * e, bool form_ctx, bool or_and_ctx, bool ite
} }
if (stack_depth > m_max_stack_depth) { if (stack_depth > m_max_stack_depth) {
for (expr* arg : subterms::ground(expr_ref(e, m))) ptr_vector<expr> todo;
if (get_depth(arg) <= 3 || is_quantifier(arg)) todo.push_back(e);
process(arg, form_ctx, or_and_ctx, ite_ctx, stack_depth - 10); for (unsigned i = 0; i < todo.size(); ++i) {
e = todo[i];
if (is_marked(e))
continue;
if (is_basic_expr(e)) {
mark(e);
todo.append(to_app(e)->get_num_args(), to_app(e)->get_args());
}
else {
process(e, form_ctx, or_and_ctx, ite_ctx, stack_depth - 10);
}
}
return; return;
} }
mark(e); mark(e);
update_core(e); update_core(e);
if (is_quantifier(e)) { if (is_quantifier(e)) {