fix(library/blast/congruence_closure): do not adjust proofs when blast.cc.heq == false

This commit is contained in:
Leonardo de Moura 2016-01-10 15:28:16 -08:00
parent e9d24ec152
commit 912bccb3f9

View file

@ -1220,6 +1220,7 @@ expr congruence_closure::mk_congr_proof_core(name const & R, expr const & lhs, e
it = &(tail(*it)); it = &(tail(*it));
} }
expr r = mk_app(spec_lemma->m_congr_lemma.get_proof(), lemma_args); expr r = mk_app(spec_lemma->m_congr_lemma.get_proof(), lemma_args);
lean_assert(g_heq_based);
if (spec_lemma->m_heq_result && !heq_proofs) if (spec_lemma->m_heq_result && !heq_proofs)
r = b.mk_eq_of_heq(r); r = b.mk_eq_of_heq(r);
else if (!spec_lemma->m_heq_result && heq_proofs) else if (!spec_lemma->m_heq_result && heq_proofs)
@ -1263,10 +1264,12 @@ expr congruence_closure::mk_congr_proof_core(name const & R, expr const & lhs, e
lean_assert(!lemma->m_heq_result); lean_assert(!lemma->m_heq_result);
r = b.lift_from_eq(R, r); r = b.lift_from_eq(R, r);
} }
if (lemma->m_heq_result && !heq_proofs) if (g_heq_based) {
r = b.mk_eq_of_heq(r); if (lemma->m_heq_result && !heq_proofs)
else if (!lemma->m_heq_result && heq_proofs) r = b.mk_eq_of_heq(r);
r = b.mk_heq_of_eq(r); else if (!lemma->m_heq_result && heq_proofs)
r = b.mk_heq_of_eq(r);
}
return r; return r;
} }
} else { } else {
@ -1458,10 +1461,12 @@ optional<expr> congruence_closure::get_eqv_proof(name const & R, expr const & e1
lhs = path2[i]; lhs = path2[i];
} }
lean_assert(pr); lean_assert(pr);
if (heq_proofs && R == get_eq_name()) if (g_heq_based) {
pr = b.mk_eq_of_heq(*pr); if (heq_proofs && R == get_eq_name())
else if (!heq_proofs && R == get_heq_name()) pr = b.mk_eq_of_heq(*pr);
pr = b.mk_heq_of_eq(*pr); else if (!heq_proofs && R == get_heq_name())
pr = b.mk_heq_of_eq(*pr);
}
return pr; return pr;
} }