Calculator
Supported operators: NOT, AND, OR, XOR, ->, <->, parentheses, TRUE, FALSE, 1, and 0.
Formula Used
Canonical CNF comes from every row where the expression evaluates to false. Each false row creates one maxterm clause.
Maxterm rule: M(r) = (l1 OR l2 OR ... OR ln)
Literal choice: if a variable is 0 in that false row, use the variable itself. If it is 1, use its negation.
Final CNF: CNF = M(r1) AND M(r2) AND ... AND M(rk)
How to Use This Calculator
Enter a logical expression with variables and connectives. You can use typed operators like AND, OR, and NOT, or symbolic forms.
Set a custom variable order when you want a specific truth table arrangement or DIMACS numbering. Leave it blank for detected order.
Choose a notation style, decide whether to include DIMACS output, and select ascending or descending row order.
Press Convert to CNF. The tool places the result above the form, shows the canonical CNF, lists false rows, and builds the truth table.
Example Data Table
| Input Expression | Variables | False Patterns | Canonical CNF | Status |
|---|---|---|---|---|
| P -> Q | P, Q | 10 | (¬P ∨ Q) | Contingency |
| P XOR Q | P, Q | 00, 11 | (P ∨ Q) ∧ (¬P ∨ ¬Q) | Contingency |
| P AND Q | P, Q | 00, 01, 10 | (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) | Contingency |
| P OR NOT P | P | None | TRUE | Tautology |
FAQs
1. What does CNF mean?
CNF means conjunctive normal form. It writes a logical statement as an AND of OR clauses, which is useful in proofs, solvers, and digital logic analysis.
2. Does this tool simplify the formula algebraically?
This tool builds the canonical CNF from the truth table. Canonical form is always correct, but it may not be the shortest possible algebraic CNF.
3. Which operators can I enter?
You can enter NOT, AND, OR, XOR, implication, equivalence, parentheses, TRUE, FALSE, 1, and 0. Symbolic forms like !, &, |, ->, and <-> also work.
4. Why is the variable limit set to ten?
Truth tables grow exponentially. Ten variables already produce 1,024 rows, which keeps the page usable while still supporting many classroom and research examples.
5. What are false row patterns?
A false row pattern is the binary assignment where the expression becomes false. Each listed pattern produces one maxterm in the canonical CNF output.
6. When should I use DIMACS output?
Use DIMACS when you want to send CNF clauses to SAT solvers or other logic software. The selected variable order determines the variable numbering.
7. What happens for tautologies and contradictions?
A tautology has no false rows, so the canonical CNF becomes TRUE. A contradiction has no true rows, so every assignment contributes to the canonical construction.
8. What does the CSV export include?
The CSV export includes summary metrics, the generated canonical CNF, false patterns, and the full truth table so you can analyze results elsewhere.