3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-11 19:53:34 +00:00

lessen depth expansin in nnf, add cancelation, add ast_marking to avoid repeated sub-expressions #3065

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-03-09 19:50:43 +01:00
parent 8beb6618d3
commit c7a6721bf1

View file

@ -628,10 +628,12 @@ class solve_eqs_tactic : public tactic {
return true;
}
void hoist_nnf(goal const& g, expr* f, vector<nnf_context> & path, unsigned idx, unsigned depth) {
if (depth > 4) {
void hoist_nnf(goal const& g, expr* f, vector<nnf_context> & path, unsigned idx, unsigned depth, ast_mark& mark) {
if (depth > 3 || mark.is_marked(f)) {
return;
}
mark.mark(f, true);
checkpoint();
app_ref var(m());
expr_ref def(m());
proof_ref pr(m());
@ -658,7 +660,7 @@ class solve_eqs_tactic : public tactic {
}
else {
path.push_back(nnf_context(true, args, i));
hoist_nnf(g, arg, path, idx, depth + 1);
hoist_nnf(g, arg, path, idx, depth + 1, mark);
path.pop_back();
}
}
@ -667,7 +669,7 @@ class solve_eqs_tactic : public tactic {
flatten_or(f, args);
for (unsigned i = 0; i < args.size(); ++i) {
path.push_back(nnf_context(false, args, i));
hoist_nnf(g, args.get(i), path, idx, depth + 1);
hoist_nnf(g, args.get(i), path, idx, depth + 1, mark);
path.pop_back();
}
}
@ -675,10 +677,11 @@ class solve_eqs_tactic : public tactic {
void collect_hoist(goal const& g) {
unsigned size = g.size();
ast_mark mark;
vector<nnf_context> path;
for (unsigned idx = 0; idx < size; idx++) {
checkpoint();
hoist_nnf(g, g.form(idx), path, idx, 0);
hoist_nnf(g, g.form(idx), path, idx, 0, mark);
}
}