Definition mod_after_alloc (phi: rmap) (lo hi: Z) (b: block) :=
proj1_sig (make_rmap (mod_after_alloc' phi lo hi b) (ghost_of phi)
_
(mod_after_alloc'_ok phi lo hi b) (ghost_of_approx phi)).
Transparent alloc.

(* Specifications: *)
Lemma adr_range_inv: forall loc loc' n,
~ adr_range loc n loc' ->
fst loc <> fst loc' \/ (fst loc=fst loc' /\ ~snd loc <= snd loc' < snd loc + n).
Lemma dry_noperm_juicy_nonreadable : forall m loc,
access_at (m_dry m) loc Cur = None ->   ~readable loc (m_phi m).
Lemma fullempty_after_alloc : forall m1 m2 lo n b ofs,
alloc m1 lo n = (m2, b) ->
access_at m2 (b, ofs) Cur = None \/ access_at m2 (b, ofs) Cur = Some Freeable.
Lemma alloc_dry_unchanged_on : forall m1 m2 loc lo hi b0,
alloc m1 lo hi = (m2, b0) ->
~adr_range (b0,lo) (hi-lo) loc ->
access_at m1 loc = access_at m2 loc /\
(access_at m1 loc Cur <> None -> contents_at m1 loc= contents_at m2 loc).
Lemma adr_range_zle_fact : forall b lo hi loc,
adr_range (b,lo) (hi-lo) loc ->
zle lo (snd loc) && zlt (snd loc) hi = true.
Lemma alloc_dry_updated_on : forall m1 m2 lo hi b loc,
alloc m1 lo hi = (m2, b) ->
adr_range (b, lo) (hi - lo) loc ->
access_at m2 loc Cur=Some Freeable /\
contents_at m2 loc=Undef.