Definition range_perm (m: mem) (b: block) (lo hi: Z) (k: perm_kind) (p: permission) : Prop :=
  forall ofs, lo <= ofs < hi -> perm m b ofs k p.

(* Specifications: *)
Theorem range_perm_implies: forall m b lo hi k p1 p2, range_perm m b lo hi k p1 -> perm_order p1 p2 -> range_perm m b lo hi k p2.
Theorem range_perm_cur: forall m b lo hi k p, range_perm m b lo hi Cur p -> range_perm m b lo hi k p.
Theorem range_perm_max: forall m b lo hi k p, range_perm m b lo hi k p -> range_perm m b lo hi Max p.
Lemma range_perm_dec: forall m b lo hi k p, {range_perm m b lo hi k p} + {~ range_perm m b lo hi k p}.
Theorem valid_access_implies: forall m chunk b ofs p1 p2, valid_access m chunk b ofs p1 -> perm_order p1 p2 -> valid_access m chunk b ofs p2.
Theorem valid_access_freeable_any: forall m chunk b ofs p, valid_access m chunk b ofs Freeable -> valid_access m chunk b ofs p.
Theorem valid_access_valid_block: forall m chunk b ofs, valid_access m chunk b ofs Nonempty -> valid_block m b.
Lemma valid_access_perm: forall m chunk b ofs k p, valid_access m chunk b ofs p -> perm m b ofs k p.
Lemma valid_access_compat: forall m chunk1 chunk2 b ofs p, size_chunk chunk1 = size_chunk chunk2 -> align_chunk chunk2 <= align_chunk chunk1 -> valid_access m chunk1 b ofs p-> valid_access m chunk2 b ofs p.
Lemma valid_access_dec: forall m chunk b ofs p, {valid_access m chunk b ofs p} + {~ valid_access m chunk b ofs p}.
Theorem range_perm_implies: forall m b lo hi k p1 p2, range_perm m b lo hi k p1 -> perm_order p1 p2 -> range_perm m b lo hi k p2.
Theorem range_perm_cur: forall m b lo hi k p, range_perm m b lo hi Cur p -> range_perm m b lo hi k p.
Theorem range_perm_max: forall m b lo hi k p, range_perm m b lo hi k p -> range_perm m b lo hi Max p.
Lemma range_perm_dec: forall m b lo hi k p, {range_perm m b lo hi k p} + {~ range_perm m b lo hi k p}.
Theorem valid_access_implies: forall m chunk b ofs p1 p2, valid_access m chunk b ofs p1 -> perm_order p1 p2 -> valid_access m chunk b ofs p2.
Theorem valid_access_freeable_any: forall m chunk b ofs p, valid_access m chunk b ofs Freeable -> valid_access m chunk b ofs p.
Theorem valid_access_valid_block: forall m chunk b ofs, valid_access m chunk b ofs Nonempty -> valid_block m b.
Lemma valid_access_perm: forall m chunk b ofs k p, valid_access m chunk b ofs p -> perm m b ofs k p.
Lemma valid_access_compat: forall m chunk1 chunk2 b ofs p, size_chunk chunk1 = size_chunk chunk2 -> align_chunk chunk2 <= align_chunk chunk1 -> valid_access m chunk1 b ofs p-> valid_access m chunk2 b ofs p.
Lemma valid_access_dec: forall m chunk b ofs p, {valid_access m chunk b ofs p} + {~ valid_access m chunk b ofs p}.