mirror of
https://github.com/Z3Prover/z3
synced 2025-09-29 20:59:01 +00:00
remove model converter operator on expr_ref&
This commit is contained in:
parent
90e610eb23
commit
d701702735
6 changed files with 2 additions and 43 deletions
|
@ -54,8 +54,6 @@ public:
|
||||||
|
|
||||||
void operator()(model_ref & md) override;
|
void operator()(model_ref & md) override;
|
||||||
|
|
||||||
void operator()(expr_ref& fml) override { UNREACHABLE(); }
|
|
||||||
|
|
||||||
void cancel() override {}
|
void cancel() override {}
|
||||||
|
|
||||||
void display(std::ostream & out) override;
|
void display(std::ostream & out) override;
|
||||||
|
|
|
@ -93,11 +93,6 @@ public:
|
||||||
this->m_c1->operator()(m);
|
this->m_c1->operator()(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(expr_ref & fml) override {
|
|
||||||
this->m_c2->operator()(fml);
|
|
||||||
this->m_c1->operator()(fml);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator()(labels_vec & r) override {
|
void operator()(labels_vec & r) override {
|
||||||
this->m_c2->operator()(r);
|
this->m_c2->operator()(r);
|
||||||
this->m_c1->operator()(r);
|
this->m_c1->operator()(r);
|
||||||
|
@ -157,11 +152,6 @@ public:
|
||||||
r.append(m_labels.size(), m_labels.data());
|
r.append(m_labels.size(), m_labels.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(expr_ref& fml) override {
|
|
||||||
model::scoped_model_completion _scm(m_model, false);
|
|
||||||
fml = (*m_model)(fml);
|
|
||||||
}
|
|
||||||
|
|
||||||
void get_units(obj_map<expr, bool>& fmls) override {
|
void get_units(obj_map<expr, bool>& fmls) override {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,8 +76,6 @@ public:
|
||||||
virtual void operator()(model_ref & m) = 0;
|
virtual void operator()(model_ref & m) = 0;
|
||||||
|
|
||||||
virtual void operator()(labels_vec & r) {}
|
virtual void operator()(labels_vec & r) {}
|
||||||
|
|
||||||
virtual void operator()(expr_ref& fml) { UNREACHABLE(); }
|
|
||||||
|
|
||||||
virtual model_converter * translate(ast_translation & translator) = 0;
|
virtual model_converter * translate(ast_translation & translator) = 0;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,8 @@ void sat2goal::mc::flush_smc(sat::solver& s, atom2bool_var const& map) {
|
||||||
void sat2goal::mc::flush_gmc() {
|
void sat2goal::mc::flush_gmc() {
|
||||||
sat::literal_vector updates;
|
sat::literal_vector updates;
|
||||||
m_smc.expand(updates);
|
m_smc.expand(updates);
|
||||||
if (!m_gmc) m_gmc = alloc(generic_model_converter, m, "sat2goal");
|
if (!m_gmc)
|
||||||
|
m_gmc = alloc(generic_model_converter, m, "sat2goal");
|
||||||
// now gmc owns the model converter
|
// now gmc owns the model converter
|
||||||
sat::literal_vector clause;
|
sat::literal_vector clause;
|
||||||
expr_ref_vector tail(m);
|
expr_ref_vector tail(m);
|
||||||
|
@ -124,16 +125,13 @@ void sat2goal::mc::set_env(ast_pp_util* visitor) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sat2goal::mc::display(std::ostream& out) {
|
void sat2goal::mc::display(std::ostream& out) {
|
||||||
flush_gmc();
|
|
||||||
if (m_gmc) m_gmc->display(out);
|
if (m_gmc) m_gmc->display(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sat2goal::mc::get_units(obj_map<expr, bool>& units) {
|
void sat2goal::mc::get_units(obj_map<expr, bool>& units) {
|
||||||
flush_gmc();
|
|
||||||
if (m_gmc) m_gmc->get_units(units);
|
if (m_gmc) m_gmc->get_units(units);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void sat2goal::mc::operator()(sat::model& md) {
|
void sat2goal::mc::operator()(sat::model& md) {
|
||||||
m_smc(md);
|
m_smc(md);
|
||||||
}
|
}
|
||||||
|
@ -145,12 +143,6 @@ void sat2goal::mc::operator()(model_ref & md) {
|
||||||
CTRACE(sat_mc, m_gmc, m_gmc->display(tout << "after sat_mc\n"); model_v2_pp(tout, *md););
|
CTRACE(sat_mc, m_gmc, m_gmc->display(tout << "after sat_mc\n"); model_v2_pp(tout, *md););
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void sat2goal::mc::operator()(expr_ref& fml) {
|
|
||||||
flush_gmc();
|
|
||||||
if (m_gmc) (*m_gmc)(fml);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sat2goal::mc::insert(sat::bool_var v, expr * atom, bool aux) {
|
void sat2goal::mc::insert(sat::bool_var v, expr * atom, bool aux) {
|
||||||
SASSERT(!m_var2expr.get(v, nullptr));
|
SASSERT(!m_var2expr.get(v, nullptr));
|
||||||
m_var2expr.reserve(v + 1);
|
m_var2expr.reserve(v + 1);
|
||||||
|
|
|
@ -56,7 +56,6 @@ public:
|
||||||
using model_converter::operator();
|
using model_converter::operator();
|
||||||
void operator()(sat::model& m);
|
void operator()(sat::model& m);
|
||||||
void operator()(model_ref& md) override;
|
void operator()(model_ref& md) override;
|
||||||
void operator()(expr_ref& fml) override;
|
|
||||||
model_converter* translate(ast_translation& translator) override;
|
model_converter* translate(ast_translation& translator) override;
|
||||||
void set_env(ast_pp_util* visitor) override;
|
void set_env(ast_pp_util* visitor) override;
|
||||||
void display(std::ostream& out) override;
|
void display(std::ostream& out) override;
|
||||||
|
|
|
@ -191,24 +191,6 @@ struct bit_blaster_model_converter : public model_converter {
|
||||||
mk_bvs(md.get(), new_model);
|
mk_bvs(md.get(), new_model);
|
||||||
md = new_model;
|
md = new_model;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
\brief simplisic expansion operator for formulas.
|
|
||||||
It just adds back bit-vector definitions to the formula whether they are used or not.
|
|
||||||
|
|
||||||
*/
|
|
||||||
void operator()(expr_ref& fml) override {
|
|
||||||
unsigned sz = m_vars.size();
|
|
||||||
if (sz == 0) return;
|
|
||||||
expr_ref_vector fmls(m());
|
|
||||||
fmls.push_back(fml);
|
|
||||||
for (unsigned i = 0; i < sz; i++) {
|
|
||||||
fmls.push_back(m().mk_eq(m().mk_const(m_vars.get(i)), m_bits.get(i)));
|
|
||||||
}
|
|
||||||
m_vars.reset();
|
|
||||||
m_bits.reset();
|
|
||||||
fml = mk_and(fmls);
|
|
||||||
}
|
|
||||||
|
|
||||||
void display(std::ostream & out) override {
|
void display(std::ostream & out) override {
|
||||||
for (func_decl * f : m_newbits)
|
for (func_decl * f : m_newbits)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue