-
Notifications
You must be signed in to change notification settings - Fork 637
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
[declare] [tactics] Move declare to vernac
#12130
[declare] [tactics] Move declare to vernac
#12130
Conversation
17cd81d
to
e842d7f
Compare
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 am fine with most of this PR, but I'd prefer having abstract.ml
still living with tactics. The fact that it relies currently on upper features is an implementation artifact that can be solved in more principled ways. By no means it is a command, otherwise you lose most of its usecases. You should use a hook instead for the time being.
This would make me cringe. |
Why? I'd bet I could move it there and nobody would realize for years. Eauto and Class_tactics are not used by Coq so indeed I'm not sure what's the point of linking them in as "dead" modules instead of adding them a non-linked lib. |
ltac is about the ltac language, not the tactics accessed through it. |
I think the problem here is that I'd prefer to keep it in |
I agree, as of today, the ltac folder is really two components: the language, and a library of tactics. I'm all for splitting this but we need the new plugin linker. Meanwhile, I think removing |
This is a technical concern unrelated to the matter at hand, and this should be considered an OCaml bug rather than anything else.
It is somewhat easy to implement
Please don't move tactic after vernac, this is nonsense, and let's collectively pretend there is no problem by using a hook. It's a pious lie, and we shouldn't base our source code organization on current defects in the implementation. |
How is that an OCaml bug, if so, we should report it upstream.
The thing is that what you propose is already non possible, as a matter of fact a large bunch of tactics do effectively lie after Still, the way I see is that having a hook has significant downside, in particular it makes impossible to reason about a component in a local way; it also makes impossible to use libraries as libraries. On the other hand, placing the tactics after the components they are using have no downsides, otherwise we would be all in some kind of large pain as this is already the case for a lot of tactics and plugins. |
Actually after giving it a go I'm afraid this doesn't seem to be the case; I don't think trusted |
e842d7f
to
82f1e47
Compare
This should be ready; I've kept |
This moves the vernacular part of hints to `vernac`; in particular, it helps removing the declaration of constants as parts of the `tactic` folder.
This PR moves `Declare` to `vernac` which will hopefully allow to unify it with `DeclareDef` and avoid exposing entry internals. There are many tradeoffs to be made as interface and placement of tactics is far from clear; I've tried to reach a minimally invasive compromise: - moved leminv to `ltac_plugin`; this is unused in the core codebase and IMO for now it is the best place - hook added for abstract; this should be cleaned up later - hook added for scheme declaration; this should be cleaned up later - separation of hints vernacular and "tactic" part should be also done later, for now I've introduced a `declareUctx` module to avoid being invasive there. In particular this last point strongly suggest that for now, the best place for `Class_tactics` would be also in `ltac`, but I've avoided that for now too. This partially supersedes coq#10951 for now and helps with coq#11492 .
This is an internal function for scheme declaration handled properly now, we can also remove `pure_definition_entry` which is IMO good too.
82f1e47
to
8de0fca
Compare
The current linking strategy is all-or-nothing. We should be able to specify that some parts of the code should be linked despite the fact that they are not used. Not being able to do that seems to be a huge liability against the Coq use case, i.e. a program that features entry points to be used by plugins but not used in the program itself. |
I think part of this is due to our own linker lacking some features, I should have a new linker ready soon so we can see what is worth reporting upstream. |
I'll leave a bit of time before merging in case some other reviewer wants to chime in. |
This PR moves
Declare
tovernac
which will hopefully allow tounify it with
DeclareDef
and avoid exposing entry internals.There are many tradeoffs to be made as interface and placement of
tactics is far from clear; I've tried to reach a minimally invasive
compromise:
Leminv
toltac_plugin
; this is unused in the core codebaseand IMO for now it is the best place
vernac
; as for now it is almost a vernacular commandlater, for now I've introduced a
declareUctx
module to avoid beinginvasive there.
In particular this last point strongly suggest that for now, the best
place for
Class_tactics
would be also inltac
, but I've avoidedthat for now too.
We also remove
declare_private_constant
from the public API.This is an internal function for scheme declaration handled properly
now, we can also remove
pure_definition_entry
which is IMO good too.This partially supersedes #10951 for now and helps with #11492 .