(* * Copyright (c) 2009-2011, Andrew Appel, Robert Dockins and Aquinas Hobor. * *)
(** This library defines boolean algebras defined from an order-theoretic perspective.  In short, a boolean algebra is a complemented distributive lattice.  We additionally require that the boolean algebra be non-trivial.  From this definition we can recover the axioms of boolean algebras as defined in allp algebra.  We also define module interfaces for boolean algebras with a splitting operator, with a relativization operator, and those which support token counting.  We then say that a share model is a boolean algebra which satisfies all three module interfaces.  We also require that the elements have a decidable equality. *)
Module Type BOOLEAN_ALGEBRA.
Parameters (t:Type) (Ord : t -> t -> Prop)
(top bot : t) (lub glb : t -> t -> t) (comp : t -> t).
Delimit Scope ba with ba. Open Scope ba.
Notation "x <= y" := (Ord x y) (at level 70, no associativity) : ba.

(* Specifications: *)
Axiom ord_refl : forall x, x <= x.
Axiom ord_trans : forall x y z, x <= y -> y <= z -> x <= z.
Axiom ord_antisym : forall x y, x <= y -> y <= x -> x = y.
Axiom lub_upper1 : forall x y, x <= (lub x y).
Axiom lub_upper2 : forall x y, y <= (lub x y).
Axiom lub_least : forall x y z, x <= z -> y <= z -> (lub x y) <= z.
Axiom glb_lower1 : forall x y, (glb x y) <= x.
Axiom glb_lower2 : forall x y, (glb x y) <= y.
Axiom glb_greatest : forall x y z, z <= x -> z <= y -> z <= (glb x y).
Axiom top_correct : forall x, x <= top.
Axiom bot_correct : forall x, bot <= x.
Axiom distrib1 : forall x y z, glb x (lub y z) = lub (glb x y) (glb x z).
Axiom comp1 : forall x, lub x (comp x) = top.
Axiom comp2 : forall x, glb x (comp x) = bot.
Axiom nontrivial : top <> bot.
Hint Resolve ord_refl ord_antisym lub_upper1 lub_upper2 lub_least
glb_lower1 glb_lower2 glb_greatest top_correct bot_correct
ord_trans : ba.