mirror of
https://github.com/Z3Prover/z3
synced 2025-08-15 15:25:26 +00:00
remove extension model converter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0d15b6abb7
commit
dc0b2a8acf
23 changed files with 69 additions and 151 deletions
|
@ -23,7 +23,7 @@ Revision History:
|
|||
--*/
|
||||
#include "tactic/tactical.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/expr_substitution.h"
|
||||
#include "ast/ast_smt2_pp.h"
|
||||
|
@ -270,8 +270,8 @@ class fix_dl_var_tactic : public tactic {
|
|||
m_rw.set_substitution(&subst);
|
||||
|
||||
if (m_produce_models) {
|
||||
extension_model_converter * _mc = alloc(extension_model_converter, m);
|
||||
_mc->insert(var->get_decl(), zero);
|
||||
generic_model_converter * _mc = alloc(generic_model_converter, m);
|
||||
_mc->add(var, zero);
|
||||
mc = _mc;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ Revision History:
|
|||
#include "tactic/arith/bound_manager.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "ast/for_each_expr.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/expr_substitution.h"
|
||||
|
@ -224,12 +223,10 @@ class lia2pb_tactic : public tactic {
|
|||
if (!check_num_bits())
|
||||
throw tactic_exception("lia2pb failed, number of necessary bits exceeds specified threshold (use option :lia2pb-total-bits to increase threshold)");
|
||||
|
||||
extension_model_converter * mc1 = 0;
|
||||
generic_model_converter * mc2 = 0;
|
||||
generic_model_converter * gmc = 0;
|
||||
if (m_produce_models) {
|
||||
mc1 = alloc(extension_model_converter, m);
|
||||
mc2 = alloc(generic_model_converter, m);
|
||||
mc = concat(mc2, mc1);
|
||||
gmc = alloc(generic_model_converter, m);
|
||||
mc = gmc;
|
||||
}
|
||||
|
||||
expr_ref zero(m);
|
||||
|
@ -259,7 +256,7 @@ class lia2pb_tactic : public tactic {
|
|||
else
|
||||
def_args.push_back(m_util.mk_mul(m_util.mk_numeral(a, true), x_prime));
|
||||
if (m_produce_models)
|
||||
mc2->hide(x_prime->get_decl());
|
||||
gmc->hide(x_prime->get_decl());
|
||||
a *= rational(2);
|
||||
}
|
||||
SASSERT(def_args.size() > 1);
|
||||
|
@ -273,7 +270,7 @@ class lia2pb_tactic : public tactic {
|
|||
TRACE("lia2pb", tout << mk_ismt2_pp(x, m) << " -> " << dep << "\n";);
|
||||
subst.insert(x, def, 0, dep);
|
||||
if (m_produce_models) {
|
||||
mc1->insert(to_app(x)->get_decl(), def);
|
||||
gmc->add(x, def);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ Notes:
|
|||
#include "util/optional.h"
|
||||
#include "tactic/arith/bv2int_rewriter.h"
|
||||
#include "tactic/arith/bv2real_rewriter.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "tactic/arith/bound_manager.h"
|
||||
#include "util/obj_pair_hashtable.h"
|
||||
|
@ -98,10 +97,9 @@ class nla2bv_tactic : public tactic {
|
|||
reduce_bv2int(g);
|
||||
reduce_bv2real(g);
|
||||
TRACE("nla2bv", g.display(tout << "after reduce\n"););
|
||||
extension_model_converter * evc = alloc(extension_model_converter, m_manager);
|
||||
mc = concat(m_fmc.get(), evc);
|
||||
mc = m_fmc.get();
|
||||
for (unsigned i = 0; i < m_vars.size(); ++i) {
|
||||
evc->insert(m_vars[i].get(), m_defs[i].get());
|
||||
m_fmc->add(m_vars[i].get(), m_defs[i].get());
|
||||
}
|
||||
for (unsigned i = 0; i < m_bv2real.num_aux_decls(); ++i) {
|
||||
m_fmc->hide(m_bv2real.get_aux_decl(i));
|
||||
|
|
|
@ -21,7 +21,6 @@ Revision History:
|
|||
#include "tactic/tactical.h"
|
||||
#include "tactic/arith/bound_manager.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/expr_substitution.h"
|
||||
|
@ -98,12 +97,10 @@ class normalize_bounds_tactic : public tactic {
|
|||
return;
|
||||
}
|
||||
|
||||
extension_model_converter * mc1 = 0;
|
||||
generic_model_converter * mc2 = 0;
|
||||
generic_model_converter * gmc = 0;
|
||||
if (produce_models) {
|
||||
mc1 = alloc(extension_model_converter, m);
|
||||
mc2 = alloc(generic_model_converter, m);
|
||||
mc = concat(mc2, mc1);
|
||||
gmc = alloc(generic_model_converter, m);
|
||||
mc = gmc;
|
||||
}
|
||||
|
||||
unsigned num_norm_bounds = 0;
|
||||
|
@ -120,8 +117,8 @@ class normalize_bounds_tactic : public tactic {
|
|||
expr * def = m_util.mk_add(x_prime, m_util.mk_numeral(val, s));
|
||||
subst.insert(x, def);
|
||||
if (produce_models) {
|
||||
mc1->insert(to_app(x)->get_decl(), def);
|
||||
mc2->hide(x_prime->get_decl());
|
||||
gmc->add(to_app(x)->get_decl(), def);
|
||||
gmc->hide(x_prime->get_decl());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ Revision History:
|
|||
#include "tactic/core/simplify_tactic.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "ast/ast_smt2_pp.h"
|
||||
#include "ast/rewriter/expr_replacer.h"
|
||||
|
||||
|
@ -776,11 +775,11 @@ struct purify_arith_proc {
|
|||
}
|
||||
}
|
||||
if (produce_models && !m_sin_cos.empty()) {
|
||||
extension_model_converter* emc = alloc(extension_model_converter, m());
|
||||
generic_model_converter* emc = alloc(generic_model_converter, m());
|
||||
mc = concat(mc.get(), emc);
|
||||
obj_map<app, std::pair<expr*,expr*> >::iterator it = m_sin_cos.begin(), end = m_sin_cos.end();
|
||||
for (; it != end; ++it) {
|
||||
emc->insert(it->m_key->get_decl(),
|
||||
emc->add(it->m_key->get_decl(),
|
||||
m().mk_ite(u().mk_ge(it->m_value.first, mk_real_zero()), u().mk_acos(it->m_value.second),
|
||||
u().mk_add(u().mk_acos(u().mk_uminus(it->m_value.second)), u().mk_pi())));
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ Revision History:
|
|||
--*/
|
||||
#include "tactic/tactical.h"
|
||||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/expr_substitution.h"
|
||||
|
@ -112,8 +111,7 @@ class recover_01_tactic : public tactic {
|
|||
}
|
||||
|
||||
// temporary fields used by operator() and process
|
||||
extension_model_converter * mc1;
|
||||
generic_model_converter * mc2;
|
||||
generic_model_converter * gmc;
|
||||
expr_substitution * subst;
|
||||
goal_ref new_goal;
|
||||
obj_map<expr, expr *> bool2int;
|
||||
|
@ -205,8 +203,8 @@ class recover_01_tactic : public tactic {
|
|||
expr * bool_def = m.mk_eq(var, m_util.mk_numeral(rational(1), true));
|
||||
subst->insert(atom, bool_def);
|
||||
if (m_produce_models) {
|
||||
mc2->hide(to_app(var)->get_decl());
|
||||
mc1->insert(to_app(atom)->get_decl(), bool_def);
|
||||
gmc->hide(var);
|
||||
gmc->add(to_app(atom)->get_decl(), bool_def);
|
||||
}
|
||||
m.inc_ref(atom);
|
||||
m.inc_ref(var);
|
||||
|
@ -288,7 +286,7 @@ class recover_01_tactic : public tactic {
|
|||
TRACE("recover_01", tout << x->get_name() << " --> " << mk_ismt2_pp(x_def, m) << "\n";);
|
||||
subst->insert(m.mk_const(x), x_def);
|
||||
if (m_produce_models) {
|
||||
mc1->insert(x, x_def);
|
||||
gmc->add(x, x_def);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -328,9 +326,8 @@ class recover_01_tactic : public tactic {
|
|||
}
|
||||
|
||||
if (m_produce_models) {
|
||||
mc1 = alloc(extension_model_converter, m);
|
||||
mc2 = alloc(generic_model_converter, m);
|
||||
mc = concat(mc2, mc1);
|
||||
gmc = alloc(generic_model_converter, m);
|
||||
mc = gmc;
|
||||
}
|
||||
|
||||
dec_ref_key_values(m, bool2int);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue