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

A fix in the core typechecker #3004

Merged
merged 11 commits into from
Aug 8, 2023
Merged

A fix in the core typechecker #3004

merged 11 commits into from
Aug 8, 2023

Conversation

aseemr
Copy link
Collaborator

@aseemr aseemr commented Aug 4, 2023

Adding a missing check for expected effect in the case when the expected type is not set.

The fix failed some examples, where the core client wanted a total effect on non-informative types, but core computed a ghost effect (and the cases passed due to the missing check).

To fix those cases, the PR also adds eager promotion so that it computes a total effect in such cases.

The PR also contains a small optimization in inserting hide/reveal coercions. If the expression is reveal e (resp. hide e), and the context expects an erased (resp. non-erased) type, then instead of making the coercion return hide (reveal e) (resp. reveal (hide e), we just return e.

The last optimization resulted in two failures, one each in Steel.ST.Array and Steel.ST.HigherArray. Since the coerced expression is a little different, two rewrite calls in the libraries (one in each file) had to be tweaked. In general, smt attribute saves us, but these cases were where the coercion was happening in the first argument of pts_to (see FStarLang/steel#63).

*)

[@expect_failure]
(*
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. The example that was showing failing smt proofs, now works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird! I noticed the same thing in a completely separate branch, so maybe some dependency got updated? In fact even master does not pass (local) ci for me right now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a difference between running with --query_stats and without. CI will pass using that flag (this definition will fail as expected). You might need to revert this change to get a green. I'll look to see what causes this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solved in #3010

@aseemr
Copy link
Collaborator Author

aseemr commented Aug 8, 2023

I have an everest green, merging.

@aseemr aseemr merged commit 4e7f140 into master Aug 8, 2023
@aseemr aseemr deleted the aseem_core_fix branch August 8, 2023 13:20
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.

2 participants