mirror of
https://github.com/Z3Prover/z3
synced 2025-10-09 01:11:55 +00:00
fix bug in activate node!
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
96bb3caa9e
commit
e916065f7c
1 changed files with 10 additions and 9 deletions
|
@ -221,28 +221,29 @@ namespace search_tree {
|
|||
auto res = activate_from_root(n);
|
||||
if (res)
|
||||
return res;
|
||||
while (n) {
|
||||
if (n->left() && n->left()->get_status() == status::closed &&
|
||||
n->right() && n->right()->get_status() == status::closed) {
|
||||
n->set_status(status::closed);
|
||||
n = n->parent();
|
||||
|
||||
auto p = n->parent();
|
||||
while (p) {
|
||||
if (p->left() && p->left()->get_status() == status::closed &&
|
||||
p->right() && p->right()->get_status() == status::closed) {
|
||||
p->set_status(status::closed);
|
||||
n = p;
|
||||
p = n->parent();
|
||||
continue;
|
||||
}
|
||||
auto p = n->parent();
|
||||
if (!p)
|
||||
return nullptr;
|
||||
if (n == p->left()) {
|
||||
res = activate_from_root(p->right());
|
||||
if (res)
|
||||
return res;
|
||||
}
|
||||
else {
|
||||
SASSERT(n == p->right());
|
||||
VERIFY(n == p->right());
|
||||
res = activate_from_root(p->left());
|
||||
if (res)
|
||||
return res;
|
||||
}
|
||||
n = p;
|
||||
p = n->parent();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue