mirror of
https://github.com/Z3Prover/z3
synced 2025-08-11 13:40:52 +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
|
@ -25,7 +25,7 @@ Notes:
|
|||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/rewriter/expr_replacer.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/ast_smt2_pp.h"
|
||||
|
||||
class bv_size_reduction_tactic : public tactic {
|
||||
|
@ -60,7 +60,7 @@ struct bv_size_reduction_tactic::imp {
|
|||
obj_map<app, numeral> m_unsigned_lowers;
|
||||
obj_map<app, numeral> m_unsigned_uppers;
|
||||
ref<bv_size_reduction_mc> m_mc;
|
||||
filter_model_converter_ref m_fmc;
|
||||
generic_model_converter_ref m_fmc;
|
||||
scoped_ptr<expr_replacer> m_replacer;
|
||||
bool m_produce_models;
|
||||
|
||||
|
@ -269,9 +269,9 @@ struct bv_size_reduction_tactic::imp {
|
|||
m_mc = alloc(bv_size_reduction_mc, m);
|
||||
m_mc->insert(v->get_decl(), new_def);
|
||||
if (!m_fmc && new_const)
|
||||
m_fmc = alloc(filter_model_converter, m);
|
||||
m_fmc = alloc(generic_model_converter, m);
|
||||
if (new_const)
|
||||
m_fmc->insert(new_const->get_decl());
|
||||
m_fmc->hide(new_const);
|
||||
}
|
||||
num_reduced++;
|
||||
}
|
||||
|
@ -335,9 +335,9 @@ struct bv_size_reduction_tactic::imp {
|
|||
m_mc = alloc(bv_size_reduction_mc, m);
|
||||
m_mc->insert(v->get_decl(), new_def);
|
||||
if (!m_fmc && new_const)
|
||||
m_fmc = alloc(filter_model_converter, m);
|
||||
m_fmc = alloc(generic_model_converter, m);
|
||||
if (new_const)
|
||||
m_fmc->insert(new_const->get_decl());
|
||||
m_fmc->hide(new_const);
|
||||
}
|
||||
num_reduced++;
|
||||
TRACE("bv_size_reduction", tout << "New definition = " << mk_ismt2_pp(new_def, m) << "\n";);
|
||||
|
|
|
@ -120,7 +120,7 @@ func_decl_ref bvarray2uf_rewriter_cfg::mk_uf_for_array(expr * e) {
|
|||
m_array_util.mk_as_array(bv_f));
|
||||
}
|
||||
else if (m_fmc)
|
||||
m_fmc->insert(bv_f);
|
||||
m_fmc->hide(bv_f);
|
||||
m_arrays_fs.insert(e, bv_f);
|
||||
m_manager.inc_ref(e);
|
||||
m_manager.inc_ref(bv_f);
|
||||
|
@ -193,10 +193,10 @@ br_status bvarray2uf_rewriter_cfg::reduce_app(func_decl * f, unsigned num, expr
|
|||
if (is_uninterp_const(e)) {
|
||||
if (m_emc)
|
||||
m_emc->insert(e->get_decl(),
|
||||
m_array_util.mk_as_array(bv_f));
|
||||
m_array_util.mk_as_array(bv_f));
|
||||
}
|
||||
else if (m_fmc)
|
||||
m_fmc->insert(bv_f);
|
||||
m_fmc->hide(bv_f);
|
||||
m_arrays_fs.insert(e, bv_f);
|
||||
m_manager.inc_ref(e);
|
||||
m_manager.inc_ref(bv_f);
|
||||
|
|
|
@ -22,7 +22,7 @@ Notes:
|
|||
|
||||
#include "ast/rewriter/rewriter.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
|
||||
class bvarray2uf_rewriter_cfg : public default_rewriter_cfg {
|
||||
ast_manager & m_manager;
|
||||
|
@ -31,7 +31,7 @@ class bvarray2uf_rewriter_cfg : public default_rewriter_cfg {
|
|||
bv_util m_bv_util;
|
||||
array_util m_array_util;
|
||||
extension_model_converter * m_emc;
|
||||
filter_model_converter * m_fmc;
|
||||
generic_model_converter * m_fmc;
|
||||
|
||||
obj_map<expr, func_decl*> m_arrays_fs;
|
||||
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
|
||||
expr_ref_vector extra_assertions;
|
||||
|
||||
void set_mcs(extension_model_converter * emc, filter_model_converter * fmc) { m_emc = emc; m_fmc = fmc; }
|
||||
void set_mcs(extension_model_converter * emc, generic_model_converter * fmc) { m_emc = emc; m_fmc = fmc; }
|
||||
|
||||
protected:
|
||||
sort * get_index_sort(expr * e);
|
||||
|
@ -79,7 +79,7 @@ struct bvarray2uf_rewriter : public rewriter_tpl<bvarray2uf_rewriter_cfg> {
|
|||
m_cfg(m, p) {
|
||||
}
|
||||
|
||||
void set_mcs(extension_model_converter * emc, filter_model_converter * fmc) { m_cfg.set_mcs(emc, fmc); }
|
||||
void set_mcs(extension_model_converter * emc, generic_model_converter * fmc) { m_cfg.set_mcs(emc, fmc); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,7 +21,7 @@ Notes:
|
|||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/rewriter/expr_replacer.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/ast_smt2_pp.h"
|
||||
|
||||
#include "tactic/bv/bvarray2uf_tactic.h"
|
||||
|
@ -69,7 +69,7 @@ class bvarray2uf_tactic : public tactic {
|
|||
|
||||
if (m_produce_models) {
|
||||
extension_model_converter * emc = alloc(extension_model_converter, m_manager);
|
||||
filter_model_converter * fmc = alloc(filter_model_converter, m_manager);
|
||||
generic_model_converter * fmc = alloc(generic_model_converter, m_manager);
|
||||
mc = concat(emc, fmc);
|
||||
m_rw.set_mcs(emc, fmc);
|
||||
}
|
||||
|
|
|
@ -21,11 +21,11 @@ Revision History:
|
|||
|
||||
#include "tactic/bv/dt2bv_tactic.h"
|
||||
#include "tactic/tactical.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "ast/datatype_decl_plugin.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "tactic/extension_model_converter.h"
|
||||
#include "ast/rewriter/var_subst.h"
|
||||
#include "ast/ast_util.h"
|
||||
|
@ -135,7 +135,7 @@ public:
|
|||
m_fd_sorts.remove(s);
|
||||
if (!m_fd_sorts.empty()) {
|
||||
ref<extension_model_converter> ext = alloc(extension_model_converter, m);
|
||||
ref<filter_model_converter> filter = alloc(filter_model_converter, m);
|
||||
ref<generic_model_converter> filter = alloc(generic_model_converter, m);
|
||||
enum2bv_rewriter rw(m, m_params);
|
||||
rw.set_is_fd(&m_is_fd);
|
||||
expr_ref new_curr(m);
|
||||
|
@ -153,7 +153,7 @@ public:
|
|||
for (expr* b : bounds)
|
||||
g->assert_expr(b);
|
||||
for (auto const& kv : rw.enum2bv())
|
||||
filter->insert(kv.m_value);
|
||||
filter->hide(kv.m_value);
|
||||
for (auto const& kv : rw.enum2def())
|
||||
ext->insert(kv.m_key, kv.m_value);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ Revision History:
|
|||
--*/
|
||||
#include "tactic/tactical.h"
|
||||
#include "ast/rewriter/rewriter_def.h"
|
||||
#include "tactic/filter_model_converter.h"
|
||||
#include "tactic/generic_model_converter.h"
|
||||
#include "util/cooperate.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
#include "ast/used_vars.h"
|
||||
|
@ -35,7 +35,7 @@ class elim_small_bv_tactic : public tactic {
|
|||
params_ref m_params;
|
||||
bv_util m_util;
|
||||
th_rewriter m_simp;
|
||||
ref<filter_model_converter> m_mc;
|
||||
ref<generic_model_converter> m_mc;
|
||||
goal * m_goal;
|
||||
unsigned m_max_bits;
|
||||
unsigned long long m_max_steps;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue