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

Support for predicate syntax in Pulse #50

Closed
nikswamy opened this issue Aug 1, 2023 · 1 comment
Closed

Support for predicate syntax in Pulse #50

nikswamy opened this issue Aug 1, 2023 · 1 comment
Labels
pulse Issues related to the Pulse separation logic DSL

Comments

@nikswamy
Copy link
Collaborator

nikswamy commented Aug 1, 2023

I find it bothersome that we have two different syntaxes for vprops is Pulse.

When one writes a predicate (e.g., a representation predicate for some structure), one uses the the syntax of F*, e.g.,

let ha_val_core (core:ha_core) (h:hash_value_t)
  : vprop
  = A.pts_to core.acc full_perm (fst h) `star`
      exists_ (λ (n:U32.t) →
        pure (U32.v n == snd h) `star`
        pts_to core.ctr full_perm n)

Whereas, in Pulse itself, one would write this as

A.pts_to core.acc full_perm (fst h) **
exists (n:U32.t).
    pure (U32.v n == snd h) **
    pts_to core.ctr full_perm n

What do you think about a convention where all vprops in a Pulse program are written in Pulse-specific syntax.

For instance, rather than using an F* let for ha_val_core, one would write something like

predicate ha_val_core (core:ha_core) (h:hash_value_t) = 
  A.pts_to core.acc full_perm (fst h) **
  exists (n:U32.t).
    pure (U32.v n == snd h) **
    pts_to core.ctr full_perm n

which would elaborate to the original let ha_val_core.

I suppose, if at some point one wanted to write some F* lemmas about ha_val_core, one would eventually confront the fact that this is just an F* term for a vprop. But, if vprops relations are manipulated mainly in Pulse itself, using Pulse ghost functions rather than F* lemmas, then perhaps one wouldn't have to encounter the F* versions very often

@tahina-pro tahina-pro added the pulse Issues related to the Pulse separation logic DSL label Sep 25, 2023
@nikswamy
Copy link
Collaborator Author

The syntax of vprops in Pulse and F* now coincide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pulse Issues related to the Pulse separation logic DSL
Projects
None yet
Development

No branches or pull requests

2 participants