mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 05:18:44 +00:00
Moved auxiliary fp.isNaN lemma injection to the right place.
Fixes #102
This commit is contained in:
parent
891073d3fe
commit
8fc0ba0ab5
|
@ -3044,13 +3044,6 @@ void fpa2bv_converter::mk_is_nan(expr * e, expr_ref & result) {
|
|||
m_simp.mk_not(sig_is_zero, sig_is_not_zero);
|
||||
m_simp.mk_eq(exp, top_exp, exp_is_top);
|
||||
m_simp.mk_and(exp_is_top, sig_is_not_zero, result);
|
||||
|
||||
// Inject auxiliary lemmas that fix e to the one and only NaN value,
|
||||
// that is (= e (fp #b0 #b1...1 #b0...01)), so that the value propagation
|
||||
// has a value to propagate.
|
||||
m_extra_assertions.push_back(m.mk_eq(sgn, m_bv_util.mk_numeral(0, 1)));
|
||||
m_extra_assertions.push_back(m.mk_eq(exp, top_exp));
|
||||
m_extra_assertions.push_back(m.mk_eq(sig, m_bv_util.mk_numeral(1, m_bv_util.get_bv_size(sig))));
|
||||
}
|
||||
|
||||
void fpa2bv_converter::mk_is_inf(expr * e, expr_ref & result) {
|
||||
|
|
|
@ -88,6 +88,22 @@ class fpa2bv_tactic : public tactic {
|
|||
new_pr = m.mk_modus_ponens(pr, new_pr);
|
||||
}
|
||||
g->update(idx, new_curr, new_pr, g->dep(idx));
|
||||
|
||||
if (is_app(new_curr)) {
|
||||
const app * a = to_app(new_curr.get());
|
||||
if (a->get_family_id() == m_conv.fu().get_family_id() &&
|
||||
a->get_decl_kind() == OP_FPA_IS_NAN) {
|
||||
// Inject auxiliary lemmas that fix e to the one and only NaN value,
|
||||
// that is (= e (fp #b0 #b1...1 #b0...01)), so that the value propagation
|
||||
// has a value to propagate.
|
||||
expr * sgn, *sig, *exp;
|
||||
expr_ref top_exp(m);
|
||||
m_conv.split_fp(new_curr, sgn, exp, sig);
|
||||
m.mk_eq(sgn, m_conv.bu().mk_numeral(0, 1));
|
||||
m.mk_eq(exp, m_conv.bu().mk_numeral(-1, m_conv.bu().get_bv_size(exp)));
|
||||
m.mk_eq(sig, m_conv.bu().mk_numeral(1, m_conv.bu().get_bv_size(sig)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (g->models_enabled())
|
||||
|
|
Loading…
Reference in a new issue