Allow pattern and type annotations in propset notation
This allows to use patterns and type annotations in the propset
notation, Like {[ (x,y) | ... ]}
or {[ x : T | ...]}
or even {[ (x, y) : A * B | ...]}
.
However, for both the old and new notation, this notation immediately break if someone adds a binary infix |
notation downstream, In which case this will be parsed as a singleton of whatever the result of the |
operation is. This was already the case before, so anyone that did that already broke the original propset
notation
Merge request reports
Activity
added 1 commit
- fb5c6950 - Add a pattern variant of the propset notation
added 1 commit
- 1f32c75a - Add a pattern variant of the propset notation
- Resolved by Thibaut Pérami
You might be running into https://github.com/coq/coq/issues/16042
- Resolved by Robbert Krebbers
Might be worth looking at how we have done this for big ops in Iris, iris!867 (merged)
added 1 commit
- e87b3a26 - Allow patterns and type annotations in propset notation
I found the correct dark corner of the Coq manual to do this: https://coq.inria.fr/refman/user-extensions/syntax-extensions.html#binders-bound-in-the-notation-and-parsed-as-terms. With this one can write
{[ (a,b) : A * B | a = b]}
without any grammar ambiguity. Basically the rule still technically starts as{[ TERM
, but then when the full grammar rule forpropset
is reduced, Coq will check that the bit before the|
is actually a pattern, and otherwise fail to reduce. It allows a pattern with a type annotation because it's in a binder position in the target of the notation- Resolved by Thibaut Pérami
Great. Would be good to have some tests to let CI check that it keeps on working.
- Resolved by Thibaut Pérami
What ever you do, please leave comments in the code that explain anything unusual that's going on, and links to wherever one can learn more about the involved tricks if applicable (like that link to the Coq reference).
Also, the MR description seems out-of-sync with the MR contents.
- Resolved by Ralf Jung
added 1 commit
- db05f07d - Allow patterns and type annotations in propset notation
added 1 commit
- c2f64d9d - Allow patterns and type annotations in propset notation
- Resolved by Thibaut Pérami
added 1 commit
- defc46c4 - Allow patterns and type annotations in propset notation
- Resolved by Thibaut Pérami
added 1 commit
- cb628394 - Allow patterns and type annotations in propset notation
Is this good to go then? Or do you have any other comments? @jung @robbertkrebbers
- Resolved by Thibaut Pérami
Sorry for forgetting about this. The only thing missing is a CHANGELOG entry.
added 19 commits
-
cb628394...cafd7113 - 18 commits from branch
iris:master
- 66e94d20 - Allow patterns and type annotations in propset notation
-
cb628394...cafd7113 - 18 commits from branch
added 1 commit
- 4e203204 - Allow patterns and type annotations in propset notation
- Resolved by Robbert Krebbers
added 5 commits
-
11300cbb...62680a79 - 3 commits from branch
iris:master
- 3aa5cd2d - Allow patterns and type annotations in propset notation
- fc4a5089 - Improve CHANGELOG.
-
11300cbb...62680a79 - 3 commits from branch
enabled an automatic merge when the pipeline for fc4a5089 succeeds
mentioned in commit 69984fab
mentioned in issue #216