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 lock_struct_array : forall sh z (v : list val) p, data_at sh (tarray (tptr (Tstruct _lock_t noattr)) z) v p = data_at sh (tarray (tptr tlock) z) v p.