Skip to content

Instantly share code, notes, and snippets.

@lironsade
Created November 25, 2017 19:26
Show Gist options
  • Save lironsade/45c0fd19f476e2e283e033a11d15730e to your computer and use it in GitHub Desktop.
Save lironsade/45c0fd19f476e2e283e033a11d15730e to your computer and use it in GitHub Desktop.
def prove_instance(proof, instance):
""" Return a proof of the given instance of the inference rule that proof
proves, via the same inference rules used by proof """
# Task 5.2.1
instantiation_map = dict()
if not instance.is_instance_of(proof.statement, instantiation_map):
return None
my_lines = []
for line in proof.lines:
my_lines.append(
DeductiveProof.Line(
instantiate(line.conclusion, instantiation_map),
line.rule, line.justification)
)
return DeductiveProof(instance, proof.rules, my_lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment