-- # Software Tools for Discrete Mathematics module Stdm06LogicOperators where -- ∨ Disjunction / or defined for symbolic convenience. infix 3 \/ (\/) :: Bool -> Bool -> Bool (\/) = (||) -- ∧ Conjunction / and defined for symbolic convenience. infix 4 /\ (/\) :: Bool -> Bool -> Bool (/\) = (&&) -- ↔ Equivalence / If and only if infix 1 <=> -- | -- >>> True <=> True -- True -- | -- >>> True <=> False -- False -- | -- >>> False <=> False -- True -- | -- >>> False <=> True -- False (<=>) :: Bool -> Bool -> Bool (<=>) a b = a == b -- → Implication / Therefore / if infix 2 ==> -- | -- >>> False ==> False -- True -- | -- >>> False ==> True -- True -- | -- >>> True ==> False -- False -- | -- >>> True ==> True -- True (==>) :: Bool -> Bool -> Bool (==>) True False = False (==>) _ _ = True -- Exclusive or infixr 2 <+> -- | -- >>> False <+> False -- False -- | -- >>> False <+> True -- True -- | -- >>> True <+> False -- True -- | -- >>> True <+> True -- False (<+>) :: Bool -> Bool -> Bool x <+> y = x /= y