(* This file is developed by Qinxiang Cao, Aquinas Hobor and Shengyi Wang in 2015. *)

(* Specifications: *)
Lemma range_overlap_spec: forall l1 n1 l2 n2,
n1 > 0 ->
n2 > 0 ->
(range_overlap l1 n1 l2 n2 <-> adr_range l1 n1 l2 \/ adr_range l2 n2 l1).
Lemma range_overlap_comm: forall l1 n1 l2 n2, range_overlap l1 n1 l2 n2 -> range_overlap l2 n2 l1 n1.
Lemma range_overlap_non_zero: forall l1 n1 l2 n2, range_overlap l1 n1 l2 n2 -> n1 > 0 /\ n2 > 0.
Definition pointer_range_overlap p n p' n' :=
exists l l', val2adr p l /\ val2adr p' l' /\ range_overlap l n l' n'.
Lemma pointer_range_overlap_dec: forall p1 n1 p2 n2, {pointer_range_overlap p1 n1 p2 n2} + {~ pointer_range_overlap p1 n1 p2 n2}.
Lemma pointer_range_overlap_refl: forall p n1 n2,
isptr p ->
n1 > 0 ->
n2 > 0 ->
pointer_range_overlap p n1 p n2.
Lemma pointer_range_overlap_comm: forall p1 n1 p2 n2,
pointer_range_overlap p1 n1 p2 n2 <->
pointer_range_overlap p2 n2 p1 n1.
Lemma pointer_range_overlap_non_zero: forall p1 n1 p2 n2,
pointer_range_overlap p1 n1 p2 n2 -> n1 > 0 /\ n2 > 0.
Lemma pointer_range_overlap_isptr: forall p1 n1 p2 n2,
pointer_range_overlap p1 n1 p2 n2 -> isptr p1 /\ isptr p2.