module Htaut.Proposition
(
Top(..),
Bottom(..),
Neg(..),
And(..),
Or(..),
type (<->),
Prop(..)
)
where
class Prop a where
bottomImply :: Bottom -> a
data Top = Top
instance Prop Top where
bottomImply _ = Top
data Bottom
instance Prop Bottom where
bottomImply f = f
type Neg a = a -> Bottom
instance (Prop a, Prop b) => Prop (a -> b) where
bottomImply f = const (bottomImply f)
data a `And` b = a `And` b
instance (Prop a, Prop b) => Prop (a `And` b) where
bottomImply f = bottomImply f `And` bottomImply f
type Or a b = Either a b
instance (Prop a, Prop b) => Prop (a `Or` b) where
bottomImply = Left . bottomImply
type a <-> b = (a -> b) `And` (b -> a)