mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
optimize the merge function
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
60aad7a662
commit
e1e27f2c26
|
@ -255,8 +255,20 @@ bool doc_manager::merge(doc& d, unsigned idx, subset_ints const& equalities,
|
||||||
while (idx != root);
|
while (idx != root);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
bool all_x = true;
|
||||||
|
if (!d.neg().is_empty()) {
|
||||||
|
idx = root;
|
||||||
|
do {
|
||||||
|
for (unsigned i = 0; all_x && i < d.neg().size(); ++i) {
|
||||||
|
all_x = (BIT_x == d.neg()[i][idx]);
|
||||||
|
}
|
||||||
|
idx = equalities.next(idx);
|
||||||
|
}
|
||||||
|
while (idx != root && all_x);
|
||||||
|
}
|
||||||
|
idx = root;
|
||||||
do {
|
do {
|
||||||
if (/*!discard_cols.get(idx) &&*/ idx != root1) {
|
if ((!discard_cols.get(idx) || !all_x) && idx != root1) {
|
||||||
tbv* t = m.allocate(d.pos());
|
tbv* t = m.allocate(d.pos());
|
||||||
m.set(*t, idx, BIT_0);
|
m.set(*t, idx, BIT_0);
|
||||||
m.set(*t, root1, BIT_1);
|
m.set(*t, root1, BIT_1);
|
||||||
|
|
Loading…
Reference in a new issue