Map.Interface, Word.Interface: Set Universe Polymorphism#163
Open
spitters wants to merge 1 commit into
Open
Conversation
Both files define typeclasses (map, word) that downstream consumers parameterize over. Without [Set Universe Polymorphism], every instance is locked at a fixed universe level, which forces universe-bumping casts at every callsite — and outright blocks composition for downstream code that needs to instantiate at multiple universe levels. Concrete motivation: Jasmin extraction (via the [JasminBridge] in AUCurves) and bedrock2-WP proofs both need to instantiate [map.rep] and [word.rep] at universe levels selected by the surrounding context. With monomorphic interfaces this fails with cryptic 'universe inconsistency' errors that bisect to the interface declaration site. The change is purely a header-level annotation; no proof bodies modified. Verified clean rebuild of the bedrock2 + downstream tree (AUCurves) with no regressions.
Collaborator
|
Errors with |
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.
Summary
Both
Map.InterfaceandWord.Interfacedefine typeclasses (map,word) that downstream consumers parameterize over. WithoutSet Universe Polymorphism, every instance is locked at a fixed universe level, which forces universe-bumping casts at every callsite — and outright blocks composition for downstream code that needs to instantiate at multiple universe levels.Motivation
Jasmin extraction (via the
JasminBridgein AUCurves) and bedrock2-WP proofs both need to instantiatemap.repandword.repat universe levels selected by the surrounding context. With monomorphic interfaces this fails with cryptic "universe inconsistency" errors that bisect to the interface declaration site.Diff
+ Set Universe Polymorphism. Require Import coqutil.sanity. ...(Identical one-line additions on
Map.Interface.vandWord.Interface.v.)Test plan