Section ALLOC.
Variable m1: mem.
Variables lo hi: Z.
Variable m2: mem.
Variable b: Values.block.
Hypothesis ALLOC: Mem.alloc m1 lo hi = (m2, b).
Transparent Mem.alloc.
Opaque Mem.alloc.
End ALLOC.
Definition gvar_info_eq {V1 V2} (v1: option (globvar V1)) (v2: option (globvar V2)) :=
match v1, v2 with
None, None => True
| Some i1, Some i2 => gvar_init i1 = gvar_init i2 /\
gvar_readonly i1 = gvar_readonly i2 /\ gvar_volatile i1 = gvar_volatile i2
| _, _ => False
end.
Definition gvar_infos_eq {F1 V1 F2 V2}
(g1 : Genv.t F1 V1) (g2 : Genv.t F2 V2) :=
forall b, gvar_info_eq (Genv.find_var_info g1 b) (Genv.find_var_info g2 b).
destruct v; simpl; intuition. Qed.

Lemma gvar_infos_eq_ReadOnlyBlocks {F1 V1 F2 V2} (g1: Genv.t F1 V1) (g2:Genv.t F2 V2):
gvar_infos_eq g1 g2 -> ReadOnlyBlocks g1 = ReadOnlyBlocks g2.