Definition value_of e :=
  match e with
  | Load v => v
  | Store v => v
  | CAS r c w => if eq_dec r c then w else r
  end.Definition value_of_hist (h : hist) := value_of (snd (last h (O, Store (vint 0)))).Notation ordered_hist := (ordered_hist (Store (vint 0))).

(* Specifications: *)
Lemma ordered_last_value : forall h v (Hordered : ordered_hist h), last_value h v <-> value_of_hist h = v.
Lemma hist_list_value : forall h l v (Horder : ordered_hist h) (Hl : hist_list h l) (Hv : apply_hist (vint 0) l = Some v), value_of_hist h = v.
Lemma ordered_last_value : forall h v (Hordered : ordered_hist h), last_value h v <-> value_of_hist h = v.
Lemma hist_list_value : forall h l v (Horder : ordered_hist h) (Hl : hist_list h l) (Hv : apply_hist (vint 0) l = Some v), value_of_hist h = v.