(* Lemma Zmax_of_nat: forall n, Z_of_nat (nat_of_Z n) = Z.max n 0. *)

(* Specifications: *)
Lemma snd_split_fullshare_not_bot: snd (Share.split fullshare) <> Share.bot.
Lemma readable_readonly2share: forall ro, readable_share (readonly2share ro).
(* Lemma nonunit_readonly2share: forall v, nonunit (readonly2share (@gvar_readonly type v)). *)
(* Lemma readable_splice_extern: forall v, readable_share (Share.lub extern_retainer (readonly2share (@gvar_readonly type v))). *)
Lemma init_data_lem:
forall (ge: genv) (v : globvar type) (b : block) (m1 : mem')
(m3 m4 : Memory.mem) (phi0 : rmap) (a : init_data) (z : Z) (rho: environ)
(w1 wf : rmap),
load_store_init_data1 ge m3 b z a ->
contents_at m4 = contents_at m3 ->
join w1 wf (beyond_block b (inflate_initial_mem m4 phi0)) ->
(forall loc : address,
if adr_range_dec (b, z) (init_data_size a) loc
then identity (wf @ loc) /\ access_at m4 loc Cur = Some (Genv.perm_globvar v)
else identity (w1 @ loc)) ->
forall (Hg: noghost w1) (VOL:  gvar_volatile v = false)
(AL: initializer_aligned z a = true)
(LO:   0 <= z) (HI: z + init_data_size a < Ptrofs.modulus)
(RHO: ge_of rho = filter_genv ge),
(init_data2pred a  (readonly2share (gvar_readonly v))
(Vptr b (Ptrofs.repr z))) rho w1.
Lemma init_data_list_size_app:
forall dl1 dl2, init_data_list_size (dl1++dl2) =
init_data_list_size dl1 + init_data_list_size dl2.
Lemma max_unsigned_modulus:
Ptrofs.max_unsigned + 1 = Ptrofs.modulus.
Lemma init_data_list_lem:
forall (ge: genv) m0 (v: globvar type) m1 b m2 m3 m4  phi0 rho,
alloc m0 0 (init_data_list_size (gvar_init v)) = (m1,b) ->
store_zeros m1 b 0 (init_data_list_size (gvar_init v)) = Some m2 ->
Genv.store_init_data_list ge m2 b 0 (gvar_init v) = Some m3 ->
drop_perm m3 b 0 (init_data_list_size (gvar_init v))
(Genv.perm_globvar v) = Some m4 ->
forall
(Hg: noghost phi0) (SANITY: init_data_list_size (gvar_init v) < Ptrofs.modulus)
(VOL:  gvar_volatile v = false)
(AL: initializers_aligned 0 (gvar_init v) = true)
(RHO: ge_of rho = filter_genv ge),
init_data_list2pred (gvar_init v) (readonly2share (gvar_readonly v)) (Vptr b Ptrofs.zero)
rho (beyond_block b (inflate_initial_mem m4 phi0)).