Skip to content
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

Coq.Structures.Orders.LebNotation defines notations at levels incompatible with the rest of the standard library #11890

Closed
JasonGross opened this issue Mar 23, 2020 · 1 comment · Fixed by #11891
Assignees
Labels
part: notations The notation system. part: standard library The standard library stdlib.
Milestone

Comments

@JasonGross
Copy link
Member

Consider:

Module Type LebNotation (T:Typ)(E:HasLeb T).
Infix "<=?" := E.leb (at level 35).
End LebNotation.
Module Type LtbNotation (T:Typ)(E:HasLtb T).
Infix "<?" := E.ltb (at level 35).
End LtbNotation.

$ git grep "<=\??" | grep level
theories/Arith/PeanoNat.v:Infix "<=?" := Nat.leb (at level 70) : nat_scope.
theories/Arith/PeanoNat.v:Infix "<?" := Nat.ltb (at level 70) : nat_scope.
theories/Init/Nat.v:Infix "<=?" := leb (at level 70) : nat_scope.
theories/Init/Nat.v:Infix "<?" := ltb (at level 70) : nat_scope.
theories/NArith/BinNat.v:Infix "<=?" := N.leb (at level 70, no associativity) : N_scope.
theories/NArith/BinNat.v:Infix "<?" := N.ltb (at level 70, no associativity) : N_scope.
theories/NArith/BinNatDef.v:Infix "<=?" := leb (at level 70, no associativity) : N_scope.
theories/NArith/BinNatDef.v:Infix "<?" := ltb (at level 70, no associativity) : N_scope.
theories/Numbers/Natural/Peano/NPeano.v:Infix "<=?" := Nat.leb (at level 70) : nat_scope.
theories/Numbers/Natural/Peano/NPeano.v:Infix "<?" := Nat.ltb (at level 70) : nat_scope.
theories/PArith/BinPos.v:Infix "<=?" := Pos.leb (at level 70, no associativity) : positive_scope.
theories/PArith/BinPos.v:Infix "<?" := Pos.ltb (at level 70, no associativity) : positive_scope.
theories/PArith/BinPosDef.v:Infix "<=?" := leb (at level 70, no associativity) : positive_scope.
theories/PArith/BinPosDef.v:Infix "<?" := ltb (at level 70, no associativity) : positive_scope.
theories/Sorting/Mergesort.v:  Infix "<=?" := leb (at level 35).
theories/Structures/Orders.v: Infix "<=?" := E.leb (at level 35).
theories/Structures/Orders.v: Infix "<?" := E.ltb (at level 35).
theories/ZArith/BinInt.v:Infix "<=?" := Z.leb (at level 70, no associativity) : Z_scope.
theories/ZArith/BinInt.v:Infix "<?" := Z.ltb (at level 70, no associativity) : Z_scope.
theories/ZArith/BinIntDef.v:Infix "<=?" := leb (at level 70, no associativity) : Z_scope.
theories/ZArith/BinIntDef.v:Infix "<?" := ltb (at level 70, no associativity) : Z_scope.
@JasonGross JasonGross added the part: standard library The standard library stdlib. label Mar 23, 2020
@JasonGross
Copy link
Member Author

JasonGross commented Mar 23, 2020

Here is a small test case:

Require Import Coq.Structures.Orders Coq.ZArith.ZArith.
(* Note that this has always worked fine without the '; we are testing importing notations from the stdlib here *)
Declare Module A : LeBool'.
Declare Module B : LtBool'.
Import A B.
(*
Error: Notation "_ <=? _" is already defined at level 70 with arguments constr
at next level, constr at next level while it is now required to be at level 35
with arguments constr at next level, constr at next level.
*)

@JasonGross JasonGross self-assigned this Mar 23, 2020
@JasonGross JasonGross added this to the 8.12+beta1 milestone Mar 23, 2020
@JasonGross JasonGross added the part: notations The notation system. label Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: notations The notation system. part: standard library The standard library stdlib.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant