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

Ghost functions have a model supporting their erasure #10

Merged
merged 20 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions lib/pulse/core/PulseCore.Atomic.fst
Original file line number Diff line number Diff line change
Expand Up @@ -302,30 +302,4 @@ let ghost_read
let ghost_write r x y f = Ghost.hide (A.ghost_write r x y f)
let ghost_share r v0 v1 = Ghost.hide (A.ghost_share r v0 v1)
let ghost_gather r v0 v1 = Ghost.hide (A.ghost_gather r v0 v1)

let ghost_witnessed
(#a:Type u#1)
(#p:pcm a)
(r:ghost_ref p)
(f:property a)
= admit() //witnessed (reveal r) f

let ghost_witness
(#a:Type)
(#pcm:pcm a)
(r:ghost_ref pcm)
(fact:stable_property pcm)
(v:Ghost.erased a)
(pf:squash (forall z. compatible pcm v z ==> fact z))
= admit() //A.witness r fact v pf

let ghost_recall
(#a:Type u#1)
(#pcm:pcm a)
(#fact:property a)
(r:ghost_ref pcm)
(v:Ghost.erased a)
(w:ghost_witnessed r fact)
= admit() //A.recall r v w

let drop p = Ghost.hide (A.drop p)
64 changes: 33 additions & 31 deletions lib/pulse/core/PulseCore.Atomic.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -401,37 +401,39 @@ val ghost_gather
(ghost_pts_to r v0 ** ghost_pts_to r v1)
(fun _ -> ghost_pts_to r (op pcm v0 v1))

val ghost_witnessed
(#a:Type u#1)
(#p:pcm a)
(r:ghost_ref p)
(f:property a)
: Type0

val ghost_witness
(#a:Type)
(#pcm:pcm a)
(r:ghost_ref pcm)
(fact:stable_property pcm)
(v:Ghost.erased a)
(pf:squash (forall z. compatible pcm v z ==> fact z))
: stt_atomic
(ghost_witnessed r fact)
#Unobservable emp_inames
(ghost_pts_to r v)
(fun _ -> ghost_pts_to r v)

val ghost_recall
(#a:Type u#1)
(#pcm:pcm a)
(#fact:property a)
(r:ghost_ref pcm)
(v:Ghost.erased a)
(w:ghost_witnessed r fact)
: stt_atomic (v1:Ghost.erased a{compatible pcm v v1})
#Unobservable emp_inames
(ghost_pts_to r v)
(fun v1 -> ghost_pts_to r v ** pure (fact v1))
// Unused?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are unused, but @mtzguido tells me that they are expected to be required soon. I will restore them in a follow-up PR.


// val ghost_witnessed
// (#a:Type u#1)
// (#p:pcm a)
// (r:ghost_ref p)
// (f:property a)
// : Type0

// val ghost_witness
// (#a:Type)
// (#pcm:pcm a)
// (r:ghost_ref pcm)
// (fact:stable_property pcm)
// (v:Ghost.erased a)
// (pf:squash (forall z. compatible pcm v z ==> fact z))
// : stt_atomic
// (ghost_witnessed r fact)
// #Unobservable emp_inames
// (ghost_pts_to r v)
// (fun _ -> ghost_pts_to r v)

// val ghost_recall
// (#a:Type u#1)
// (#pcm:pcm a)
// (#fact:property a)
// (r:ghost_ref pcm)
// (v:Ghost.erased a)
// (w:ghost_witnessed r fact)
// : stt_atomic (v1:Ghost.erased a{compatible pcm v v1})
// #Unobservable emp_inames
// (ghost_pts_to r v)
// (fun v1 -> ghost_pts_to r v ** pure (fact v1))

val drop (p:slprop)
: stt_ghost unit p (fun _ -> emp)
Loading