-
Notifications
You must be signed in to change notification settings - Fork 42
feat: iinduction #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alvinylt
wants to merge
184
commits into
leanprover-community:master
Choose a base branch
from
ISTA-PLV:iInduction
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: iinduction #430
Changes from all commits
Commits
Show all changes
184 commits
Select commit
Hold shift + click to select a range
46a0789
Start implementing iinduction: move IntoIH from Induction.lean to Cla…
alvinylt 5421a78
Simple iinduction test
alvinylt 562fd64
Use evalTacticAt for iinduction
alvinylt 9af4f6f
Try using iRevertCore and iIntroCore separately
alvinylt 72fd7a0
Finish the proof for iinduction
alvinylt a7aeae1
Use iRevertIntro instead of iRevertCore and iIntroCore separately
alvinylt 6203c5f
Remove redundant Iris entailment in Lean context
alvinylt 7035695
Avoid unnamed variable in generated induction subgoals
alvinylt e963f76
Revert all hypotheses in the intuitionistic context
alvinylt d9fa30a
Towards using IntoIH for moving induction hypothesis from Lean's cont…
alvinylt ffcdbb3
Revert only spatial and intuitionistic hypotheses that contain x
alvinylt e94141b
Use the result of IntoIH synthesis in addIntoIH
alvinylt 8ba460a
Iteratively add induction hypotheses into the Iris proof state
alvinylt 8524a82
Towards implementing findIHs
alvinylt 998ffb8
Implement findIHs
alvinylt 4bc644c
Remove induction hypotheses from the regular Lean context
alvinylt 4f6817a
Adjust iHypsContaining
alvinylt ff5ea5c
Introducing IHs into the Iris intuitionstic context
alvinylt 2f47ceb
Use Lean.Meta.Tactic.induction instead of evalTacticAt for more flexi…
alvinylt a9be948
Generalisation to find recursor name for induction
alvinylt c627c24
Towards having explicit variable names for induction hypotheses
alvinylt a11f967
Solve kernel mismatch, currently using a placeholder theorem
alvinylt b304c88
Implement InductionState, towards finishing the placeholder theorem
alvinylt 7395139
Finish revert_IH proof, more assumptions required
alvinylt cbdadb6
Towards completing the use of InductionState
alvinylt 5a5beaa
Port type class instances into_ih_Forall and into_ih_Forall2
alvinylt aa5f430
Finish proof for intoIH_listForall
alvinylt eab9ccf
Finish proof for intoIH_listForall2
alvinylt b6b03a1
Code refactoring and comments
alvinylt 783ad43
Remove goal from InductionState, simplifications
alvinylt 31e5633
Add test for iinduction
alvinylt bfd3e59
Obtain constructor names from inductInfo: towards allowing user-given…
alvinylt e5c7a22
Towards implementing the `with` syntax
alvinylt 7d1cb7c
Pretty variables for cases in the `with` syntax
alvinylt b826e7f
Check for invalid alternative names and throw pretty error
alvinylt 43b8215
Move most of elaboration code into iInductionCore for reusability
alvinylt 48945d9
iInductionCore: alternative names being optional, use pattern matching
alvinylt 7378f8d
Code refactoring
alvinylt 3632223
More code refactoring
alvinylt 1dbd7ac
More code refactoring 2 and fix tests
alvinylt e376e70
More code refactoring and formatting
alvinylt bff359b
Implement iinduction ... using ... (user-supplied recursor name)
alvinylt e87b607
Implement iinduction ... using ... with
alvinylt a8daced
Implement iinduction ... generalizing ...
alvinylt ab75206
Fix iinduction ... generalizing ...
alvinylt 34fece6
Use binderIdent instead of ident for `with` syntax to support undersc…
alvinylt cc81368
Catch invalid, missing and duplicate constructor names when `with` sy…
alvinylt 1525cd2
Hypotheses explicitly reverted by the user using the `generalized` sy…
alvinylt 559ba5a
Consolidate tests for iinduction
alvinylt 10589a5
Define new function isIrisGoalWithForalls for findIHs: search for Iri…
alvinylt 58efe2c
Fix priority of IntoIH instances
alvinylt 062ec01
More iinduction tests
alvinylt 9a17cba
Generalisation to provide support for expressions, not just idents
alvinylt 18a9e31
Code formatting
alvinylt c95dede
Catch extra arguments for alternative names
alvinylt bd0fca7
Fallback recursor name when getCustomEliminator? fails
alvinylt 76f321b
The constructor names should depend on the recursor
alvinylt 9831208
Remove redundant comment
alvinylt 7709bbf
Add test with binary tree
alvinylt e0c690a
Bug fix for handling more than one IH in addIH, simplify InductionSta…
alvinylt 7b893ca
Pretty goal naming with clickable drop-down in InfoView
alvinylt 4d51583
Improve findIHs comment and remove redundant function isIrisGoalWithF…
alvinylt 5570273
Add more specific error message for IntoIH synthesis failure in addIH
alvinylt 05b2cb9
Refactor buildPfIntHyps as Hyps.buildIntuitionisticProof
alvinylt 2abdf66
Remove unused function: Hyps.intuitionisticProps
alvinylt 8412da6
Rename iHypsContaining to iHypsToGeneralize, refine docstring
alvinylt 73e28b6
Move addIH into addIHs inline
alvinylt 97f0ef7
Improve revert_IH docstring explanation
alvinylt d7d9da5
Rename termToFVar as generalizeTermWithFVar, more details in the comment
alvinylt 343af53
Generalise ProofModeContinuation, towards avoiding directly manipulat…
alvinylt 258aad6
Rename inductionAlts as inductionAlt for consistency with Lean.Init.T…
alvinylt ff898f6
Consolidate elaborations into one, move comment from text to elaborat…
alvinylt b22135d
Further generalise iRevertIntro, update usage of continuation function
alvinylt fec0ee0
Move code that manipulates ProofModeM to ProofModeM.lean
alvinylt 95c53c2
Simplify the handling of user-supplied tactics in iInductionCore
alvinylt d64a101
Eliminate custom-defined inductionAlt, reuse built-in definition instead
alvinylt 4f2d10b
Define structures for better code organisation
alvinylt 6b43be8
Implement tactic before alts
alvinylt 32bb9fb
Typo fix
alvinylt 43562d1
Allowing multiple constructors for the same set of tactic sequences
alvinylt d7408bb
Simplify parsing
alvinylt 024b975
Debug: remove incorrect popping of goal from ProofModeM state
alvinylt b0bd59f
Implement hole and synthetic hole on RHS of `=>` using `with` syntax
alvinylt a333ac3
Use short syntax name
alvinylt cf43a44
Improve pattern matching in parser
alvinylt 4def6f0
Simplify imports
alvinylt c53d592
Towards supporting wildcard
alvinylt a023c04
Implement wildcard as last alternative
alvinylt 931eabb
More syntax tests
alvinylt 8f19e97
Check for redundant wildcard alternative
alvinylt f2fb850
More tests for wildcard syntax
alvinylt 0127a9f
Minor refinements
alvinylt afccd6c
Check for redundant alternative names after the first tactic
alvinylt 812b3eb
Error handling without explicit checks with a function
alvinylt 5b32861
Error message refinements
alvinylt d39bce3
Minor refinements
alvinylt 0731db4
Implement checkDependentHyps and refactor the way targets for iRevert…
alvinylt 3a2f03c
Towards pretty suggestions
alvinylt e568514
Fix spacing in pretty TryThis suggestion using ppSpace, adjust order …
alvinylt 269d7b6
Fix missing introduction subgoal introduction when `with` syntax is n…
alvinylt febf3f2
Bug fix: withoutFVars should wrap over addBIGoal
alvinylt 196450a
Minor formatting issue
alvinylt 4b85ced
Minor refinements: tactic explanation
alvinylt 675be7c
Merge remote-tracking branch 'upstream' into iInduction
alvinylt 5d00ede
Update intuitionistically_sep_2 as intuitionistically_sep_mpr in Expr…
alvinylt 8c29bed
Update sep_mono_l and sep_mono_r as sep_mono_left and sep_mono_right …
alvinylt 17aefd6
iinduction usage: wp_makeList in HeapLang/Lib/Quicksort.lean
alvinylt f1f0263
iinduction usage: Instances/Lib/FUpd.lean
alvinylt 2d26cef
iinduction usage: wp_pure_step_fupd in ProgramLogic/Lifting.lean
alvinylt bf2fbe2
Simplify alternative name comparison
alvinylt 02678a2
Minor refinements: tests for error messages and alternative names
alvinylt ae4fd2d
Tests with binary tree
alvinylt a5fcc55
Tests with natural numbers and lists
alvinylt 7714f79
Consolidate iinduction tests
alvinylt 5782aee
More consolidation of iinduction tests
alvinylt b71df06
More consolidation of iinduction tests: `generalize` syntax
alvinylt 5f81ec0
Minor comment fix
alvinylt 107e19d
Another test with Tree.mirror
alvinylt 57ecb81
Test iinduction for pure hypotheses and spatial hypotheses
alvinylt 9ba7098
irevert bug fix
alvinylt 341e827
Fix missing Iris hypotheses in "Try this" suggestion
alvinylt dcd1206
Ensure the "Try this" suggestion handles order of hypotheses in `gene…
alvinylt 38090e0
Typo fix
alvinylt ae2dc76
Implement "Try this" suggestion for iloeb and irevert
alvinylt ab12f97
Adjust the priority of IntoIH type class instances
alvinylt 78c7e28
Tests with NTree for `List.Forall₂`
alvinylt 1386255
Define containsIrisGoal to recursive traverse an expression to see if…
alvinylt 23b6d27
Complete proof example that uses `iinduction` with `intoIH_listForall₂`
alvinylt f21db0a
Remove unused definitions in tests
alvinylt 53d1c3d
Rewrite comment for checkDependentHyps
alvinylt c684029
Remove intoIH_listForall
alvinylt f66b5ce
Merge remote-tracking branch 'origin/master' into iInduction
MackieLoeffel d2dfc2f
Add proof for testing `iinduction` with `NTree.induction_principle`
alvinylt 0724695
Check for forward dependencies in `iHypsToGeneralize`
alvinylt 4d9d5a1
Avoid repetitive code for `checkDependentHyps`
alvinylt 2721180
Refactor code in `iInductionCore`
alvinylt 65b92b3
Minor refactoring
alvinylt 3bd9128
Factorise the continuation function within `iInductionCore`
alvinylt 2cbe8ef
Use `Option.forM` to avoid unnecessary no-ops
alvinylt 9c4fc02
Use `Std.HashSet` in `checkCtors` for efficient check for duplicates …
alvinylt 3c4e87a
Condense comments and syntax formatting
alvinylt 8f71934
Minor formatting
alvinylt bee1c3c
Minor fix
alvinylt 1c98244
Merge remote-tracking branch 'upstream' into iInduction
alvinylt 2c57b4a
Update `intoIH_entails` in response to #469
alvinylt 0a6fd19
Eliminate unnecessary use of `Option` for `genSelTargets` in `iInduct…
alvinylt 40141f3
Rename `k` as `kIntro`, use `k'` inline to avoid variable declaration
alvinylt 7df0c36
Minor comment improvements
alvinylt 2cbd1ad
Refactor `addBIGoalRunTactics`
alvinylt 50ee146
Towards a one-liner `findIHs`
alvinylt 7afbc84
Move `findIHs` inline and further condensation
alvinylt 2943d7a
Further condense `ihFVars`
alvinylt 572f50a
Minor simplifications regarding monadic operations
alvinylt fc2239a
Minor simplifications
alvinylt 89a8226
Eliminate `containsIrisGoal` by moving it inline
alvinylt e54087d
Always require manual resolution of hypotheses dependent on the induc…
alvinylt 93d8585
Update comments
alvinylt d4073c4
Typo fix
alvinylt 27d03eb
Refactor code in `Revert.lean`: introduce `getDependentHyps`
alvinylt c73bcbb
New function `getCompleteSelTargets` for the fixed selection targets
alvinylt 5337208
Implement `generalizing!` syntax: implicit reverting
alvinylt 6ca077e
Minor formatting
alvinylt 7aa10c2
Test `generalizing!` syntax
alvinylt 9603821
Print "Try this" suggestion only when all names are accessible
alvinylt bbaa9ac
Print second "Try this" suggestion
alvinylt 697ddf4
Implement `generalizing!` for `iloeb`
alvinylt aa7060c
Towards better error printing with inaccessible names
alvinylt 869d8e3
Implement `irevert!` as an alternative to `irevert` for auto-resoluti…
alvinylt 7f053e1
Bug fix: spatial hypotheses should also be checked for `irevert`
alvinylt 07a1c6b
Handle the printing of inaccessible names properly
alvinylt 7460200
Update tests
alvinylt c69fac3
Minor bug fix
alvinylt bffe809
Code formatting 1
alvinylt bc5684d
Code formatting 2
alvinylt ff45f2b
Code formatting 3
alvinylt aabdbe2
Reduce code repetition with `iLoebCore`
alvinylt 11d0baa
Update `ProofMode/Porting.lean`
alvinylt 0ae8fb3
Update `tactics.md`
alvinylt c3ff1e7
Typo fix
alvinylt 77335b6
More accurate descriptions in `tactics.md`
alvinylt e91f09e
Add a test for `irevert!`
alvinylt 348b093
Add a test for `iloeb` with `generalizing!` clause
alvinylt 462d2d3
Minor formatting
alvinylt d8dc168
Merge remote-tracking branch 'upstream/master' into iInduction
alvinylt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.