Definition AccessMap_EE_FUN'  (m1 m1' m2:Mem.mem) (b:block):
           Z -> perm_kind -> option permission :=
if plt b (Mem.nextblock m1')
then
  if plt b (Mem.nextblock m2)
  then (fun ofs k =>
         if Mem.perm_dec m1 b ofs Max Nonempty
         then PMap.get b m1'.(Mem.mem_access) ofs k
         else PMap.get b m2.(Mem.mem_access) ofs k)
  else PMap.get b m1'.(Mem.mem_access)
else (fun ofs k => None).Definition AccessMap_EE_FUN  (m1 m1' m2:Mem.mem) (b:block):
           Z -> perm_kind -> option permission :=
  if plt b (Mem.nextblock m2)
  then (fun ofs k =>
         if Mem.perm_dec m1 b ofs Max Nonempty
         then PMap.get b m1'.(Mem.mem_access) ofs k
         else PMap.get b m2.(Mem.mem_access) ofs k)
  else PMap.get b m1'.(Mem.mem_access).

Lemma mkAccessMap_EE_exists: forall (m1 m1' m2:Mem.mem), exists M : PMap.t (Z -> perm_kind -> option permission), fst M = (fun k ofs => None) /\ forall b, PMap.get b M = AccessMap_EE_FUN' m1 m1' m2 b.