Created
November 25, 2017 19:26
-
-
Save lironsade/45c0fd19f476e2e283e033a11d15730e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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