(** Profs about [mem_obs_eq] and [weak_mem_obs_eq] *)

(* Specifications: *)
Lemma weak_obs_eq_restr :
forall (m m' : Mem.mem) (f : memren)
(weakObsEq: weak_mem_obs_eq f m m')
(pf: permMapLt (getCurPerm m) (getMaxPerm m))
(pf': permMapLt (getCurPerm m') (getMaxPerm (setMaxPerm m'))),
weak_mem_obs_eq f (restrPermMap pf) (restrPermMap pf').
Lemma mem_obs_eq_restr :
forall (m m' : Mem.mem) (f : memren)
(memObsEq: mem_obs_eq f m m')
(pf: permMapLt (getCurPerm m) (getMaxPerm m))
(pf': permMapLt (getCurPerm m') (getMaxPerm (setMaxPerm m'))),
mem_obs_eq f (restrPermMap pf) (restrPermMap pf').
Lemma weak_obs_eq_setMax:
forall (f : memren) (m m' : mem),
weak_mem_obs_eq f m m' <-> weak_mem_obs_eq f m (setMaxPerm m').
Lemma weak_mem_obs_eq_restrEq:
forall f f' mc mf mc' mf' pmap pmapF
(Hlt: permMapLt pmap (getMaxPerm mc))
(HltF: permMapLt pmapF (getMaxPerm mf))
(Hlt': permMapLt pmap (getMaxPerm mc'))
(HltF': permMapLt pmapF (getMaxPerm mf'))
(Hobs_eq: weak_mem_obs_eq f (restrPermMap Hlt) (restrPermMap HltF))
(Hobs_eq': weak_mem_obs_eq f' mc' mf')
(Hincr: ren_incr f f')
(Hsep: ren_separated f f' mc mf),
weak_mem_obs_eq f' (restrPermMap Hlt') (restrPermMap HltF').
(** Changes to the memories in place where permissions are below [Readable] preserve [strong_mem_obs_eq] *)
Lemma strong_mem_obs_eq_disjoint_step:
forall f f' mc mf mc' mf' pmap pmapF
(Hlt: permMapLt pmap (getMaxPerm mc))
(HltF: permMapLt pmapF (getMaxPerm mf))
(Hlt': permMapLt pmap (getMaxPerm mc'))
(HltF': permMapLt pmapF (getMaxPerm mf'))
(Hobs_eq: mem_obs_eq f (restrPermMap Hlt) (restrPermMap HltF))
(Hstable: forall b ofs, Mem.perm (restrPermMap Hlt) b ofs Cur Readable ->
ZMap.get ofs (Mem.mem_contents mc) # b = ZMap.get ofs (Mem.mem_contents mc') # b)
(HstableF: forall b ofs, Mem.perm (restrPermMap HltF) b ofs Cur Readable ->
ZMap.get ofs (Mem.mem_contents mf) # b = ZMap.get ofs (Mem.mem_contents mf') # b)
(Hincr: ren_incr f f')
(Hsep: ren_separated f f' mc mf),
strong_mem_obs_eq f' (restrPermMap Hlt') (restrPermMap HltF').