Problem 47 Solutions
Solution 1
(.&) : Bool -> Bool -> Bool
(.&) a b =
a && b
(.|) : Bool -> Bool -> Bool
(.|) a b =
a || b
(/&) : Bool -> Bool -> Bool
(/&) a b =
not (a && b)
(/|) : Bool -> Bool -> Bool
(/|) a b =
not (a || b)
(*|) : Bool -> Bool -> Bool
(*|) a b =
not (a == b)
(.^) : Bool -> Bool -> Bool
(.^) a b =
if a then b else True
(.=) : Bool -> Bool -> Bool
(.=) a b =
a == b
truthTable : (Bool -> Bool -> Bool) -> List (Bool, Bool, Bool)
truthTable f =
[ (True, True, f True True)
, (True, False, f True False)
, (False, True, f False True)
, (False, False, f False False)
]
Back to problem