Program Definition getYES (phi : rmap) := proj1_sig (make_rmap (getYES_aux phi) (ghost_of phi) (level phi) _ _).
Next Obligation.
pose proof resource_at_approx phi as V.
extensionality l. specialize (V l).
unfold getYES_aux, "oo" in *.
destruct (phi @ _); simpl in *; auto.
congruence.
Qed.
Next Obligation.
apply ghost_of_approx.
Qed.
Program Definition getNO (phi : rmap) := proj1_sig (make_rmap (getNO_aux phi) (core (ghost_of phi)) (level phi) _ _).
Next Obligation.
pose proof resource_at_approx phi as V.
extensionality l. specialize (V l).
unfold getNO_aux, "oo" in *.
destruct (phi @ _); simpl in *; auto.
Qed.
Next Obligation.
rewrite ghost_core; auto.
Qed.

Lemma writable0_glb_Rsh:
forall sh, writable0_share sh -> Share.glb Share.Rsh sh = Share.Rsh.