License | GNU LGPLv3 |
---|---|
Maintainer | paul.bittner@uni-ulm.de |
Safe Haskell | Safe |
Generation of truth tables for Logic
s.
Synopsis
- unarytable :: Logic a => (a -> a) -> [a] -> [a]
- cartesian :: [a] -> [b] -> [(a, b)]
- binarytable :: Logic a => (a -> a -> a) -> [a] -> [a]
- binarify :: ([a] -> b) -> a -> a -> b
- hfillto :: Int -> String -> String
- defaultlinewidth :: Int
- defaulthfillto :: String -> String
- prettyunarytable :: (Logic a, Show a) => [a] -> (a -> a) -> String -> String
- prettybinarytable :: (Logic a, Show a) => [a] -> (a -> a -> a) -> String -> String
- generatetruthtablesfor :: (Logic a, Show a) => [a] -> String
Documentation
unarytable :: Logic a => (a -> a) -> [a] -> [a] Source #
For a unary operator and a set of values, produces all results when applying that operator to that set of values.
binarytable :: Logic a => (a -> a -> a) -> [a] -> [a] Source #
For a binary operator and a set of values, produces all results when applying that operator to all combinations of values.
binarify :: ([a] -> b) -> a -> a -> b Source #
Creates a function of two arguments by reusing a function on lists.
hfillto :: Int -> String -> String Source #
Appends spaces to the given string until it has length i
(first argument).
defaultlinewidth :: Int Source #
Default value for width of lines when printing truth tables.
defaulthfillto :: String -> String Source #
hfillto
with defaultlinewidth
prettyunarytable :: (Logic a, Show a) => [a] -> (a -> a) -> String -> String Source #
For a list of values and a unary operator, generates a truth table with the given name.
prettybinarytable :: (Logic a, Show a) => [a] -> (a -> a -> a) -> String -> String Source #
For a list of values and a binary operator, generates a truth table with the given name.
generatetruthtablesfor :: (Logic a, Show a) => [a] -> String Source #
Generates a truthtable for all common operators of a logic (not, and, or, implies, equals) for the given set of values.