3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

FPA: bugfixes in mul() and abs()

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2013-03-06 15:04:58 +00:00
parent bdc675b1df
commit e5307300de
2 changed files with 5 additions and 5 deletions

View file

@ -227,7 +227,7 @@ br_status float_rewriter::mk_abs(expr * arg1, expr_ref & result) {
return BR_DONE;
}
sort * s = m().get_sort(arg1);
result = m().mk_ite(m_util.mk_lt(arg1, m_util.mk_pzero(s)),
result = m().mk_ite(m_util.mk_is_sign_minus(arg1),
m_util.mk_uminus(arg1),
arg1);
return BR_REWRITE2;

View file

@ -610,11 +610,11 @@ void fpa2bv_converter::mk_mul(func_decl * f, unsigned num, expr * const * args,
expr_ref h_p(m), l_p(m), rbits(m);
h_p = m_bv_util.mk_extract(2*sbits-1, sbits, product);
l_p = m_bv_util.mk_extract(2*sbits-1, sbits, product);
l_p = m_bv_util.mk_extract(sbits-1, 0, product);
if (sbits >= 4) {
expr_ref sticky(m);
sticky = m.mk_app(m_bv_util.get_fid(), OP_BREDOR, m_bv_util.mk_extract(sbits-4, 0, l_p));
sticky = m.mk_app(m_bv_util.get_fid(), OP_BREDOR, m_bv_util.mk_extract(sbits-4, 0, l_p));
rbits = m_bv_util.mk_concat(m_bv_util.mk_extract(sbits-1, sbits-3, l_p), sticky);
}
else
@ -2094,11 +2094,11 @@ void fpa2bv_converter::round(sort * s, expr_ref & rm, expr_ref & sgn, expr_ref &
expr * round_sticky[2] = { round, sticky };
last_or_sticky = m_bv_util.mk_bv_or(2, last_sticky);
round_or_sticky = m_bv_util.mk_bv_or(2, round_sticky);
not_round = m_bv_util.mk_bv_not(round);
not_round = m_bv_util.mk_bv_not(round);
not_lors = m_bv_util.mk_bv_not(last_or_sticky);
not_rors = m_bv_util.mk_bv_not(round_or_sticky);
not_sgn = m_bv_util.mk_bv_not(sgn);
expr * round_lors[2] = { not_round, not_lors };
expr * round_lors[2] = { not_round, not_lors};
expr * pos_args[2] = { sgn, not_rors };
expr * neg_args[2] = { not_sgn, not_rors };