mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 17:45:32 +00:00
Partial support for fpa2bv translation in complex types.
This commit is contained in:
parent
b6d90a64da
commit
fe3f8466b6
7 changed files with 266 additions and 70 deletions
|
@ -46,6 +46,12 @@ void fpa2bv_model_converter::display(std::ostream & out) {
|
|||
unsigned indent = n.size() + 4;
|
||||
out << mk_ismt2_pp(it->m_value, m, indent) << ")";
|
||||
}
|
||||
for (obj_map<sort, sort*>::iterator it = m_subst_sorts.begin();
|
||||
it != m_subst_sorts.end();
|
||||
it++) {
|
||||
out << "\n " << mk_ismt2_pp(it->m_key, m) << " -> ";
|
||||
out << mk_ismt2_pp(it->m_value, m);
|
||||
}
|
||||
for (obj_map<func_decl, std::pair<app*, app*> >::iterator it = m_specials.begin();
|
||||
it != m_specials.end();
|
||||
it++) {
|
||||
|
@ -55,6 +61,7 @@ void fpa2bv_model_converter::display(std::ostream & out) {
|
|||
out << mk_ismt2_pp(it->m_value.first, m, indent) << "; " <<
|
||||
mk_ismt2_pp(it->m_value.second, m, indent) << ")";
|
||||
}
|
||||
out << ")";
|
||||
}
|
||||
|
||||
model_converter * fpa2bv_model_converter::translate(ast_translation & translator) {
|
||||
|
@ -88,6 +95,15 @@ model_converter * fpa2bv_model_converter::translate(ast_translation & translator
|
|||
translator.to().inc_ref(k);
|
||||
translator.to().inc_ref(v);
|
||||
}
|
||||
for (obj_map<sort, sort*>::iterator it = m_subst_sorts.begin();
|
||||
it != m_subst_sorts.end();
|
||||
it++) {
|
||||
sort * k = translator(it->m_key);
|
||||
sort * v = translator(it->m_value);
|
||||
res->m_subst_sorts.insert(k, v);
|
||||
translator.to().inc_ref(k);
|
||||
translator.to().inc_ref(v);
|
||||
}
|
||||
for (obj_map<func_decl, std::pair<app*, app*> >::iterator it = m_specials.begin();
|
||||
it != m_specials.end();
|
||||
it++) {
|
||||
|
@ -410,6 +426,7 @@ void fpa2bv_model_converter::convert(model * bv_mdl, model * float_mdl) {
|
|||
}
|
||||
else {
|
||||
// Just keep.
|
||||
SASSERT(!m_fpa_util.is_float(f->get_range()) && !m_fpa_util.is_rm(f->get_range()));
|
||||
expr_ref val(m);
|
||||
bv_mdl->eval(it->m_value, val);
|
||||
if (val) float_mdl->register_decl(f, val);
|
||||
|
|
|
@ -32,6 +32,7 @@ class fpa2bv_model_converter : public model_converter {
|
|||
obj_map<func_decl, expr*> m_const2bv;
|
||||
obj_map<func_decl, expr*> m_rm_const2bv;
|
||||
obj_map<func_decl, func_decl*> m_uf2bvuf;
|
||||
obj_map<sort, sort*> m_subst_sorts;
|
||||
obj_map<func_decl, std::pair<app*, app*> > m_specials;
|
||||
|
||||
public:
|
||||
|
@ -64,6 +65,14 @@ public:
|
|||
m.inc_ref(it->m_key);
|
||||
m.inc_ref(it->m_value);
|
||||
}
|
||||
for (obj_map<sort, sort*>::iterator it = conv.m_subst_sorts.begin();
|
||||
it != conv.m_subst_sorts.end();
|
||||
it++)
|
||||
{
|
||||
m_subst_sorts.insert(it->m_key, it->m_value);
|
||||
m.inc_ref(it->m_key);
|
||||
m.inc_ref(it->m_value);
|
||||
}
|
||||
for (obj_map<func_decl, std::pair<app*, app*> >::iterator it = conv.m_specials.begin();
|
||||
it != conv.m_specials.end();
|
||||
it++) {
|
||||
|
@ -78,6 +87,7 @@ public:
|
|||
dec_ref_map_key_values(m, m_const2bv);
|
||||
dec_ref_map_key_values(m, m_rm_const2bv);
|
||||
dec_ref_map_key_values(m, m_uf2bvuf);
|
||||
dec_ref_map_key_values(m, m_subst_sorts);
|
||||
for (obj_map<func_decl, std::pair<app*, app*> >::iterator it = m_specials.begin();
|
||||
it != m_specials.end();
|
||||
it++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue