3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00

have free variable utility use a class for more efficient re-use

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-09-15 16:14:22 -07:00
parent 73070585b8
commit c09903288f
39 changed files with 300 additions and 303 deletions

View file

@ -2271,17 +2271,14 @@ namespace qe {
void expr_quant_elim::instantiate_expr(expr_ref_vector& bound, expr_ref& fml) {
ptr_vector<sort> sorts;
get_free_vars(fml, sorts);
if (!sorts.empty()) {
expr_free_vars fv;
fv(fml);
fv.set_default_sort(m.mk_bool_sort());
if (!fv.empty()) {
expr_ref tmp(m);
for (unsigned i = sorts.size(); i > 0;) {
for (unsigned i = fv.size(); i > 0;) {
--i;
sort* s = sorts[i];
if (!s) {
s = m.mk_bool_sort();
}
bound.push_back(m.mk_fresh_const("bound", s));
bound.push_back(m.mk_fresh_const("bound", fv[i]));
}
var_subst subst(m);
subst(fml, bound.size(), bound.c_ptr(), tmp);