Definition writes e v :=
match e with
| Load _ => False
| Store v' => v' = v
| CAS r c v' => r = c /\ v' = v
end.

(* Specifications: *)
Lemma change_implies_write : forall v h i, apply_hist i h = Some v -> v <> i ->
exists e, In e h /\ writes e v.
Lemma change_implies_write : forall v h i, apply_hist i h = Some v -> v <> i ->
exists e, In e h /\ writes e v.