Section MEMORY_BLOCK_AGGREGATE.
Context {cs: compspecs}.

(* Specifications: *)
Lemma memory_block_array_pred: forall  {A}{d: Inhabitant A} sh t lo hi v b ofs,
0 <= ofs + sizeof t * lo /\ ofs + sizeof t * hi < Ptrofs.modulus ->
0 <= lo <= hi ->
Zlength v = hi - lo ->
array_pred lo hi
(fun i _ p => memory_block sh (sizeof t) (offset_val (sizeof t * i) p)) v
(Vptr b (Ptrofs.repr ofs)) =
memory_block sh (sizeof t * (hi - lo)) (Vptr b (Ptrofs.repr (ofs + sizeof t * lo))).
Lemma memory_block_array_pred': forall {A}{d: Inhabitant A} (a: A) sh t z b ofs,
0 <= z ->
0 <= ofs /\ ofs + sizeof t * z < Ptrofs.modulus ->
array_pred 0 z
(fun i _ p =>
memory_block sh (sizeof t) (offset_val (sizeof t * i) p))
(list_repeat (Z.to_nat z) a)
(Vptr b (Ptrofs.repr ofs))  =
memory_block sh (sizeof t * z) (Vptr b (Ptrofs.repr ofs)).
Lemma memory_block_struct_pred: forall sh m sz {A} (v: compact_prod (map A m)) b ofs,
(m = nil -> sz = 0) ->
members_no_replicate m = true ->
sizeof_struct cenv_cs 0 m <= sz < Ptrofs.modulus ->
0 <= ofs /\ ofs + sz < Ptrofs.modulus ->
struct_pred m
(fun it _ p =>
(memory_block sh (field_offset_next cenv_cs (fst it) m sz - field_offset cenv_cs (fst it) m))
(offset_val (field_offset cenv_cs (fst it) m) p)) v (Vptr b (Ptrofs.repr ofs)) =
memory_block sh sz (Vptr b (Ptrofs.repr ofs)).
Lemma memory_block_union_pred: forall sh m sz {A} (v: compact_sum (map A m)) b ofs,
(m = nil -> sz = 0) ->
union_pred m (fun it _ => memory_block sh sz) v (Vptr b (Ptrofs.repr ofs)) =
memory_block sh sz (Vptr b (Ptrofs.repr ofs)).