please write a haskell program for tautology checker for pro
please write a haskell program for tautology checker for propositions.
thanks.
Solution
Try this... class BooleanFunc f where isTautology :: f -> Bool instance BooleanFunc Bool where isTautology = id instance (BooleanFunc b) => BooleanFunc (Bool -> b) where isTautology f = isTautology (f True) && isTautology (f False) main = do print . isTautology $ \\a b c d -> True || a || b || c || d print . isTautology $ \\a b c d -> a || b || c || d