Skip to content

Commit

Permalink
Added a rudimentary QED
Browse files Browse the repository at this point in the history
  • Loading branch information
isahers1 committed Apr 12, 2022
1 parent b1cd776 commit 0cd2606
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Binary file modified __pycache__/proof.cpython-39.pyc
Binary file not shown.
3 changes: 1 addition & 2 deletions abelian_proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@
p.forallElim(1,['b'])
p.substituteRHS(8,9)
p.identleft(10)

## HOW DO WE FINISH THE PROOF?
p.qed(['b','a'],11)
10 changes: 8 additions & 2 deletions proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ def __init__(self, label, assumption, goal=None, steps=[], justifications = []):
# self.currAssumption = [goal.assum] # is this neccessary?
self.show()

def qed(self):
return self.goal.conc in self.steps
def qed(self, replacements, lineNum):
if isinstance(self.goal, forall): # how do I know a line is a replacement of a forall?
if self.goal.replace(replacements) == self.steps[lineNum]: # how do I know replacement variables are all arbitrarily introduced?
self.steps += [True]
self.justifications += [f"Proof is finished by line {lineNum}"]
self.show()
else:
return self.goal.conc in self.steps

def undo(self):
self.steps = self.steps[:-1]
Expand Down

0 comments on commit 0cd2606

Please sign in to comment.