From 495203bf962f9d37f85eca09665f63d934186896 Mon Sep 17 00:00:00 2001 From: Isaac Date: Mon, 18 Apr 2022 16:08:57 -0700 Subject: [PATCH] qed on failed subproof --- __pycache__/logicObjects.cpython-39.pyc | Bin 8719 -> 9121 bytes __pycache__/proof.cpython-39.pyc | Bin 20463 -> 21039 bytes contradiction_proof.py | 3 ++- logicObjects.py | 11 +++++++++++ proof.py | 15 ++++++++++++++- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/__pycache__/logicObjects.cpython-39.pyc b/__pycache__/logicObjects.cpython-39.pyc index 228e8e8c28c7cce11a4a5cea5adb71ce783752fb..7285b63b78d5c987cbac85559cad38de8906afaa 100644 GIT binary patch delta 1538 zcmZ`(OKclu5Z-^+k9BNs?AVUoG_E(QRBAQYq)nO<(!}IZXlg=fpbAkf*NL}r()f{C zhliCYh^h#Q1Bekw2(?lrxNzZdKyX2-go=<5QsIDPIE9DA2_eCy2*S)dwsU~BW_ETS z-#;^+`Cpy7^@x`9dOIX~YQJR`U(r9*(k>j09LG)9F8=Q8!L*`<%H5mNs@N2(;;K9+ zft|b|ff;}A_E{25nZrd*J6o)*tr%t^n>E(6*(Jg1y+@(9jcAg{oFJALTY^BPDJc`# zk~c+FY|7WfutZvsm-)TkL6VeLuFD4+T3c8mFKLzh!qS`+x6i`1m!R&+{ra!}?C$Pv zaANw-ORwv31^P(_KePLZkwT@{f;VTH8^ua>rCc(rQ157e0ym+-+$;r&rHM=rF-h1& zhwxZb^R?@Afl+~Mb~f(BgtJFPu;Ph^kCA_h$mA1Mq1x!Dz%eX4qj-mkdI~4qFN=Bn z$_?TYj(cW9gXH)mM>rZ0ifV&F@*kIB2!Hfk6qj+tJ0nhFt}|fg#Fp@eHys!vDa&Ep zSvp7|@3Qk@Jgv<*PLT>8?v}55pM?$i9BokBghQ*!|ZDE0iYz z9%E+3cd}%a!mYP}>#DJ46pd2Vgmd^>_>_1LzYHG{<9OE_2{Zm1MEmRWzyziLj=P=J znN|^>;xCb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vdPb2ga!mJ20 z0P|#r=}6cRZKbrRSLq4ehm?{%U(hVYBl6rUgrA9#wUKB(7XKk9W>S~vpF|^wE119x iPSI**H$B(gpZzC4mkXEGSG)b8(0vn|#GW>huanVb;|v!@R>oikP2bHg86$m|G&Lrd2Hcw* R5h%;(Gr26#fAaCb3;;jk6SDvS diff --git a/contradiction_proof.py b/contradiction_proof.py index a8e489e..dcac2a3 100644 --- a/contradiction_proof.py +++ b/contradiction_proof.py @@ -23,4 +23,5 @@ p.switchSidesOfEqual(8) p.notElim(6,9) p.concludeSubproof(6) -#p.impliesIntroduction([4,5],11) \ No newline at end of file +p.impliesIntroduction([4,5],11) +p.qed(12) diff --git a/logicObjects.py b/logicObjects.py index 8ec70d7..4075cee 100644 --- a/logicObjects.py +++ b/logicObjects.py @@ -70,6 +70,17 @@ def elim(self, arg): if arg==self.assum: return self.conc + def __eq__(self, other): + return self.assum == other.assum and self.conc == other.conc + + def __repr__(self): + assumptionstr = "" + for assumption in self.assum: + assumptionstr += str(assumption) + assumptionstr += ", " + assumptionstr = assumptionstr[:-2] + return assumptionstr + " → " + str(self.conc) + class Not: def __init__(self, arg): self.arg = arg diff --git a/proof.py b/proof.py index 6041010..13e5698 100644 --- a/proof.py +++ b/proof.py @@ -615,4 +615,17 @@ def notElim(self, lineNum1, lineNum2): self.justifications += [f'Contradiction from lines {lineNum1} and {lineNum2}'] self.show() else: - print(f"The statement on line {lineNum1} isn't a Not") \ No newline at end of file + print(f"The statement on line {lineNum1} isn't a Not") + + def impliesIntroduction(self, lineNumsAssums, lineNumConc): # needs work, a lot of it + ''' + Introduce an implication based on assumptions and a conclusion + :param lineNumsAssums: the lines containing the assumptions + :param lineNumConc: the line to conclude + ''' + assums = [] + for line in lineNumsAssums: + assums.append(self.steps[line]) + self.steps += [Implies(assums,self.steps[lineNumConc])] + self.justifications += [f"Introduced implies based on assumptions on lines {lineNumsAssums} to conclude line {lineNumConc}"] + self.show() \ No newline at end of file