mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
add stubs for converting assertions, consolidate filter_model_converter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
53e36c9cf9
commit
0d15b6abb7
76 changed files with 244 additions and 356 deletions
|
@ -19,7 +19,6 @@ Notes:
|
|||
#include "tactic/tactical.h"
|
||||
#include "ast/normal_forms/defined_names.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "util/cooperate.h"
|
||||
#include "ast/scoped_proof.h"
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ Notes:
|
|||
#include "tactic/tactical.h"
|
||||
#include "ast/normal_forms/defined_names.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "util/cooperate.h"
|
||||
|
||||
class elim_term_ite_tactic : public tactic {
|
||||
|
@ -28,7 +28,7 @@ class elim_term_ite_tactic : public tactic {
|
|||
struct rw_cfg : public default_rewriter_cfg {
|
||||
ast_manager & m;
|
||||
defined_names m_defined_names;
|
||||
ref<filter_model_converter> m_mc;
|
||||
ref<generic_model_converter> m_mc;
|
||||
goal * m_goal;
|
||||
unsigned long long m_max_memory; // in bytes
|
||||
bool m_produce_models;
|
||||
|
@ -55,8 +55,8 @@ class elim_term_ite_tactic : public tactic {
|
|||
m_num_fresh++;
|
||||
if (m_produce_models) {
|
||||
if (!m_mc)
|
||||
m_mc = alloc(filter_model_converter, m);
|
||||
m_mc->insert(_result->get_decl());
|
||||
m_mc = alloc(generic_model_converter, m);
|
||||
m_mc->hide(_result->get_decl());
|
||||
}
|
||||
}
|
||||
result = _result.get();
|
||||
|
|
|
@ -18,7 +18,6 @@ Notes:
|
|||
--*/
|
||||
#include "tactic/tactical.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
|
@ -873,9 +872,9 @@ class elim_uncnstr_tactic : public tactic {
|
|||
app_ref_vector & fresh_vars = m_rw->cfg().m_fresh_vars;
|
||||
m_num_elim_apps = fresh_vars.size();
|
||||
if (produce_models && !fresh_vars.empty()) {
|
||||
filter_model_converter * fmc = alloc(filter_model_converter, m());
|
||||
for (unsigned i = 0; i < fresh_vars.size(); i++)
|
||||
fmc->insert(fresh_vars.get(i)->get_decl());
|
||||
generic_model_converter * fmc = alloc(generic_model_converter, m());
|
||||
for (app * f : fresh_vars)
|
||||
fmc->hide(f);
|
||||
mc = concat(fmc, m_mc.get());
|
||||
}
|
||||
else {
|
||||
|
@ -910,7 +909,7 @@ class elim_uncnstr_tactic : public tactic {
|
|||
imp * m_imp;
|
||||
params_ref m_params;
|
||||
public:
|
||||
elim_uncnstr_tactic(ast_manager & m, params_ref const & p):
|
||||
elim_uncnstr_tactic(ast_manager & m, params_ref const & p):
|
||||
m_params(p) {
|
||||
m_imp = alloc(imp, m, p);
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ Revision History:
|
|||
--*/
|
||||
#include "ast/normal_forms/nnf.h"
|
||||
#include "tactic/tactical.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
|
||||
class nnf_tactic : public tactic {
|
||||
params_ref m_params;
|
||||
|
@ -97,10 +97,10 @@ public:
|
|||
result.push_back(g.get());
|
||||
unsigned num_extra_names = dnames.get_num_names();
|
||||
if (num_extra_names > 0) {
|
||||
filter_model_converter * fmc = alloc(filter_model_converter, m);
|
||||
generic_model_converter * fmc = alloc(generic_model_converter, m);
|
||||
mc = fmc;
|
||||
for (unsigned i = 0; i < num_extra_names; i++)
|
||||
fmc->insert(dnames.get_name_decl(i));
|
||||
fmc->hide(dnames.get_name_decl(i));
|
||||
}
|
||||
TRACE("nnf", g->display(tout););
|
||||
SASSERT(g->is_well_sorted());
|
||||
|
|
|
@ -23,13 +23,13 @@ Revision History:
|
|||
--*/
|
||||
#include "tactic/tactical.h"
|
||||
#include "tactic/core/occf_tactic.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "util/cooperate.h"
|
||||
|
||||
class occf_tactic : public tactic {
|
||||
struct imp {
|
||||
ast_manager & m;
|
||||
filter_model_converter * m_mc;
|
||||
generic_model_converter * m_mc;
|
||||
|
||||
imp(ast_manager & _m):
|
||||
m(_m) {
|
||||
|
@ -115,7 +115,7 @@ class occf_tactic : public tactic {
|
|||
SASSERT(!c2b.contains(cnstr));
|
||||
expr * bvar = m.mk_fresh_const(0, m.mk_bool_sort());
|
||||
if (produce_models)
|
||||
m_mc->insert(to_app(bvar)->get_decl());
|
||||
m_mc->hide(to_app(bvar)->get_decl());
|
||||
c2b.insert(cnstr, bvar_info(bvar, sign));
|
||||
if (sign) {
|
||||
g->assert_expr(m.mk_or(bvar, m.mk_not(cnstr)), 0, 0);
|
||||
|
@ -157,7 +157,7 @@ class occf_tactic : public tactic {
|
|||
if (!is_target(cls))
|
||||
continue;
|
||||
if (produce_models && !m_mc) {
|
||||
m_mc = alloc(filter_model_converter, m);
|
||||
m_mc = alloc(generic_model_converter, m);
|
||||
mc = m_mc;
|
||||
}
|
||||
expr * keep = 0;
|
||||
|
|
|
@ -23,7 +23,7 @@ Notes:
|
|||
#include "util/map.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
|
||||
/**
|
||||
\brief Reduce the number of arguments in function applications.
|
||||
|
@ -395,7 +395,7 @@ struct reduce_args_tactic::imp {
|
|||
var_ref_vector new_vars(m_manager);
|
||||
ptr_buffer<expr> new_eqs;
|
||||
extension_model_converter * e_mc = alloc(extension_model_converter, m_manager);
|
||||
filter_model_converter * f_mc = alloc(filter_model_converter, m_manager);
|
||||
generic_model_converter * f_mc = alloc(generic_model_converter, m_manager);
|
||||
decl2arg2func_map::iterator it = decl2arg2funcs.begin();
|
||||
decl2arg2func_map::iterator end = decl2arg2funcs.end();
|
||||
for (; it != end; ++it) {
|
||||
|
@ -416,7 +416,7 @@ struct reduce_args_tactic::imp {
|
|||
for (; it2 != end2; ++it2) {
|
||||
app * t = it2->m_key;
|
||||
func_decl * new_def = it2->m_value;
|
||||
f_mc->insert(new_def);
|
||||
f_mc->hide(new_def);
|
||||
SASSERT(new_def->get_arity() == new_args.size());
|
||||
app * new_t = m_manager.mk_app(new_def, new_args.size(), new_args.c_ptr());
|
||||
if (def == 0) {
|
||||
|
|
|
@ -51,7 +51,7 @@ Notes:
|
|||
--*/
|
||||
#include "tactic/tactical.h"
|
||||
#include "tactic/goal_shared_occs.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/rewriter/bool_rewriter.h"
|
||||
#include "tactic/core/simplify_tactic.h"
|
||||
#include "util/cooperate.h"
|
||||
|
@ -80,7 +80,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
frame(app * n):m_t(n), m_first(true) {}
|
||||
};
|
||||
|
||||
typedef filter_model_converter mc;
|
||||
typedef generic_model_converter mc;
|
||||
|
||||
ast_manager & m;
|
||||
svector<frame> m_frame_stack;
|
||||
|
@ -344,7 +344,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
app * v = m.mk_fresh_const(0, m.mk_bool_sort());
|
||||
m_fresh_vars.push_back(v);
|
||||
if (m_mc)
|
||||
m_mc->insert(v->get_decl());
|
||||
m_mc->hide(v->get_decl());
|
||||
return v;
|
||||
}
|
||||
|
||||
|
@ -817,7 +817,7 @@ class tseitin_cnf_tactic : public tactic {
|
|||
m_frame_stack.reset();
|
||||
m_clauses.reset();
|
||||
if (m_produce_models)
|
||||
m_mc = alloc(filter_model_converter, m);
|
||||
m_mc = alloc(generic_model_converter, m);
|
||||
else
|
||||
m_mc = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue