-
Notifications
You must be signed in to change notification settings - Fork 641
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
Ensure that names of constants, inductive types or constructors have distinct names and that binders are named #18394
Conversation
5168ed4
to
f54d0d0
Compare
I think that autogenerated names in general are really bad. It's extremely annoying for tactics, but here it's affecting vernacular definitions. The fix goes in the wrong direction for #14597. If one wants to name bound variables, it's the responsibility of the user to name the corresponding definition correctly. |
Yes. It might be quite a lot of overlays though. We could make an evaluation of the number of changes to do and if too much have a warning as compromise? (Or ask upstreams to do the changes?) |
I think a warning is a good idea, regardless of the chosen solution. |
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. |
…name for each one.
f54d0d0
to
f9e405b
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.
This PR is doing the wrong change. Never ever should we rename binders explicitly given by the user using an freshening algorithm, that would drive people crazy and make the code very much not modular (e.g. when metaprogramming). Similarly, anonymous binders should similarly remain anonymous. Instead, Coq should warn when there are two variables names that conflict and let the user fix the issue, not try to be clever.
This is going the wrong way and there is no point in keeping zombie PRs, we should close. |
"zombie PR" is your terminology that I don't endorse! Personally, I would name it an experience which suggests that another approach should be done (in particular in relation to #14597). But that will require some concentration on the topic that I don't have now. |
The PR does the following:
ensure that Coq objects have distinct names, e.g.:
Possible alternative: failing instead of renaming silently but this would require adaptations (see note below).
ensure that binders are named:
Note: The alternative to force naming user-side would require several changes in the CI.
The last point will be useful for #14597 which requires named binders but for which CI showed that this is sometimes not the case.
See also issue #6786 about non-distinct names in inductive types.
Depends on #18393.
Note: Here are typical cases which indirectly generate definitions with several times the same name:
Related issue: avoid the time spent at renaming the types of objects in
Typing.type_of_constant
& cie.