mirror of
https://github.com/Z3Prover/z3
synced 2025-11-10 16:12:03 +00:00
fix build issues
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
94cdbe5d87
commit
c5d65cdedd
2 changed files with 146 additions and 164 deletions
|
|
@ -412,17 +412,7 @@ namespace smt {
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
case state::is_running: // batch manager is still running, but all threads have processed their cubes, which
|
case state::is_running: // batch manager is still running, but all threads have processed their cubes, which
|
||||||
// means all cubes were unsat
|
// means all cubes were unsat
|
||||||
if (!m_search_tree.is_closed())
|
|
||||||
throw default_exception("inconsistent end state");
|
throw default_exception("inconsistent end state");
|
||||||
|
|
||||||
// case when all cubes were unsat, but depend on nonempty asms, so we need to add these asms to final unsat core
|
|
||||||
// these asms are stored in the cube tree, at the root node
|
|
||||||
if (p.ctx.m_unsat_core.empty()) {
|
|
||||||
SASSERT(root && root->is_closed());
|
|
||||||
for (auto a : m_search_tree.get_core_from_root())
|
|
||||||
p.ctx.m_unsat_core.push_back(a);
|
|
||||||
}
|
|
||||||
return l_false;
|
|
||||||
case state::is_unsat:
|
case state::is_unsat:
|
||||||
return l_false;
|
return l_false;
|
||||||
case state::is_sat:
|
case state::is_sat:
|
||||||
|
|
|
||||||
|
|
@ -111,9 +111,6 @@ namespace search_tree {
|
||||||
m_right->display(out, indent + 2);
|
m_right->display(out, indent + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool has_core() const {
|
|
||||||
return !m_core.empty();
|
|
||||||
}
|
|
||||||
void set_core(vector<literal> const &core) {
|
void set_core(vector<literal> const &core) {
|
||||||
m_core = core;
|
m_core = core;
|
||||||
}
|
}
|
||||||
|
|
@ -161,8 +158,8 @@ namespace search_tree {
|
||||||
if (!n || n->get_status() == status::closed)
|
if (!n || n->get_status() == status::closed)
|
||||||
return;
|
return;
|
||||||
n->set_status(status::closed);
|
n->set_status(status::closed);
|
||||||
close(n->left);
|
close(n->left());
|
||||||
close(n->right);
|
close(n->right());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invariants:
|
// Invariants:
|
||||||
|
|
@ -172,8 +169,7 @@ namespace search_tree {
|
||||||
if (!n || n->get_status() == status::closed)
|
if (!n || n->get_status() == status::closed)
|
||||||
return;
|
return;
|
||||||
node<Config> *p = n->parent();
|
node<Config> *p = n->parent();
|
||||||
if (p && any_of(C, [n](auto const& l) {
|
if (p && all_of(C, [n](auto const &l) { return l != n->get_literal(); })) {
|
||||||
return l == n->get_literal(); })) {
|
|
||||||
close_with_core(p, C);
|
close_with_core(p, C);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -182,13 +178,24 @@ namespace search_tree {
|
||||||
n->set_core(C);
|
n->set_core(C);
|
||||||
n->set_status(status::closed);
|
n->set_status(status::closed);
|
||||||
|
|
||||||
if (p)
|
if (!p)
|
||||||
try_resolve_upwards(p);
|
return;
|
||||||
|
auto left = p->left();
|
||||||
|
auto right = p->right();
|
||||||
|
if (!left || !right)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// only attempt when both children are closed and each has a core
|
||||||
|
if (left->get_status() != status::closed || right->get_status() != status::closed)
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto resolvent = compute_sibling_resolvent(left, right);
|
||||||
|
close_with_core(p, resolvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Given complementary sibling nodes for literals x and ¬x, sibling resolvent = (core_left ∪ core_right) \ {x, ¬x}
|
// Given complementary sibling nodes for literals x and ¬x, sibling resolvent = (core_left ∪ core_right) \ {x,
|
||||||
vector<literal>
|
// ¬x}
|
||||||
compute_sibling_resolvent(node<Config> *left, node<Config> *right) {
|
vector<literal> compute_sibling_resolvent(node<Config> *left, node<Config> *right) {
|
||||||
vector<literal> res;
|
vector<literal> res;
|
||||||
|
|
||||||
auto &core_l = left->get_core();
|
auto &core_l = left->get_core();
|
||||||
|
|
@ -209,20 +216,6 @@ namespace search_tree {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void try_resolve_upwards(node<Config> *p) {
|
|
||||||
auto left = p->left();
|
|
||||||
auto right = p->right();
|
|
||||||
if (!left || !right)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// only attempt when both children are closed and each has a core
|
|
||||||
if (left->get_status() != status::closed || right->get_status() != status::closed)
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto resolvent = compute_sibling_resolvent(left, right);
|
|
||||||
close_with_core(p, resolvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
tree(literal const &null_literal) : m_null_literal(null_literal) {
|
tree(literal const &null_literal) : m_null_literal(null_literal) {
|
||||||
reset();
|
reset();
|
||||||
|
|
@ -332,6 +325,5 @@ public:
|
||||||
m_root->display(out, 0);
|
m_root->display(out, 0);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
} // namespace search_tree
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue