Fixpoint memory_block' (sh: share) (n: nat) (b: block) (i: Z) : mpred :=
  match n with
  | O => emp
  | S n' => mapsto_ sh (Tint I8 Unsigned noattr) (Vptr b (Ptrofs.repr i))
         * memory_block' sh n' b (i+1)
 end.Definition memory_block'_alt (sh: share) (n: nat) (b: block) (ofs: Z) : mpred :=
 if readable_share_dec sh 
 then VALspec_range (Z_of_nat n) sh (b, ofs)
 else nonlock_permission_bytes sh (b,ofs) (Z.of_nat n).

(* Specifications: *)
Lemma memory_block'_eq: forall sh n b i, 0 <= i -> Z_of_nat n + i < Ptrofs.modulus -> memory_block' sh n b i = memory_block'_alt sh n b i.
Lemma mapsto_share_join: forall sh1 sh2 sh t p v, join sh1 sh2 sh -> mapsto sh1 t p v * mapsto sh2 t p v = mapsto sh t p v.
Lemma Nat2Z_add_lt: forall n i, Ptrofs.unsigned i + n < Ptrofs.modulus -> Z.of_nat (nat_of_Z n) + Ptrofs.unsigned i < Ptrofs.modulus.
Lemma Nat2Z_add_le: forall n i, Ptrofs.unsigned i + n <= Ptrofs.modulus -> Z.of_nat (nat_of_Z n) + Ptrofs.unsigned i <= Ptrofs.modulus.
Lemma memory_block_non_pos_Vptr: forall sh n b z, n <= 0 -> memory_block sh n (Vptr b z) = emp.
Lemma memory_block_zero_Vptr: forall sh b z, memory_block sh 0 (Vptr b z) = emp.
Lemma memory_block'_split: forall sh b ofs i j, 0 <= i <= j -> j <= j+ofs < Ptrofs.modulus -> memory_block' sh (nat_of_Z j) b ofs = memory_block' sh (nat_of_Z i) b ofs * memory_block' sh (nat_of_Z (j-i)) b (ofs+i).
Lemma memory_block_split: forall (sh : share) (b : block) (ofs n m : Z), 0 <= n -> 0 <= m -> n + m <= n + m + ofs < Ptrofs.modulus -> memory_block sh (n + m) (Vptr b (Ptrofs.repr ofs)) = memory_block sh n (Vptr b (Ptrofs.repr ofs)) * memory_block sh m (Vptr b (Ptrofs.repr (ofs + n))).
Lemma memory_block_share_join: forall sh1 sh2 sh n p, sepalg.join sh1 sh2 sh -> memory_block sh1 n p * memory_block sh2 n p = memory_block sh n p.
Lemma mapsto_pointer_void: forall sh t a, eqb_type (Tpointer t a) int_or_ptr_type = false -> eqb_type (Tpointer Tvoid a) int_or_ptr_type = false -> mapsto sh (Tpointer t a) = mapsto sh (Tpointer Tvoid a).
Lemma is_pointer_or_null_nullval: is_pointer_or_null nullval.
Lemma tc_val_pointer_nullval': forall t a, tc_val (Tpointer t a) nullval.