Instance Inhabitant_hist_el : Inhabitant hashtable_hist_el := HGet 0 0.

(* Specifications: *)
Lemma only_one_add_succeeds : forall k v1 v2 l i1 i2 H0 H (HH : apply_hist H0 l = Some H)
(Hin1 : Znth i1 l = HAdd k v1 true) (Hin2 : Znth i2 l = HAdd k v2 true),
i2 = i1 /\ v2 = v1.
Lemma one_add_succeeds : forall k v b l H0 H (HH : apply_hist H0 l = Some H) (Hk : H0 k = None)
(Hin : In (HAdd k v b) l) (Hout : forall v, ~In (HSet k v) l), exists v', In (HAdd k v' true) l.
Lemma filter_find_count : forall {A} {d : Inhabitant A} (f : A -> bool) l li (Hunique : NoDup li)
(Hli : forall i, In i li -> f (Znth i l) = true) (Hrest : forall i, ~In i li -> f (Znth i l) = false),
Zlength (filter f l) = Zlength li.
Lemma hists_eq : forall lr l (Hlr : Forall (fun '(h, ls) => add_events empty_map
[HAdd 1 1 (Znth 0 ls); HAdd 2 1 (Znth 1 ls); HAdd 3 1 (Znth 2 ls)] h) lr)
(Hlens : Forall (fun '(_, ls) => Zlength ls = 3) lr)
(Hl : hist_list' (maps_add (map fst lr)) l) (Hdisj : all_disjoint (map fst lr)),
Permutation (concat (map snd lr)) (map (fun e => match e with HAdd _ _ b => b | _ => false end) l).
Lemma add_three : forall lr HT l (Hlr : Zlength lr = 3)
(Hhists : Forall (fun '(h, ls) => add_events empty_map [HAdd 1 1 (Znth 0 ls); HAdd 2 1 (Znth 1 ls);
HAdd 3 1 (Znth 2 ls)] h) lr) (Hlens : Forall (fun '(_, ls) => Zlength ls = 3) lr)
(Hl : hist_list (maps_add (map fst lr)) l) (HHT : apply_hist empty_map l = Some HT)
(Hdisj : all_disjoint (map fst lr)),
Zlength (filter id (concat (map snd lr))) = 3.
Lemma body_main : semax_body Vprog Gprog f_main main_spec.
End Proofs.