Instance CompSpecs : compspecs.Definition Vprog : varspecs.Definition release2_spec := DECLARE _release2 release2_spec.Definition freelock2_spec := DECLARE _freelock2 (freelock2_spec _).Definition spawn_spec := DECLARE _spawn spawn_spec.(* One might think it should just return an unknown number, but in fact it needs to follow a known hash
   function at the logic level to be useful. *)

Definition tentry := Tstruct _entry noattr.Instance hf1 : hash_fun := { size := 16384; hash i := (i * 654435761) mod 16384 }.Definition v_R (h : list hist_el) (v : Z) := emp.(* Entries are no longer consecutive. *)
Definition wf_hists h := Forall (fun x => (ordered_hist (fst x) /\ Forall int_op (map snd (fst x))) /\
  (ordered_hist (snd x) /\ Forall int_op (map snd (snd x)))) h.Definition make_map h :=
  map (fun hs => (make_int (value_of_hist (fst hs)), make_int (value_of_hist (snd hs)))) h.Definition atomic_entry sh pk pv gk gv hk hv :=
  atomic_loc_hist sh pk gk 0 k_R hk * atomic_loc_hist sh pv gv 0 v_R hv.Definition atomic_entries sh entries ghosts hists := fold_right sepcon emp
  (map (fun x => let '((pk, pv), (gk, gv), (hk, hv)) := x in atomic_entry sh pk pv gk gv hk hv)
    (combine (combine entries ghosts) hists)).Definition f_lock_pred tsh sh entries ghosts p t locksp lockt resultsp res :=
  selflock (f_lock_inv sh entries ghosts p t locksp lockt resultsp res) tsh lockt.

Lemma add_item_trace_wf : forall h k v i s h' (Hwf : wf_hists h) (Htrace : add_item_trace h k v i s h'), wf_hists h'.