Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert unsound NaN constraints in theory_fpa #6993

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/smt/theory_fpa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,6 @@ namespace smt {
return true;
}

void theory_fpa::mk_bv_nan(sort * s, expr_ref & result) {
SASSERT(m_fpa_util.is_float(s));
unsigned sbits = m_fpa_util.get_sbits(s);
unsigned ebits = m_fpa_util.get_ebits(s);
expr_ref exp(m), sgn(m), sig(m);
exp = m_bv_util.mk_numeral(m_fpa_util.fm().m_powers2.m1(ebits), ebits);
sgn = m_bv_util.mk_numeral(0, 1);
sig = m_bv_util.mk_numeral(1, sbits - 1);
expr * args[3] = {sgn, exp, sig};
result = m_bv_util.mk_concat(3, args);
}

bool theory_fpa::internalize_term(app * term) {
TRACE("t_fpa_internalize", tout << "internalizing term: " << mk_ismt2_pp(term, m) << "\n";);
SASSERT(term->get_family_id() == get_family_id());
Expand Down Expand Up @@ -298,22 +286,6 @@ namespace smt {
default: /* ignore */;
}

expr * owner = e->get_expr();
sort * s = owner->get_sort();
if (m_fpa_util.is_float(s))
{
TRACE("t_fpa", tout << "extra nan constraint for: " << mk_ismt2_pp(owner, m) << "\n";);
expr_ref wrapped(m), is_nan(m), bv_nan(m);
app_ref impl(m);
wrapped = m_converter.wrap(owner);
is_nan = m_fpa_util.mk_is_nan(owner);
mk_bv_nan(s, bv_nan);
impl = m.mk_or(m.mk_and(is_nan, m.mk_eq(wrapped, bv_nan)),
m.mk_and(m.mk_not(is_nan), m.mk_not(m.mk_eq(wrapped, bv_nan))));
assert_cnstr(impl);
assert_cnstr(mk_side_conditions());
}

if (!ctx.relevancy())
relevant_eh(term);
}
Expand Down
2 changes: 0 additions & 2 deletions src/smt/theory_fpa.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ namespace smt {
enode* ensure_enode(expr* e);
enode* get_root(expr* a) { return ensure_enode(a)->get_root(); }
app* get_ite_value(expr* e);

void mk_bv_nan(sort * s, expr_ref & result);
};

};
Expand Down
Loading