mirror of
https://github.com/Z3Prover/z3
synced 2025-06-21 21:33:39 +00:00
call it data instead of c_ptr for approaching C++11 std::vector convention.
This commit is contained in:
parent
524dcd35f9
commit
4a6083836a
456 changed files with 2802 additions and 2802 deletions
|
@ -431,7 +431,7 @@ bool proof_checker::check1_basic(proof* p, expr_ref_vector& side_conditions) {
|
|||
}
|
||||
}
|
||||
expr_ref rewrite_cond(m);
|
||||
rewrite_cond = m.mk_or(rewrite_eq.size(), rewrite_eq.c_ptr());
|
||||
rewrite_cond = m.mk_or(rewrite_eq.size(), rewrite_eq.data());
|
||||
side_conditions.push_back(rewrite_cond.get());
|
||||
return true;
|
||||
}
|
||||
|
@ -788,7 +788,7 @@ bool proof_checker::check1_basic(proof* p, expr_ref_vector& side_conditions) {
|
|||
// SASSERT(to_quantifier(premise)->get_num_decls() == sub.size());
|
||||
premise = to_quantifier(premise)->get_expr();
|
||||
}
|
||||
premise = vs(premise, sub.size(), sub.c_ptr());
|
||||
premise = vs(premise, sub.size(), sub.data());
|
||||
}
|
||||
fmls.push_back(premise.get());
|
||||
TRACE("proof_checker",
|
||||
|
@ -819,7 +819,7 @@ bool proof_checker::check1_basic(proof* p, expr_ref_vector& side_conditions) {
|
|||
fmls[i] = premise1;
|
||||
}
|
||||
fmls[0] = premise0;
|
||||
premise0 = m.mk_or(fmls.size(), fmls.c_ptr());
|
||||
premise0 = m.mk_or(fmls.size(), fmls.data());
|
||||
if (is_forall(conclusion)) {
|
||||
quantifier* q = to_quantifier(conclusion);
|
||||
premise0 = m.mk_iff(premise0, q->get_expr());
|
||||
|
@ -861,7 +861,7 @@ void proof_checker::set_false(expr_ref& e, unsigned position, expr_ref& lit) {
|
|||
args.append(a->get_num_args(), a->get_args());
|
||||
lit = args[position].get();
|
||||
args[position] = m.mk_false();
|
||||
e = m.mk_or(args.size(), args.c_ptr());
|
||||
e = m.mk_or(args.size(), args.data());
|
||||
}
|
||||
else if (m.is_implies(e, body, head)) {
|
||||
expr* const* heads = &head;
|
||||
|
@ -880,14 +880,14 @@ void proof_checker::set_false(expr_ref& e, unsigned position, expr_ref& lit) {
|
|||
args.append(num_heads, heads);
|
||||
lit = args[position].get();
|
||||
args[position] = m.mk_false();
|
||||
e = m.mk_implies(body, m.mk_or(args.size(), args.c_ptr()));
|
||||
e = m.mk_implies(body, m.mk_or(args.size(), args.data()));
|
||||
}
|
||||
else {
|
||||
position -= num_heads;
|
||||
args.append(num_bodies, bodies);
|
||||
lit = m.mk_not(args[position].get());
|
||||
args[position] = m.mk_true();
|
||||
e = m.mk_implies(m.mk_and(args.size(), args.c_ptr()), head);
|
||||
e = m.mk_implies(m.mk_and(args.size(), args.data()), head);
|
||||
}
|
||||
}
|
||||
else if (position == 0) {
|
||||
|
@ -1112,7 +1112,7 @@ void proof_checker::get_hypotheses(proof* p, expr_ref_vector& ante) {
|
|||
}
|
||||
}
|
||||
if (all_found) {
|
||||
h = mk_hyp(hyps.size(), hyps.c_ptr());
|
||||
h = mk_hyp(hyps.size(), hyps.data());
|
||||
m_pinned.push_back(h);
|
||||
m_hypotheses.insert(p, h);
|
||||
stack.pop_back();
|
||||
|
@ -1241,7 +1241,7 @@ void proof_checker::dump_proof(proof const* pr) {
|
|||
SASSERT(m.has_fact(a));
|
||||
antecedents.push_back(m.get_fact(a));
|
||||
}
|
||||
dump_proof(antecedents.size(), antecedents.c_ptr(), consequent);
|
||||
dump_proof(antecedents.size(), antecedents.data(), consequent);
|
||||
}
|
||||
|
||||
void proof_checker::dump_proof(unsigned num_antecedents, expr * const * antecedents, expr * consequent) {
|
||||
|
|
|
@ -192,13 +192,13 @@ class reduce_hypotheses {
|
|||
compute_mark1(res);
|
||||
} else if (m.is_unit_resolution(p)) {
|
||||
// unit: reduce units; reduce the first premise; rebuild unit resolution
|
||||
res = mk_unit_resolution_core(args.size(), args.c_ptr());
|
||||
res = mk_unit_resolution_core(args.size(), args.data());
|
||||
compute_mark1(res);
|
||||
} else {
|
||||
// other: reduce all premises; reapply
|
||||
if (m.has_fact(p)) { args.push_back(to_app(m.get_fact(p))); }
|
||||
SASSERT(p->get_decl()->get_arity() == args.size());
|
||||
res = m.mk_app(p->get_decl(), args.size(), (expr * const*)args.c_ptr());
|
||||
res = m.mk_app(p->get_decl(), args.size(), (expr * const*)args.data());
|
||||
compute_mark1(res);
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ class reduce_hypotheses {
|
|||
if (args.empty()) {
|
||||
return pf;
|
||||
}
|
||||
lemma = mk_or(m, args.size(), args.c_ptr());
|
||||
lemma = mk_or(m, args.size(), args.data());
|
||||
proof* res = m.mk_lemma(pf, lemma);
|
||||
m_pinned.push_back(res);
|
||||
|
||||
|
@ -280,10 +280,10 @@ class reduce_hypotheses {
|
|||
|
||||
SASSERT(new_fact_cls.size() + pf_args.size() - 1 == cls.size());
|
||||
expr_ref new_fact(m);
|
||||
new_fact = mk_or(m, new_fact_cls.size(), new_fact_cls.c_ptr());
|
||||
new_fact = mk_or(m, new_fact_cls.size(), new_fact_cls.data());
|
||||
|
||||
// create new proof step
|
||||
proof *res = m.mk_unit_resolution(pf_args.size(), pf_args.c_ptr(), new_fact);
|
||||
proof *res = m.mk_unit_resolution(pf_args.size(), pf_args.data(), new_fact);
|
||||
m_pinned.push_back(res);
|
||||
return res;
|
||||
}
|
||||
|
@ -556,7 +556,7 @@ public:
|
|||
clause = m_literals[0];
|
||||
}
|
||||
else {
|
||||
clause = m.mk_or(m_literals.size(), m_literals.c_ptr());
|
||||
clause = m.mk_or(m_literals.size(), m_literals.data());
|
||||
}
|
||||
tmp = m.mk_lemma(tmp, clause);
|
||||
m_refs.push_back(tmp);
|
||||
|
@ -642,7 +642,7 @@ public:
|
|||
if (m.is_complement(clause, m.get_fact(parents[i].get()))) {
|
||||
parents[1] = parents[i].get();
|
||||
parents.resize(2);
|
||||
result = m.mk_unit_resolution(parents.size(), parents.c_ptr());
|
||||
result = m.mk_unit_resolution(parents.size(), parents.data());
|
||||
m_refs.push_back(result);
|
||||
add_hypotheses(result);
|
||||
found = true;
|
||||
|
@ -679,7 +679,7 @@ public:
|
|||
result = parents[0].get();
|
||||
}
|
||||
else {
|
||||
result = m.mk_unit_resolution(parents.size(), parents.c_ptr());
|
||||
result = m.mk_unit_resolution(parents.size(), parents.data());
|
||||
m_refs.push_back(result);
|
||||
add_hypotheses(result);
|
||||
}
|
||||
|
@ -709,7 +709,7 @@ public:
|
|||
args.push_back(m.get_fact(p));
|
||||
}
|
||||
if (change) {
|
||||
tmp = m.mk_app(p->get_decl(), args.size(), args.c_ptr());
|
||||
tmp = m.mk_app(p->get_decl(), args.size(), args.data());
|
||||
m_refs.push_back(tmp);
|
||||
}
|
||||
else {
|
||||
|
@ -886,7 +886,7 @@ static void permute_unit_resolution(expr_ref_vector& refs, obj_map<proof,proof*>
|
|||
// AG: This can lead to merging of the units with other terms in interpolation,
|
||||
// AG: but without farkas coefficients this does not make sense
|
||||
prNew = m.mk_th_lemma(tid, m.get_fact(pr),
|
||||
premises.size(), premises.c_ptr(), num_params-1, params+1);
|
||||
premises.size(), premises.data(), num_params-1, params+1);
|
||||
}
|
||||
else {
|
||||
ptr_vector<expr> args;
|
||||
|
@ -896,7 +896,7 @@ static void permute_unit_resolution(expr_ref_vector& refs, obj_map<proof,proof*>
|
|||
if (m.has_fact(pr)) {
|
||||
args.push_back(m.get_fact(pr));
|
||||
}
|
||||
prNew = m.mk_app(pr->get_decl(), args.size(), args.c_ptr());
|
||||
prNew = m.mk_app(pr->get_decl(), args.size(), args.data());
|
||||
}
|
||||
|
||||
cache.insert(pr, prNew);
|
||||
|
@ -938,7 +938,7 @@ private:
|
|||
}
|
||||
instantiate(sub, conclusion);
|
||||
return
|
||||
m.mk_hyper_resolve(premises.size(), premises.c_ptr(), conclusion,
|
||||
m.mk_hyper_resolve(premises.size(), premises.data(), conclusion,
|
||||
positions,
|
||||
substs);
|
||||
}
|
||||
|
@ -967,12 +967,12 @@ private:
|
|||
substs.push_back(sub);
|
||||
conclusion = m.get_fact(p);
|
||||
instantiate(sub, conclusion);
|
||||
return m.mk_hyper_resolve(premises.size(), premises.c_ptr(), conclusion, positions, substs);
|
||||
return m.mk_hyper_resolve(premises.size(), premises.data(), conclusion, positions, substs);
|
||||
}
|
||||
|
||||
void compose(expr_ref_vector& sub, expr_ref_vector const& s0) {
|
||||
for (unsigned i = 0; i < sub.size(); ++i) {
|
||||
sub[i] = var_subst(m, false)(sub[i].get(), s0.size(), s0.c_ptr());
|
||||
sub[i] = var_subst(m, false)(sub[i].get(), s0.size(), s0.data());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -990,7 +990,7 @@ private:
|
|||
tout << sub.size() << "\n";);
|
||||
return;
|
||||
}
|
||||
fml = var_subst(m, false)(q->get_expr(), sub.size(), sub.c_ptr());
|
||||
fml = var_subst(m, false)(q->get_expr(), sub.size(), sub.data());
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
++j;
|
||||
}
|
||||
SASSERT(j >= 1);
|
||||
res = j > 1 ? m.mk_or(j, args.c_ptr()) : args.get(0);
|
||||
res = j > 1 ? m.mk_or(j, args.data()) : args.get(0);
|
||||
}
|
||||
|
||||
void mk_app(func_decl *decl, expr_ref_vector &args, expr_ref &res)
|
||||
|
@ -115,7 +115,7 @@ public:
|
|||
// we don't want (= (not a) (not b)) to be reduced to (= a b)
|
||||
{ res = m.mk_eq(args.get(0), args.get(1)); }
|
||||
else
|
||||
{ brwr.mk_app(decl, args.size(), args.c_ptr(), res); }
|
||||
{ brwr.mk_app(decl, args.size(), args.data(), res); }
|
||||
}
|
||||
|
||||
void operator()(ast_manager &m, proof *pr, proof_ref &res)
|
||||
|
@ -202,7 +202,7 @@ public:
|
|||
}
|
||||
else {
|
||||
// rebuild unit resolution
|
||||
newp = m.mk_unit_resolution(parents.size(), parents.c_ptr());
|
||||
newp = m.mk_unit_resolution(parents.size(), parents.data());
|
||||
// XXX the old and new facts should be
|
||||
// equivalent. The test here is much
|
||||
// stronger. It might need to be relaxed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue