Corollary int_op_value_of_hist : forall h, Forall int_op (map snd h) -> tc_val tint (value_of_hist h).

(* Specifications: *)
Lemma make_map_app : forall h1 h2 (Hnz : Forall (fun x => value_of_hist (fst x) <> vint 0) h1) (Hint : Forall (fun x => Forall int_op (map snd (fst x))) h1), make_map (h1 ++ h2) = make_map h1 ++ make_map h2.
Lemma make_map_drop : forall h1 h2 (Hz : Forall (fun x => value_of_hist (fst x) = vint 0) h2), make_map (h1 ++ h2) = make_map h1.
Lemma index_of_app : forall k m1 m2, index_of (m1 ++ m2) k = match index_of m1 k with Some i => Some i | None => option_map (Z.add (Zlength m1)) (index_of m2 k) end.
Lemma index_of_out : forall k m, Forall (fun x => fst x <> k) m -> index_of m k = None.
Lemma make_map_length : forall h (Hnz : Forall (fun x => value_of_hist (fst x) <> vint 0) h) (Hint : Forall (fun x => Forall int_op (map snd (fst x))) h), Zlength (make_map h) = Zlength h.
Lemma make_map_no_key : forall h k (Hout : Forall (fun x => make_int (value_of_hist (fst x)) <> k) h), Forall (fun x => fst x <> k) (make_map h).
Lemma set_item_trace_map : forall h k v i h' l (Hwf : wf_hists h l) (Htrace : set_item_trace h k v i h') (Hk : k <> 0) (Hrepk : repable_signed k) (Hrepv : repable_signed v), wf_hists h' (Z.max (i + 1) l) /\ let m' := make_map (sublist 0 i h' ++ sublist i (Zlength h) h) in wf_map (set m' k v) /\ incl (make_map h) m' /\ make_map h' = set m' k v.
Lemma index_of_iff_out : forall m k, index_of m k = None <-> ~In k (map fst m).
Lemma apply_int_ops : forall v h i (Hv : apply_hist (Vint i) h = Some v) (Hints : Forall int_op h), tc_val tint v.