3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-19 12:23:38 +00:00

Bugfix for rewriter exceptions in theory_fpa. Relates to #570.

This commit is contained in:
Christoph M. Wintersteiger 2016-11-15 19:59:08 +00:00
parent 3a6ce8f8a1
commit ee60ba824f

View file

@ -334,23 +334,30 @@ namespace smt {
TRACE("t_fpa_detail", tout << "term: " << mk_ismt2_pp(e, get_manager()) << std::endl; TRACE("t_fpa_detail", tout << "term: " << mk_ismt2_pp(e, get_manager()) << std::endl;
tout << "converted term: " << mk_ismt2_pp(e_conv, get_manager()) << std::endl;); tout << "converted term: " << mk_ismt2_pp(e_conv, get_manager()) << std::endl;);
if (m_fpa_util.is_rm(e)) { try {
SASSERT(m_fpa_util.is_bv2rm(e_conv)); if (m_fpa_util.is_rm(e)) {
expr_ref bv_rm(m); SASSERT(m_fpa_util.is_bv2rm(e_conv));
m_th_rw(to_app(e_conv)->get_arg(0), bv_rm); expr_ref bv_rm(m);
res = m_fpa_util.mk_bv2rm(bv_rm); m_th_rw(to_app(e_conv)->get_arg(0), bv_rm);
res = m_fpa_util.mk_bv2rm(bv_rm);
}
else if (m_fpa_util.is_float(e)) {
SASSERT(m_fpa_util.is_fp(e_conv));
expr_ref sgn(m), sig(m), exp(m);
m_converter.split_fp(e_conv, sgn, exp, sig);
m_th_rw(sgn);
m_th_rw(exp);
m_th_rw(sig);
res = m_fpa_util.mk_fp(sgn, exp, sig);
}
else
UNREACHABLE();
} }
else if (m_fpa_util.is_float(e)) { catch (rewriter_exception &)
SASSERT(m_fpa_util.is_fp(e_conv)); {
expr_ref sgn(m), sig(m), exp(m); m_th_rw.reset();
m_converter.split_fp(e_conv, sgn, exp, sig); throw;
m_th_rw(sgn);
m_th_rw(exp);
m_th_rw(sig);
res = m_fpa_util.mk_fp(sgn, exp, sig);
} }
else
UNREACHABLE();
return res; return res;
} }