mirror of
https://github.com/Z3Prover/z3
synced 2025-05-10 09:15:47 +00:00
Use nullptr.
This commit is contained in:
parent
f01328c65f
commit
76eb7b9ede
625 changed files with 4639 additions and 4639 deletions
|
@ -51,13 +51,13 @@ extern "C" {
|
|||
LOG_Z3_mk_tactic(c, name);
|
||||
RESET_ERROR_CODE();
|
||||
tactic_cmd * t = mk_c(c)->find_tactic_cmd(symbol(name));
|
||||
if (t == 0) {
|
||||
if (t == nullptr) {
|
||||
SET_ERROR_CODE(Z3_INVALID_ARG);
|
||||
RETURN_Z3(0);
|
||||
RETURN_Z3(nullptr);
|
||||
}
|
||||
tactic * new_t = t->mk(mk_c(c)->m());
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
void Z3_API Z3_tactic_inc_ref(Z3_context c, Z3_tactic t) {
|
||||
|
@ -81,13 +81,13 @@ extern "C" {
|
|||
LOG_Z3_mk_probe(c, name);
|
||||
RESET_ERROR_CODE();
|
||||
probe_info * p = mk_c(c)->find_probe(symbol(name));
|
||||
if (p == 0) {
|
||||
if (p == nullptr) {
|
||||
SET_ERROR_CODE(Z3_INVALID_ARG);
|
||||
RETURN_Z3(0);
|
||||
RETURN_Z3(nullptr);
|
||||
}
|
||||
probe * new_p = p->get();
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
void Z3_API Z3_probe_inc_ref(Z3_context c, Z3_probe p) {
|
||||
|
@ -112,7 +112,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = and_then(to_tactic_ref(t1), to_tactic_ref(t2));
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_or_else(Z3_context c, Z3_tactic t1, Z3_tactic t2) {
|
||||
|
@ -121,7 +121,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = or_else(to_tactic_ref(t1), to_tactic_ref(t2));
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_par_or(Z3_context c, unsigned num, Z3_tactic const ts[]) {
|
||||
|
@ -134,7 +134,7 @@ extern "C" {
|
|||
}
|
||||
tactic * new_t = par(num, _ts.c_ptr());
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_par_and_then(Z3_context c, Z3_tactic t1, Z3_tactic t2) {
|
||||
|
@ -143,7 +143,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = par_and_then(to_tactic_ref(t1), to_tactic_ref(t2));
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_try_for(Z3_context c, Z3_tactic t, unsigned ms) {
|
||||
|
@ -152,7 +152,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = try_for(to_tactic_ref(t), ms);
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_when(Z3_context c, Z3_probe p, Z3_tactic t) {
|
||||
|
@ -161,7 +161,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = when(to_probe_ref(p), to_tactic_ref(t));
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_cond(Z3_context c, Z3_probe p, Z3_tactic t1, Z3_tactic t2) {
|
||||
|
@ -170,7 +170,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = cond(to_probe_ref(p), to_tactic_ref(t1), to_tactic_ref(t2));
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_repeat(Z3_context c, Z3_tactic t, unsigned max) {
|
||||
|
@ -179,7 +179,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = repeat(to_tactic_ref(t), max);
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_skip(Z3_context c) {
|
||||
|
@ -188,7 +188,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = mk_skip_tactic();
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_fail(Z3_context c) {
|
||||
|
@ -197,7 +197,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = mk_fail_tactic();
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_fail_if(Z3_context c, Z3_probe p) {
|
||||
|
@ -206,7 +206,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = fail_if(to_probe_ref(p));
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_fail_if_not_decided(Z3_context c) {
|
||||
|
@ -215,7 +215,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
tactic * new_t = mk_fail_if_undecided_tactic();
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_tactic Z3_API Z3_tactic_using_params(Z3_context c, Z3_tactic t, Z3_params p) {
|
||||
|
@ -227,7 +227,7 @@ extern "C" {
|
|||
to_param_ref(p).validate(r);
|
||||
tactic * new_t = using_params(to_tactic_ref(t), to_param_ref(p));
|
||||
RETURN_TACTIC(new_t);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_const(Z3_context c, double val) {
|
||||
|
@ -236,7 +236,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_const_probe(val);
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_lt(Z3_context c, Z3_probe p1, Z3_probe p2) {
|
||||
|
@ -245,7 +245,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_lt(to_probe_ref(p1), to_probe_ref(p2));
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_gt(Z3_context c, Z3_probe p1, Z3_probe p2) {
|
||||
|
@ -254,7 +254,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_gt(to_probe_ref(p1), to_probe_ref(p2));
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_le(Z3_context c, Z3_probe p1, Z3_probe p2) {
|
||||
|
@ -263,7 +263,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_le(to_probe_ref(p1), to_probe_ref(p2));
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_ge(Z3_context c, Z3_probe p1, Z3_probe p2) {
|
||||
|
@ -272,7 +272,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_ge(to_probe_ref(p1), to_probe_ref(p2));
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_eq(Z3_context c, Z3_probe p1, Z3_probe p2) {
|
||||
|
@ -281,7 +281,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_eq(to_probe_ref(p1), to_probe_ref(p2));
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_and(Z3_context c, Z3_probe p1, Z3_probe p2) {
|
||||
|
@ -290,7 +290,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_and(to_probe_ref(p1), to_probe_ref(p2));
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_or(Z3_context c, Z3_probe p1, Z3_probe p2) {
|
||||
|
@ -299,7 +299,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_or(to_probe_ref(p1), to_probe_ref(p2));
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_probe Z3_API Z3_probe_not(Z3_context c, Z3_probe p) {
|
||||
|
@ -308,7 +308,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
probe * new_p = mk_not(to_probe_ref(p));
|
||||
RETURN_PROBE(new_p);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
unsigned Z3_API Z3_get_num_tactics(Z3_context c) {
|
||||
|
@ -372,7 +372,7 @@ extern "C" {
|
|||
to_tactic_ref(t)->collect_param_descrs(d->m_descrs);
|
||||
Z3_param_descrs r = of_param_descrs(d);
|
||||
RETURN_Z3(r);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_string Z3_API Z3_tactic_get_descr(Z3_context c, Z3_string name) {
|
||||
|
@ -380,7 +380,7 @@ extern "C" {
|
|||
LOG_Z3_tactic_get_descr(c, name);
|
||||
RESET_ERROR_CODE();
|
||||
tactic_cmd * t = mk_c(c)->find_tactic_cmd(symbol(name));
|
||||
if (t == 0) {
|
||||
if (t == nullptr) {
|
||||
SET_ERROR_CODE(Z3_INVALID_ARG);
|
||||
return "";
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ extern "C" {
|
|||
LOG_Z3_probe_get_descr(c, name);
|
||||
RESET_ERROR_CODE();
|
||||
probe_info * p = mk_c(c)->find_probe(symbol(name));
|
||||
if (p == 0) {
|
||||
if (p == nullptr) {
|
||||
SET_ERROR_CODE(Z3_INVALID_ARG);
|
||||
return "";
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ extern "C" {
|
|||
}
|
||||
catch (z3_exception & ex) {
|
||||
mk_c(c)->handle_exception(ex);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ extern "C" {
|
|||
params_ref p;
|
||||
Z3_apply_result r = _tactic_apply(c, t, g, p);
|
||||
RETURN_Z3(r);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_apply_result Z3_API Z3_tactic_apply_ex(Z3_context c, Z3_tactic t, Z3_goal g, Z3_params p) {
|
||||
|
@ -455,7 +455,7 @@ extern "C" {
|
|||
to_param_ref(p).validate(pd);
|
||||
Z3_apply_result r = _tactic_apply(c, t, g, to_param_ref(p));
|
||||
RETURN_Z3(r);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
void Z3_API Z3_apply_result_inc_ref(Z3_context c, Z3_apply_result r) {
|
||||
|
@ -503,14 +503,14 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
if (i > to_apply_result(r)->m_subgoals.size()) {
|
||||
SET_ERROR_CODE(Z3_IOB);
|
||||
RETURN_Z3(0);
|
||||
RETURN_Z3(nullptr);
|
||||
}
|
||||
Z3_goal_ref * g = alloc(Z3_goal_ref, *mk_c(c));
|
||||
g->m_goal = to_apply_result(r)->m_subgoals[i];
|
||||
mk_c(c)->save_object(g);
|
||||
Z3_goal result = of_goal(g);
|
||||
RETURN_Z3(result);
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
Z3_model Z3_API Z3_apply_result_convert_model(Z3_context c, Z3_apply_result r, unsigned i, Z3_model m) {
|
||||
|
@ -519,7 +519,7 @@ extern "C" {
|
|||
RESET_ERROR_CODE();
|
||||
if (i > to_apply_result(r)->m_subgoals.size()) {
|
||||
SET_ERROR_CODE(Z3_IOB);
|
||||
RETURN_Z3(0);
|
||||
RETURN_Z3(nullptr);
|
||||
}
|
||||
model_ref new_m = to_model_ref(m)->copy();
|
||||
if (to_apply_result(r)->m_mc)
|
||||
|
@ -528,7 +528,7 @@ extern "C" {
|
|||
m_ref->m_model = new_m;
|
||||
mk_c(c)->save_object(m_ref);
|
||||
RETURN_Z3(of_model(m_ref));
|
||||
Z3_CATCH_RETURN(0);
|
||||
Z3_CATCH_RETURN(nullptr);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue