use Program less in stdlib - #19797
Conversation
andres-erbsen
commented
Oct 31, 2024
- replace all uses of Program mode with refine; abstract
- Import as little of Program as possible
- prefer non-program tactics when straightforward
- keep Require statements for compat (for now)
- replace all uses of Program mode with refine; abstract - Import as little of Program as possible - prefer non-program tactics when straightforward - keep Require statements for compat (for now)
|
@coq/stdlib-maintainers This looks feasible, please review. @coq-community/coq-dpdgraph CI contacts @Karmaki @ybertot: it seems that the coq-dpdgraph test suite compares stdlib definition graph to a golden reference stored outside stdlib, and that reference currently includes identifier names gensym-ed by Program. I could update the blessed reference, but is this level of coupling intentional and still desired for a coq-community-maintained project? |
|
I think that this pull request makes a good case for why Also, keeping |
|
Maybe we can wait for the merge of #19023 to take advantage of the abstract selector. |
|
Good point. That would certainly make my objection moot. And it would actually be a good way to exercise the |
|
I don't think we're in a hurry to get rid of Program, contrarily to the plugin whose name must not be uttered, that starts with fun and ends in ind. This command is used for several distinct reasons:
The problematic stuff that is superseded by Equations is the third point. The two first points are legitimate even without the magic Program features. In particular, they are part of the short-term roadmap to reimplement the abstract tactical directly in the proof engine and would be subsumed by this. As a result, I'd recommend waiting for the landing of the reimplemented abstract before touching anything Program-related in the stdlib. |
|
Concerning coq-dpdgraph, the differences that appear in the graph seem to have low significance. The normal way to proceed would be to accept the new version of the graph as the future reference. Normally, the coq-dpdgraph environment provides a way to do that in a few steps. I don't remember why it was important to test coq-dpdgraph in conjunction with the Setoids machinery, but if the latter is in stdlib, then it makes sense that coq-dpdgraph depends on it. If it turns out to be a nuisance, we may need to come up with lower this nuisance in two ways:
|
|
I agree with the summary by @ppedrot, but there is a catch that makes me still lean towards ditching Program entirely asap: as far as I understand, it is not possible to use "Program just for separating computation from proof obligations"; it will translate your code and run globally-specified tactics even if you just wanted the code-structuring features. I agree having another mechanism for specifically the desired part would be nice (and I'm hoping for #[transparent] Definition with #[sealed] Lemma rather than abstract:{ ) but IMO that's still easier to migrate to after this PR than before it. |
|
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
|
Stdlib is now in its own repo: https://github.com/coq/stdlib , if this PR is still current, please reopen it there. |