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

Use a typeclass for non informative types #27

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

mtzguido
Copy link
Member

This removes the built-in knowledge of non-informative types that is present in the checker, and instead encodes this property via a typeclass. When the checker needs to construct a "non_informative_witness" for a type, essentially a revealing function, instead of applying some built-in rules it can now just call the typeclass resolution tactic, via the new call_subtac primitive (FStarLang/FStar#3226), obtaining both the dictionary for the constraint and a proof of its well-typing.

All examples work as before (and importantly #11 still works, since the resolution tactic does not need to re-check its goal). Also a big chunk of checker about derivations of non_informative constraints is now gone: we basically get the derivation for free from the call_subtac invocation.

The main advantage is that non-informative types are now open, and any user can add a type to the class.

Leveraging the new call_subtac primitive to call the typeclass
resolution tactic and obtain a well-typed dictionary.
@mtzguido mtzguido merged commit 1ba4cbd into FStarLang:main Mar 22, 2024
1 check passed
@mtzguido mtzguido deleted the non_info_class branch March 22, 2024 03:08
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