Module LPMap1(L: SEMILATTICE) <: SEMILATTICE.
Definition t := PTree.t L.t.
Definition get (p: positive) (x: t) : L.t :=
match x!p with None => L.bot | Some x => x end.
Definition set (p: positive) (v: L.t) (x: t) : t :=
if L.beq v L.bot
then PTree.remove p x
else PTree.set p v x.
Definition eq (x y: t) : Prop :=
forall p, L.eq (get p x) (get p y).
Definition beq (x y: t) : bool := PTree.beq L.beq x y.
Definition ge (x y: t) : Prop :=
forall p, L.ge (get p x) (get p y).
Definition bot : t := PTree.empty _.

Lemma ge_bot: forall x, ge x bot.