Notation noaliasR_fwd D x y := (noaliasR_fwd1 D x y (Logic.eq_refl _)).
Notation "()" := (Logic.eq_refl _).
Example exnc A (x1 x2 x3 x4 : ptr) (v1 v2 : A) (h1 h2 : heap) :
def (h1 :+ x2 :-> 1 :+ h2 :+ x1 :-> v2 :+ (x3 :-> v1 :+ empty)) ->
(x1 != x2) /\
(x1 != x2) && (x2 != x3) && (x3 != x1) /\
(x2 == x3) = false /\ (x1 == x2) = false.
Arguments scan_it [s f].
Definition search_them x y g := @Search2.find2E x y g.
Arguments search_them x y [g].
Example without_notation
A (x1 x2 x3 : ptr) (v1 v2 v3 : A) (h1 h2 : heap) :
def (h1 :+ (x1 :-> v1 :+ x2 :-> v2) :+ (h2 :+ x3 :-> v3))
-> (x1 != x3).
(* Lemma noaliasR_fwd_wrong2 s (f : Scan.form s) (d : def f) x y (g : Search2.form x y) : (@search_them x y g (@scan_it s f d)). *)
Notation noaliasR_fwd' x y D := (search_them x y (scan_it D)).
Example exnc A (x1 x2 x3 x4 : ptr) (v1 v2 : A) (h1 h2 : heap) :
def (h1 :+ x2 :-> 1 :+ h2 :+ x1 :-> v2 :+ (x3 :-> v1 :+ empty)) ->
(x1 != x2) /\
(x1 != x2) && (x2 != x3) && (x3 != x1) /\
(x2 == x3) = false /\ (x1 == x2) = false.

(* Specifications: *)
Lemma noaliasR_fwd3 s (f : Scan.form s) (D : def f) x y
(g : check x y s) : x != y_of g.