Definition latest_read (h : hist) v :=
  (* initial condition *)
  ((forall t r w, h t = Some (AE r w) -> w = Empty -> r = Empty) /\ v = vint 1) \/
  v <> Empty /\ exists n, h n = Some (AE v Empty) /\
  forall t r w, h t = Some (AE r w) -> w = Empty -> r <> Empty -> (t <= n)%nat.

Lemma last_two_reads_cons : forall r w h, last_two_reads (AE r w :: h) = if eq_dec w Empty then if eq_dec r Empty then last_two_reads h else (r, fst (last_two_reads h)) else last_two_reads h.