mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 17:45:32 +00:00
Improved support for FPA unspecified min/max values, model validation, and proof generation.
This commit is contained in:
parent
ca496f20cb
commit
9b5abcd55a
8 changed files with 192 additions and 106 deletions
|
@ -210,6 +210,11 @@ void fpa2bv_model_converter::convert(model * bv_mdl, model * float_mdl) {
|
|||
|
||||
obj_hashtable<func_decl> seen;
|
||||
|
||||
for (obj_hashtable<func_decl>::iterator it = m_decls_to_hide.begin();
|
||||
it != m_decls_to_hide.end();
|
||||
it++)
|
||||
seen.insert(*it);
|
||||
|
||||
for (obj_map<func_decl, expr*>::iterator it = m_const2bv.begin();
|
||||
it != m_const2bv.end();
|
||||
it++)
|
||||
|
@ -353,6 +358,7 @@ void fpa2bv_model_converter::convert(model * bv_mdl, model * float_mdl) {
|
|||
model_converter * mk_fpa2bv_model_converter(ast_manager & m,
|
||||
obj_map<func_decl, expr*> const & const2bv,
|
||||
obj_map<func_decl, expr*> const & rm_const2bv,
|
||||
obj_map<func_decl, func_decl*> const & uf2bvuf) {
|
||||
return alloc(fpa2bv_model_converter, m, const2bv, rm_const2bv, uf2bvuf);
|
||||
obj_map<func_decl, func_decl*> const & uf2bvuf,
|
||||
obj_hashtable<func_decl> const & decls_to_hide) {
|
||||
return alloc(fpa2bv_model_converter, m, const2bv, rm_const2bv, uf2bvuf, decls_to_hide);
|
||||
}
|
||||
|
|
|
@ -27,13 +27,14 @@ 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_hashtable<func_decl> m_decls_to_hide;
|
||||
|
||||
public:
|
||||
fpa2bv_model_converter(ast_manager & m, obj_map<func_decl, expr*> const & const2bv,
|
||||
obj_map<func_decl, expr*> const & rm_const2bv,
|
||||
obj_map<func_decl, func_decl*> const & uf2bvuf) :
|
||||
obj_map<func_decl, func_decl*> const & uf2bvuf,
|
||||
obj_hashtable<func_decl> const & decls_to_hide) :
|
||||
m(m) {
|
||||
// Just create a copy?
|
||||
for (obj_map<func_decl, expr*>::iterator it = const2bv.begin();
|
||||
it != const2bv.end();
|
||||
it++)
|
||||
|
@ -58,12 +59,20 @@ public:
|
|||
m.inc_ref(it->m_key);
|
||||
m.inc_ref(it->m_value);
|
||||
}
|
||||
for (obj_hashtable<func_decl>::iterator it = decls_to_hide.begin();
|
||||
it != decls_to_hide.end();
|
||||
it++)
|
||||
{
|
||||
m_decls_to_hide.insert(*it);
|
||||
m.inc_ref(*it);
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~fpa2bv_model_converter() {
|
||||
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_collection_values(m, m_decls_to_hide);
|
||||
}
|
||||
|
||||
virtual void operator()(model_ref & md, unsigned goal_idx) {
|
||||
|
@ -96,6 +105,7 @@ protected:
|
|||
model_converter * mk_fpa2bv_model_converter(ast_manager & m,
|
||||
obj_map<func_decl, expr*> const & const2bv,
|
||||
obj_map<func_decl, expr*> const & rm_const2bv,
|
||||
obj_map<func_decl, func_decl*> const & uf2bvuf);
|
||||
obj_map<func_decl, func_decl*> const & uf2bvuf,
|
||||
obj_hashtable<func_decl> const & decls_to_hide);
|
||||
|
||||
#endif
|
|
@ -107,7 +107,7 @@ class fpa2bv_tactic : public tactic {
|
|||
}
|
||||
|
||||
if (g->models_enabled())
|
||||
mc = mk_fpa2bv_model_converter(m, m_conv.const2bv(), m_conv.rm_const2bv(), m_conv.uf2bvuf());
|
||||
mc = mk_fpa2bv_model_converter(m, m_conv.const2bv(), m_conv.rm_const2bv(), m_conv.uf2bvuf(), m_conv.decls_to_hide());
|
||||
|
||||
g->inc_depth();
|
||||
result.push_back(g.get());
|
||||
|
@ -151,7 +151,12 @@ public:
|
|||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
try {
|
||||
(*m_imp)(in, result, mc, pc, core);
|
||||
}
|
||||
catch (rewriter_exception & ex) {
|
||||
throw tactic_exception(ex.msg());
|
||||
}
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue