-
Notifications
You must be signed in to change notification settings - Fork 236
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
Fixing #3089, and some unifier fixes #3091
Conversation
This stopped working after making the unifier reduce primops (FStarLang/FStar#3091), as it has no knowledge of arithmetic (except for the treatment of literals and negation). Hence, a problem like `3 =?= n+1` fails.
Actually it does lead to one regression: project-everest/mitls-fstar#258 |
I rebased the PR and removed point (2). The only failure caused by this fact is in a use of the canonicalization tactic ( |
The unifier must handle equating two concrete universe levels (among other things), as we already do for embedded terms and other constants. Make it so for all lazy terms that have a "faithful" representation.
Taken from Vale
One can use SMTQuery for that.
#3089 revealed that the unifier is not using primops for its normalization to WHNF, but I believe it should. While it is using primops in some localized places (see e.g.
let equal
around line 4176), it's not the case for thewhnf
function called incompress_tprob
. AddingPrimops
there fixes the problem in #3089, but uncovers two other issues due to the extra normalization:1- We are not handling equality of universe values (causing a regression in FStar.Reflection.Typing), or other lazy opaque terms. I fixed by this making the unifier expand lazy terms to their representation, as long as this is sound, i.e. if the repr is complete. This is case for universes, fixing this issue.
2- The unifier cannot match
N
(a literal) with- X
(a negation, i.e. an application of op_Minus). I made this work by rewriting the problem into-N
(still a literal) andX
. This was uncovered by a failing tactic in Vale code. I've added an F* test for it now.Everest came back green locally.