3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-15 18:36:16 +00:00
This commit is contained in:
Nikolaj Bjorner 2020-05-07 11:04:24 -07:00
parent 54f38d004b
commit e459cf4cc1
2 changed files with 29 additions and 0 deletions

View file

@ -171,6 +171,32 @@ enode_vector induction_lemmas::induction_positions(enode* n) {
n->unset_mark2();
return result;
}
// Collecting induction positions relative to parent.
induction_lemmas::induction_positions_t induction_lemmas::induction_positions2(enode* n) {
induction_positions_t result;
enode_vector todo;
todo.push_back(n);
n->set_mark();
for (unsigned i = 0; i < todo.size(); ++i) {
enode* n = todo[i];
unsigned idx = 0;
for (enode* a : smt::enode::args(n)) {
if (viable_induction_term(n, a)) {
result.push_back(induction_position_t(n, idx));
}
if (!a->is_marked()) {
a->set_mark();
todo.push_back(a);
}
++idx;
}
}
for (enode* n : todo)
n->unset_mark();
return result;
}
/**
extract substitutions for x into accessor values of the same sort.