module Circuit.Logics.Lattice
( JoinSemiLattice (..),
MeetSemiLattice (..),
Lattice,
LowerBounded (..),
UpperBounded (..),
BoundedLattice,
)
where
class (Eq a) => JoinSemiLattice a where
(\/) :: a -> a -> a
infixr 5 \/
class (Eq a) => MeetSemiLattice a where
(/\) :: a -> a -> a
infixr 6 /\
type Lattice a = (JoinSemiLattice a, MeetSemiLattice a)
class (JoinSemiLattice a) => LowerBounded a where
bottom :: a
class (MeetSemiLattice a) => UpperBounded a where
top :: a
type BoundedLattice a =
(JoinSemiLattice a, MeetSemiLattice a, LowerBounded a, UpperBounded a)
instance JoinSemiLattice Bool where
\/ :: Bool -> Bool -> Bool
(\/) = Bool -> Bool -> Bool
(||)
instance MeetSemiLattice Bool where
/\ :: Bool -> Bool -> Bool
(/\) = Bool -> Bool -> Bool
(&&)
instance LowerBounded Bool where
bottom :: Bool
bottom = Bool
False
instance UpperBounded Bool where
top :: Bool
top = Bool
True