truth-table-generator
Generate the full truth table for a Boolean expression. Parses operators AND/OR/NOT/XOR/NAND/NOR/IMPLIES/IFF and their symbols, enumerates all 2^N variable assignments, and returns the result for each row plus the value of every sub-expression. Supports up to 6 variables (64 rows).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expression": "<expression>"
},
"name": "truth-table-generator"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | A Boolean expression. Operators: AND/OR/NOT/XOR/NAND/NOR/IMPLIES/IFF (case-insensitive) and symbols && || ! ^ -> <->. Variables are letters or short names (≤ 8 chars). Constants TRUE/FALSE/1/0 supported. Max 6 distinct variables. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | Every row of the truth table. | |
| canonical | Yes | Parenthesized canonical form of the input expression. | |
| variables | Yes | Variable names in first-appearance order, upper-cased. | |
| isTautology | Yes | True if every row evaluates to true. | |
| isContradiction | Yes | True if every row evaluates to false. | |
| subExpressionLabels | Yes | Sub-expression strings shown as extra columns, in evaluation order. |