-
Notifications
You must be signed in to change notification settings - Fork 689
[Numeral notations] Use Coqlib registered constants #8720
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
Conversation
7b187f1
to
ff1786e
Compare
@@ -40,7 +40,7 @@ Notation zero := (D0 Nil). | |||
|
|||
(** For signed integers, we use two constructors [Pos] and [Neg]. *) | |||
|
|||
Inductive int := Pos (d:uint) | Neg (d:uint). | |||
Variant int := Pos (d:uint) | Neg (d:uint). |
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.
Why this change?
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 agree it’s unrelated. But since I was already touching this file, I took the opportunity to tidy it a bit…
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.
Thanks!
plugins/syntax/numeral.ml
Outdated
CErrors.user_err | ||
(pr_qualid f ++ str " should go from Decimal.int to " ++ | ||
pr_qualid ty ++ str " or (option " ++ pr_qualid ty ++ str ")." ++ | ||
fnl () ++ str "Instead of Decimal.int, the types Decimal.uint or Z could be used" ++ | ||
(if loadZ then str " (require BinNums first)." else str ".")) | ||
fnl () ++ str "Instead of Decimal.int, the types Decimal.uint or Z could be used.") |
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.
What is the reason for dropping the parenthetical? You could instead augment it to say require BinNums or Register a constant as ... first
.
Either way, please also update the documentation to match the updated error message.
ff1786e
to
cd16bfd
Compare
I’ve just updated the error messages and the corresponding documentation. |
CErrors.user_err | ||
(pr_qualid g ++ str " should go from " ++ pr_qualid ty ++ | ||
str " to Decimal.int or (option Decimal.int)." ++ fnl () ++ | ||
str "Instead of Decimal.int, the types Decimal.uint or Z could be used" ++ | ||
(if loadZ then str " (require BinNums first)." else str ".")) | ||
str "Instead of Decimal.int, the types Decimal.uint or Z could be used (you may need to require BinNums or Decimal first).") |
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 think you should only display the part about Require
if the types don't resolve / aren't registered. But I don't object strongly.
0efce69
to
c10e3cd
Compare
This PR breaks HoTT; the overlay is ready but would break the compatibility of HoTT with Coq 8.9. Thus we wait: 1. that Coq 8.9 is released (or at least the β); 2. that a version of HoTT compatible with said version of Coq is officially tagged; 3. that HoTT merges the overlay. No need to hurry. |
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'll let people more knowledgeable comment.
What's the dependency? |
I think the answer is in my previous message: #8720 (comment) |
I've only seen that tag used for other Coq PRs before but I guess nothing else fits better. |
c10e3cd
to
c9eddfe
Compare
c9eddfe
to
0fdc539
Compare
HoTT has been updated, so this PR is ready now. |
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.
My requests about error messages stand, but I'm not going to block this PR on that basis, and it would be nice to see this land.
Taking this as part of @coq/parsing-maintainers |
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.
Look pretty straightforward, will merge soon if not further comments.
Reviewed-by: JasonGross Ack-by: SkySkimmer Reviewed-by: Zimmi48 Reviewed-by: ejgallego Ack-by: ppedrot Ack-by: vbgl
Fixes #8564.
Waiting for HoTT release, see #8720 (comment)