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).

Lemma ge_trans: forall x y z, ge x y -> ge y z -> ge x z.