Module Type TYPE_ALGEBRA.
(** Type expressions *)
Parameter t: Type.
Parameter eq: forall (x y: t), {x=y} + {x<>y}.
Parameter default: t.
(** Subtyping *)
Parameter sub: t -> t -> Prop.
Parameter sub_dec: forall x y, {sub x y} + {~sub x y}.
(** Least upper bounds. [lub x y] is specified only when [x] and [y] have a common supertype; it can be arbitrary otherwise. *)
Parameter lub: t -> t -> t.

Axiom lub_left: forall x y z, sub x z -> sub y z -> sub x (lub x y).
Axiom lub_right: forall x y z, sub x z -> sub y z -> sub y (lub x y).
Axiom lub_min: forall x y z, sub x z -> sub y z -> sub (lub x y) z.