def testExport2(self): """Repeated theorems.""" pt1 = ProofTerm.assume(Term.mk_equals(x, y)) pt2 = ProofTerm.reflexive(f) pt3 = ProofTerm.combination(pt2, pt1) # f x = f y pt4 = ProofTerm.combination(pt3, pt1) # f x x = f y y prf = pt4.export() self.assertEqual(len(prf.items), 4) self.assertEqual(thy.check_proof(prf), pt4.th)
def get_proof_term(self, thy, t): if t.ty != Term.COMB: raise ConvException() pt1 = self.cv1.get_proof_term(thy, t.fun) pt2 = self.cv2.get_proof_term(thy, t.arg) # Obtain some savings if one of pt1 and pt2 is reflexivity: if pt1.th.is_reflexive(): return ProofTerm.arg_combination(thy, pt1.prop.rhs, pt2) elif pt2.th.is_reflexive(): return ProofTerm.fun_combination(thy, pt2.prop.rhs, pt1) else: return ProofTerm.combination(pt1, pt2)
def get_proof_term(self, thy, x, pts): assert pts[0].prop.is_equals(), "fun_combination" return ProofTerm.combination(pts[0], refl(x))
def get_proof_term(self, thy, f, pts): assert pts[0].prop.is_equals(), "arg_combination" return ProofTerm.combination(refl(f), pts[0])