3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00
This commit is contained in:
Nikolaj Bjorner 2020-05-01 11:04:48 -07:00
parent 5b6255e3d1
commit f8590634bd

View file

@ -980,7 +980,10 @@ bool poly_rewriter<Config>::hoist_ite(expr_ref& e) {
++i; ++i;
} }
if (!pinned.empty()) { if (!pinned.empty()) {
std::cout << "hoist: " << e << "\n";
e = mk_add_app(adds.size(), adds.c_ptr()); e = mk_add_app(adds.size(), adds.c_ptr());
std::cout << "hoisted: " << e << "\n";
return true; return true;
} }
return false; return false;
@ -1010,8 +1013,18 @@ bool poly_rewriter<Config>::hoist_ite(expr* a, obj_hashtable<expr>& shared, nume
} }
set_intersection<obj_hashtable<expr>, obj_hashtable<expr>>(shared, tmp); set_intersection<obj_hashtable<expr>, obj_hashtable<expr>>(shared, tmp);
} }
if (shared.empty())
return false;
// ensure that expression occur uniquely, otherwise
// using the shared hash-table is unsound.
ast_mark is_marked;
for (expr* e : adds) {
if (is_marked.is_marked(e))
return false;
is_marked.mark(e, true);
}
g = numeral(1); g = numeral(1);
return !shared.empty(); return true;
} }
template<typename Config> template<typename Config>