forked from coq/coq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support quotations (genargs) in patterns
For coq#11641 `constr_pattern` is split in 2 types, one is allowed to contain genargs and the other not. To share code this uses a GADT `'i constr_pattern_r`, with genargs allowed instantiated to `` [`uninstantiated] constr_pattern_r ``, without genargs instantiated to `` constr_pattern = [`any] constr_pattern_r ``. Ltac2 instantiates the genargs in the `ml_interp` for the TacExt ie a pattern expression is interned to `` [`uninstantiated] constr_pattern_r `` then interped to `constr_pattern`. Most code (basically everything except ltac2) uses only the no-genarg version (TODO change this? but currently we have no non-ltac2 genargs handled). For now I just have it handling `$pattern:` quotations. For instance something like `ltac2pat:(tactic : pattern)` should be easy to implement (main issue is how to handle the tactic monad switch, but maybe `interp_pat` should live in the monad?). Exposing a `preterm -> pattern` should also be possible. Also maybe internalization should pass around `pattern_mode`? This would let us intern `ltac2:(tac)` with different expected types depending on if we're interning as constr or pattern. PS the genarg mod_subst operators should probably be in their own gensubst module, for now out of lazyness I put them in genarg.ml
- Loading branch information
1 parent
d4bc060
commit 480cd79
Showing
22 changed files
with
308 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
overlay elpi https://github.com/SkySkimmer/coq-elpi pattern-quotations 17667 | ||
|
||
overlay equations https://github.com/SkySkimmer/Coq-Equations pattern-quotations 17667 |
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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.