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

Remove usages of Z3_TRUE / Z3_FALSE.

Now that this is all using stdbool.h, we can just use true/false.

For now, we leave the aliases in place in z3_api.h.
This commit is contained in:
Bruce Mitchener 2018-11-20 00:25:37 +07:00
parent 8b2450aba7
commit 56bbed173e
23 changed files with 188 additions and 189 deletions

View file

@ -83,8 +83,8 @@ extern "C" {
Z3_TRY;
LOG_Z3_algebraic_is_value(c, a);
RESET_ERROR_CODE();
return Z3_algebraic_is_value_core(c, a) ? Z3_TRUE : Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return Z3_algebraic_is_value_core(c, a) ? true : false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_algebraic_is_pos(Z3_context c, Z3_ast a) {
@ -283,7 +283,7 @@ extern "C" {
r = _am.IRAT_PRED(av, bv); \
} \
} \
return r ? Z3_TRUE : Z3_FALSE;
return r ? true : false;
Z3_bool Z3_API Z3_algebraic_lt(Z3_context c, Z3_ast a, Z3_ast b) {
@ -293,7 +293,7 @@ extern "C" {
CHECK_IS_ALGEBRAIC(a, 0);
CHECK_IS_ALGEBRAIC(b, 0);
BIN_PRED(<,lt);
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_algebraic_gt(Z3_context c, Z3_ast a, Z3_ast b) {

View file

@ -121,7 +121,7 @@ extern "C" {
Z3_bool Z3_API Z3_is_algebraic_number(Z3_context c, Z3_ast a) {
LOG_Z3_is_algebraic_number(c, a);
return mk_c(c)->autil().is_irrational_algebraic_numeral(to_expr(a)) ? Z3_TRUE : Z3_FALSE;
return mk_c(c)->autil().is_irrational_algebraic_numeral(to_expr(a)) ? true : false;
}
Z3_ast Z3_API Z3_get_algebraic_number_lower(Z3_context c, Z3_ast a, unsigned precision) {

View file

@ -313,7 +313,7 @@ extern "C" {
LOG_Z3_is_well_sorted(c, t);
RESET_ERROR_CODE();
return is_well_sorted(mk_c(c)->m(), to_expr(t));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_symbol_kind Z3_API Z3_get_symbol_kind(Z3_context c, Z3_symbol s) {

View file

@ -62,7 +62,7 @@ extern "C" {
LOG_Z3_ast_map_contains(c, m, k);
RESET_ERROR_CODE();
return to_ast_map_ref(m).contains(to_ast(k));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_ast Z3_API Z3_ast_map_find(Z3_context c, Z3_ast_map m, Z3_ast k) {

View file

@ -57,13 +57,13 @@ extern "C" {
try {
g_Z3_global_param_get_buffer = gparams::get_value(param_id);
*param_value = g_Z3_global_param_get_buffer.c_str();
return Z3_TRUE;
return true;
}
catch (z3_exception & ex) {
// The error handler is only available for contexts
// Just throw a warning.
warning_msg("%s", ex.msg());
return Z3_FALSE;
return false;
}
}

View file

@ -205,17 +205,17 @@ extern "C" {
*out = 0;
}
if (Z3_get_sort_kind(c, s) != Z3_FINITE_DOMAIN_SORT) {
return Z3_FALSE;
return false;
}
if (!out) {
return Z3_FALSE;
return false;
}
// must start logging here, since function uses Z3_get_sort_kind above
LOG_Z3_get_finite_domain_sort_size(c, s, out);
RESET_ERROR_CODE();
VERIFY(mk_c(c)->datalog_util().try_get_size(to_sort(s), *out));
return Z3_TRUE;
Z3_CATCH_RETURN(Z3_FALSE);
return true;
Z3_CATCH_RETURN(false);
}
Z3_fixedpoint Z3_API Z3_mk_fixedpoint(Z3_context c) {

View file

@ -1243,7 +1243,7 @@ extern "C" {
return false;
}
return fu.is_nan(to_expr(t));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_fpa_is_numeral_inf(Z3_context c, Z3_ast t) {
@ -1257,7 +1257,7 @@ extern "C" {
return false;
}
return fu.is_inf(to_expr(t));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_fpa_is_numeral_zero(Z3_context c, Z3_ast t) {
@ -1271,7 +1271,7 @@ extern "C" {
return false;
}
return fu.is_zero(to_expr(t));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_fpa_is_numeral_normal(Z3_context c, Z3_ast t) {
@ -1285,7 +1285,7 @@ extern "C" {
return false;
}
return fu.is_normal(to_expr(t));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_fpa_is_numeral_subnormal(Z3_context c, Z3_ast t) {
@ -1299,7 +1299,7 @@ extern "C" {
return false;
}
return fu.is_subnormal(to_expr(t));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_fpa_is_numeral_positive(Z3_context c, Z3_ast t) {
@ -1313,7 +1313,7 @@ extern "C" {
return false;
}
return fu.is_positive(to_expr(t));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_fpa_is_numeral_negative(Z3_context c, Z3_ast t) {
@ -1327,7 +1327,7 @@ extern "C" {
return false;
}
return fu.is_negative(to_expr(t));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
};

View file

@ -87,7 +87,7 @@ extern "C" {
LOG_Z3_goal_inconsistent(c, g);
RESET_ERROR_CODE();
return to_goal_ref(g)->inconsistent();
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
unsigned Z3_API Z3_goal_depth(Z3_context c, Z3_goal g) {
@ -141,7 +141,7 @@ extern "C" {
LOG_Z3_goal_is_decided_sat(c, g);
RESET_ERROR_CODE();
return to_goal_ref(g)->is_decided_sat();
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_goal_is_decided_unsat(Z3_context c, Z3_goal g) {
@ -149,7 +149,7 @@ extern "C" {
LOG_Z3_goal_is_decided_unsat(c, g);
RESET_ERROR_CODE();
return to_goal_ref(g)->is_decided_unsat();
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_model Z3_API Z3_goal_convert_model(Z3_context c, Z3_goal g, Z3_model m) {

View file

@ -34,7 +34,7 @@ extern "C" {
}
Z3_bool Z3_API Z3_open_log(Z3_string filename) {
Z3_bool res = Z3_TRUE;
Z3_bool res = true;
#ifdef Z3_LOG_SYNC
#pragma omp critical (z3_log)
@ -46,7 +46,7 @@ extern "C" {
if (g_z3_log->bad() || g_z3_log->fail()) {
dealloc(g_z3_log);
g_z3_log = nullptr;
res = Z3_FALSE;
res = false;
}
else {
*g_z3_log << "V \"" << Z3_MAJOR_VERSION << "." << Z3_MINOR_VERSION << "." << Z3_BUILD_NUMBER << "." << Z3_REVISION_NUMBER << " " << __DATE__ << "\"\n";

View file

@ -80,11 +80,11 @@ extern "C" {
LOG_Z3_model_has_interp(c, m, a);
CHECK_NON_NULL(m, 0);
if (to_model_ref(m)->has_interpretation(to_func_decl(a))) {
return Z3_TRUE;
return true;
} else {
return Z3_FALSE;
return false;
}
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_func_interp Z3_API Z3_model_get_func_interp(Z3_context c, Z3_model m, Z3_func_decl f) {
@ -162,15 +162,15 @@ extern "C" {
LOG_Z3_model_eval(c, m, t, model_completion, v);
if (v) *v = nullptr;
RESET_ERROR_CODE();
CHECK_NON_NULL(m, Z3_FALSE);
CHECK_IS_EXPR(t, Z3_FALSE);
CHECK_NON_NULL(m, false);
CHECK_IS_EXPR(t, false);
model * _m = to_model_ref(m);
expr_ref result(mk_c(c)->m());
model::scoped_model_completion _scm(*_m, model_completion == Z3_TRUE);
model::scoped_model_completion _scm(*_m, model_completion == true);
result = (*_m)(to_expr(t));
mk_c(c)->save_ast_trail(result.get());
*v = of_ast(result.get());
RETURN_Z3_model_eval Z3_TRUE;
RETURN_Z3_model_eval true;
Z3_CATCH_RETURN(0);
}
@ -230,7 +230,7 @@ extern "C" {
LOG_Z3_is_as_array(c, a);
RESET_ERROR_CODE();
return a && is_expr(to_ast(a)) && is_app_of(to_expr(a), mk_c(c)->get_array_fid(), OP_AS_ARRAY);
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_func_decl Z3_API Z3_get_as_array_func_decl(Z3_context c, Z3_ast a) {

View file

@ -146,7 +146,7 @@ extern "C" {
Z3_TRY;
LOG_Z3_is_numeral_ast(c, a);
RESET_ERROR_CODE();
CHECK_IS_EXPR(a, Z3_FALSE);
CHECK_IS_EXPR(a, false);
expr* e = to_expr(a);
return
mk_c(c)->autil().is_numeral(e) ||
@ -154,29 +154,29 @@ extern "C" {
mk_c(c)->fpautil().is_numeral(e) ||
mk_c(c)->fpautil().is_rm_numeral(e) ||
mk_c(c)->datalog_util().is_numeral_ext(e);
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_get_numeral_rational(Z3_context c, Z3_ast a, rational& r) {
Z3_TRY;
// This function is not part of the public API
RESET_ERROR_CODE();
CHECK_IS_EXPR(a, Z3_FALSE);
CHECK_IS_EXPR(a, false);
expr* e = to_expr(a);
if (mk_c(c)->autil().is_numeral(e, r)) {
return Z3_TRUE;
return true;
}
unsigned bv_size;
if (mk_c(c)->bvutil().is_numeral(e, r, bv_size)) {
return Z3_TRUE;
return true;
}
uint64_t v;
if (mk_c(c)->datalog_util().is_numeral(e, v)) {
r = rational(v, rational::ui64());
return Z3_TRUE;
return true;
}
return Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return false;
Z3_CATCH_RETURN(false);
}
@ -188,7 +188,7 @@ extern "C" {
CHECK_IS_EXPR(a, "");
rational r;
Z3_bool ok = Z3_get_numeral_rational(c, a, r);
if (ok == Z3_TRUE) {
if (ok == true) {
return mk_c(c)->mk_external_string(r.to_string());
}
else {
@ -253,7 +253,7 @@ extern "C" {
return mk_c(c)->mk_external_string(buffer.str());
}
Z3_bool ok = Z3_get_numeral_rational(c, a, r);
if (ok == Z3_TRUE) {
if (ok == true) {
return mk_c(c)->mk_external_string(r.to_string());
}
else {
@ -268,24 +268,24 @@ extern "C" {
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
LOG_Z3_get_numeral_small(c, a, num, den);
RESET_ERROR_CODE();
CHECK_IS_EXPR(a, Z3_FALSE);
CHECK_IS_EXPR(a, false);
rational r;
Z3_bool ok = Z3_get_numeral_rational(c, a, r);
if (ok == Z3_TRUE) {
if (ok == true) {
rational n = numerator(r);
rational d = denominator(r);
if (n.is_int64() && d.is_int64()) {
*num = n.get_int64();
*den = d.get_int64();
return Z3_TRUE;
return true;
}
else {
return Z3_FALSE;
return false;
}
}
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
return Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return false;
Z3_CATCH_RETURN(false);
}
@ -294,18 +294,18 @@ extern "C" {
// This function invokes Z3_get_numeral_int64, but it is still ok to add LOG command here because it does not return a Z3 object.
LOG_Z3_get_numeral_int(c, v, i);
RESET_ERROR_CODE();
CHECK_IS_EXPR(v, Z3_FALSE);
CHECK_IS_EXPR(v, false);
if (!i) {
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
return Z3_FALSE;
return false;
}
int64_t l;
if (Z3_get_numeral_int64(c, v, &l) && l >= INT_MIN && l <= INT_MAX) {
*i = static_cast<int>(l);
return Z3_TRUE;
return true;
}
return Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_get_numeral_uint(Z3_context c, Z3_ast v, unsigned* u) {
@ -313,18 +313,18 @@ extern "C" {
// This function invokes Z3_get_numeral_uint64, but it is still ok to add LOG command here because it does not return a Z3 object.
LOG_Z3_get_numeral_uint(c, v, u);
RESET_ERROR_CODE();
CHECK_IS_EXPR(v, Z3_FALSE);
CHECK_IS_EXPR(v, false);
if (!u) {
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
return Z3_FALSE;
return false;
}
uint64_t l;
if (Z3_get_numeral_uint64(c, v, &l) && (l <= 0xFFFFFFFF)) {
*u = static_cast<unsigned>(l);
return Z3_TRUE;
return true;
}
return Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_get_numeral_uint64(Z3_context c, Z3_ast v, uint64_t* u) {
@ -332,20 +332,20 @@ extern "C" {
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
LOG_Z3_get_numeral_uint64(c, v, u);
RESET_ERROR_CODE();
CHECK_IS_EXPR(v, Z3_FALSE);
CHECK_IS_EXPR(v, false);
if (!u) {
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
return Z3_FALSE;
return false;
}
rational r;
Z3_bool ok = Z3_get_numeral_rational(c, v, r);
SASSERT(u);
if (ok == Z3_TRUE && r.is_uint64()) {
if (ok == true && r.is_uint64()) {
*u = r.get_uint64();
return ok;
}
return Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_get_numeral_int64(Z3_context c, Z3_ast v, int64_t* i) {
@ -353,19 +353,19 @@ extern "C" {
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
LOG_Z3_get_numeral_int64(c, v, i);
RESET_ERROR_CODE();
CHECK_IS_EXPR(v, Z3_FALSE);
CHECK_IS_EXPR(v, false);
if (!i) {
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
return Z3_FALSE;
return false;
}
rational r;
Z3_bool ok = Z3_get_numeral_rational(c, v, r);
if (ok == Z3_TRUE && r.is_int64()) {
if (ok == true && r.is_int64()) {
*i = r.get_int64();
return ok;
}
return Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_get_numeral_rational_int64(Z3_context c, Z3_ast v, int64_t* num, int64_t* den) {
@ -373,14 +373,14 @@ extern "C" {
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
LOG_Z3_get_numeral_rational_int64(c, v, num, den);
RESET_ERROR_CODE();
CHECK_IS_EXPR(v, Z3_FALSE);
CHECK_IS_EXPR(v, false);
if (!num || !den) {
SET_ERROR_CODE(Z3_INVALID_ARG, nullptr);
return Z3_FALSE;
return false;
}
rational r;
Z3_bool ok = Z3_get_numeral_rational(c, v, r);
if (ok != Z3_TRUE) {
if (ok != true) {
return ok;
}
rational n = numerator(r);
@ -390,8 +390,8 @@ extern "C" {
*den = d.get_int64();
return ok;
}
return Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return false;
Z3_CATCH_RETURN(false);
}
Z3_ast Z3_API Z3_mk_bv_numeral(Z3_context c, unsigned sz, Z3_bool const* bits) {

View file

@ -347,24 +347,24 @@ extern "C" {
Z3_TRY;
LOG_Z3_is_quantifier_forall(c, a);
RESET_ERROR_CODE();
return ::is_forall(to_ast(a)) ? Z3_TRUE : Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return ::is_forall(to_ast(a)) ? true : false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_is_quantifier_exists(Z3_context c, Z3_ast a) {
Z3_TRY;
LOG_Z3_is_quantifier_exists(c, a);
RESET_ERROR_CODE();
return ::is_exists(to_ast(a)) ? Z3_TRUE : Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return ::is_exists(to_ast(a)) ? true : false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_is_lambda(Z3_context c, Z3_ast a) {
Z3_TRY;
LOG_Z3_is_lambda(c, a);
RESET_ERROR_CODE();
return ::is_lambda(to_ast(a)) ? Z3_TRUE : Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return ::is_lambda(to_ast(a)) ? true : false;
Z3_CATCH_RETURN(false);
}

View file

@ -220,7 +220,7 @@ extern "C" {
RESET_ERROR_CODE();
reset_rcf_cancel(c);
return rcfm(c).lt(to_rcnumeral(a), to_rcnumeral(b));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_rcf_gt(Z3_context c, Z3_rcf_num a, Z3_rcf_num b) {
@ -229,7 +229,7 @@ extern "C" {
RESET_ERROR_CODE();
reset_rcf_cancel(c);
return rcfm(c).gt(to_rcnumeral(a), to_rcnumeral(b));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_rcf_le(Z3_context c, Z3_rcf_num a, Z3_rcf_num b) {
@ -238,7 +238,7 @@ extern "C" {
RESET_ERROR_CODE();
reset_rcf_cancel(c);
return rcfm(c).le(to_rcnumeral(a), to_rcnumeral(b));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_rcf_ge(Z3_context c, Z3_rcf_num a, Z3_rcf_num b) {
@ -247,7 +247,7 @@ extern "C" {
RESET_ERROR_CODE();
reset_rcf_cancel(c);
return rcfm(c).ge(to_rcnumeral(a), to_rcnumeral(b));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_rcf_eq(Z3_context c, Z3_rcf_num a, Z3_rcf_num b) {
@ -256,7 +256,7 @@ extern "C" {
RESET_ERROR_CODE();
reset_rcf_cancel(c);
return rcfm(c).eq(to_rcnumeral(a), to_rcnumeral(b));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_rcf_neq(Z3_context c, Z3_rcf_num a, Z3_rcf_num b) {
@ -265,7 +265,7 @@ extern "C" {
RESET_ERROR_CODE();
reset_rcf_cancel(c);
return rcfm(c).neq(to_rcnumeral(a), to_rcnumeral(b));
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
Z3_string Z3_API Z3_rcf_num_to_string(Z3_context c, Z3_rcf_num a, Z3_bool compact, Z3_bool html) {

View file

@ -70,8 +70,8 @@ extern "C" {
LOG_Z3_is_seq_sort(c, s);
RESET_ERROR_CODE();
bool result = mk_c(c)->sutil().is_seq(to_sort(s));
return result?Z3_TRUE:Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return result?true:false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_is_re_sort(Z3_context c, Z3_sort s) {
@ -79,8 +79,8 @@ extern "C" {
LOG_Z3_is_re_sort(c, s);
RESET_ERROR_CODE();
bool result = mk_c(c)->sutil().is_re(to_sort(s));
return result?Z3_TRUE:Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return result?true:false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_is_string_sort(Z3_context c, Z3_sort s) {
@ -88,8 +88,8 @@ extern "C" {
LOG_Z3_is_string_sort(c, s);
RESET_ERROR_CODE();
bool result = mk_c(c)->sutil().is_string(to_sort(s));
return result?Z3_TRUE:Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return result?true:false;
Z3_CATCH_RETURN(false);
}
Z3_bool Z3_API Z3_is_string(Z3_context c, Z3_ast s) {
@ -97,8 +97,8 @@ extern "C" {
LOG_Z3_is_string(c, s);
RESET_ERROR_CODE();
bool result = mk_c(c)->sutil().str.is_string(to_expr(s));
return result?Z3_TRUE:Z3_FALSE;
Z3_CATCH_RETURN(Z3_FALSE);
return result?true:false;
Z3_CATCH_RETURN(false);
}
Z3_string Z3_API Z3_get_string(Z3_context c, Z3_ast s) {

View file

@ -80,7 +80,7 @@ extern "C" {
RESET_ERROR_CODE();
if (idx >= to_stats_ref(s).size()) {
SET_ERROR_CODE(Z3_IOB, nullptr);
return Z3_FALSE;
return false;
}
return to_stats_ref(s).is_uint(idx);
Z3_CATCH_RETURN(0);
@ -92,10 +92,10 @@ extern "C" {
RESET_ERROR_CODE();
if (idx >= to_stats_ref(s).size()) {
SET_ERROR_CODE(Z3_IOB, nullptr);
return Z3_FALSE;
return false;
}
return !to_stats_ref(s).is_uint(idx);
Z3_CATCH_RETURN(Z3_FALSE);
Z3_CATCH_RETURN(false);
}
unsigned Z3_API Z3_stats_get_uint_value(Z3_context c, Z3_stats s, unsigned idx) {

View file

@ -2038,7 +2038,7 @@ namespace z3 {
Z3_ast r = 0;
Z3_bool status = Z3_model_eval(ctx(), m_model, n, model_completion, &r);
check_error();
if (status == Z3_FALSE && ctx().enable_exceptions())
if (status == false && ctx().enable_exceptions())
Z3_THROW(exception("failed to evaluate expression"));
return expr(ctx(), r);
}

View file

@ -31,7 +31,7 @@ extern "C" {
/** @name Algebraic Numbers */
/*@{*/
/**
\brief Return Z3_TRUE if \c a can be used as value in the Z3 real algebraic
\brief Return \c true if \c a can be used as value in the Z3 real algebraic
number package.
def_API('Z3_algebraic_is_value', BOOL, (_in(CONTEXT), _in(AST)))
@ -39,7 +39,7 @@ extern "C" {
Z3_bool Z3_API Z3_algebraic_is_value(Z3_context c, Z3_ast a);
/**
\brief Return the Z3_TRUE if \c a is positive, and Z3_FALSE otherwise.
\brief Return \c true if \c a is positive, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
@ -48,7 +48,7 @@ extern "C" {
Z3_bool Z3_API Z3_algebraic_is_pos(Z3_context c, Z3_ast a);
/**
\brief Return the Z3_TRUE if \c a is negative, and Z3_FALSE otherwise.
\brief Return \c true if \c a is negative, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
@ -57,7 +57,7 @@ extern "C" {
Z3_bool Z3_API Z3_algebraic_is_neg(Z3_context c, Z3_ast a);
/**
\brief Return the Z3_TRUE if \c a is zero, and Z3_FALSE otherwise.
\brief Return \c true if \c a is zero, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
@ -141,7 +141,7 @@ extern "C" {
Z3_ast Z3_API Z3_algebraic_power(Z3_context c, Z3_ast a, unsigned k);
/**
\brief Return Z3_TRUE if a < b, and Z3_FALSE otherwise.
\brief Return \c true if a < b, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
\pre Z3_algebraic_is_value(c, b)
@ -151,7 +151,7 @@ extern "C" {
Z3_bool Z3_API Z3_algebraic_lt(Z3_context c, Z3_ast a, Z3_ast b);
/**
\brief Return Z3_TRUE if a > b, and Z3_FALSE otherwise.
\brief Return \c true if a > b, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
\pre Z3_algebraic_is_value(c, b)
@ -161,7 +161,7 @@ extern "C" {
Z3_bool Z3_API Z3_algebraic_gt(Z3_context c, Z3_ast a, Z3_ast b);
/**
\brief Return Z3_TRUE if a <= b, and Z3_FALSE otherwise.
\brief Return \c true if a <= b, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
\pre Z3_algebraic_is_value(c, b)
@ -171,7 +171,7 @@ extern "C" {
Z3_bool Z3_API Z3_algebraic_le(Z3_context c, Z3_ast a, Z3_ast b);
/**
\brief Return Z3_TRUE if a >= b, and Z3_FALSE otherwise.
\brief Return \c true if a >= b, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
\pre Z3_algebraic_is_value(c, b)
@ -181,7 +181,7 @@ extern "C" {
Z3_bool Z3_API Z3_algebraic_ge(Z3_context c, Z3_ast a, Z3_ast b);
/**
\brief Return Z3_TRUE if a == b, and Z3_FALSE otherwise.
\brief Return \c true if a == b, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
\pre Z3_algebraic_is_value(c, b)
@ -191,7 +191,7 @@ extern "C" {
Z3_bool Z3_API Z3_algebraic_eq(Z3_context c, Z3_ast a, Z3_ast b);
/**
\brief Return Z3_TRUE if a != b, and Z3_FALSE otherwise.
\brief Return \c true if a != b, and \c false otherwise.
\pre Z3_algebraic_is_value(c, a)
\pre Z3_algebraic_is_value(c, b)

View file

@ -1435,7 +1435,7 @@ extern "C" {
/**
\brief Get a global (or module) parameter.
Returns \c Z3_FALSE if the parameter value does not exist.
Returns \c false if the parameter value does not exist.
\sa Z3_global_param_set
@ -3953,7 +3953,7 @@ extern "C" {
unsigned Z3_API Z3_get_bv_sort_size(Z3_context c, Z3_sort t);
/**
\brief Store the size of the sort in \c r. Return Z3_FALSE if the call failed.
\brief Store the size of the sort in \c r. Return \c false if the call failed.
That is, Z3_get_sort_kind(s) == Z3_FINITE_DOMAIN_SORT
def_API('Z3_get_finite_domain_sort_size', BOOL, (_in(CONTEXT), _in(SORT), _out(UINT64)))
@ -4518,7 +4518,7 @@ extern "C" {
\param num numerator.
\param den denominator.
Return \c Z3_TRUE if the numeral value fits in 64 bit numerals, \c Z3_FALSE otherwise.
Return \c true if the numeral value fits in 64 bit numerals, \c false otherwise.
\pre Z3_get_ast_kind(a) == Z3_NUMERAL_AST
@ -4528,7 +4528,7 @@ extern "C" {
/**
\brief Similar to #Z3_get_numeral_string, but only succeeds if
the value can fit in a machine int. Return Z3_TRUE if the call succeeded.
the value can fit in a machine int. Return \c true if the call succeeded.
\pre Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
@ -4540,7 +4540,7 @@ extern "C" {
/**
\brief Similar to #Z3_get_numeral_string, but only succeeds if
the value can fit in a machine unsigned int. Return Z3_TRUE if the call succeeded.
the value can fit in a machine unsigned int. Return \c true if the call succeeded.
\pre Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
@ -4552,7 +4552,7 @@ extern "C" {
/**
\brief Similar to #Z3_get_numeral_string, but only succeeds if
the value can fit in a machine \c uint64_t int. Return Z3_TRUE if the call succeeded.
the value can fit in a machine \c uint64_t int. Return \c true if the call succeeded.
\pre Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
@ -4564,7 +4564,7 @@ extern "C" {
/**
\brief Similar to #Z3_get_numeral_string, but only succeeds if
the value can fit in a machine \c int64_t int. Return Z3_TRUE if the call succeeded.
the value can fit in a machine \c int64_t int. Return \c true if the call succeeded.
\pre Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
@ -4576,7 +4576,7 @@ extern "C" {
/**
\brief Similar to #Z3_get_numeral_string, but only succeeds if
the value can fit as a rational number as machine \c int64_t int. Return Z3_TRUE if the call succeeded.
the value can fit as a rational number as machine \c int64_t int. Return \c true if the call succeeded.
\pre Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST
@ -4853,12 +4853,12 @@ extern "C" {
/**
\brief Evaluate the AST node \c t in the given model.
Return \c Z3_TRUE if succeeded, and store the result in \c v.
Return \c true if succeeded, and store the result in \c v.
If \c model_completion is Z3_TRUE, then Z3 will assign an interpretation for any constant or function that does
If \c model_completion is \c true, then Z3 will assign an interpretation for any constant or function that does
not have an interpretation in \c m. These constants and functions were essentially don't cares.
If \c model_completion is Z3_FALSE, then Z3 will not assign interpretations to constants for functions that do
If \c model_completion is \c false, then Z3 will not assign interpretations to constants for functions that do
not have interpretations in \c m. Evaluation behaves as the identify function in this case.
The evaluation may fail for the following reasons:
@ -4995,7 +4995,7 @@ extern "C" {
/**
\brief The \ccode{(_ as-array f)} AST node is a construct for assigning interpretations for arrays in Z3.
It is the array such that forall indices \c i we have that \ccode{(select (_ as-array f) i)} is equal to \ccode{(f i)}.
This procedure returns Z3_TRUE if the \c a is an \c as-array AST node.
This procedure returns \c true if the \c a is an \c as-array AST node.
Z3 current solvers have minimal support for \c as_array nodes.
@ -6370,7 +6370,7 @@ extern "C" {
Z3_string Z3_API Z3_stats_get_key(Z3_context c, Z3_stats s, unsigned idx);
/**
\brief Return Z3_TRUE if the given statistical data is a unsigned integer.
\brief Return \c true if the given statistical data is a unsigned integer.
\pre idx < Z3_stats_size(c, s)
@ -6379,7 +6379,7 @@ extern "C" {
Z3_bool Z3_API Z3_stats_is_uint(Z3_context c, Z3_stats s, unsigned idx);
/**
\brief Return Z3_TRUE if the given statistical data is a double.
\brief Return \c true if the given statistical data is a double.
\pre idx < Z3_stats_size(c, s)

View file

@ -134,42 +134,42 @@ extern "C" {
Z3_rcf_num Z3_API Z3_rcf_power(Z3_context c, Z3_rcf_num a, unsigned k);
/**
\brief Return Z3_TRUE if a < b
\brief Return \c true if a < b
def_API('Z3_rcf_lt', BOOL, (_in(CONTEXT), _in(RCF_NUM), _in(RCF_NUM)))
*/
Z3_bool Z3_API Z3_rcf_lt(Z3_context c, Z3_rcf_num a, Z3_rcf_num b);
/**
\brief Return Z3_TRUE if a > b
\brief Return \c true if a > b
def_API('Z3_rcf_gt', BOOL, (_in(CONTEXT), _in(RCF_NUM), _in(RCF_NUM)))
*/
Z3_bool Z3_API Z3_rcf_gt(Z3_context c, Z3_rcf_num a, Z3_rcf_num b);
/**
\brief Return Z3_TRUE if a <= b
\brief Return \c true if a <= b
def_API('Z3_rcf_le', BOOL, (_in(CONTEXT), _in(RCF_NUM), _in(RCF_NUM)))
*/
Z3_bool Z3_API Z3_rcf_le(Z3_context c, Z3_rcf_num a, Z3_rcf_num b);
/**
\brief Return Z3_TRUE if a >= b
\brief Return \c true if a >= b
def_API('Z3_rcf_ge', BOOL, (_in(CONTEXT), _in(RCF_NUM), _in(RCF_NUM)))
*/
Z3_bool Z3_API Z3_rcf_ge(Z3_context c, Z3_rcf_num a, Z3_rcf_num b);
/**
\brief Return Z3_TRUE if a == b
\brief Return \c true if a == b
def_API('Z3_rcf_eq', BOOL, (_in(CONTEXT), _in(RCF_NUM), _in(RCF_NUM)))
*/
Z3_bool Z3_API Z3_rcf_eq(Z3_context c, Z3_rcf_num a, Z3_rcf_num b);
/**
\brief Return Z3_TRUE if a != b
\brief Return \c true if a != b
def_API('Z3_rcf_neq', BOOL, (_in(CONTEXT), _in(RCF_NUM), _in(RCF_NUM)))
*/

View file

@ -10608,7 +10608,6 @@ namespace smt {
std::map<expr*, std::map<expr*, int> > var_eq_concat_map;
int conflictInDep = ctx_dep_analysis(varAppearInAssign, freeVar_map, unrollGroup_map, var_eq_concat_map);
if (conflictInDep == -1) {
// return Z3_TRUE;
return FC_DONE;
}

View file

@ -662,7 +662,7 @@ void test_equiv(Equivalence_params params, unsigned bvsize, bool is_signed) {
// Z3_solver_assert(ctx, s, Z3_mk_eq(ctx, t2, Z3_mk_numeral(ctx, "1", bv)));
// //TEST_NO_UNDERFLOW;
// Z3_solver_assert(ctx, s, test_udfl);
// ENSURE(Z3_check(ctx) == Z3_TRUE);
// ENSURE(Z3_check(ctx) == true);
// Z3_solver_pop(ctx, s, 1);
//
// Z3_del_config(cfg);