-
Notifications
You must be signed in to change notification settings - Fork 237
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
Some fixes/improvements to the core typechecker #3256
Merged
Merged
Conversation
This file contains 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
ttyp is the type of the *annotation* of the letbinding, not the annotation itself. Fix it.
mtzguido
added a commit
to mtzguido/pulse
that referenced
this pull request
Apr 19, 2024
Thanks @mtzguido I reviews the core changes and they look good to me. I agree that we could weaken the guard as an additional improvement in the future, but it's sound to not do that. So, I'm okay with it as is for now. |
Thanks for reviewing! Merging. |
mtzguido
added a commit
to mtzguido/pulse
that referenced
this pull request
Apr 19, 2024
mtzguido
added a commit
to FStarLang/pulse
that referenced
this pull request
Apr 19, 2024
snap, bracing for FStarLang/FStar#3256
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.
Most importantly:
Core/Tactics: controlling SMT guards and unfolding for check_equiv: this adds a new flag to the check_equiv invocation to forbid it from generating guards and unfolding definitions. I plan to use it from Pulse to match vprops.
Core.check_equiv: always WHNF: adding some normalization to always work with terms in HNF. This makes matching, for example,
1+2
and3
trivial.Core: allow checking pure/ghost (non-Tot) lets: talked about with @nikswamy. The first call to check
lb.lbdef
will accumulate a guard for the precondition if need be, and similarly for the body, so this should be safe. What we are not doing is using the spec of the lbdef to weaken the guard of the body. To do that I think we would need to obtain the strongest post of the lbdef, and we don't have machinery for that. I wonder if instead of accumulating guards Core could accumulate a WP of the checked term, in which case this would just be WP composition, and at the top-level we would instantiate with thefun _ -> True
postcondition. In any case, it doesn't seem like a limitation in the tests I'm doing, and it is sound.Core: fix checking of letbinding: fix the type in the subtyping call, it was off by one level.
Tactics: exposing full check_equiv with both flags: the
check_equiv
tactic is now derived from thet_check_equiv
primitive which provides access to both flags.check_equiv_nosmt
is defined to set both flags to false. This will require a small Pulse patch since the snapshot has fully resolved names.