Boolean Expression Truth Table Builder
The provided makefile should handle all of the compiling and linking of objects. However, you need to install the Flex Lexer and the Bison Parser, as the app uses Flex and Bison to generate the parser. For Debian Linux distros, this is as simple as:
sudo apt-get install flex
sudo apt-get install bison
TruthTable <Expression1> <Expression2> ...
- Expression - The boolean expression to build a truth table for. Each instance of <Expression> will get its own truth table.
An expression is a series of identifiers or literals connected by operators and parenthesis. For example:
[(a&b) -> (b|~c)] <-> (b!=T)
Identifiers all start with a letter, followed by 0 or more alphanumeric characters. Literals are either
T
or F
(or any of the variations listed below). Unary operators go before an identifier, and binary
operators go between an identifier (infix notation).
If you wish to include multiple expressions in a single truth table, each expression should separated by a comma. For example:
(a&b), a->(a&b), [~a<->c]
Note: Although truth tables normally don't list the same expression twice, using this comma notation overrides this rule
for the outermost expression. So, it might include a -> (a&b)
twice, but not (a&b)
twice.
Value | Symbols |
---|---|
True | True, T, or 1 |
False | False, F, or 1 |
Note:True
and False
can be in any case, so TrUe
, TRue
, and TRUE
are all valid.
Operation | Symbol | Type |
---|---|---|
Not | ~ or ! | Unary |
Or | + or | | Binary |
And | & | Binary |
Exclusive Or | ^ | Binary |
Implies | -> | Binary |
Not Implies | ~> or - | Binary |
If and Only If | <-> | Binary |
Equals | = | Binary |
Not Equals | != | Binary |
More operators may be added in the future