Section INITMEM_EXISTS.
Variable ge: t.

(* Specifications: *)
Lemma store_zeros_exists:
forall m b p n,
Mem.range_perm m b p (p + n) Cur Writable ->
exists m', store_zeros m b p n = Some m'.
Lemma store_init_data_exists:
forall m b p i,
Mem.range_perm m b p (p + init_data_size i) Cur Writable ->
(init_data_alignment i | p) ->
(forall id ofs, i = Init_addrof id ofs -> exists b, find_symbol ge id = Some b) ->
exists m', store_init_data ge m b p i = Some m'.
Lemma store_init_data_list_exists:
forall b il m p,
Mem.range_perm m b p (p + init_data_list_size il) Cur Writable ->
init_data_list_aligned p il ->
(forall id ofs, In (Init_addrof id ofs) il -> exists b, find_symbol ge id = Some b) ->
exists m', store_init_data_list ge m b p il = Some m'.
Lemma alloc_global_exists:
forall m idg,
match idg with
| (id, Gfun f) => True
| (id, Gvar v) =>
init_data_list_aligned 0 v.(gvar_init)
/\ forall i o, In (Init_addrof i o) v.(gvar_init) -> exists b, find_symbol ge i = Some b
end ->
exists m', alloc_global ge m idg = Some m'.
Lemma store_zeros_exists:
forall m b p n,
Mem.range_perm m b p (p + n) Cur Writable ->
exists m', store_zeros m b p n = Some m'.
Lemma store_init_data_exists:
forall m b p i,
Mem.range_perm m b p (p + init_data_size i) Cur Writable ->
(init_data_alignment i | p) ->
(forall id ofs, i = Init_addrof id ofs -> exists b, find_symbol ge id = Some b) ->
exists m', store_init_data ge m b p i = Some m'.
Lemma store_init_data_list_exists:
forall b il m p,
Mem.range_perm m b p (p + init_data_list_size il) Cur Writable ->
init_data_list_aligned p il ->
(forall id ofs, In (Init_addrof id ofs) il -> exists b, find_symbol ge id = Some b) ->
exists m', store_init_data_list ge m b p il = Some m'.
Lemma alloc_global_exists:
forall m idg,
match idg with
| (id, Gfun f) => True
| (id, Gvar v) =>
init_data_list_aligned 0 v.(gvar_init)
/\ forall i o, In (Init_addrof i o) v.(gvar_init) -> exists b, find_symbol ge i = Some b
end ->
exists m', alloc_global ge m idg = Some m'.