(****** THE REST OF THIS FILE IS AN ATTEMPT TO PROVE THE CONTRUCTION WITHOUT THE EXTRA CLAUSE (HM1': Mem.valid_block m1' b) IN THE DEFINITION OF THE CONTENT MAP -- BUT THIS WOULD REQUIRE US TO HAVE m1'!!b = ZMap.init Undef for all b >= nextblock m1' -- an invariant that is not currently satisfied by the memory model*)
Definition Content_EE_Property'
(m1 m1' m2:Mem.mem) (CM:ZMap.t (ZMap.t memval)):=
forall b,
(Mem.valid_block m2 b -> forall ofs,
(Mem.perm m1 b ofs Max Nonempty ->
ZMap.get ofs (PMap.get b CM) =
ZMap.get ofs (PMap.get b m1'.(Mem.mem_contents))) /\
(~Mem.perm m1 b ofs Max Nonempty ->
ZMap.get ofs (PMap.get b CM) =
ZMap.get ofs (PMap.get b m2.(Mem.mem_contents))))
/\ (~ Mem.valid_block m2 b -> forall ofs,
ZMap.get ofs (PMap.get b CM) =
ZMap.get ofs (PMap.get b m1'.(Mem.mem_contents)))
/\ fst CM !! b = Undef.

Lemma EE_ok': forall (m1 m1' m2 m3 m3':Mem.mem)
(Ext12: Mem.extends m1 m2)
(Fwd1: mem_forward m1 m1')
(Ext23: Mem.extends m2 m3)
(Fwd3: mem_forward m3 m3')
(Ext13' : Mem.extends m1' m3')
(UnchOn13 : Mem.unchanged_on (loc_out_of_bounds m1) m3 m3')
m2'
(NB: m2'.(Mem.nextblock)=m3'.(Mem.nextblock))
(CONT: Content_EE_Property' m1 m1' m2 (m2'.(Mem.mem_contents)))
(ACCESS: AccessMap_EE_Property m1 m1' m2 (m2'.(Mem.mem_access))),
mem_forward m2 m2' /\
Mem.extends m1' m2' /\
Mem.extends m2' m3' /\
Mem.unchanged_on (loc_out_of_bounds m1) m2 m2'.