LicenseGNU LGPLv3
Maintainerpaul.bittner@uni-ulm.de
Safe HaskellSafe

Truthtable

Description

Generation of truth tables for Logics.

Synopsis

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.

cartesian :: [a] -> [b] -> [(a, b)] Source #

Builds the cartesions product of two lists.

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.

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.