3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

fixes to bdd

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-06-14 16:49:04 -07:00 committed by Arie Gurfinkel
parent 05abf19009
commit a0af3383db
4 changed files with 12 additions and 10 deletions

View file

@ -556,7 +556,7 @@ namespace sat {
bool is_false = false;
for (unsigned k = 0; k < sz; ++k) {
SASSERT(!is_false || value(p[k].second) == l_false);
SASSERT(k < j == (value(p[k].second) != l_false));
SASSERT((k < j) == (value(p[k].second) != l_false));
is_false = value(p[k].second) == l_false;
});

View file

@ -108,7 +108,7 @@ namespace sat {
bool bdd_manager::check_result(op_entry*& e1, op_entry const* e2, BDD a, BDD b, BDD c) {
if (e1 != e2) {
SASSERT(e2->m_result != -1);
SASSERT(e2->m_result != null_bdd);
push_entry(e1);
e1 = nullptr;
return true;
@ -117,7 +117,7 @@ namespace sat {
e1->m_bdd1 = a;
e1->m_bdd2 = b;
e1->m_op = c;
SASSERT(e1->m_result == -1);
SASSERT(e1->m_result == null_bdd);
return false;
}
}
@ -203,7 +203,7 @@ namespace sat {
void * mem = m_alloc.allocate(sizeof(op_entry));
result = new (mem) op_entry(l, r, op);
}
result->m_result = -1;
result->m_result = null_bdd;
return result;
}
@ -667,7 +667,7 @@ namespace sat {
r = e2->m_result;
}
else {
SASSERT(e1->m_result == -1);
SASSERT(e1->m_result == null_bdd);
push(mk_quant_rec(l, lo(b), op));
push(mk_quant_rec(l, hi(b), op));
r = make_node(lvl, read(2), read(1));
@ -782,7 +782,7 @@ namespace sat {
ptr_vector<op_entry> to_delete, to_keep;
for (auto* e : m_op_cache) {
if (e->m_result != -1) {
if (e->m_result != null_bdd) {
to_delete.push_back(e);
}
else {

View file

@ -32,6 +32,8 @@ namespace sat {
typedef unsigned BDD;
const BDD null_bdd = UINT_MAX;
enum bdd_op {
bdd_and_op = 2,
bdd_or_op = 3,