3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-18 01:02:15 +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

@ -118,7 +118,7 @@ struct bit_blaster_model_converter : public model_converter {
func_decl * bit_decl = to_app(bit)->get_decl();
expr * bit_val = old_model->get_const_interp(bit_decl);
// remark: if old_model does not assign bit_val, then assume it is false.
if (bit_val != 0 && m().is_true(bit_val))
if (bit_val != nullptr && m().is_true(bit_val))
val++;
}
}
@ -133,7 +133,7 @@ struct bit_blaster_model_converter : public model_converter {
func_decl * bit_decl = to_app(bit)->get_decl();
expr * bit_val = old_model->get_const_interp(bit_decl);
// remark: if old_model does not assign bit_val, then assume it is false.
if (bit_val != 0 && !util.is_zero(bit_val))
if (bit_val != nullptr && !util.is_zero(bit_val))
val++;
}
}

View file

@ -55,7 +55,7 @@ class bit_blaster_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 proofs_enabled = g->proofs_enabled();
if (proofs_enabled && m_blast_quant)
@ -90,7 +90,7 @@ class bit_blaster_tactic : public tactic {
if (change && g->models_enabled())
mc = mk_bit_blaster_model_converter(m(), m_rewriter->const2bits());
else
mc = 0;
mc = nullptr;
g->inc_depth();
result.push_back(g.get());
TRACE("after_bit_blaster", g->display(tout); if (mc) mc->display(tout); tout << "\n";);
@ -113,7 +113,7 @@ public:
tactic * translate(ast_manager & m) override {
SASSERT(!m_rewriter); // assume translation isn't used where rewriter is external.
return alloc(bit_blaster_tactic, m, 0, m_params);
return alloc(bit_blaster_tactic, m, nullptr, m_params);
}
~bit_blaster_tactic() override {
@ -161,7 +161,7 @@ public:
tactic * mk_bit_blaster_tactic(ast_manager & m, params_ref const & p) {
return clean(alloc(bit_blaster_tactic, m, 0, p));
return clean(alloc(bit_blaster_tactic, m, nullptr, p));
}
tactic * mk_bit_blaster_tactic(ast_manager & m, bit_blaster_rewriter* rw, params_ref const & p) {

View file

@ -106,7 +106,7 @@ class bv1_blaster_tactic : public tactic {
sort * b = butil().mk_sort(1);
ptr_buffer<expr> bits;
for (unsigned i = 0; i < bv_size; i++) {
bits.push_back(m().mk_fresh_const(0, b));
bits.push_back(m().mk_fresh_const(nullptr, b));
}
r = butil().mk_concat(bits.size(), bits.c_ptr());
m_saved.push_back(r);
@ -253,7 +253,7 @@ class bv1_blaster_tactic : public tactic {
}
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;
if (num == 0 && f->get_family_id() == null_family_id && butil().is_bv_sort(f->get_range())) {
mk_const(f, result);
return BR_DONE;
@ -383,7 +383,7 @@ class bv1_blaster_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;
if (!is_target(*g))
throw tactic_exception("bv1 blaster cannot be applied to goal");

View file

@ -68,7 +68,7 @@ struct bv_bound_chk_rewriter_cfg : public default_rewriter_cfg {
}
br_status reduce_app_core(func_decl * f, unsigned num, expr * const * args, expr_ref & result, proof_ref & result_pr) {
result_pr = 0;
result_pr = nullptr;
const family_id fid = f->get_family_id();
if (fid != m_b_rw.get_fid()) return BR_FAILED;
bv_bounds bvb(m());
@ -206,7 +206,7 @@ void bv_bound_chk_tactic::operator()(goal_ref const & g,
fail_if_proof_generation("bv-bound-chk", g);
fail_if_unsat_core_generation("bv-bound-chk", g);
TRACE("bv-bound-chk", g->display(tout << "before:"); tout << std::endl;);
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
m_imp->operator()(g);
g->inc_depth();
result.push_back(g.get());

View file

@ -194,7 +194,7 @@ namespace {
bool is_bound(expr *e, expr*& v, interval& b) const {
uint64 n;
expr *lhs = 0, *rhs = 0;
expr *lhs = nullptr, *rhs = nullptr;
unsigned sz;
if (m_bv.is_bv_ule(e, lhs, rhs)) {
@ -382,7 +382,7 @@ namespace {
}
interval ctx, intr;
result = 0;
result = nullptr;
if (b.is_full() && b.tight) {
result = m.mk_true();
@ -561,7 +561,7 @@ namespace {
bool is_bound(expr *e, expr*& v, interval& b) const {
uint64 n;
expr *lhs = 0, *rhs = 0;
expr *lhs = nullptr, *rhs = nullptr;
unsigned sz = 0;
if (m_bv.is_bv_ule(e, lhs, rhs)) {

View file

@ -184,8 +184,8 @@ struct bv_size_reduction_tactic::imp {
return;
TRACE("before_bv_size_reduction", g.display(tout););
m_produce_models = g.models_enabled();
mc = 0;
m_mc = 0;
mc = nullptr;
m_mc = nullptr;
unsigned num_reduced = 0;
{
tactic_report report("bv-size-reduction", g);
@ -211,11 +211,11 @@ struct bv_size_reduction_tactic::imp {
unsigned bv_sz = m_util.get_bv_size(v);
numeral l = m_util.norm(it->m_value, bv_sz, true);
obj_map<app, numeral>::obj_map_entry * entry = m_signed_uppers.find_core(v);
if (entry != 0) {
if (entry != nullptr) {
numeral u = m_util.norm(entry->get_data().m_value, bv_sz, true);
TRACE("bv_size_reduction", tout << l << " <= " << v->get_decl()->get_name() << " <= " << u << "\n";);
expr * new_def = 0;
app * new_const = 0;
expr * new_def = nullptr;
app * new_const = nullptr;
if (l > u) {
g.assert_expr(m.mk_false());
return;
@ -235,7 +235,7 @@ struct bv_size_reduction_tactic::imp {
unsigned i_nb = l_nb;
TRACE("bv_size_reduction", tout << " l <= " << v->get_decl()->get_name() << " <= u <= 0 " << " --> " << i_nb << " bits\n";);
if (i_nb < v_nb) {
new_const = m.mk_fresh_const(0, m_util.mk_sort(i_nb));
new_const = m.mk_fresh_const(nullptr, m_util.mk_sort(i_nb));
new_def = m_util.mk_concat(m_util.mk_numeral(numeral(-1), v_nb - i_nb), new_const);
}
}
@ -245,7 +245,7 @@ struct bv_size_reduction_tactic::imp {
unsigned i_nb = ((l_nb > u_nb) ? l_nb : u_nb) + 1;
TRACE("bv_size_reduction", tout << " l <= " << v->get_decl()->get_name() << " <= 0 <= u " << " --> " << i_nb << " bits\n";);
if (i_nb < v_nb) {
new_const = m.mk_fresh_const(0, m_util.mk_sort(i_nb));
new_const = m.mk_fresh_const(nullptr, m_util.mk_sort(i_nb));
new_def = m_util.mk_sign_extend(v_nb - i_nb, new_const);
}
}
@ -256,7 +256,7 @@ struct bv_size_reduction_tactic::imp {
unsigned v_nb = m_util.get_bv_size(v);
TRACE("bv_size_reduction", tout << l << " <= " << v->get_decl()->get_name() << " <= " << u << " --> " << u_nb << " bits\n";);
if (u_nb < v_nb) {
new_const = m.mk_fresh_const(0, m_util.mk_sort(u_nb));
new_const = m.mk_fresh_const(nullptr, m_util.mk_sort(u_nb));
new_def = m_util.mk_concat(m_util.mk_numeral(numeral(0), v_nb - u_nb), new_const);
}
}
@ -365,8 +365,8 @@ struct bv_size_reduction_tactic::imp {
if (m_fmc) {
mc = concat(m_fmc.get(), mc.get());
}
m_mc = 0;
m_fmc = 0;
m_mc = nullptr;
m_fmc = nullptr;
}
report_tactic_progress(":bv-reduced", num_reduced);
TRACE("after_bv_size_reduction", g.display(tout); if (m_mc) m_mc->display(tout););
@ -390,7 +390,7 @@ void bv_size_reduction_tactic::operator()(goal_ref const & g,
SASSERT(g->is_well_sorted());
fail_if_proof_generation("bv-size-reduction", g);
fail_if_unsat_core_generation("bv-size-reduction", g);
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
m_imp->operator()(*(g.get()), mc);
g->inc_depth();
result.push_back(g.get());

View file

@ -37,8 +37,8 @@ bvarray2uf_rewriter_cfg::bvarray2uf_rewriter_cfg(ast_manager & m, params_ref con
m_bindings(m),
m_bv_util(m),
m_array_util(m),
m_emc(0),
m_fmc(0),
m_emc(nullptr),
m_fmc(nullptr),
extra_assertions(m) {
updt_params(p);
// We need to make sure that the mananger has the BV and array plugins loaded.
@ -108,7 +108,7 @@ func_decl_ref bvarray2uf_rewriter_cfg::mk_uf_for_array(expr * e) {
if (m_array_util.is_as_array(e))
return func_decl_ref(static_cast<func_decl*>(to_app(e)->get_decl()->get_parameter(0).get_ast()), m_manager);
else {
func_decl * bv_f = 0;
func_decl * bv_f = nullptr;
if (!m_arrays_fs.find(e, bv_f)) {
sort * domain = get_index_sort(e);
sort * range = get_value_sort(e);
@ -184,7 +184,7 @@ br_status bvarray2uf_rewriter_cfg::reduce_app(func_decl * f, unsigned num, expr
func_decl_ref itefd(m_manager);
e = m_manager.mk_ite(c, f_ta, f_fa);
func_decl * bv_f = 0;
func_decl * bv_f = nullptr;
if (!m_arrays_fs.find(f_a, bv_f)) {
sort * domain = get_index_sort(args[1]);
sort * range = get_value_sort(args[1]);

View file

@ -61,7 +61,7 @@ class bvarray2uf_tactic : public tactic {
{
SASSERT(g->is_well_sorted());
tactic_report report("bvarray2uf", *g);
mc = 0; pc = 0; core = 0; result.reset();
mc = nullptr; pc = nullptr; core = nullptr; result.reset();
fail_if_unsat_core_generation("bvarray2uf", g);
TRACE("bvarray2uf", tout << "Before: " << std::endl; g->display(tout); );

View file

@ -122,7 +122,7 @@ public:
model_converter_ref & mc,
proof_converter_ref & pc,
expr_dependency_ref & core) override {
mc = 0; pc = 0; core = 0;
mc = nullptr; pc = nullptr; core = nullptr;
bool produce_proofs = g->proofs_enabled();
tactic_report report("dt2bv", *g);
unsigned size = g->size();

View file

@ -52,7 +52,7 @@ class elim_small_bv_tactic : public tactic {
m_bindings(_m),
m_num_eliminated(0) {
updt_params(p);
m_goal = 0;
m_goal = nullptr;
m_max_steps = UINT_MAX;
}
@ -77,13 +77,13 @@ class elim_small_bv_tactic : public tactic {
expr_ref res(m);
expr_ref_vector substitution(m);
substitution.resize(num_decls, 0);
substitution.resize(num_decls, nullptr);
substitution[num_decls - idx - 1] = replacement;
// (VAR 0) is in the first position of substitution; (VAR num_decls-1) is in the last position.
for (unsigned i = 0; i < max_var_idx_p1; i++)
substitution.push_back(0);
substitution.push_back(nullptr);
// (VAR num_decls) ... (VAR num_decls+sz-1); are in positions num_decls .. num_decls+sz-1
@ -175,7 +175,7 @@ class elim_small_bv_tactic : public tactic {
TRACE("elim_small_bv", tout << "elimination result: " << mk_ismt2_pp(result, m) << std::endl; );
result_pr = 0; // proofs NIY
result_pr = nullptr; // proofs NIY
m_bindings.shrink(old_sz);
return true;
}
@ -230,7 +230,7 @@ class elim_small_bv_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("elim-small-bv", *g);
bool produce_proofs = g->proofs_enabled();
fail_if_proof_generation("elim-small-bv", g);

View file

@ -84,7 +84,7 @@ class max_bv_sharing_tactic : public tactic {
return m().mk_app(f, arg1, arg2);
if (s.contains(expr_pair(arg2, arg1)))
return m().mk_app(f, arg2, arg1);
return 0;
return nullptr;
}
struct ref_count_lt {
@ -106,10 +106,10 @@ class max_bv_sharing_tactic : public tactic {
ptr_buffer<expr, 128> _args;
bool first = false;
expr * num = 0;
expr * num = nullptr;
for (unsigned i = 0; i < num_args; i++) {
expr * arg = args[i];
if (num == 0 && m_util.is_numeral(arg)) {
if (num == nullptr && m_util.is_numeral(arg)) {
if (i == 0) first = true;
num = arg;
}
@ -128,7 +128,7 @@ class max_bv_sharing_tactic : public tactic {
for (unsigned i = 0; i < num_args - 1; i++) {
for (unsigned j = i + 1; j < num_args; j++) {
expr * r = reuse(s, f, _args[i], _args[j]);
if (r != 0) {
if (r != nullptr) {
TRACE("bv_sharing_detail", tout << "reusing args: " << i << " " << j << "\n";);
_args[i] = r;
SASSERT(num_args > 1);
@ -186,7 +186,7 @@ class max_bv_sharing_tactic : public tactic {
}
num_args = j;
if (num_args == 1) {
if (num == 0) {
if (num == nullptr) {
result = _args[0];
}
else {
@ -209,7 +209,7 @@ class max_bv_sharing_tactic : public tactic {
case OP_BMUL:
case OP_BOR:
case OP_BXOR:
result_pr = 0;
result_pr = nullptr;
return reduce_ac_app(f, num, args, result);
default:
return BR_FAILED;
@ -242,7 +242,7 @@ class max_bv_sharing_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("max-bv-sharing", *g);
bool produce_proofs = g->proofs_enabled();