(** * Lattice for dataflow analysis *)
Module VA <: SEMILATTICE.
Inductive t' := Bot | State (ae: aenv) (am: amem).
Definition t := t'.
Definition eq (x y: t) :=
match x, y with
| Bot, Bot => True
| State ae1 am1, State ae2 am2 =>
AE.eq ae1 ae2 /\ forall bc m, mmatch bc m am1 <-> mmatch bc m am2
| _, _ => False
end.

Lemma ge_bot: forall x, ge x bot.
Definition lub (x y: t) : t :=
match x, y with
| Bot, _ => y
| _, Bot => x
| State ae1 am1, State ae2 am2 => State (AE.lub ae1 ae2) (mlub am1 am2)
end.