Skip to content

Make heterogeneous equality universe polymorphic - #878

Open
remix7531 wants to merge 2 commits into
PrincetonUniversity:masterfrom
remix7531:fix/jmeq-universe-polymorphism
Open

remix7531 wants to merge 2 commits into
PrincetonUniversity:masterfrom
remix7531:fix/jmeq-universe-polymorphism

Conversation

@remix7531

Copy link
Copy Markdown
Contributor

Importing VST.floyd.jmeq_lemmas before SSProve.Crypt.choice_type fails with a universe inconsistency, because the monomorphic equality lemmas pin the global universes of sum, prod and list. This makes the module locally universe polymorphic and applies those constructors at their use sites, which also keeps reptype working as the NDmk_funspec witness. Statements and assumptions are unchanged.

The second commit adds regressions to make test. make vst, make test and make assumptions.txt pass on Rocq 9.1.1 and 9.2, 32 and 64 bit.

Importing VST.floyd.jmeq_lemmas before SSProve.Crypt.choice_type fails
because the monomorphic equality lemmas pin the global template
universes of sum, prod and list:

    Universe inconsistency. Cannot enforce projections.u0 <= prod.u0
    because prod.u0 < ind.Ind.constructors.u3 <= projections.u0.

Make the module locally universe polymorphic. An unapplied sum, prod or
list still refers to its global universes, so apply each one at its use
site. Without that, polymorphism alone breaks reptype as the
NDmk_funspec witness. Theorem statements, assumptions and opacity are
unchanged. The old section comments become a one-line Stdlib
attribution.
Register product, list, transport, elimination and automation
regressions with make test. They check distinct universe levels and
both monomorphic and polymorphic callers, using qualified VST equality
names.

Check reptype as a witness for both NDmk_funspec entry points.
Polymorphism alone breaks this.
@remix7531

Copy link
Copy Markdown
Contributor Author

@andrew-appel Quick ping. This is the last known blocker for using VST and SSProve together in libshrincs.

The notation clash has a compiler fix and a VST fix for stock Rocq 9.1. Rocq #22502, VST #875. SSProve now supplies the word carrier for VST specs and keeps nominal imports from shadowing MathComp equality. SSProve #133, SSProve #134.

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.

1 participant