End LOCATIONS.
(** * The lattice for dataflow analysis *)
Module NA <: SEMILATTICE.
Definition t := (nenv * nmem)%type.
Definition eq (x y: t) :=
NE.eq (fst x) (fst y) /\
(forall ge sp b ofs, nlive ge sp (snd x) b ofs <-> nlive ge sp (snd y) b ofs).

(* Specifications: *)
Lemma eq_refl: forall x, eq x x.
Lemma eq_sym: forall x y, eq x y -> eq y x.
Lemma eq_trans: forall x y z, eq x y -> eq y z -> eq x z.
Definition beq (x y: t) : bool :=
NE.beq (fst x) (fst y) && nmem_beq (snd x) (snd y).
Lemma beq_correct: forall x y, beq x y = true -> eq x y.
Definition ge (x y: t) : Prop :=
NE.ge (fst x) (fst y) /\
(forall ge sp b ofs, nlive ge sp (snd y) b ofs -> nlive ge sp (snd x) b ofs).
Lemma ge_refl: forall x y, eq x y -> ge x y.
Lemma ge_trans: forall x y z, ge x y -> ge y z -> ge x z.
Definition bot : t := (NE.bot, NMemDead).
Lemma ge_bot: forall x, ge x bot.
Definition lub (x y: t) : t :=
(NE.lub (fst x) (fst y), nmem_lub (snd x) (snd y)).
Lemma ge_lub_left: forall x y, ge (lub x y) x.
Lemma ge_lub_right: forall x y, ge (lub x y) y.
End NA.