(********************* Lemmas and definitions related to mem_step ********)
apply (mem_step_freelist _ _ nil); trivial.
Qed.
Record memstep_preserve (P:mem -> mem -> Prop) :=
{
preserve_trans: forall m1 m2 m3, P m1 m2 -> P m2 m3 -> P m1 m3;
preserve_mem: forall m m', mem_step m m' -> P m m'
}.
subst; trivial. Qed.
intros. apply preserve_mem; trivial.
eapply mem_forward_preserve; trivial.
Qed.
constructor.
+ intros. xomega.
+ induction 1.
- apply Mem.nextblock_storebytes in H;
rewrite H; xomega.
- apply Mem.nextblock_alloc in H.
rewrite H. clear. xomega.
- apply nextblock_freelist in H.
rewrite H; xomega.
- xomega.
Qed.
*)
(* Theorem loadbytes_drop m b lo hi p m' (D:Mem.drop_perm m b lo hi p = Some m'): forall b' ofs, b' <> b \/ ofs < lo \/ hi <= ofs \/ perm_order p Readable -> Mem.loadbytes m' b' ofs 1 = Mem.loadbytes m b' ofs 1. *)

Lemma alloc_access_inv m b lo hi m' (ALLOC: Mem.alloc m lo hi = (m', b)) b' ofs k p
(P: (Mem.mem_access m') !! b' ofs k = Some p):
(b'=b /\ Z.le lo ofs /\ Z.lt ofs hi) \/
(b' <> b /\ (Mem.mem_access m) !! b' ofs k = Some p).