3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-20 07:36:38 +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);
r = allocate(A);
t = m.allocate(B.pos());
if (m.set_and(*t, A.pos()) && r->neg().insert(m, t.detach())) {
result.push_back(r.detach());
}
else {
result.push_back(allocate(A));
if (m.set_and(*t, A.pos())) {
r->neg().insert(m, t.detach());
}
result.push_back(r.detach());
for (unsigned i = 0; i < B.neg().size(); ++i) {
r = allocate(A);
if (set_and(*r, B.neg()[i])) {
r->neg().intersect(m, r->pos());
result.push_back(r.detach());
}
}