You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify each proof step in tactic mode. Roughly, the idea for step (old :: ProofSnapshot, new :: ProofSnapshot) is to:
(1) Look at all goals in old which no longer exist in new. For each one:
(2) Retrieve it's assignment in new. For each metavariable in the assignment:
(3) If it is a goal which exists in new, it's fine and we do nothing since we can assume it will be solved in future steps. In this case, we replace it with sorry in the assignment so that the expression can be sent to kernel.
(4) Otherwise, it's an error since there is a metavariable which won't be assigned in the future.
(5) Send the assignment with metavariables replaced by sorry to kernel for a type check.
@kim-em I think this feature is still important. It complements the proofStatus feature (#63) which checks the whole proof term in each branch and thus reports false errors any time the proof branches (e.g. due to have), even when the proof branch is in fact correct. This new stepVerification feature simply checks that no goals disappear during tactic application (i.e. each goal present in stateBefore and not present in stateAfter is correctly assigned). This is useful in automated theorem proving.
proofStatus will never report completed because the proof branches using have. However, we can believe the proof due to the fact that each stepVerification is "OK" and goals is empty at the end.
For an example of an incorrect proof, consider this input:
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Verify each proof step in tactic mode. Roughly, the idea for step
(old :: ProofSnapshot, new :: ProofSnapshot)is to:oldwhich no longer exist innew. For each one:new. For each metavariable in the assignment:new, it's fine and we do nothing since we can assume it will be solved in future steps. In this case, we replace it withsorryin the assignment so that the expression can be sent to kernel.sorryto kernel for a type check.Compared to #63, this approach could eliminate false negatives like https://github.com/leanprover-community/repl/blob/master/test/name_generator.in, where checking the whole proof term doesn't work since in a
havebranch we don't see the metavariable assignments from the main branch.