3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 01:25:31 +00:00

Bugfix for fp.min/fp.max in fpa2bv converter; hide BV UFs from FP models.

Fixes #642
This commit is contained in:
Christoph M. Wintersteiger 2016-06-09 17:51:31 +01:00
parent bfeab9cc15
commit bd187e0989
5 changed files with 38 additions and 43 deletions

View file

@ -1273,10 +1273,10 @@ expr_ref fpa2bv_converter::mk_min_max_unspecified(func_decl * f, expr * x, expr
// There is no "hardware interpretation" for fp.min/fp.max.
std::pair<app*, app*> decls(0, 0);
if (!m_specials.find(f, decls)) {
if (!m_min_max_specials.find(f, decls)) {
decls.first = m.mk_fresh_const(0, m_bv_util.mk_sort(1));
decls.second = m.mk_fresh_const(0, m_bv_util.mk_sort(1));
m_specials.insert(f, decls);
m_min_max_specials.insert(f, decls);
m.inc_ref(f);
m.inc_ref(decls.first);
m.inc_ref(decls.second);
@ -4100,13 +4100,13 @@ void fpa2bv_converter::reset(void) {
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);
for (obj_map<func_decl, std::pair<app*, app*> >::iterator it = m_specials.begin();
it != m_specials.end();
for (obj_map<func_decl, std::pair<app*, app*> >::iterator it = m_min_max_specials.begin();
it != m_min_max_specials.end();
it++) {
m.dec_ref(it->m_key);
m.dec_ref(it->m_value.first);
m.dec_ref(it->m_value.second);
}
m_specials.reset();
m_min_max_specials.reset();
m_extra_assertions.reset();
}

View file

@ -32,6 +32,11 @@ Notes:
#include"basic_simplifier_plugin.h"
class fpa2bv_converter {
public:
typedef obj_map<func_decl, std::pair<app *, app *> > special_t;
typedef obj_map<func_decl, expr*> const2bv_t;
typedef obj_map<func_decl, func_decl*> uf2bvuf_t;
protected:
ast_manager & m;
basic_simplifier_plugin m_simp;
@ -46,11 +51,10 @@ protected:
fpa_decl_plugin * m_plugin;
bool m_hi_fp_unspecified;
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<func_decl, std::pair<app *, app *> > m_specials;
const2bv_t m_const2bv;
const2bv_t m_rm_const2bv;
uf2bvuf_t m_uf2bvuf;
special_t m_min_max_specials;
friend class fpa2bv_model_converter;
@ -154,9 +158,11 @@ public:
void dbg_decouple(const char * prefix, expr_ref & e);
expr_ref_vector m_extra_assertions;
bool is_special(func_decl * f) { return m_specials.contains(f); }
bool is_uf2bvuf(func_decl * f) { return m_uf2bvuf.contains(f); }
special_t const & get_min_max_specials() const { return m_min_max_specials; };
const2bv_t const & get_const2bv() const { return m_const2bv; };
const2bv_t const & get_rm_const2bv() const { return m_rm_const2bv; };
uf2bvuf_t const & get_uf2bvuf() const { return m_uf2bvuf; };
protected:
void mk_one(func_decl *f, expr_ref & sign, expr_ref & result);