Document the %N scope recipe for mathcomp consumers of emitted .v (#413) - #415
Merged
Conversation
0xGeorgii
force-pushed
the
413-mathcomp-scope-note
branch
from
August 15, 2026 13:33
1fdcbde to
50a9a34
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Fixes #413. Stacked on #414 (base is
412-ma-ofs-binder); this PR contains only the documentation commit.Adds a "mathcomp consumers" subsection to
ROCQ_CONTRACT.md's required-context section covering what the downstream discharge (Inference-Global-Software/wasm-verifier#42) discovered:Local Delimit Scope N_scope with N.recipe, placed after the mathcomp imports, with the mechanism: mathcomp'sssrnatrebinds the%Nkey tonat_scope(keeping%numas its replacement key forBinNat'sN_scope), so an ssrnat-importing consumer re-reads1%N : Nasnatand fails at the record fields. Also whyLocalmatters (a file-globalDelimitleaks throughRequire), the default-onhiding-delimiting-keywarning, and the symmetric cost (mathcomp's%N-keyednatnotations stop parsing in that file)%Nrather than emitting%num: that key is defined byssrnat, so it does not exist in the mathcomp-free context the standalone contract and the repo's own coqc gate targetMa ofsrename (wasm-to-v: rename the emittedMahelper'sofbinder (reserved by ssreflect) #412), needed only for a.vgenerated before it; with the residual noted that emittedDefinitionnames are user identifiers printed verbatim, so a source function namedofwould reintroduce the collision for its own lineClaims verified against primary sources (mathcomp 2.6.0
boot/ssrnat.vL136-138 for the twoDelimitlines; rocqssrparser.mlg'sssrbindergrammar for theofkeyword) and replayed locally against Rocq 9.2 by simulating ssrnat'sDelimitsequence.Confidence Score: 5/5
The documentation-only PR appears safe to merge.
No blocking failure remains.
Important Files Changed
%Nscope rebinding for mathcomp consumers and the historical ssreflect import-order accommodation.Reviews (2): Last reviewed commit: "Document the %N scope recipe for mathcom..." | Re-trigger Greptile