Repository navigation
Print == and != at level 70 - #875
Merged
andrew-appel merged 1 commit intoNov 9, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Floyd's printing notations for
==and!=sit at level 17, while ssreflect'seqtypeand Stdlib'sSetoidClassdeclare both at level 70. Rocq 9.1 rejects an only-printing notation at a different level once such a declaration is in scope, so on master both of these fail:The first fails with:
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 17 with arguments constr at level 17, constr at level 16.Importing Floyd first works, so developments that combine VST with MathComp or SSProve have to order their imports. libshrincs, formally verified SHRINCS implementations in VST and SSProve, documents this in proof/vst/base.v and proof/wots_plus_c.v.
I fixed this in Rocq: rocq-prover/rocq#22502 lets only-printing notations use different levels, with a warning (fixing rocq-prover/rocq#12465), and rocq-prover/rocq#22503 makes such notations take the parsing levels, so
0 == (1 + 1)keeps its parentheses. Both are merged into Rocq master, but VST builds with Rocq 9.1, so it needs this change as well.This PR puts both notations at level 70 with no associativity, where Floyd's
<,>,<=and>=already are. Goal display changes only around==and!=. Two expressions that master prints misleadingly now print correctly, and a plain comparison gains parentheses:Sset _v (Eunop Onotbool (Ebinop Oeq x y))_v = !_x == _y;_v = !(_x == _y);Sset _v (Ebinop Oadd (Ebinop Oeq x y) 1)_v = (_x == _y + (1));_v = ((_x == _y) + (1));Sset _v (Ebinop Oeq x y)_v = _x == _y;_v = (_x == _y);Here
xandyareEtempvar _x tintandEtempvar _y tint.Tested on Rocq 9.1.1 at both bit sizes:
make vst,make testandmake assumptions.txtpass with unchanged assumptions, and both files above compile.