Definition juicy_mem_alloc (jm: juicy_mem) (lo hi: Z) : juicy_mem * block :=
(mkJuicyMem (fst (alloc (m_dry jm) lo hi))
(after_alloc lo hi (snd (alloc (m_dry jm) lo hi)) (m_phi jm)
(juicy_mem_alloc_aux1 _ _ _ _ _ (eq_refl _)))
(after_alloc_contents_cohere _ _ _ _ _ (eq_refl _))
(after_alloc_access_cohere _ _ _ _ _ (eq_refl _))
(after_alloc_max_access_cohere _ _ _ _ _ (eq_refl _))
(after_alloc_alloc_cohere _ _ _ _ _ (eq_refl _)),
snd (alloc (m_dry jm) lo hi)).

(* Specifications: *)
Lemma juicy_mem_alloc_at:
forall jm lo hi jm' b,
juicy_mem_alloc jm lo hi = (jm',b) ->
forall loc, m_phi jm' @ loc =
if adr_range_dec (b, lo) (hi - lo) loc
then YES Share.top readable_share_top (VAL Undef) NoneP
else m_phi jm @ loc.
Lemma juicy_mem_alloc_level:
forall jm lo hi jm' b,
juicy_mem_alloc jm lo hi = (jm', b) -> level jm = level jm'.
Lemma juicy_mem_alloc_succeeds: forall j j' b lo hi,
juicy_mem_alloc j lo hi = (j', b) -> (m_dry j', b) = alloc (m_dry j) lo hi.