End Snapshot.
Definition pos_PCM := ghost_PCM.pos_PCM.
Definition ref_PCM := ghost_PCM.ref_PCM.
Notation completable := ghost_PCM.completable.
Section Reference.
Context {P : Ghost}.
Definition ghost_reference g a := own(RA := ref_PCM P) g (None, Some a) NoneP.
Definition ghost_part g sh a := own(RA := ref_PCM P) g (Some (sh, a), None) NoneP.
Definition ghost_part_ref g sh a r :=
own(RA := ref_PCM P) g (Some (sh, a), Some r) NoneP.

(* Specifications: *)
Lemma ghost_part_ref_join : forall g (sh : share) a b,
ghost_part g sh a * ghost_reference g b = ghost_part_ref g sh a b.
Lemma ref_sub : forall g sh a b pp,
own(RA := ref_PCM P) g (Some (sh, a), None) pp * own(RA := ref_PCM P) g (None, Some b) pp |--
!!(if eq_dec sh Tsh then a = b else exists x, join a x b).
Lemma ref_add : forall g sh a r b a' r' pp
(Ha : join a b a') (Hr : join r b r') (Hb : forall c, join_sub a c -> join_sub c r -> joins c b),
own(RA := ref_PCM P) g (Some (sh, a), Some r) pp |-- |==>
own(RA := ref_PCM P) g (Some (sh, a'), Some r') pp.
Lemma self_completable : forall a, completable (Some (Tsh, a)) a.
End Reference.