Adding eassert, eset, epose, etc.#248
Conversation
|
@herbelin, you appear to have commitment issues ;) Otherwise, cool! As for generalizing vs. extentializing - I had a discussion with Pierre Courtieu IIRC about a tactic that was like eapply, but generalized over remaining args instead of making them holes. Point being - it would be useful to have a general method that takes something that generates holes and instead turns those into generalizations. An "unrefine"? |
| (TacLetTac(na,c,clp,b,eqpat)) | ||
| (Tacticals.New.tclWITHHOLES false (*in hope of a future "eset/epose"*) | ||
| (TacLetTac(ev,na,c,clp,b,eqpat)) | ||
| (Tacticals.New.tclWITHHOLES ev (*in hope of a future "eset/epose"*) |
There was a problem hiding this comment.
Shouldn't this comment be removed?
9cd8a9d to
59ea032
Compare
|
This is likely a naïve question, but why are two sets of tactics needed? Why can't the the existing set, pose, etc... gain the capability of generalizing over evars? |
|
@ejgallego Backwards compatibility. If you make |
|
@JasonGross umm, it looks to me that if automation would fail because of that, it would be very fragile automation to begin with. I'm pretty convinced that supporting fragile automation is a futile goal. |
|
@herbelin do you want this PR to be discussed for integration on the 8.7 roadmap? |
|
@maximedenes: yes, I think it is natural to have them, even if it gets eventually supersed by a new more flexible model. (And I miss them from time to time.) |
|
@herbelin It would be good if no new tactics were introduced without proper documentation. Not saying that this PR cannot get merged right now, but if it is then it should be on your TODO list to document the variants before the 8.7 beta release. Another remark is that if we actually get an attribute system one day, then the e variants of tactics could instead be replaced by a uniform attribute, which could be set to emulate the behavior of the basic variant, of the e variant, or of the generalizing variant which was discussed above. And it could also be set more globally via an option... |
|
@Zimmi48: doc: I agree. To be eventually superseded by a more uniform attribute system, no objection at all, on the contrary, since it would just become a particular case of a more general mechanism. |
59ea032 to
fabd7ce
Compare
|
Fixed bugs and added doc. I remained vague on the specification of what a generated existential variable is, but I think it is a general issue of the documentation, if not of the system in general, to have a clearer semantics on where (dependent) existential variables go (on the shelf? at which position? etc.). |
47107f8 to
18a6c65
Compare
|
Hugo the PR is failing to build on Travis, could you fix it? |
18a6c65 to
95f8ee0
Compare
|
@ejgallego: fix applied, now ok on travis. Otherwise, on coqdev, @maximedenes asked about "What is the long term plan on e/not e-tactics? How is this a first step towards this long term plan?". I answered that if the discussion is ripe for a long term plan on e-tactics I'm ok to be the one who organizes it. In particular, we can consider having an e-variant for each existing tactic, we can consider providing a modifier to stop a tactic failing on unresolved evars, or consider making stopping failing on unresolved evars to be the default (did I miss other alternatives)? But whatever the long term plan is, a first step is to allow each individual existing tactic to be able to behave in the e-way (in the sense of allowing unresolved evars). So, whatever long term plan we have, I don't see how to avoid having this PR as a step towards it. Also, I'm ready to extend the implementation of e-variants to other tactics, so that these are accessible using a generic modifier or general option, or whatever, but I'm not necessarily enthousiastic to add a concrete syntax for all of them. More precisely: I think it makes sense, by regularity, to have |
|
@maximedenes: did you take time to study my answer? To improve the fluidity of development, I really think that we should make progress on the PRs pending for a long time (congratulations in passing for today's efficiency!), and, unless I missed something in the discussion, this one is blocking on your answer. |
|
No strong opinion on this one, however as a user it doesn't feel great to have so many versions of tactics. In particular I was discussing with @Zimmi48 today how ssr |
|
There was some related discussion in #449 (comment) (where I remarked in particular that @ejgallego Now, I'd be interested to hear how this also replaces the e-variants proposed by Hugo here. |
|
@ejgallego: It is certain that we can reduce the number of tactics, but
But, maybe are you actually talking about the number of tactics in general, independently of the existence of an e-variant? In particular, when you say that ssr is versatile enough to replace 4 tactics, I guess that you are referring to Also, we tried several times in the past to support in vanilla But if you think that such a merge of ssr |
|
@herbelin You misread a bit of @ejgallego comment. He's talking about the ssr tactic |
|
I think adding new tactics has some risk because of the number of already existing tactics, but is an ok compromise as a step towards a model that factors them using attributes for instance. @herbelin Can you rebase this PR so that we merge it? Thanks! |
95f8ee0 to
28c6566
Compare
|
@Zimmi48: Ah, sorry, I indeed misread @ejgallego's comment. It happens that vanilla Actually, it is even the other way round, So, maybe, ssr, which roughly derived from vanilla Coq as it was at the beginning of the 2000's, just kept vanilla's |
|
@Zimmi48, @ejgallego: By the way, it is a long time that I wonder about the user feedback wrt the |
|
@herbelin From what Georges Gonthier told me yesterday, |
|
@Zimmi48: The tactic Maybe it is time that Georges and the Coq developers from the 2000's meet and get beyond the syntactic quarrel from this period of time, concentrating on how to work together rather than maintaining a futile "schism", as P. C. called it. |
|
Thanks! This now looks great to me. |
|
@herbelin Travis passed. Could you isolate the commits that are really implementing what the title of this PR suggests? We could then merge it. Thanks! |
|
@maximedenes: I made #693 for the fix. If we want to nitpick, there is also "Support for using type information to infer more precise evar sources." which, in rare circumstances, changes the name the user sees for evars whose name is generated by Coq (typically evars associated to a dependent |
5b83fe6 to
54dfab3
Compare
This allows a better control on the name to give to an evar and, in particular, to address the issue about naming produced by "epose proof" in one of the comment of Zimmi48 at PR rocq-prover#248 (see file names.v).
|
Something is wrong, the test-suite does not pass. |
|
LGTM. |
a goal with unresolved evars.
evars. This is for consistency with the rest of the language. For instance, "eremember" and "epose" are supposed to refer to terms occurring in the goal, hence not leaving evars, hence in general pointless. Eventually, I guess that "e" should be a modifier (see e.g. the discussion at rocq-prover#3872), or the difference is removed.
Includes fixes and suggestions from Théo.
This allows a better control on the name to give to an evar and, in particular, to address the issue about naming produced by "epose proof" in one of the comment of Zimmi48 at PR rocq-prover#248 (see file names.v). Incidentally updating output of Show output test (evar numbers shifted).
54dfab3 to
bbde815
Compare
|
@maximedenes: Just a shift in evar ID for emacs. Fixed. By the way, there is another problem with test-suite on MacOS X since #687: |
|
@SkySkimmer: thanks. |
This allows a better control on the name to give to an evar and, in particular, to address the issue about naming produced by "epose proof" in one of the comment of Zimmi48 at PR rocq-prover#248 (see file names.v). Incidentally updating output of Show output test (evar numbers shifted).
248: Remove MTele accessors. r=Janno a=Janno Accessors are less general than packed arguments (i.e. `ArgsOf`) and much less convenient to use on top that. Co-authored-by: Jan-Oliver Kaiser <janno@mpi-sws.org>
This is a natural extension of the language of primitive tactics. It provides e-variants for
assert,pose,set,remember,pose proof,enough, allowing to manipulate partial terms or statements, and hence to ease a way to develop proofs by refinement and unification. One can for instance see it as adding some benefits of "refine" to usual tactics (typically, I found the need foreassertwhen implementingfunctional extensionality in).Not a commitment to the e-policy. With a translating tool, the e-prefix could eventually become the default if considered to be the good way to go. In the meantime, I however don't see other alternatives than adding specific e-variants. (See also #3872.)
Not a commitment to say that statements with free evars should be kept with unresolved evars rather than generalized over unresolved evars. For instance, Matthieu's
`could be generalized to tell "generalize" rather than "keep evars/fail", as in, say, providingassert `(_ = _)to be possibly interpreted asassert (forall A (x y : A), x = y).Not a commitment to say that the syntax of tactics should be hard-wired in
g_tactic.ml4. I followed the easy path but maybe these tactics could already be definable withTACTIC EXTENDinstead.No documentation yet.