3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-26 13:53:33 +00:00

fixup proof log annotations of rules

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2025-10-19 10:04:18 +02:00
parent 6485808b49
commit 65f38eac16
7 changed files with 49 additions and 42 deletions

View file

@ -151,7 +151,7 @@ namespace smt {
update(st, m_lits, pr);
}
void clause_proof::propagate(literal lit, justification const& jst, literal_vector const& ante) {
void clause_proof::propagate(literal lit, justification * jst, literal_vector const& ante) {
if (!is_enabled())
return;
m_lits.reset();
@ -159,8 +159,7 @@ namespace smt {
m_lits.push_back(ctx.literal2expr(~l));
m_lits.push_back(ctx.literal2expr(lit));
auto st = clause_proof::status::th_lemma;
auto pr = justification2proof(st, &const_cast<justification &>(jst));
// proof_ref pr(m.mk_app(symbol("smt"), 0, nullptr, m.mk_proof_sort()), m);
auto pr = justification2proof(st, jst);
update(st, m_lits, pr);
}

View file

@ -82,7 +82,7 @@ namespace smt {
void add(literal lit1, literal lit2, clause_kind k, justification* j, literal_buffer const* simp_lits = nullptr);
void add(clause& c, literal_buffer const* simp_lits = nullptr);
void add(unsigned n, literal const* lits, clause_kind k, justification* j);
void propagate(literal lit, justification const& j, literal_vector const& ante);
void propagate(literal lit, justification* j, literal_vector const& ante);
void del(clause& c);
proof_ref get_proof(bool inconsistent);
bool is_enabled() const { return m_enabled; }

View file

@ -347,7 +347,7 @@ namespace smt {
literal_vector & antecedents = m_tmp_literal_vector;
antecedents.reset();
justification2literals_core(js, antecedents);
m_ctx.get_clause_proof().propagate(consequent, *js, antecedents);
m_ctx.get_clause_proof().propagate(consequent, js, antecedents);
for (literal l : antecedents)
process_antecedent(l, num_marks);
(void)consequent;

View file

@ -724,13 +724,16 @@ namespace smt {
auto bjust = ctx.mk_justification(just);
if (ctx.clause_proof_active()) {
// assume all justifications is a non-empty list of symbol parameters
// proof logging is basically broken: it doesn't log propagations, but instead
// only propagations that are processed by conflict resolution.
// this misses conflicts at base level.
proof_ref pr(m);
expr_ref_vector args(m);
for (unsigned i = 1; i < ax.params.size(); ++i)
args.push_back(m.mk_app(ax.params[i].get_symbol(), 0, nullptr, m.mk_proof_sort()));
pr = m.mk_app(ax.params[0].get_symbol(), args.size(), args.data(), m.mk_proof_sort());
for (auto const& p : ax.params)
args.push_back(m.mk_const(p.get_symbol(), m.mk_proof_sort()));
pr = m.mk_app(m.get_family_name(get_family_id()), args.size(), args.data(), m.mk_proof_sort());
justification_proof_wrapper jp(ctx, pr.get(), false);
ctx.get_clause_proof().propagate(lit, jp, antecedent);
ctx.get_clause_proof().propagate(lit, &jp, antecedent);
jp.del_eh(m);
}
ctx.assign(lit, bjust);