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

Making pts_to a method #232

Merged
merged 3 commits into from
Oct 8, 2024
Merged

Making pts_to a method #232

merged 3 commits into from
Oct 8, 2024

Conversation

mtzguido
Copy link
Member

@mtzguido mtzguido commented Oct 6, 2024

By adding a pulse_unfold attribute to the pts_to method (and the instances), it gets automatically unfolded by the Pulse checker whenever needed, and we can just work with the polymorphic pts_to. This PR fixes the class, defines some instances for the pointer-like types in the library, and uses it wherever possible.

There is tension whenever refinements are involved, as usual. See for instance FStarLang/FStar#3534. I think that if that is fixed, this will become quite robust.

The operator |-> is aliased to pts_to (with full permission). However the precedence is wrong: it binds weaker than **, so we would require parenthesis everywhere, and hence I didn't use it. I think we should just add configurable mixfix operators to F* to fix this.

Resugaring and context printing do not know about the typeclasses being unfolded, so context dumps are still in the underlying terms (R.pts_to, A.pts_to, etc). This is sometimes good, sometimes bad. A toggle would be nice, but this is an F* problem.

Note: using typeclasses for Pulse functions, instead of just slprops, also somewhat works.

Just one type annotation needed in library, and it makes sense. Adding
instances for ref, gref, box, vec, array, higher array.

It's definitely not ideal to have to mark everything pulse_unfold, but
that seems easy to fix: we need to tag instances and methods with a
particular attribute and add it to the normalization call done by Pulse.
@mtzguido
Copy link
Member Author

mtzguido commented Oct 6, 2024

( testing zulip bot :^) )

@mtzguido mtzguido merged commit 7c6f8c0 into FStarLang:main Oct 8, 2024
1 check passed
@mtzguido mtzguido deleted the pts_to branch October 8, 2024 05:29
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