(** * Globals separated *)
(** globals_separate is an invariant enforcing that newly allocated blocks are NOT mapped to global blocks. It is used to re-establish meminj_preserves_globals in the after external diagram. In that sense it replaces sm_inject_separated (jan 2015). *)
Definition globals_separate {F V:Type} (ge: Genv.t F V) mu nu :=
forall b1 b2 d, as_inj mu b1 = None ->
as_inj nu b1 =Some(b2,d) ->
isGlobalBlock ge b2 = false.
intros ? ? mu ge b1 b2 d map1 map2.
rewrite map1 in map2; discriminate.
Qed.
intros ? ? ? ? mu mu' ge1 ge2 gsep geq b1 b2 d map1 map2.
rewrite <- (genvs_domain_eq_isGlobal _ _ geq).
eapply gsep; eauto.
Qed.

Lemma gsep_trans:
forall {F V} (ge:  Genv.t F V) mu mu' mu'',
Values.inject_incr (as_inj mu') (as_inj mu'') ->
globals_separate ge mu mu' ->
globals_separate ge mu' mu'' ->
globals_separate ge mu mu''.