Package mepk.kernel
Class Proof
java.lang.Object
mepk.kernel.Proof
- Direct Known Subclasses:
ExpandedAbbreviationsProof,ProofStep,TrivialProof,TrustedProof
A proof is a recipe for constructing one set of statements from another using
only
ProofSteps. Proofs should be values: it should not be
possible to modify them after they have been created.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanabstract Map<String,Abbreviation> Return the abbreviations used by this proof.Return the set of statements constructed by this proof from thegroundingstatements.Return the set of statements which form the basis of this proof.abstract JustificationgetJustificationFor(Statement statement) Return a justification for the given statement.final inthashCode()final voidverify()Verify this proof, by checking itsjustificationsand recursively verifying theirproofs.protected final voidverifyStatementsAreJustified(Set<Statement> grounded) Recursively check that each of the given statements is justified: it must either be one of this proof'sgroundingstatements, or have aJustificationwhoseProofStepyields it and whoseproofjustifies that step's prerequisites (which are checked recursively).
-
Constructor Details
-
Proof
protected Proof()Create a new proof.
-
-
Method Details
-
getGrounding
Return the set of statements which form the basis of this proof.- Returns:
- the grounding statements
-
getGrounded
Return the set of statements constructed by this proof from thegroundingstatements.- Returns:
- the grounded statements
-
getAbbreviations
Return the abbreviations used by this proof.- Returns:
- the abbreviations
-
getJustificationFor
Return a justification for the given statement.- Parameters:
statement- a statement which is an element ofgetGrounded()- Returns:
- either
null, meaning that no justification is necessary becausegetGrounding().contains(statement); or aJustificationwhich gives aproof stepthat constructs the statement, and aproofthat constructs all prerequisites of the proof step.
-
hashCode
public final int hashCode() -
equals
-
verify
Verify this proof, by checking itsjustificationsand recursively verifying theirproofs.- Throws:
MEPKVerificationException- if the verification fails.
-
verifyStatementsAreJustified
protected final void verifyStatementsAreJustified(Set<Statement> grounded) throws MEPKVerificationException Recursively check that each of the given statements is justified: it must either be one of this proof'sgroundingstatements, or have aJustificationwhoseProofStepyields it and whoseproofjustifies that step's prerequisites (which are checked recursively). This proof must not have anyabbreviationsleft to expand.- Parameters:
grounded- the statements to check; must be a subset ofgetGrounded()- Throws:
MEPKVerificationException- if any statement is not justified
-