3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 10:52:02 +00:00

DoC: compact result of substract and maintain invariant

Signed-off-by: Nuno Lopes <a-nlopes@microsoft.com>
This commit is contained in:
Nuno Lopes 2014-09-30 16:24:59 +01:00
parent 1606359dc9
commit 8d1177bf3f

View file

@ -472,15 +472,15 @@ void doc_manager::subtract(doc const& A, doc const& B, doc_vector& result) {
tbv_ref t(m); tbv_ref t(m);
r = allocate(A); r = allocate(A);
t = m.allocate(B.pos()); t = m.allocate(B.pos());
if (m.set_and(*t, A.pos()) && r->neg().insert(m, t.detach())) { if (m.set_and(*t, A.pos())) {
result.push_back(r.detach()); r->neg().insert(m, t.detach());
}
else {
result.push_back(allocate(A));
} }
result.push_back(r.detach());
for (unsigned i = 0; i < B.neg().size(); ++i) { for (unsigned i = 0; i < B.neg().size(); ++i) {
r = allocate(A); r = allocate(A);
if (set_and(*r, B.neg()[i])) { if (set_and(*r, B.neg()[i])) {
r->neg().intersect(m, r->pos());
result.push_back(r.detach()); result.push_back(r.detach());
} }
} }