mirror of
https://github.com/Z3Prover/z3
synced 2025-06-29 17:38:45 +00:00
More FPA exponent/siginficand order consistency
This commit is contained in:
parent
1610e4fbd0
commit
de3cb7e5dc
6 changed files with 246 additions and 218 deletions
|
@ -490,11 +490,24 @@ func_decl * fpa_decl_plugin::mk_to_fp(decl_kind k, unsigned num_parameters, para
|
|||
return m_manager->mk_func_decl(name, arity, domain, fp, func_decl_info(m_family_id, k, num_parameters, parameters));
|
||||
}
|
||||
else if (arity == 3 &&
|
||||
is_sort_of(domain[0], m_family_id, ROUNDING_MODE_SORT) &&
|
||||
is_sort_of(domain[1], m_arith_fid, REAL_SORT) &&
|
||||
is_sort_of(domain[2], m_arith_fid, INT_SORT))
|
||||
is_sort_of(domain[0], m_family_id, ROUNDING_MODE_SORT) &&
|
||||
is_sort_of(domain[1], m_arith_fid, REAL_SORT) &&
|
||||
is_sort_of(domain[2], m_arith_fid, INT_SORT))
|
||||
{
|
||||
// Rounding + 1 Real + 1 Int -> 1 FP
|
||||
// Rounding + 1 Real + 1 Int -> 1 FP
|
||||
if (!(num_parameters == 2 && parameters[0].is_int() && parameters[1].is_int()))
|
||||
m_manager->raise_exception("expecting two integer parameters to to_fp");
|
||||
|
||||
sort * fp = mk_float_sort(parameters[0].get_int(), parameters[1].get_int());
|
||||
symbol name("to_fp");
|
||||
return m_manager->mk_func_decl(name, arity, domain, fp, func_decl_info(m_family_id, k, num_parameters, parameters));
|
||||
}
|
||||
else if (arity == 3 &&
|
||||
is_sort_of(domain[0], m_family_id, ROUNDING_MODE_SORT) &&
|
||||
is_sort_of(domain[1], m_arith_fid, INT_SORT) &&
|
||||
is_sort_of(domain[2], m_arith_fid, REAL_SORT))
|
||||
{
|
||||
// Rounding + 1 Int + 1 Real -> 1 FP
|
||||
if (!(num_parameters == 2 && parameters[0].is_int() && parameters[1].is_int()))
|
||||
m_manager->raise_exception("expecting two integer parameters to to_fp");
|
||||
|
||||
|
@ -545,6 +558,7 @@ func_decl * fpa_decl_plugin::mk_to_fp(decl_kind k, unsigned num_parameters, para
|
|||
"(Real), "
|
||||
"(RoundingMode (_ BitVec (eb+sb))), "
|
||||
"(RoundingMode (_ FloatingPoint eb' sb')), "
|
||||
"(RoundingMode Int Real), "
|
||||
"(RoundingMode Real Int), "
|
||||
"(RoundingMode Int), and "
|
||||
"(RoundingMode Real)."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue