mirror of
https://github.com/Z3Prover/z3
synced 2025-12-06 03:52:24 +00:00
Return bool instead of int from Z3_rcf_interval (#8046)
In the underlying realclosure implementation, the interval operations for
{`lower`,`upper`}`_is_`{`inf`,`open`} return `bool` results. Currently these
are cast to `int` when surfacing them to the API. This patch keeps them at
type `bool` through to `Z3_rcf_interval`.
Signed-off-by: Josh Berdine <josh@berdine.net>
This commit is contained in:
parent
40d8d5ad9a
commit
4401abbb4a
4 changed files with 6 additions and 6 deletions
|
|
@ -385,7 +385,7 @@ extern "C" {
|
||||||
Z3_CATCH_RETURN(nullptr);
|
Z3_CATCH_RETURN(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Z3_API Z3_rcf_interval(Z3_context c, Z3_rcf_num a, int * lower_is_inf, int * lower_is_open, Z3_rcf_num * lower, int * upper_is_inf, int * upper_is_open, Z3_rcf_num * upper) {
|
int Z3_API Z3_rcf_interval(Z3_context c, Z3_rcf_num a, bool * lower_is_inf, bool * lower_is_open, Z3_rcf_num * lower, bool * upper_is_inf, bool * upper_is_open, Z3_rcf_num * upper) {
|
||||||
Z3_TRY;
|
Z3_TRY;
|
||||||
LOG_Z3_rcf_interval(c, a, lower_is_inf, lower_is_open, lower, upper_is_inf, upper_is_open, upper);
|
LOG_Z3_rcf_interval(c, a, lower_is_inf, lower_is_open, lower, upper_is_inf, upper_is_open, upper);
|
||||||
RESET_ERROR_CODE();
|
RESET_ERROR_CODE();
|
||||||
|
|
|
||||||
|
|
@ -272,9 +272,9 @@ extern "C" {
|
||||||
|
|
||||||
\pre Z3_rcf_is_algebraic(ctx, a);
|
\pre Z3_rcf_is_algebraic(ctx, a);
|
||||||
|
|
||||||
def_API('Z3_rcf_interval', INT, (_in(CONTEXT), _in(RCF_NUM), _out(INT), _out(INT), _out(RCF_NUM), _out(INT), _out(INT), _out(RCF_NUM)))
|
def_API('Z3_rcf_interval', INT, (_in(CONTEXT), _in(RCF_NUM), _out(BOOL), _out(BOOL), _out(RCF_NUM), _out(BOOL), _out(BOOL), _out(RCF_NUM)))
|
||||||
*/
|
*/
|
||||||
int Z3_API Z3_rcf_interval(Z3_context c, Z3_rcf_num a, int * lower_is_inf, int * lower_is_open, Z3_rcf_num * lower, int * upper_is_inf, int * upper_is_open, Z3_rcf_num * upper);
|
int Z3_API Z3_rcf_interval(Z3_context c, Z3_rcf_num a, bool * lower_is_inf, bool * lower_is_open, Z3_rcf_num * lower, bool * upper_is_inf, bool * upper_is_open, Z3_rcf_num * upper);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Return the number of sign conditions of an algebraic number.
|
\brief Return the number of sign conditions of an algebraic number.
|
||||||
|
|
|
||||||
|
|
@ -3429,7 +3429,7 @@ namespace realclosure {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_interval(numeral const & a, int & lower_is_inf, int & lower_is_open, numeral & lower, int & upper_is_inf, int & upper_is_open, numeral & upper)
|
bool get_interval(numeral const & a, bool & lower_is_inf, bool & lower_is_open, numeral & lower, bool & upper_is_inf, bool & upper_is_open, numeral & upper)
|
||||||
{
|
{
|
||||||
if (!is_algebraic(a))
|
if (!is_algebraic(a))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -6475,7 +6475,7 @@ namespace realclosure {
|
||||||
return m_imp->get_sign_condition_sign(a, i);
|
return m_imp->get_sign_condition_sign(a, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool manager::get_interval(numeral const & a, int & lower_is_inf, int & lower_is_open, numeral & lower, int & upper_is_inf, int & upper_is_open, numeral & upper)
|
bool manager::get_interval(numeral const & a, bool & lower_is_inf, bool & lower_is_open, numeral & lower, bool & upper_is_inf, bool & upper_is_open, numeral & upper)
|
||||||
{
|
{
|
||||||
return m_imp->get_interval(a, lower_is_inf, lower_is_open, lower, upper_is_inf, upper_is_open, upper);
|
return m_imp->get_interval(a, lower_is_inf, lower_is_open, lower, upper_is_inf, upper_is_open, upper);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,7 @@ namespace realclosure {
|
||||||
|
|
||||||
int get_sign_condition_sign(numeral const &a, unsigned i);
|
int get_sign_condition_sign(numeral const &a, unsigned i);
|
||||||
|
|
||||||
bool get_interval(numeral const & a, int & lower_is_inf, int & lower_is_open, numeral & lower, int & upper_is_inf, int & upper_is_open, numeral & upper);
|
bool get_interval(numeral const & a, bool & lower_is_inf, bool & lower_is_open, numeral & lower, bool & upper_is_inf, bool & upper_is_open, numeral & upper);
|
||||||
|
|
||||||
unsigned num_sign_condition_coefficients(numeral const &a, unsigned i);
|
unsigned num_sign_condition_coefficients(numeral const &a, unsigned i);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue