-
Notifications
You must be signed in to change notification settings - Fork 9
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
Naming conventions #2
Comments
"push" lemmas have often been named like |
Sorry, what do you mean by "push"? A few remarks:
|
By the way, I don't think that there is a unique satisfactory naming convention. So, some arbitrary choice will be made at some point. We have so many technical points to solve that I don't expect to spend much time on naming conventions, although I will read all these documents to stay informed. |
I agree, and my conclusion about that was that the (challenging and interesting) way to address this heterogeneity of style is to turn naming conventions into languages of naming. But let's address things in order and start indeed by collecting the technical points to solve. |
By "push" lemmas I mean the rules for commuting one operation from outside of other operations to inputs of these operations. Here are some push lemmas for
I can't think of other naming conventions that I have clear opinions about, but this one has been very helpful in cases it is applicable. I don't particularly care that it is the only naming convention allowed for these lemmas, but I would find it unfortunate if names/aliases of this style were barred from inclusion in stdlib2. For more examples of this pattern, please see https://github.com/mit-plv/fiat-crypto/blob/4ecdd6ca43af688e5cd36ec9ab2496c4e192477d/src/Util/ZUtil/Hints/PullPush.v and https://github.com/mit-plv/fiat-crypto/search?q=push&unscoped_q=push |
It was not so much a proposal than a description of the naming convention that we used in Coquelicot and in Flocq 3 and how it fared. The driving motivation was that the name of a theorem you need to apply to the current goal should be inferrable from the statement of the goal. I recall here the main principles for those who did not follow that WG:
Here are a few examples (premises are skipped unless relevant):
That said, our approach is obviously flawed, since some theorems do not follow the above naming conventions. To conclude, here are the main differences with MathComp's naming convention (and why we did not want to follow it):
|
A concrete case about naming is given in coq/coq#8815, which, among others, adds the following
Coquelicot/Flocq would say If I understood correctly, MathComp rules would say Stdlib1 has many variants for such a lemma, such as So, maybe Any opinion in the context of stdlib2? |
About this particular example, I doubt that these lemmas should be in the standard library. Instead, a unique and more general |
Good questions! Can you detail your vision? What should be the extent of a "standard library"? What should be the place of decidable relations? Can you give examples? |
@CohenCyril and I will extend https://github.com/math-comp/math-comp/blob/master/CONTRIBUTING.md#statements-of-lemmas-theorems-and-definitions
These conventions will be used in stdlib2.
Their description should be moved to the stdlib2 repository, and missing/unclear conventions can be discussed here.
The text was updated successfully, but these errors were encountered: