Definition prog_var_block (rho: environ) (il: list ident) (b: block) : Prop :=
  Exists (fun id => match ge_of rho id with Some b' => b'=b | _ => False end) il.

(* Specifications: *)
Lemma match_fdecs_in: forall i vl G, In i (map (@fst _ _) G) -> match_fdecs vl G -> In i (map (@fst _ _) vl).
Lemma match_fdecs_norepet: forall vl G, list_norepet (map (@fst _ _) vl) -> match_fdecs vl G -> list_norepet (map (@fst _ _) G).
Lemma list_norepet_prog_funct': forall A B (vl: list (ident * globdef A B)), list_norepet (map (@fst _ _) vl) -> list_norepet (map (@fst _ _) (prog_funct' vl)).
Lemma match_fdecs_rev': forall vl G vl' G', list_norepet (map (@fst _ _) (rev vl ++ vl')) -> match_fdecs vl G -> match_fdecs vl' G' -> match_fdecs (rev vl ++ vl') (rev G ++ G').
Lemma match_fdecs_rev: forall vl G, list_norepet (map (@fst _ _) vl) -> match_fdecs (rev vl) (rev G) = match_fdecs vl G.
Lemma initial_core_rev: forall (gev: Genv.t fundef type) G n (vl: list (ident * globdef fundef type)) (H: list_norepet (map fst (rev vl))) (SAME_IDS : match_fdecs (prog_funct' vl) (rev G)), initial_core gev G n = initial_core gev (rev G) n.
Lemma alloc_Gfun_inflate: forall n rho i f fs gv vl gev m0 m G0 G, Genv.alloc_global gev m0 (i, Gfun f) = Some m -> (forall phi : rmap, hackfun (inflate_initial_mem m0 (initial_core gev (G0 ++ (i, fs) :: G) n)) phi -> (globvars2pred gv vl rho) phi) -> Genv.find_symbol gev i = Some (nextblock m0) -> ~ In i (map fst vl) -> forall phi : rmap, hackfun (inflate_initial_mem m (initial_core gev (G0 ++ (i, fs) :: G) n)) phi -> (globvars2pred gv vl rho) phi.
Lemma resource_identity_dec: forall (r: resource), {identity r}+{~identity r}.
Lemma hackfun_sep: forall w1 w2 w w', hackfun w w' -> join w1 w2 w -> exists w1', exists w2', join w1' w2' w' /\ hackfun w1 w1' /\ hackfun w2 w2'.
Lemma init_datalist_hack: forall b sh rho dl phi0 z, (init_data_list2pred dl sh (Vptr b z) rho) phi0 -> forall phi, hackfun phi0 phi -> readable_share sh -> (init_data_list2pred dl sh (Vptr b z) rho) phi.
Lemma another_hackfun_lemma: forall n i v gev m G phi m0, hackfun (inflate_initial_mem m (initial_core gev G n)) phi -> Genv.alloc_global gev m0 (i, Gvar v) = Some m -> hackfun (inflate_initial_mem m0 (initial_core gev G n)) (upto_block (nextblock m0) phi).
Lemma hackfun_beyond_block: forall b w w', hackfun w w' -> hackfun (beyond_block b w) (beyond_block b w').
Lemma Pos_to_nat_eq_S: forall b, Pos.to_nat b = S (nat_of_Z (Z.pos b) - 1).
Lemma global_initializers: forall (prog: program) G m n rho, list_norepet (prog_defs_names prog) -> all_initializers_aligned prog -> match_fdecs (prog_funct prog) G -> ge_of rho = filter_genv (globalenv prog) -> Genv.init_mem prog = Some m -> app_pred (globvars2pred (globals_of_env rho) (prog_vars prog) rho) (inflate_initial_mem m (initial_core (Genv.globalenv prog) G n)).