Inductive match_freelists (j:meminj): list (block * Z * Z) -> list (block * Z * Z) -> Prop :=
match_freelists_nil: match_freelists j nil nil
| match_freelists_cons: forall b1 lo1 hi1 t1 b2 lo2 hi2 t2 delta,
j b1 = Some (b2,delta) ->
lo2 = lo1+delta -> hi2 = hi1+delta ->
match_freelists j t1 t2 ->
match_freelists j ((b1,lo1,hi1)::t1) ((b2,lo2,hi2)::t2).

(*version of Lemma meminj_preserves_globals_initSM, for a definition of clause match_genv that uses foreign_of*)
Lemma meminj_preserves_globals_initSM_frgn: forall {F1 V1} (ge: Genv.t F1 V1) j
(PG : meminj_preserves_globals ge j) DomS DomT m R Y
(HR: forall b, isGlobalBlock ge b = true -> R b = true),
meminj_preserves_globals ge (foreign_of (initial_SM DomS DomT (REACH m R) Y j)).