(*TODO: Move to ev_semantics*)
Definition in_free_list (b : block) ofs xs :=
exists x, List.In x xs /\
let '(b', lo, hi) := x in
b = b' /\
(lo <= ofs < hi)%Z.
Fixpoint in_free_list_trace (b : block) ofs es :=
match es with
| event_semantics.Free l :: es =>
in_free_list b ofs l \/ in_free_list_trace b ofs es
| _ :: es =>
in_free_list_trace b ofs es
| [:: ] =>
False
end.

(** If (b, ofs) is not in the list of freed locations and b is a valid block then the permissions remains the same (cannot be freed or allocated)*)
Lemma ev_elim_free_2:
forall m ev m' b ofs,
ev_elim m ev m' ->
~ in_free_list_trace b ofs ev ->
Mem.perm_order'' (permission_at m' b ofs Cur) (permission_at m b ofs Cur).