mirror of
https://github.com/Z3Prover/z3
synced 2025-10-09 09:21:56 +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);
|
auto res = activate_from_root(n);
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
while (n) {
|
|
||||||
if (n->left() && n->left()->get_status() == status::closed &&
|
auto p = n->parent();
|
||||||
n->right() && n->right()->get_status() == status::closed) {
|
while (p) {
|
||||||
n->set_status(status::closed);
|
if (p->left() && p->left()->get_status() == status::closed &&
|
||||||
n = n->parent();
|
p->right() && p->right()->get_status() == status::closed) {
|
||||||
|
p->set_status(status::closed);
|
||||||
|
n = p;
|
||||||
|
p = n->parent();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto p = n->parent();
|
|
||||||
if (!p)
|
|
||||||
return nullptr;
|
|
||||||
if (n == p->left()) {
|
if (n == p->left()) {
|
||||||
res = activate_from_root(p->right());
|
res = activate_from_root(p->right());
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SASSERT(n == p->right());
|
VERIFY(n == p->right());
|
||||||
res = activate_from_root(p->left());
|
res = activate_from_root(p->left());
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
n = p;
|
n = p;
|
||||||
|
p = n->parent();
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue