Skip to content

Map.Interface, Word.Interface: Set Universe Polymorphism#163

Open
spitters wants to merge 1 commit into
mit-plv:masterfrom
spitters:spitters/universe-polymorphic-interfaces
Open

Map.Interface, Word.Interface: Set Universe Polymorphism#163
spitters wants to merge 1 commit into
mit-plv:masterfrom
spitters:spitters/universe-polymorphic-interfaces

Conversation

@spitters

Copy link
Copy Markdown

Summary

Both Map.Interface and Word.Interface 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.

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.

Diff

+ Set Universe Polymorphism.
  Require Import coqutil.sanity.
  ...

(Identical one-line additions on Map.Interface.v and Word.Interface.v.)

Test plan

  • Clean rebuild of bedrock2 + downstream Rocq tree (AUCurves) with no regressions.
  • Header-only annotation, no proof bodies modified.

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.
@JasonGross

Copy link
Copy Markdown
Collaborator

Errors with
File "./src/coqutil/Map/Properties.v", line 116, characters 6-36:
Error: Tactic generated a subgoal identical to the original goal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants