{- |
Description: Type class for reasoning on 'Logic's.
License: GNU LGPLv3
Maintainer: paul.bittner@uni-ulm.de
Type class for reasoning on 'Logic's.
-}
module Logic where
class Logic l where
ltrue :: l
lfalse :: l
lvalues :: [l]
lvalues = [l
forall l. Logic l => l
lfalse, l
forall l. Logic l => l
ltrue]
lnot :: l -> l
land :: [l] -> l
lor :: [l] -> l
lor = l -> l
forall l. Logic l => l -> l
lnot(l -> l) -> ([l] -> l) -> [l] -> l
forall b c a. (b -> c) -> (a -> b) -> a -> c
.[l] -> l
forall l. Logic l => [l] -> l
land([l] -> l) -> ([l] -> [l]) -> [l] -> l
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(l -> l) -> [l] -> [l]
forall a b. (a -> b) -> [a] -> [b]
map l -> l
forall l. Logic l => l -> l
lnot
limplies :: l -> l -> l
limplies p :: l
p q :: l
q = [l] -> l
forall l. Logic l => [l] -> l
lor [l -> l
forall l. Logic l => l -> l
lnot l
p, l
q]
lequals :: l -> l -> l
lequals p :: l
p q :: l
q = [l] -> l
forall l. Logic l => [l] -> l
land [l -> l -> l
forall l. Logic l => l -> l -> l
limplies l
p l
q, l -> l -> l
forall l. Logic l => l -> l -> l
limplies l
q l
p]
leval :: (l -> l) -> l -> l