3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-15 07:15:26 +00:00

Use nullptr.

This commit is contained in:
Bruce Mitchener 2018-02-12 14:05:55 +07:00
parent f01328c65f
commit 76eb7b9ede
625 changed files with 4639 additions and 4639 deletions

View file

@ -115,7 +115,7 @@ class add_bounds_tactic : public tactic {
model_converter_ref & mc,
proof_converter_ref & pc,
expr_dependency_ref & core) {
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
tactic_report report("add-bounds", *g);
bound_manager bm(m);
expr_fast_mark1 visited;

View file

@ -50,7 +50,7 @@ struct arith_bounds_tactic : public tactic {
void mk_proof(proof_ref& pr, goal_ref const& s, unsigned i, unsigned j) {
if (s->proofs_enabled()) {
proof* th_lemma = m.mk_th_lemma(a.get_family_id(), m.mk_implies(s->form(i), s->form(j)), 0, 0);
proof* th_lemma = m.mk_th_lemma(a.get_family_id(), m.mk_implies(s->form(i), s->form(j)), 0, nullptr);
pr = m.mk_modus_ponens(s->pr(i), th_lemma);
}
}

View file

@ -201,22 +201,22 @@ bool bound_manager::is_disjunctive_bound(expr * f, expr_dependency * d) {
if (!m().is_or(f)) return false;
unsigned sz = to_app(f)->get_num_args();
if (sz == 0) return false;
expr * x, * y, * v = 0;
expr * x, * y, * v = nullptr;
bool is_int;
for (unsigned i = 0; i < sz; ++i) {
expr * e = to_app(f)->get_arg(i);
if (!m().is_eq(e, x, y)) return false;
if (is_uninterp_const(x) &&
is_numeral(y, n, is_int) && is_int &&
(x == v || v == 0)) {
if (v == 0) { v = x; lo = hi = n; }
(x == v || v == nullptr)) {
if (v == nullptr) { v = x; lo = hi = n; }
if (n < lo) lo = n;
if (n > hi) hi = n;
}
else if (is_uninterp_const(y) &&
is_numeral(x, n, is_int) && is_int &&
(y == v || v == 0)) {
if (v == 0) { v = y; lo = hi = n; }
(y == v || v == nullptr)) {
if (v == nullptr) { v = y; lo = hi = n; }
if (n < lo) lo = n;
if (n > hi) hi = n;
}

View file

@ -50,7 +50,7 @@ public:
ast_manager & m() const { return m_util.get_manager(); }
void operator()(goal const & g);
void operator()(expr * n, expr_dependency * d = 0);
void operator()(expr * n, expr_dependency * d = nullptr);
bool has_lower(expr * c, numeral & v, bool & strict) const {
limit l;
@ -76,14 +76,14 @@ public:
expr_dependency * d;
if (m_lower_deps.find(c, d))
return d;
return 0;
return nullptr;
}
expr_dependency * upper_dep(expr * c) const {
expr_dependency * d;
if (m_upper_deps.find(c, d))
return d;
return 0;
return nullptr;
}
bool has_lower(expr * c) const {

View file

@ -182,7 +182,7 @@ void bound_propagator::mk_eq(unsigned sz, mpz * as, var * xs) {
}
void bound_propagator::init_eq(linear_equation * eq) {
if (eq == 0)
if (eq == nullptr)
return;
unsigned c_idx = m_constraints.size();
m_constraints.push_back(constraint());
@ -383,7 +383,7 @@ bool bound_propagator::relevant_bound(var x, double new_k) const {
if (LOWER && has_lower(x)) tout << "old: " << m.to_string(m_lowers[x]->m_k) << " | " << m_lowers[x]->m_approx_k << "\n";
if (!LOWER && has_upper(x)) tout << "old: " << m.to_string(m_uppers[x]->m_k) << " | " << m_uppers[x]->m_approx_k << "\n";);
bound * b = LOWER ? m_lowers[x] : m_uppers[x];
if (b == 0)
if (b == nullptr)
return true; // variable did not have a bound
double interval_size;
@ -537,7 +537,7 @@ bool bound_propagator::propagate_eq(unsigned c_idx) {
bound * u_i = m_uppers[x_i];
if (a_i < 0.0) {
if (!ll_failed) {
if (l_i == 0) {
if (l_i == nullptr) {
if (ll_i == UINT_MAX)
ll_i = i;
else
@ -549,7 +549,7 @@ bool bound_propagator::propagate_eq(unsigned c_idx) {
}
if (!uu_failed) {
if (u_i == 0) {
if (u_i == nullptr) {
if (uu_i == UINT_MAX)
uu_i = i;
else
@ -562,7 +562,7 @@ bool bound_propagator::propagate_eq(unsigned c_idx) {
}
else {
if (!ll_failed) {
if (u_i == 0) {
if (u_i == nullptr) {
if (ll_i == UINT_MAX)
ll_i = i;
else
@ -574,7 +574,7 @@ bool bound_propagator::propagate_eq(unsigned c_idx) {
}
if (!uu_failed) {
if (l_i == 0) {
if (l_i == nullptr) {
if (uu_i == UINT_MAX)
uu_i = i;
else
@ -780,7 +780,7 @@ bool bound_propagator::upper(var x, mpq & k, bool & strict, unsigned & ts) const
bound_propagator::bound * bound_propagator::bound::at(unsigned timestamp) {
bound * r = this;
while (r != 0 && r->m_timestamp >= timestamp)
while (r != nullptr && r->m_timestamp >= timestamp)
r = r->m_prev;
return r;
}

View file

@ -38,7 +38,7 @@ void bv2int_rewriter_ctx::collect_power2(goal const& s) {
expr* f = s.form(j);
if (!m.is_or(f)) continue;
unsigned sz = to_app(f)->get_num_args();
expr* x, *y, *v = 0;
expr* x, *y, *v = nullptr;
rational n;
vector<rational> bounds;
bool is_int, ok = true;
@ -50,12 +50,12 @@ void bv2int_rewriter_ctx::collect_power2(goal const& s) {
break;
}
if (arith.is_numeral(y, n, is_int) && is_int &&
(x == v || v == 0)) {
(x == v || v == nullptr)) {
v = x;
bounds.push_back(n);
}
else if (arith.is_numeral(x, n, is_int) && is_int &&
(y == v || v == 0)) {
(y == v || v == nullptr)) {
v = y;
bounds.push_back(n);
}

View file

@ -103,7 +103,7 @@ struct bv2int_rewriter_cfg : public default_rewriter_cfg {
bool rewrite_patterns() const { return false; }
bool flat_assoc(func_decl * f) const { return false; }
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
return m_r.mk_app_core(f, num, args, result);
}
bv2int_rewriter_cfg(ast_manager & m, bv2int_rewriter_ctx& ctx):m_r(m, ctx) {}

View file

@ -181,7 +181,7 @@ struct bv2real_rewriter_cfg : public default_rewriter_cfg {
bool rewrite_patterns() const { return false; }
bool flat_assoc(func_decl * f) const { return false; }
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
return m_r.mk_app_core(f, num, args, result);
}
bv2real_rewriter_cfg(ast_manager & m, bv2real_util& u):m_r(m, u) {}
@ -216,7 +216,7 @@ struct bv2real_elim_rewriter_cfg : public default_rewriter_cfg {
bool rewrite_patterns() const { return false; }
bool flat_assoc(func_decl * f) const { return false; }
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
return m_r.mk_app_core(f, num, args, result);
}
bv2real_elim_rewriter_cfg(bv2real_util& u):m_r(u) {}

View file

@ -58,7 +58,7 @@ public:
expr_dependency_ref & core) override {
TRACE("card2bv-before", g->display(tout););
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
tactic_report report("card2bv", *g);
th_rewriter rw1(m, m_params);
pb2bv_rewriter rw2(m, m_params);

View file

@ -79,7 +79,7 @@ namespace pb {
bool rewrite_patterns() const { return false; }
bool flat_assoc(func_decl * f) const { return false; }
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
return m_r.mk_app_core(f, num, args, result);
}
card2bv_rewriter_cfg(ast_manager & m):m_r(m) {}

View file

@ -94,7 +94,7 @@ class degree_shift_tactic : public tactic {
m_autil(_m),
m_pinned(_m),
m_one(1),
m_rw(0) {
m_rw(nullptr) {
}
@ -205,8 +205,8 @@ class degree_shift_tactic : public tactic {
void prepare_substitution(model_converter_ref & mc) {
SASSERT(!m_var2degree.empty());
filter_model_converter * fmc = 0;
extension_model_converter * xmc = 0;
filter_model_converter * fmc = nullptr;
extension_model_converter * xmc = nullptr;
if (m_produce_models) {
fmc = alloc(filter_model_converter, m);
xmc = alloc(extension_model_converter, m);
@ -217,7 +217,7 @@ class degree_shift_tactic : public tactic {
for (; it != end; ++it) {
SASSERT(it->m_value.is_int());
SASSERT(it->m_value >= rational(2));
app * fresh = m.mk_fresh_const(0, it->m_key->get_decl()->get_range());
app * fresh = m.mk_fresh_const(nullptr, it->m_key->get_decl()->get_range());
m_pinned.push_back(fresh);
m_var2var.insert(it->m_key, fresh);
if (m_produce_models) {
@ -241,7 +241,7 @@ class degree_shift_tactic : public tactic {
proof_converter_ref & pc,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
m_produce_proofs = g->proofs_enabled();
m_produce_models = g->models_enabled();
tactic_report report("degree_shift", *g);
@ -275,12 +275,12 @@ class degree_shift_tactic : public tactic {
if (it->m_value.is_even()) {
app * new_var = m_var2var.find(it->m_key);
app * new_c = m_autil.mk_ge(new_var, m_autil.mk_numeral(rational(0), false));
proof * new_pr = 0;
proof * new_pr = nullptr;
if (m_produce_proofs) {
proof * pr = m_var2pr.find(it->m_key);
new_pr = m.mk_th_lemma(m_autil.get_family_id(), new_c, 1, &pr);
}
g->assert_expr(new_c, new_pr, 0);
g->assert_expr(new_c, new_pr, nullptr);
}
}
}

View file

@ -319,7 +319,7 @@ class diff_neq_tactic : public tactic {
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted());
m_produce_models = g->models_enabled();
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
tactic_report report("diff-neq", *g);
fail_if_proof_generation("diff-neq", g);
fail_if_unsat_core_generation("diff-neq", g);

View file

@ -153,7 +153,7 @@ public:
proof_converter_ref & pc,
expr_dependency_ref & core) override {
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
tactic_report report("elim01", *g);

View file

@ -59,7 +59,7 @@ class eq2bv_tactic : public tactic {
bool rewrite_patterns() const { return false; }
bool flat_assoc(func_decl * f) const { return false; }
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
return mk_app_core(f, num, args, result);
}
eq_rewriter_cfg(eq2bv_tactic& t):m(t.m), t(t) {}
@ -149,7 +149,7 @@ public:
proof_converter_ref & pc,
expr_dependency_ref & core) override {
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
m_trail.reset();
m_fd.reset();
m_max.reset();
@ -175,7 +175,7 @@ public:
expr_ref new_curr(m);
proof_ref new_pr(m);
if (is_bound(g->form(i))) {
g->update(i, m.mk_true(), 0, 0);
g->update(i, m.mk_true(), nullptr, nullptr);
continue;
}
m_rw(g->form(i), new_curr, new_pr);

View file

@ -262,7 +262,7 @@ class factor_tactic : public tactic {
proof_converter_ref & pc,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
tactic_report report("factor", *g);
bool produce_proofs = g->proofs_enabled();

View file

@ -44,7 +44,7 @@ class fix_dl_var_tactic : public tactic {
m_util(u) {
}
void throw_failed(expr * ctx1, expr * ctx2 = 0) {
void throw_failed(expr * ctx1, expr * ctx2 = nullptr) {
TRACE("fix_dl_var", tout << mk_ismt2_pp(ctx1, m) << "\n"; if (ctx2) tout << mk_ismt2_pp(ctx2, m) << "\n";);
throw failed();
}
@ -178,7 +178,7 @@ class fix_dl_var_tactic : public tactic {
}
app * most_occs(obj_map<app, unsigned> & occs, unsigned & best) {
app * r = 0;
app * r = nullptr;
best = 0;
obj_map<app, unsigned>::iterator it = occs.begin();
obj_map<app, unsigned>::iterator end = occs.end();
@ -227,7 +227,7 @@ class fix_dl_var_tactic : public tactic {
return most_occs();
}
catch (failed) {
return 0;
return nullptr;
}
}
};
@ -254,13 +254,13 @@ class fix_dl_var_tactic : public tactic {
proof_converter_ref & pc,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
tactic_report report("fix-dl-var", *g);
bool produce_proofs = g->proofs_enabled();
m_produce_models = g->models_enabled();
app * var = is_target(u)(*g);
if (var != 0) {
if (var != nullptr) {
IF_VERBOSE(TACTIC_VERBOSITY_LVL, verbose_stream() << "(fixing-at-zero " << var->get_decl()->get_name() << ")\n";);
tactic_report report("fix-dl-var", *g);

View file

@ -54,7 +54,7 @@ class fm_tactic : public tactic {
bool is_false(model_ref & md, app * p) {
SASSERT(is_uninterp_const(p));
expr * val = md->get_const_interp(p->get_decl());
if (val == 0) {
if (val == nullptr) {
// if it is don't care, then set to false
md->register_decl(p->get_decl(), m.mk_false());
return true;
@ -828,7 +828,7 @@ class fm_tactic : public tactic {
reset_constraints();
m_bvar2expr.reset();
m_bvar2sign.reset();
m_bvar2expr.push_back(0); // bvar 0 is not used
m_bvar2expr.push_back(nullptr); // bvar 0 is not used
m_bvar2sign.push_back(0);
m_expr2var.reset();
m_is_int.reset();
@ -838,11 +838,11 @@ class fm_tactic : public tactic {
m_expr2var.reset();
m_lowers.reset();
m_uppers.reset();
m_new_goal = 0;
m_mc = 0;
m_new_goal = nullptr;
m_mc = nullptr;
m_counter = 0;
m_inconsistent = false;
m_inconsistent_core = 0;
m_inconsistent_core = nullptr;
init_forbidden_set(g);
}
@ -878,7 +878,7 @@ class fm_tactic : public tactic {
// 0 <= 0 -- > true
if (c.m_c.is_pos() || (!c.m_strict && c.m_c.is_zero()))
return m.mk_true();
ineq = 0;
ineq = nullptr;
}
else {
bool int_cnstr = all_int(c);
@ -1115,7 +1115,7 @@ class fm_tactic : public tactic {
}
else {
TRACE("add_constraint_bug", tout << "all variables are forbidden "; display(tout, *c); tout << "\n";);
m_new_goal->assert_expr(to_expr(*c), 0, c->m_dep);
m_new_goal->assert_expr(to_expr(*c), nullptr, c->m_dep);
del_constraint(c);
return false;
}
@ -1130,7 +1130,7 @@ class fm_tactic : public tactic {
if (is_occ(f))
add_constraint(f, g.dep(i));
else
m_new_goal->assert_expr(f, 0, g.dep(i));
m_new_goal->assert_expr(f, nullptr, g.dep(i));
}
}
@ -1367,7 +1367,7 @@ class fm_tactic : public tactic {
display(tout, l);
tout << "\n";
display(tout, u); tout << "\n";);
return 0; // no constraint needs to be created.
return nullptr; // no constraint needs to be created.
}
new_lits.reset();
@ -1411,7 +1411,7 @@ class fm_tactic : public tactic {
display(tout, l);
tout << "\n";
display(tout, u); tout << "\n";);
return 0;
return nullptr;
}
expr_dependency * new_dep = m.mk_join(l.m_dep, u.m_dep);
@ -1423,7 +1423,7 @@ class fm_tactic : public tactic {
display(tout, u); tout << "\n";);
m_inconsistent = true;
m_inconsistent_core = new_dep;
return 0;
return nullptr;
}
constraint * new_cnstr = mk_constraint(new_lits.size(),
@ -1493,7 +1493,7 @@ class fm_tactic : public tactic {
constraint const & l_c = *(l[i]);
constraint const & u_c = *(u[j]);
constraint * new_c = resolve(l_c, u_c, x);
if (new_c != 0) {
if (new_c != nullptr) {
num_new_cnstrs++;
new_constraints.push_back(new_c);
}
@ -1528,7 +1528,7 @@ class fm_tactic : public tactic {
c->m_dead = true;
expr * new_f = to_expr(*c);
TRACE("fm_bug", tout << "asserting...\n" << mk_ismt2_pp(new_f, m) << "\nnew_dep: " << c->m_dep << "\n";);
m_new_goal->assert_expr(new_f, 0, c->m_dep);
m_new_goal->assert_expr(new_f, nullptr, c->m_dep);
}
}
}
@ -1555,7 +1555,7 @@ class fm_tactic : public tactic {
proof_converter_ref & pc,
expr_dependency_ref & core) {
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
tactic_report report("fm", *g);
fail_if_proof_generation("fm", g);
m_produce_models = g->models_enabled();
@ -1571,7 +1571,7 @@ class fm_tactic : public tactic {
if (m_inconsistent) {
m_new_goal->reset();
m_new_goal->assert_expr(m.mk_false(), 0, m_inconsistent_core);
m_new_goal->assert_expr(m.mk_false(), nullptr, m_inconsistent_core);
}
else {
TRACE("fm", display(tout););
@ -1595,7 +1595,7 @@ class fm_tactic : public tactic {
eliminated++;
if (m_inconsistent) {
m_new_goal->reset();
m_new_goal->assert_expr(m.mk_false(), 0, m_inconsistent_core);
m_new_goal->assert_expr(m.mk_false(), nullptr, m_inconsistent_core);
break;
}
}

View file

@ -112,7 +112,7 @@ class lia2card_tactic : public tactic {
bool rewrite_patterns() const { return false; }
bool flat_assoc(func_decl * f) const { return false; }
br_status reduce_app(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
return mk_app_core(f, num, args, result);
}
lia_rewriter_cfg(lia2card_tactic& t):m(t.m), t(t), a(m), args(m) {}
@ -164,7 +164,7 @@ public:
proof_converter_ref & pc,
expr_dependency_ref & core) override {
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
m_01s->reset();
tactic_report report("cardinality-intro", *g);

View file

@ -197,7 +197,7 @@ class lia2pb_tactic : public tactic {
fail_if_proof_generation("lia2pb", g);
m_produce_models = g->models_enabled();
m_produce_unsat_cores = g->unsat_core_enabled();
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
tactic_report report("lia2pb", *g);
m_bm.reset(); m_rw.reset(); m_new_deps.reset();
@ -224,8 +224,8 @@ class lia2pb_tactic : public tactic {
if (!check_num_bits())
throw tactic_exception("lia2pb failed, number of necessary bits exceeds specified threshold (use option :lia2pb-total-bits to increase threshold)");
extension_model_converter * mc1 = 0;
filter_model_converter * mc2 = 0;
extension_model_converter * mc1 = nullptr;
filter_model_converter * mc2 = nullptr;
if (m_produce_models) {
mc1 = alloc(extension_model_converter, m);
mc2 = alloc(filter_model_converter, m);
@ -251,7 +251,7 @@ class lia2pb_tactic : public tactic {
rational a(1);
unsigned num_bits = u.get_num_bits();
for (unsigned i = 0; i < num_bits; i++) {
app * x_prime = m.mk_fresh_const(0, m_util.mk_int());
app * x_prime = m.mk_fresh_const(nullptr, m_util.mk_int());
g->assert_expr(m_util.mk_le(zero, x_prime));
g->assert_expr(m_util.mk_le(x_prime, one));
if (a.is_one())
@ -264,14 +264,14 @@ class lia2pb_tactic : public tactic {
}
SASSERT(def_args.size() > 1);
expr * def = m_util.mk_add(def_args.size(), def_args.c_ptr());
expr_dependency * dep = 0;
expr_dependency * dep = nullptr;
if (m_produce_unsat_cores) {
dep = m.mk_join(m_bm.lower_dep(x), m_bm.upper_dep(x));
if (dep != 0)
if (dep != nullptr)
m_new_deps.push_back(dep);
}
TRACE("lia2pb", tout << mk_ismt2_pp(x, m) << " -> " << dep << "\n";);
subst.insert(x, def, 0, dep);
subst.insert(x, def, nullptr, dep);
if (m_produce_models) {
mc1->insert(to_app(x)->get_decl(), def);
}
@ -287,7 +287,7 @@ class lia2pb_tactic : public tactic {
unsigned size = g->size();
for (unsigned idx = 0; idx < size; idx++) {
expr * curr = g->form(idx);
expr_dependency * dep = 0;
expr_dependency * dep = nullptr;
m_rw(curr, new_curr, new_pr);
if (m_produce_unsat_cores) {
dep = m.mk_join(m_rw.get_used_dependencies(), g->dep(idx));

View file

@ -174,7 +174,7 @@ linear_equation * linear_equation_manager::mk(unsigned sz, mpz * as, var * xs, b
}
sz = j;
if (sz <= 1)
return 0;
return nullptr;
}
else {
DEBUG_CODE({
@ -265,7 +265,7 @@ linear_equation * linear_equation_manager::mk(mpz const & b1, linear_equation co
m.del(new_a);
SASSERT(m_int_buffer.size() == m_var_buffer.size());
if (m_int_buffer.empty())
return 0;
return nullptr;
return mk_core(m_int_buffer.size(), m_int_buffer.c_ptr(), m_var_buffer.c_ptr());
}

View file

@ -75,7 +75,7 @@ class nla2bv_tactic : public tactic {
m_vars(m),
m_defs(m),
m_trail(m),
m_fmc(0) {
m_fmc(nullptr) {
m_default_bv_size = m_num_bits = p.get_uint("nla2bv_bv_size", 4);
}
@ -408,14 +408,14 @@ class nla2bv_tactic : public tactic {
}
~scoped_set_imp() {
m_owner.m_imp = 0;
m_owner.m_imp = nullptr;
}
};
public:
nla2bv_tactic(params_ref const & p):
m_params(p),
m_imp(0) {
m_imp(nullptr) {
}
tactic * translate(ast_manager & m) override {
@ -449,7 +449,7 @@ public:
SASSERT(g->is_well_sorted());
fail_if_proof_generation("nla2bv", g);
fail_if_unsat_core_generation("nla2bv", g);
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
imp proc(g->m(), m_params);
scoped_set_imp setter(*this, proc);

View file

@ -85,7 +85,7 @@ class normalize_bounds_tactic : public tactic {
model_converter_ref & mc,
proof_converter_ref & pc,
expr_dependency_ref & core) {
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
bool produce_models = in->models_enabled();
bool produce_proofs = in->proofs_enabled();
tactic_report report("normalize-bounds", *in);
@ -98,8 +98,8 @@ class normalize_bounds_tactic : public tactic {
return;
}
extension_model_converter * mc1 = 0;
filter_model_converter * mc2 = 0;
extension_model_converter * mc1 = nullptr;
filter_model_converter * mc2 = nullptr;
if (produce_models) {
mc1 = alloc(extension_model_converter, m);
mc2 = alloc(filter_model_converter, m);
@ -116,7 +116,7 @@ class normalize_bounds_tactic : public tactic {
if (is_target(x, val)) {
num_norm_bounds++;
sort * s = m.get_sort(x);
app * x_prime = m.mk_fresh_const(0, s);
app * x_prime = m.mk_fresh_const(nullptr, s);
expr * def = m_util.mk_add(x_prime, m_util.mk_numeral(val, s));
subst.insert(x, def);
if (produce_models) {

View file

@ -43,7 +43,7 @@ pb2bv_model_converter::pb2bv_model_converter(ast_manager & _m, obj_map<func_decl
if (!c2bit.contains(d)) {
SASSERT(d->get_arity() == 0);
m.inc_ref(d);
m_c2bit.push_back(func_decl_pair(d, static_cast<func_decl*>(0)));
m_c2bit.push_back(func_decl_pair(d, static_cast<func_decl*>(nullptr)));
}
}
}
@ -71,7 +71,7 @@ void pb2bv_model_converter::operator()(model_ref & md, unsigned goal_idx) {
for (; it != end; ++it) {
if (it->second) {
expr * val = md->get_const_interp(it->second);
if (val == 0 || m.is_false(val)) {
if (val == nullptr || m.is_false(val)) {
/* false's and don't cares get the integer 0 solution*/
md->register_decl(it->first, a_util.mk_numeral(rational(0), true));
}

View file

@ -216,7 +216,7 @@ private:
}
bool get_subst(expr * s, expr * & t, proof * & t_pr) {
t_pr = 0;
t_pr = nullptr;
if (owner.is_constraint_core(s)) {
owner.convert(to_app(s), m_saved_res, true, false);
t = m_saved_res;
@ -328,12 +328,12 @@ private:
func_decl * fd = x->get_decl();
obj_map<func_decl, expr*> & const2lit = sign ? m_not_const2bit : m_const2bit;
expr * r = 0;
expr * r = nullptr;
const2lit.find(fd, r);
if (r != 0)
if (r != nullptr)
return r;
r = m.mk_fresh_const(0, m.mk_bool_sort());
r = m.mk_fresh_const(nullptr, m.mk_bool_sort());
expr * not_r = m.mk_not(r);
m_const2bit.insert(fd, r);
m_not_const2bit.insert(fd, not_r);
@ -490,7 +490,7 @@ private:
for (unsigned j = 0; j < i; j++)
m_clause.push_back(monomial(numeral(1), m_p[j].m_lit));
app * new_var = m.mk_fresh_const(0, m_arith_util.mk_int());
app * new_var = m.mk_fresh_const(nullptr, m_arith_util.mk_int());
m_temporary_ints.push_back(new_var);
m_clause.push_back(monomial(numeral(1), lit(new_var, true)));
@ -895,7 +895,7 @@ private:
fail_if_proof_generation("pb2bv", g);
m_produce_models = g->models_enabled();
m_produce_unsat_cores = g->unsat_core_enabled();
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
tactic_report report("pb2bv", *g);
m_bm.reset(); m_rw.reset(); m_new_deps.reset();
@ -946,7 +946,7 @@ private:
}
for (unsigned idx = 0; idx < size; idx++)
g->update(idx, new_exprs[idx].get(), 0, (m_produce_unsat_cores) ? new_deps[idx].get() : g->dep(idx));
g->update(idx, new_exprs[idx].get(), nullptr, (m_produce_unsat_cores) ? new_deps[idx].get() : g->dep(idx));
if (m_produce_models) {
filter_model_converter * mc1 = alloc(filter_model_converter, m);

View file

@ -354,7 +354,7 @@ struct propagate_ineqs_tactic::imp {
void find_ite_bounds(expr * root) {
TRACE("find_ite_bounds_bug", display_bounds(tout););
expr * n = root;
expr * target = 0;
expr * target = nullptr;
expr * c, * t, * e;
expr * x, * y;
bool has_l, has_u;
@ -374,7 +374,7 @@ struct propagate_ineqs_tactic::imp {
break;
}
else if (is_x_minus_y_eq_0(n, x, y)) {
n = 0;
n = nullptr;
}
else {
break;
@ -394,7 +394,7 @@ struct propagate_ineqs_tactic::imp {
break;
}
if (target == 0) {
if (target == nullptr) {
target = x;
if (lower(y, curr, curr_strict)) {
has_l = true;
@ -448,7 +448,7 @@ struct propagate_ineqs_tactic::imp {
if (!has_l && !has_u)
break;
if (n == 0) {
if (n == nullptr) {
TRACE("find_ite_bounds", tout << "found bounds for: " << mk_ismt2_pp(target, m) << "\n";
tout << "has_l: " << has_l << " " << nm.to_string(l_min) << " l_strict: " << l_strict << "\n";
tout << "has_u: " << has_u << " " << nm.to_string(u_max) << " u_strict: " << u_strict << "\n";
@ -484,7 +484,7 @@ struct propagate_ineqs_tactic::imp {
m_new_goal->inc_depth();
r = m_new_goal.get();
if (!collect_bounds(*g)) {
m_new_goal = 0;
m_new_goal = nullptr;
r = g;
return; // nothing to be done
}
@ -534,7 +534,7 @@ void propagate_ineqs_tactic::operator()(goal_ref const & g,
SASSERT(g->is_well_sorted());
fail_if_proof_generation("propagate-ineqs", g);
fail_if_unsat_core_generation("propagate-ineqs", g);
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
goal_ref r;
(*m_imp)(g.get(), r);
result.push_back(r.get());

View file

@ -170,8 +170,8 @@ struct purify_arith_proc {
}
std::pair<expr*, expr*> pair;
if (!m_sin_cos.find(to_app(theta), pair)) {
pair.first = m().mk_fresh_const(0, u().mk_real());
pair.second = m().mk_fresh_const(0, u().mk_real());
pair.first = m().mk_fresh_const(nullptr, u().mk_real());
pair.second = m().mk_fresh_const(nullptr, u().mk_real());
m_sin_cos.insert(to_app(theta), pair);
m_pinned.push_back(pair.first);
m_pinned.push_back(pair.second);
@ -214,7 +214,7 @@ struct purify_arith_proc {
bool elim_inverses() const { return m_owner.m_elim_inverses; }
expr * mk_fresh_var(bool is_int) {
expr * r = m().mk_fresh_const(0, is_int ? u().mk_int() : u().mk_real());
expr * r = m().mk_fresh_const(nullptr, is_int ? u().mk_int() : u().mk_real());
m_new_vars.push_back(r);
return r;
}
@ -241,7 +241,7 @@ struct purify_arith_proc {
}
void mk_def_proof(expr * k, expr * def, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
if (produce_proofs()) {
expr * eq = m().mk_eq(k, def);
proof * pr1 = m().mk_def_intro(eq);
@ -691,7 +691,7 @@ struct purify_arith_proc {
};
void process_quantifier(quantifier * q, expr_ref & result, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
rw r(*this);
expr_ref new_body(m());
proof_ref new_body_pr(m());
@ -761,7 +761,7 @@ struct purify_arith_proc {
sz = r.cfg().m_new_cnstrs.size();
TRACE("purify_arith", tout << r.cfg().m_new_cnstrs << "\n";);
for (unsigned i = 0; i < sz; i++) {
m_goal.assert_expr(r.cfg().m_new_cnstrs.get(i), m_produce_proofs ? r.cfg().m_new_cnstr_prs.get(i) : 0, 0);
m_goal.assert_expr(r.cfg().m_new_cnstrs.get(i), m_produce_proofs ? r.cfg().m_new_cnstr_prs.get(i) : nullptr, nullptr);
}
// add filter_model_converter to eliminate auxiliary variables from model
@ -830,7 +830,7 @@ public:
expr_dependency_ref & core) override {
try {
SASSERT(g->is_well_sorted());
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
tactic_report report("purify-arith", *g);
TRACE("purify_arith", g->display(tout););
bool produce_proofs = g->proofs_enabled();

View file

@ -70,7 +70,7 @@ class recover_01_tactic : public tactic {
bool save_clause(expr * c) {
if (!m.is_or(c))
return false;
func_decl * x = 0;
func_decl * x = nullptr;
app * cls = to_app(c);
if (cls->get_num_args() <= 1 || cls->get_num_args() >= m_cls_max_size)
return false;
@ -84,7 +84,7 @@ class recover_01_tactic : public tactic {
else if (m.is_not(lit, arg) && is_uninterp_const(arg)) {
// negative literal
}
else if (x == 0 && m.is_eq(lit, lhs, rhs)) {
else if (x == nullptr && m.is_eq(lit, lhs, rhs)) {
// x = k literal
if (is_uninterp_const(lhs) && m_util.is_numeral(rhs)) {
x = to_app(lhs)->get_decl();
@ -101,7 +101,7 @@ class recover_01_tactic : public tactic {
}
}
if (x != 0) {
if (x != nullptr) {
var2clauses::obj_map_entry * entry = m_var2clauses.insert_if_not_there2(x, ptr_vector<app>());
if (entry->get_data().m_value.empty() || entry->get_data().m_value.back()->get_num_args() == cls->get_num_args()) {
entry->get_data().m_value.push_back(cls);
@ -134,7 +134,7 @@ class recover_01_tactic : public tactic {
}
}
}
return 0;
return nullptr;
}
// Find coeff (the k of literal (x = k)) of clause cls.
@ -199,7 +199,7 @@ class recover_01_tactic : public tactic {
SASSERT(is_uninterp_const(atom));
expr * var;
if (!bool2int.find(atom, var)) {
var = m.mk_fresh_const(0, m_util.mk_int());
var = m.mk_fresh_const(nullptr, m_util.mk_int());
new_goal->assert_expr(m_util.mk_le(m_util.mk_numeral(rational(0), true), var));
new_goal->assert_expr(m_util.mk_le(var, m_util.mk_numeral(rational(1), true)));
expr * bool_def = m.mk_eq(var, m_util.mk_numeral(rational(1), true));
@ -225,7 +225,7 @@ class recover_01_tactic : public tactic {
if (clauses.size() < expected_num_clauses) // using < instead of != because we tolerate duplicates
return false;
app * zero_cls = find_zero_cls(x, clauses);
if (zero_cls == 0)
if (zero_cls == nullptr)
return false;
buffer<bool> found; // marks which idx were found
@ -302,7 +302,7 @@ class recover_01_tactic : public tactic {
fail_if_proof_generation("recover-01", g);
fail_if_unsat_core_generation("recover-01", g);
m_produce_models = g->models_enabled();
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
tactic_report report("recover-01", *g);
bool saved = false;
@ -357,7 +357,7 @@ class recover_01_tactic : public tactic {
if (!recovered) {
result.push_back(g.get());
mc = 0;
mc = nullptr;
return;
}