(***********************************************************************)

Goal forall mu (WD: SM_wd mu) m1 m2 m2'
(U: Mem.unchanged_on (local_out_of_reach mu m1) m2 m2'),
Mem.unchanged_on (fun b ofs => pubBlocksTgt mu b = true /\
                  loc_out_of_reach (pub_of mu) m1 b ofs) m2 m2'.Goal forall mu (WD: SM_wd mu) m1 m2 m2'
(U: Mem.unchanged_on (local_out_of_reach mu m1) m2 m2'),
Mem.unchanged_on (fun b ofs => locBlocksTgt mu b = true /\
                    pubBlocksTgt mu b = false) m2 m2'.Goal forall mu m1 m2 m2' (WD:SM_wd mu)
  (U1: Mem.unchanged_on (fun b ofs => locBlocksTgt mu b = true /\
                    pubBlocksTgt mu b = false) m2 m2')
  (U2: Mem.unchanged_on (fun b ofs => pubBlocksTgt mu b = true /\
                  loc_out_of_reach (pub_of mu) m1 b ofs) m2 m2'),
Mem.unchanged_on (local_out_of_reach mu m1) m2 m2'.

Lemma halted_loc_check: forall mu m1 m2 v1 v2 (MInj: Mem.inject (locvisible_of mu) m1 m2) (VInj: val_inject (locvisible_of mu) v1 v2) (WD: SM_wd mu), exists pubSrc' pubTgt' nu, (pubSrc' = fun b => (locBlocksSrc mu b) && (REACH m1 (exportedSrc mu (v1::nil)) b)) /\ (pubTgt' = fun b => (locBlocksTgt mu b) && (REACH m2 (exportedTgt mu (v2::nil)) b)) /\ (nu = replace_locals mu pubSrc' pubTgt') /\ SM_wd nu /\ val_inject (shared_of nu) v1 v2 /\ Mem.inject (shared_of nu) m1 m2.