Fixpoint alloc_globals_rev {F V} (ge: Genv.t F V) (m: mem) (vl: list (ident * globdef F V))
                         {struct vl} : option mem :=
  match vl with
  | nil => Some m
  | v :: vl' =>
     match alloc_globals_rev ge m vl' with
     | Some m' => Genv.alloc_global ge m' v
     | None => None
     end
  end.

(* Specifications: *)
Lemma alloc_globals_app: forall F V (ge: Genv.t F V) m m2 vs vs', Genv.alloc_globals ge m (vs++vs') = Some m2 <-> exists m', Genv.alloc_globals ge m vs = Some m' /\ Genv.alloc_globals ge m' vs' = Some m2.
Lemma alloc_globals_rev_eq: forall F V (ge: Genv.t F V) m vl, Genv.alloc_globals ge m (rev vl) = alloc_globals_rev ge m vl.
Lemma zlength_nonneg: forall A l, 0 <= @Zlength A l.
Lemma alloc_globals_rev_nextblock: forall {F V} (ge: Genv.t F V) vl m, alloc_globals_rev ge empty vl = Some m -> nextblock m = Z.to_pos(Z.succ (Zlength vl)).
Lemma store_zeros_max_access: forall m b z N m', store_zeros m b z N = Some m' -> max_access_at m' = max_access_at m.
Lemma store_zeros_access: forall m b z N m', store_zeros m b z N = Some m' -> access_at m' = access_at m.
Lemma store_zeros_contents1: forall m b z N m' loc, fst loc <> b -> store_zeros m b z N = Some m' -> contents_at m loc = contents_at m' loc.
Lemma alloc_global_old: forall {F V} (ge: Genv.t F V) m iv m', Genv.alloc_global ge m iv = Some m' -> forall loc, (fst loc < nextblock m)%positive -> access_at m loc = access_at m' loc /\ contents_at m loc = contents_at m' loc.