3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 05:18:44 +00:00

DoC: fix bug in filter_project with '(not (= c1 c2))' style constraints

Signed-off-by: Nuno Lopes <a-nlopes@microsoft.com>
This commit is contained in:
Nuno Lopes 2014-10-08 11:12:41 +01:00
parent 985ad30349
commit de73a4d893
2 changed files with 26 additions and 5 deletions

View file

@ -938,12 +938,17 @@ namespace datalog {
else if (m.is_not(g, e1)) {
udoc sub;
sub.push_back(dm.allocateX());
apply_guard(e1, sub, equalities, discard_cols);
TRACE("doc",
result.display(dm, tout << "result0:") << "\n";
sub.display(dm, tout << "sub:") << "\n";);
// TODO: right now we state that no columns are discarded to avoid
// silent column merging. This can be optimized if the set of merged
// columns is returned so that here we remove different columns.
bit_vector empty;
empty.resize(discard_cols.size(), false);
apply_guard(e1, sub, equalities, empty);
result.subtract(dm, sub);
result.simplify(dm);
TRACE("doc",
result.display(dm, tout << "result0:") << "\n";
sub.display(dm, tout << "sub:") << "\n";);
sub.reset(dm);
TRACE("doc", result.display(dm, tout << "result:") << "\n";);
}

View file

@ -376,15 +376,31 @@ public:
unsigned_vector remove;
remove.push_back(0);
remove.push_back(2);
t1 = mk_full(sig2);
apply_filter(*t1, conds[2].get());
apply_filter_project(*t1, remove, conds[2].get());
apply_filter_project(*t1, remove, conds[3].get());
t1->deallocate();
t1 = mk_full(sig2);
apply_filter(*t1, conds[3].get());
apply_filter_project(*t1, remove, conds[2].get());
apply_filter_project(*t1, remove, conds[3].get());
t1->deallocate();
for (unsigned i = 0; i < conds.size(); ++i) {
t1 = mk_full(sig2);
apply_filter_project(*t1, remove, conds[i].get());
t1->deallocate();
}
remove[1] = 1;
for (unsigned i = 0; i < conds.size(); ++i) {
t1 = mk_full(sig2);
apply_filter_project(*t1, remove, conds[i].get());
t1->deallocate();
}
t1->deallocate();
}