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
When ltac is used in a notation, insert the variables bound by the notation as uconstr. #8200
Conversation
1f41752
to
0da2382
Compare
Hi @JasonGross, both fiat-crypto and bedrock fail now... could you have a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not realize that it would solve 3 bugs at the same time!
Anyway, that's perfect to me. Maybe the CHANGES
text might look a bit cryptic for a non-expert though. Assuming that this is acceptable for @gares and @JasonGross, I would either say something like "Notations expanding to expressions containing calls to ltac:(tac)
now accept their arguments to have unresolved existential variables." or just say nothing.
Seeing last comment by @CohenCyril at #8190, I realized that other fixes are possible, with other implications, which seem related to the above discussion on using type classes or not. I don't know if it is better to have the discussion here or there, but I copy-paste my answer: Another fix could be to change instead the interpretation function for
works, while, currently, it fails with |
I am not sure what's up with bedrock running out of memory (@andres-erbsen, do you know?). For fiat-crypto, I've reported the issue as #8208. I can push a fix for this particular instance, though since I don't have this branch checked out locally, I'm not going to build all of fiat-crypto with it at the moment. Feel free to submit an overlay PR that wraps all the relevant bindings of |
And, given that this is not a strictly backwards compatible fix (because things like |
open_constr has been changed to uconstr, as I requested
Indeed, the need for overlays makes this a non-backportable fix in the end. Sorry @CohenCyril, you'll have to backtrack on creating the new CHANGES section and move this back where it was initially. |
- code by Hugo @herbelin and @JasonGross - Notations expanding to expressions containing calls to `ltac:(tac)` now accept that their arguments contain unresolved existential variables. - fixes coq#8190, coq#3278 and coq#4728 - adding a test-suite file for the bug
I don't quite like the fact that Ltac automatically performs coercions to emulate dynamic subtyping. This really doesn't scale (e.g. what about lists of uconstrs?). The same kind of problem with term notations will arise in Ltac2 and by design there is no way there to get the runtime to perfom coercion. That means that the type of variables coming from notations would be Therefore, for the time being I think I'd rather prefer having Ltac1 taking term notation arguments as |
Other than performance (which is how uconstr is introduced in the manual), what flexibility does uconstr provide? I do find myself writing |
@ppedrot I'm not convinced. Note that Ltac1 already dynamically casts Tactic Notation "mycbv" constr(c) tactic3(tac) := let v := eval cbv in c in tac v.
Goal True.
let v := uconstr:(I) in mycbv v (fun v' => pose v'). I think this support should be extended to constructions like In Ltac2 describing things as |
@@ -1,4 +1,4 @@ | |||
Changes from 8.8.2 to 8.9+beta1 | |||
Changes from 8.8.1 to 8.9+beta1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traditionally, this section was called "Changes beyond 8.8" to avoid anticipating too much (and was renamed at release time). Now, a 8.8.2 should indeed likely happen so this section title will likely reveal accurate.
How to make this PR progress? Is there an agreement on My alternative proposal here is probably better than encoding an |
I actually have no clue how to decide which of the four options (i.e. {your first proposal, your alternative proposal} * {uconstr, open_constr} ...) |
@CohenCyril: re-reading the discussion, my feeling is that answering the So, my feeling is that to make this PR progress, one need to make a temporary somehow arbitrary choice. We can keep it as it is. We can throw a dice. If you have some more time to dedicate to the PR, I can make a choice for you. If not, as far as I'm concerned, I'd be happy as it is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, I think this is too big a change for 8.9, as it will break subtle code in the wild. If anything, let's have a technical discussion and postpone this to 8.10.
Looks like there are design problems which need to be worked out. A PR is not the place for that, try an issue, cep or maybe discourse thread. |
Kind: bug fix
Fixes #8190, #3278 and #4728