3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-29 17:38:45 +00:00

various bugfixes and extensions for FPA

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2015-01-15 19:25:49 +00:00
parent caafee0033
commit 5344d6f3c0
10 changed files with 396 additions and 341 deletions

View file

@ -72,7 +72,7 @@ func_decl * fpa_decl_plugin::mk_numeral_decl(mpf const & v) {
parameter p(mk_id(v), true);
SASSERT(p.is_external());
sort * s = mk_float_sort(v.get_ebits(), v.get_sbits());
return m_manager->mk_const_decl(symbol("fpa"), s, func_decl_info(m_family_id, OP_FPA_NUM, 1, &p));
return m_manager->mk_const_decl(symbol("fp.numeral"), s, func_decl_info(m_family_id, OP_FPA_NUM, 1, &p));
}
app * fpa_decl_plugin::mk_numeral(mpf const & v) {
@ -131,6 +131,11 @@ bool fpa_decl_plugin::is_numeral(expr * n, mpf & val) {
return false;
}
bool fpa_decl_plugin::is_numeral(expr * n) {
scoped_mpf v(m_fm);
return is_numeral(n, v);
}
bool fpa_decl_plugin::is_rm_numeral(expr * n, mpf_rounding_mode & val) {
if (is_app_of(n, m_family_id, OP_FPA_RM_NEAREST_TIES_TO_AWAY)) {
val = MPF_ROUND_NEAREST_TAWAY;
@ -156,6 +161,11 @@ bool fpa_decl_plugin::is_rm_numeral(expr * n, mpf_rounding_mode & val) {
return 0;
}
bool fpa_decl_plugin::is_rm_numeral(expr * n) {
mpf_rounding_mode t;
return is_rm_numeral(n, t);
}
void fpa_decl_plugin::del(parameter const & p) {
SASSERT(p.is_external());
recycled_id(p.get_ext_id());