(** The sizes of blocks appearing in [e] are respected. *)

Definition match_bounds (e: Csharpminor.env) (m: mem) : Prop :=
  forall id b sz ofs p,
  PTree.get id e = Some(b, sz) -> Mem.perm m b ofs Max p -> 0 <= ofs < sz.

(* Specifications: *)
Lemma match_bounds_invariant: forall e m1 m2, match_bounds e m1 -> (forall id b sz ofs p, PTree.get id e = Some(b, sz) -> Mem.perm m2 b ofs Max p -> Mem.perm m1 b ofs Max p) -> match_bounds e m2.
Lemma match_bounds_invariant: forall e m1 m2, match_bounds e m1 -> (forall id b sz ofs p, PTree.get id e = Some(b, sz) -> Mem.perm m2 b ofs Max p -> Mem.perm m1 b ofs Max p) -> match_bounds e m2.