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

@ -43,7 +43,7 @@ namespace smt {
m_assigned_literals(assigned_literals),
m_lemma_atoms(m),
m_todo_js_qhead(0),
m_antecedents(0),
m_antecedents(nullptr),
m_watches(watches),
m_new_proofs(m),
m_lemma_proof(m)
@ -204,7 +204,7 @@ namespace smt {
eq2literals(p.first, p.second);
}
if (m_todo_js_qhead == m_todo_js.size()) {
m_antecedents = 0;
m_antecedents = nullptr;
return;
}
}
@ -480,7 +480,7 @@ namespace smt {
// save space for first uip
m_lemma.push_back(null_literal);
m_lemma_atoms.push_back(0);
m_lemma_atoms.push_back(nullptr);
unsigned num_marks = 0;
if (not_l != null_literal) {
@ -758,7 +758,7 @@ namespace smt {
return pr;
}
m_todo_pr.push_back(tp_elem(n1, n2));
return 0;
return nullptr;
}
/**
@ -766,7 +766,7 @@ namespace smt {
*/
proof * conflict_resolution::norm_eq_proof(enode * n1, enode * n2, proof * pr) {
if (!pr)
return 0;
return nullptr;
SASSERT(m_manager.has_fact(pr));
app * fact = to_app(m_manager.get_fact(pr));
app * n1_owner = n1->get_owner();
@ -814,7 +814,7 @@ namespace smt {
switch (js.get_kind()) {
case eq_justification::AXIOM:
UNREACHABLE();
return 0;
return nullptr;
case eq_justification::EQUATION:
TRACE("proof_gen_bug", tout << js.get_literal() << "\n"; m_ctx.display_literal_info(tout, js.get_literal()););
return norm_eq_proof(n1, n2, get_proof(js.get_literal()));
@ -845,11 +845,11 @@ namespace smt {
visited = false;
}
if (!visited)
return 0;
return nullptr;
app * e1 = n1->get_owner();
app * e2 = n2->get_owner();
app * e2_prime = m_manager.mk_app(e2->get_decl(), e2->get_arg(1), e2->get_arg(0));
proof * pr1 = 0;
proof * pr1 = nullptr;
if (!prs.empty()) {
pr1 = m_manager.mk_congruence(e1, e2_prime, prs.size(), prs.c_ptr());
m_new_proofs.push_back(pr1);
@ -877,14 +877,14 @@ namespace smt {
}
}
if (!visited)
return 0;
return nullptr;
proof * pr = m_manager.mk_congruence(n1->get_owner(), n2->get_owner(), prs.size(), prs.c_ptr());
m_new_proofs.push_back(pr);
return pr;
}
default:
UNREACHABLE();
return 0;
return nullptr;
}
}
@ -899,7 +899,7 @@ namespace smt {
return pr;
}
m_todo_pr.push_back(tp_elem(l));
return 0;
return nullptr;
}
/**
@ -945,7 +945,7 @@ namespace smt {
SASSERT(js);
proof * pr = get_proof(js);
ptr_buffer<proof> prs;
bool visited = pr != 0;
bool visited = pr != nullptr;
TRACE("get_proof_bug", if (pr != 0) tout << js->get_name() << "\n";);
CTRACE("get_proof_bug_after", invocation_counter >= DUMP_AFTER_NUM_INVOCATIONS, if (pr != 0) tout << js->get_name() << "\n";);
CTRACE("get_proof_bug_after", invocation_counter >= DUMP_AFTER_NUM_INVOCATIONS, if (pr != 0) js->display_debug_info(*this, tout););
@ -973,7 +973,7 @@ namespace smt {
visited = false;
}
if (!visited)
return 0;
return nullptr;
expr_ref l_exr(m_manager);
m_ctx.literal2expr(l, l_exr);
TRACE("get_proof_bug",
@ -1034,7 +1034,7 @@ namespace smt {
}
SASSERT(js != 0);
m_todo_pr.push_back(tp_elem(js));
return 0;
return nullptr;
}
void conflict_resolution::init_mk_proof() {
@ -1061,7 +1061,7 @@ namespace smt {
SASSERT(js.get_kind() != b_justification::AXIOM);
if (js.get_kind() == b_justification::CLAUSE) {
clause * cls = js.get_clause();
bool visited = get_proof(cls->get_justification()) != 0;
bool visited = get_proof(cls->get_justification()) != nullptr;
unsigned num_lits = cls->get_num_literals();
unsigned i = 0;
if (l != false_literal) {
@ -1070,20 +1070,20 @@ namespace smt {
}
else {
SASSERT(cls->get_literal(1) == l);
if (get_proof(~cls->get_literal(0)) == 0)
if (get_proof(~cls->get_literal(0)) == nullptr)
visited = false;
i = 2;
}
}
for (; i < num_lits; i++) {
SASSERT(cls->get_literal(i) != l);
if (get_proof(~cls->get_literal(i)) == 0)
if (get_proof(~cls->get_literal(i)) == nullptr)
visited = false;
}
return visited;
}
else
return get_proof(js.get_justification()) != 0;
return get_proof(js.get_justification()) != nullptr;
}
void conflict_resolution::mk_proof(literal l, b_justification js) {
@ -1114,11 +1114,11 @@ namespace smt {
UNREACHABLE();
break;
case eq_justification::EQUATION:
if (get_proof(js.get_literal()) == 0)
if (get_proof(js.get_literal()) == nullptr)
visited = false;
break;
case eq_justification::JUSTIFICATION:
if (get_proof(js.get_justification()) == 0)
if (get_proof(js.get_justification()) == nullptr)
visited = false;
break;
case eq_justification::CONGRUENCE: {
@ -1132,16 +1132,16 @@ namespace smt {
enode * c1_2 = n1->get_arg(1);
enode * c2_1 = n2->get_arg(0);
enode * c2_2 = n2->get_arg(1);
if (c1_1 != c2_2 && get_proof(c1_1, c2_2) == 0)
if (c1_1 != c2_2 && get_proof(c1_1, c2_2) == nullptr)
visited = false;
if (c1_2 != c2_1 && get_proof(c1_2, c2_1) == 0)
if (c1_2 != c2_1 && get_proof(c1_2, c2_1) == nullptr)
visited = false;
}
else {
for (unsigned i = 0; i < num_args; i++) {
enode * c1 = n1->get_arg(i);
enode * c2 = n2->get_arg(i);
if (c1 != c2 && get_proof(c1, c2) == 0)
if (c1 != c2 && get_proof(c1, c2) == nullptr)
visited = false;
}
}
@ -1204,7 +1204,7 @@ namespace smt {
}
prs2.pop_back();
}
proof * pr = 0;
proof * pr = nullptr;
SASSERT(!prs1.empty());
if (prs1.size() == 1)
pr = prs1[0];
@ -1290,13 +1290,13 @@ namespace smt {
}
SASSERT(visit_b_justification(consequent, conflict));
proof * pr = 0;
proof * pr = nullptr;
if (not_l == null_literal) {
pr = get_proof(false_literal, conflict);
SASSERT(pr);
}
else {
proof * prs[2] = { 0, 0};
proof * prs[2] = { nullptr, nullptr};
m_lit2proof.find(not_l, prs[0]);
SASSERT(prs[0]);
prs[1] = get_proof(consequent, conflict);
@ -1310,13 +1310,13 @@ namespace smt {
m_ctx.literal2expr(lit, l_expr);
lits.push_back(l_expr);
}
expr * fact = 0;
expr * fact = nullptr;
switch (lits.size()) {
case 0: fact = 0; break;
case 0: fact = nullptr; break;
case 1: fact = lits[0]; break;
default: fact = m_manager.mk_or(lits.size(), lits.c_ptr());
}
if (fact == 0)
if (fact == nullptr)
m_lemma_proof = pr;
else
m_lemma_proof = m_manager.mk_lemma(pr, fact);