Definition wf_map (m : list (Z * Z)) := Forall (fun i => repable_signed i /\ i <> 0) (map fst m).Definition int_op e :=
  match e with
  | Load v | Store v => tc_val tint v
  | CAS r c w => tc_val tint r /\ tc_val tint c /\ tc_val tint w
  end.Definition v_R (h : list hist_el) (v : val) := emp.Definition wf_hists h l := Forall (fun x => ordered_hist (fst x) /\ ordered_hist (snd x) /\
  Forall int_op (map snd (fst x)) /\ Forall int_op (map snd (snd x))) h /\ 0 <= l <= Zlength h /\
    Forall (fun x => value_of_hist (fst x) <> vint 0) (sublist 0 l h) /\
    Forall (fun x => value_of_hist (fst x) = vint 0) (sublist l (Zlength h) h).Definition make_int v := match v with Vint i => Int.signed i | _ => 0 end.

(* Specifications: *)
Lemma make_int_spec : forall v, tc_val tint v -> vint (make_int v) = v.
Lemma Forall_set : forall P m k v, Forall P m -> P (k, v) -> Forall P (set m k v).
Lemma wf_make_map : forall h, wf_map (make_map h).
Lemma make_map_eq : forall h h', Forall2 (fun a b => value_of_hist (fst a) = value_of_hist (fst b) /\ value_of_hist (snd a) = value_of_hist (snd b)) h h' -> make_map h = make_map h'.
Lemma int_op_value : forall e, int_op e -> tc_val tint (value_of e).