Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FStar.Compiler.Sealed: add an internal sealed type #3212

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

mtzguido
Copy link
Member

@mtzguido mtzguido commented Feb 9, 2024

Motivated by #3210, this PR should make these bugs impossible.

We add an identity type internal to the compiler, called sealed, with
seal and unseal operations just like in user space. This type is
behind an interface so we must use seal and unseal correctly otherwise
the typechecker will reject it. This type constructor can now get an
embedding instance (e_sealed) and trigger automatically whenever needed.

Motivated by FStarLang#3210, this PR should make these bugs impossible.

We add an identity type internal to the compiler, called `sealed`, with
`seal` and `unseal` operations just like in user space. This type is
behind an interface so we must use seal and unseal correctly otherwise
the typechecker will reject it. This type constructor can now get an
embedding instance (e_sealed) and trigger automatically whenever needed.
@mtzguido
Copy link
Member Author

mtzguido commented Feb 9, 2024

Note: using a box type for the internal Sealed.sealed would almost work, except for the fact that we embed ranges (FStar.Compiler.Range.range) as a sealed thing (via e_range) but we do not expose that fact internally, which would take a bunch of churn to do. Maybe using sealed range everywhere in reflection/tactics would work, but also I don't see a big gain in moving to a box type.

@mtzguido mtzguido merged commit 657f181 into FStarLang:master Feb 9, 2024
2 checks passed
@mtzguido mtzguido deleted the sealed branch February 9, 2024 19:28
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