module Solutions.P46 (
BoolFunc,
table,
and',
or',
nand',
nor',
xor',
impl',
equ',
functions,
) where
import Problems.Logic
table :: BoolFunc -> [(Bool, Bool, Bool)]
table :: BoolFunc -> [(Bool, Bool, Bool)]
table BoolFunc
f = [(Bool
a, Bool
b, BoolFunc
f Bool
a Bool
b) | Bool
a <- [Bool
False, Bool
True], Bool
b <- [Bool
False, Bool
True]]
and' :: BoolFunc
and' :: BoolFunc
and' Bool
True Bool
True = Bool
True
and' Bool
_ Bool
_ = Bool
False
or' :: BoolFunc
or' :: BoolFunc
or' Bool
False Bool
False = Bool
False
or' Bool
_ Bool
_ = Bool
True
nand' :: BoolFunc
nand' :: BoolFunc
nand' Bool
True Bool
True = Bool
False
nand' Bool
_ Bool
_ = Bool
True
nor' :: BoolFunc
nor' :: BoolFunc
nor' Bool
False Bool
False = Bool
True
nor' Bool
_ Bool
_ = Bool
False
xor' :: BoolFunc
xor' :: BoolFunc
xor' Bool
True Bool
False = Bool
True
xor' Bool
False Bool
True = Bool
True
xor' Bool
_ Bool
_ = Bool
False
impl' :: BoolFunc
impl' :: BoolFunc
impl' Bool
False Bool
False = Bool
True
impl' Bool
False Bool
True = Bool
True
impl' Bool
True Bool
False = Bool
False
impl' Bool
True Bool
True = Bool
True
equ' :: BoolFunc
equ' :: BoolFunc
equ' Bool
False Bool
False = Bool
True
equ' Bool
True Bool
True = Bool
True
equ' Bool
_ Bool
_ = Bool
False
functions :: Functions
functions :: Functions
functions = Functions { getTable :: BoolFunc -> [(Bool, Bool, Bool)]
getTable = BoolFunc -> [(Bool, Bool, Bool)]
table
, getAnd :: BoolFunc
getAnd = BoolFunc
and'
, getOr :: BoolFunc
getOr = BoolFunc
or'
, getNand :: BoolFunc
getNand = BoolFunc
nand'
, getNor :: BoolFunc
getNor = BoolFunc
nor'
, getXor :: BoolFunc
getXor = BoolFunc
xor'
, getImpl :: BoolFunc
getImpl = BoolFunc
impl'
, getEqu :: BoolFunc
getEqu = BoolFunc
equ' }