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
Remove obsolete locality #1049
Remove obsolete locality #1049
Conversation
The existence of both |
Well, they really mean the same thing. So is that so much of a problem? And of course, the point is to make the |
Ocaml is pretty smart about disambiguating constructors. Enable warnings 41 and 42 in the configure.ml to see how much it happens in the coq code. |
I'm fine with changing it btw, if you suggest a name :) |
In fact maybe I have a candidate. We could rename |
What would |
Yes. (I guess) |
Note that it is already what it means. AFAIK |
It is not always clear to me when |
Oh my god! I realize only now a huge flaw of this PR. The syntax:
is still valid (but with a different meaning), since |
The Any objection to making |
Leave the grammar entry in but parse to an error? |
No objection on my side, and But it seems that there has never been any warning |
Yeah, but it's many grammar entries, and the point of this PR was to remove them :) |
Oh! I didn't know. I'll fix it, and hopefully try to make the beautifier do this translation for 8.7. |
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 looks very good.
The solution adopted for Let
does not look bad: like Coercion
, Class
, etc., it adds a flavor to Definition
, namely here the Discharge
flavor.
About Coercion Local
, maybe an error for some while. Otherwise Definition Local := 0
is accepted, so why not Coercion Local
?
About clarifying when Local
/Global
refers to a section or module scope, something remains to be done, certainly. Maybe elaborating about the names Private
, Extern
, ... @aspiwack and @ppedrot also had ideas about that.
(edited for typos)
parsing/g_vernac.ml4
Outdated
@@ -1145,33 +1132,33 @@ GEXTEND Gram | |||
| IDENT "Bind"; IDENT "Scope"; sc = IDENT; "with"; | |||
refl = LIST1 class_rawexpr -> VernacBindScope (sc,refl) | |||
|
|||
| IDENT "Infix"; local = obsolete_locality; | |||
| IDENT "Infix"; |
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.
To satisfy at the nitpicking tradition, I would delete the newline here.
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.
Sure, will fix, thanks!
plugins/ssr/ssrvernac.ml4
Outdated
@@ -546,7 +546,7 @@ GEXTEND Gram | |||
d = G_vernac.def_body -> | |||
let s = coerce_reference_to_id qid in | |||
Vernacexpr.VernacDefinition | |||
((Some Decl_kinds.Global,Decl_kinds.CanonicalStructure), | |||
((NoDischarge,Decl_kinds.CanonicalStructure), |
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.
Isn't this a change of semantics of Local Canonical
? (By the way - heavily insisting 😄 -, what are the motivations and mid-term plans of SSReflect developers w.r.t. this redundancy?)
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.
Good question, I wasn't too sure about this one. Do you mean that the current default locality
for definitions depend on their kind
? I'll double check.
stm/vernac_classifier.ml
Outdated
match discharge with | ||
| Decl_kinds.NoDischarge -> GuaranteesOpacity | ||
| Decl_kinds.Discharge -> Doesn'tGuaranteeOpacity | ||
in |
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 is a fix compared to previous version?
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.
Yes, see commit message.
vernac/locality.ml
Outdated
| None, NoDischarge -> Global | ||
| None, Discharge -> Discharge | ||
| Some true, Discharge -> CErrors.user_err Pp.(str "Local not allowed in this case") | ||
| Some false, Discharge -> CErrors.user_err Pp.(str "Global not allowed in this case") |
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.
😄
> Coercion Local S:nat>->nat.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning: Deprecated syntax: use "Local" as a prefix.
[deprecated-local-syntax,deprecated] |
Is it also triggered when the body is provided? |
Ah, ok, now I connect to the gitter quiproquo. |
Oh, I had read your question incorrectly. I have no idea about the distinction of module locality vs file locality. @ppedrot? |
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've only looked at the classifier fix
@maximedenes What? The question is not even well-defined, there is not even such thing as a module or section locality, locality is a property of libobjects and they have idiosyncratic implementations that cannot be unified. |
Not even in part? What could/would be some good candidates to move to a unified direct-control implementation? |
795066c
to
fca135d
Compare
fca135d
to
8daec9b
Compare
This is preparing the landing of coq/coq#1049. For now, I'm duplicating this patch which was already done upstream in CoqPrime, but please consider removing this ad-hoc copy (see discussion on PR mit-plv#269).
This is preparing the landing of coq/coq#1049. For now, I'm duplicating this patch which was already done upstream in CoqPrime, but please consider removing this ad-hoc copy (see discussion on PR #269).
60595d7
to
9bbb2f8
Compare
Green light here: |
9bbb2f8
to
a18185a
Compare
So have you chosen a solution to avoid the issue with |
No, I did not. Since this syntax was deprecated really a long time ago, I think it is ok. I should add an entry in |
33a1b80
to
dd65bb5
Compare
dd65bb5
to
90ea619
Compare
Green light here: https://travis-ci.org/maximedenes/coq/builds/308320677 |
We remove deprecated syntax "Coercion Local" and such, and seize the opportunity to refactor some code around vernac_expr. We also do a small fix on the STM classification, which didn't know about Let Fixpoint and Let CoFixpoint. This is a preliminary step for the work on attributes.
90ea619
to
ae5944b
Compare
green light again: https://travis-ci.org/maximedenes/coq/builds/309020975 |
We remove deprecated syntax "Coercion Local" and such, and seize the
opportunity to refactor some code around vernac_expr.
This is a preliminary step for the work on attributes.
We also fix a related classification issue in the STM.