End Read.
Section Write.
Variable (A : Type) (x : ptr) (v : A).
Definition write_s : spec unit :=
(fun i => x \in dom i : Prop,
fun y i m => y = Val tt /\ upd i x (dyn v) = m).
Definition write_sp (p : ideald write_s.1) (y : ans unit) m :=
exists i, i \In id_val p /\ x \in dom i /\
y = Val tt /\ m = upd i x (dyn v).

Lemma write_coherent : coherent write_sp.