Calculator Input
Supported operators: NOT, AND, OR, XOR, NAND, NOR, ->, <->, !, ~, &, |, ^, ↑, ↓.
Example Data Table
This sample shows the implication statement P -> Q.
| P | Q | P -> Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
Formula Used
Truth value evaluation applies truth-functional rules to each operator, then resolves the expression according to precedence and parentheses.
| Operator | Meaning | Rule |
|---|---|---|
| NOT P | Negation | True only when P is false. |
| P AND Q | Conjunction | True only when both P and Q are true. |
| P OR Q | Disjunction | True when at least one operand is true. |
| P XOR Q | Exclusive OR | True when exactly one operand is true. |
| P -> Q | Implication | False only when P is true and Q is false. |
| P <-> Q | Biconditional | True when both operands share the same value. |
| P NAND Q | Not AND | Equivalent to NOT (P AND Q). |
| P NOR Q | Not OR | Equivalent to NOT (P OR Q). |
The calculator tokenizes the input, converts infix notation to postfix notation, and evaluates each row using stack-based logic.
How to Use This Calculator
- Enter your main logical statement in Expression A.
- Add a comparison expression if you want an equivalence test.
- Provide variable assignments such as
P=1,Q=0,R=1. - Select your preferred display format and calculation mode.
- Choose the maximum variable count allowed for truth table generation.
- Press the calculate button to show the result above the form.
- Review truth values, classification, the truth table, and the graph.
- Use the export buttons to save CSV or PDF output.
Frequently Asked Questions
1) What does this calculator find?
It evaluates logical expressions, builds truth tables, classifies propositions, and optionally checks whether two expressions are logically equivalent.
2) Which operators are supported?
You can use NOT, AND, OR, XOR, NAND, NOR, implication, and biconditional operators with words or common symbols.
3) Why does implication become true when the premise is false?
Material implication is false only in one case: a true premise leading to a false conclusion. Every other case evaluates as true.
4) What is the difference between direct evaluation and truth table mode?
Direct evaluation uses the assignments you enter. Truth table mode tests every possible combination of detected variables.
5) What are tautology, contradiction, and contingency?
A tautology is always true, a contradiction is always false, and a contingency becomes true for some rows and false for others.
6) Why was my truth table skipped?
Truth table generation is limited by the selected maximum variable count to keep the page responsive and readable.
7) Can I compare two expressions?
Yes. Enter a second expression in the comparison field. The calculator then checks row-by-row agreement when a full truth table is available.
8) What format should variable assignments follow?
Use comma-separated pairs such as P=1,Q=0,R=true. Accepted values include 1, 0, true, false, T, and F.