From 3333d8ec4a59f6dee6c568498b734038f2fa19cb Mon Sep 17 00:00:00 2001 From: remix7531 <131352678+remix7531@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:01:34 +0000 Subject: [PATCH] Print == and != at level 70 Floyd's printing notations for == and != sat at level 17, while ssreflect's eqtype and Stdlib's SetoidClass declare both at level 70. Rocq 9.1 rejects an only-printing notation at a different level once such a declaration is in scope, so importing Floyd after either library failed, for example with: Notation "_ != _" is already defined at level 70 ... while it is now required to be at level 17. Put both at level 70 with no associativity, where Floyd's <, >, <= and >= already are. --- floyd/Clightnotations.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/floyd/Clightnotations.v b/floyd/Clightnotations.v index d8be02ab7..b27c15e41 100644 --- a/floyd/Clightnotations.v +++ b/floyd/Clightnotations.v @@ -114,9 +114,10 @@ Notation "a1 | a2" := (Ebinop Oor a1%expr a2%expr _) (only printing, a2 at level Notation "a1 / a2" := (Ebinop Odiv a1%expr a2%expr _) (only printing, format "'[hv ' a1 '/' / a2 ']'", at level 40, left associativity) : expr_scope. Notation "a1 << a2" := (Ebinop Oshl a1%expr a2%expr _) (only printing, a2 at level 14, left associativity (* XXX Is LtoR the same as left associativity in Coq? *), at level 15, format "'[hv ' a1 '/' << a2 ']'") : expr_scope. Notation "a1 & a2" := (Ebinop Oand a1%expr a2%expr _) (only printing, a2 at level 17, left associativity (* XXX Is LtoR the same as left associativity in Coq? *), at level 18, format "'[hv ' a1 '/' & a2 ']'") : expr_scope. -Notation "a1 != a2" := (Ebinop Cop.One a1%expr a2%expr _) (only printing, a2 at level 16, left associativity (* XXX Is LtoR the same as left associativity in Coq? *), at level 17, format "'[hv ' a1 '/' != a2 ']'") : expr_scope. +(* != and == sit at level 70 like < above, not at their C precedence: ssreflect declares both at level 70, Stdlib's SetoidClass declares == there, and Rocq 9.1 rejects an only printing notation at a different level once such a declaration is imported (rocq-prover/rocq#12465). *) +Notation "a1 != a2" := (Ebinop Cop.One a1%expr a2%expr _) (only printing, at level 70, no associativity, format "'[hv ' a1 '/' != a2 ']'") : expr_scope. Notation "a1 * a2" := (Ebinop Omul a1%expr a2%expr _) (only printing, format "'[hv ' a1 '/' * a2 ']'", at level 40, left associativity) : expr_scope. -Notation "a1 == a2" := (Ebinop Oeq a1%expr a2%expr _) (only printing, a2 at level 16, left associativity (* XXX Is LtoR the same as left associativity in Coq? *), at level 17, format "'[hv ' a1 '/' == a2 ']'") : expr_scope. +Notation "a1 == a2" := (Ebinop Oeq a1%expr a2%expr _) (only printing, at level 70, no associativity, format "'[hv ' a1 '/' == a2 ']'") : expr_scope. Notation "a1 + a2" := (Ebinop Oadd a1%expr a2%expr _) (only printing, format "'[hv ' a1 '/' + a2 ']'", at level 50, left associativity) : expr_scope. Notation "& a1" := (Eaddrof a1%expr _) (only printing, a1 at level 11, right associativity (* XXX Is RtoL the same as right associativity in Coq? *), at level 11, format "'[hv ' & a1 ']'") : expr_scope. Notation "'__builtin_fabs' a1" := (Eunop Oabsfloat a1%expr _) (only printing, a1 at level 11, right associativity (* XXX Is RtoL the same as right associativity in Coq? *), at level 11, format "'[hv ' '__builtin_fabs' a1 ']'") : expr_scope.