Program Definition juicy_mem_storebytes j b ofs bytes: option juicy_mem :=
if range_perm_dec (m_dry j) b ofs (ofs + Z_of_nat (length bytes)) Cur Writable
then Some (storebytes_juicy_mem j _ b ofs bytes _)
else None.
Next Obligation.
apply (proj1_sig (range_perm_storebytes (m_dry j) b ofs bytes H)).
Defined.
Next Obligation.
apply (proj2_sig (range_perm_storebytes (m_dry j) b ofs bytes H)).
Qed.

Lemma juicy_mem_storebytes_succeeds: forall j j' b ofs bytes,
juicy_mem_storebytes j b ofs bytes = Some j' ->
exists m', storebytes (m_dry j) b ofs bytes = Some m' /\ m' = m_dry j'.