Conjunctive normal form
Conjunctive normal form (CNF) is a standardized syntactic form for propositional logic formulas, consisting of a conjunction of one or more clauses, where each clause is a disjunction of literals and a literal is either a propositional variable or its negation.[1][2][3] Any propositional logic formula can be converted to an equivalent CNF formula via a systematic process involving the elimination of logical connectives like implications and equivalences, application of De Morgan's laws to push negations inward, removal of double negations, and distribution of disjunctions over conjunctions, though this transformation may exponentially increase the formula's size.[1][2] The resulting CNF preserves the original formula's satisfiability, making it a canonical representation for logical expressions.[1] CNF is foundational in computational complexity theory as the input format for the Boolean satisfiability problem (SAT), which determines whether a given CNF formula admits a truth assignment that makes it true; SAT was the first problem proven NP-complete by Stephen Cook in 1971.[3] Modern SAT solvers, which efficiently handle large-scale CNF instances using techniques like DPLL and CDCL, rely on this form to achieve practical performance despite SAT's theoretical intractability.[2][4] Beyond theory, CNF finds broad applications in computer science, including formal verification of hardware and software systems where logical properties are encoded as CNF constraints to check for bugs or inconsistencies, artificial intelligence planning by modeling goals and actions as satisfiability problems, and automated theorem proving via resolution, a complete inference method that operates directly on CNF clauses.[5][6][1] These uses underscore CNF's role in bridging logical reasoning with practical algorithmic solutions across diverse domains.[7]Definition and Syntax
Formal Definition
In propositional logic, a literal is either a propositional variable p (a positive literal) or its negation \neg p (a negative literal).[1][8] A clause is a finite disjunction of literals, such as l_1 \vee l_2 \vee \cdots \vee l_k, where each l_j is a literal and k \geq 1.[1][9] A conjunctive normal form (CNF) formula is a finite conjunction of clauses, denoted as \phi = \bigwedge_{i=1}^m \left( \bigvee_{j=1}^{k_i} l_{ij} \right), where m \geq 1, each k_i \geq 1, and each l_{ij} is a literal.[8][9] Semantically, a CNF formula \phi is satisfied (true) under a truth assignment if and only if every clause is true, which occurs precisely when at least one literal in each clause is true.[1][8] Special cases of CNF include the empty CNF (a conjunction with no clauses, m = 0), which is vacuously true as a tautology; a single-clause CNF ( m = 1), which reduces to a disjunction of literals; and a unit clause (a clause with a single literal, k_i = 1), which requires that literal to be true for the clause to hold.[1][9] CNF serves as the syntactic dual to disjunctive normal form (DNF), where the roles of conjunction and disjunction are reversed.[1]Examples and Canonical Forms
A simple example of a conjunctive normal form (CNF) formula involving three propositional variables p, q, and r is (p \lor \lnot q) \land (\lnot p \lor r). This formula consists of two clauses, each a disjunction of literals, conjoined together, satisfying the syntactic structure of CNF. To verify the satisfiability of this CNF formula, a truth table can be constructed enumerating all $2^3 = 8 possible assignments to p, q, and r. The formula evaluates to true under several assignments, such as p = \top, q = \top, r = \top (where both clauses hold) and p = \bot, q = \bot, r = \top (where the second clause holds and the first simplifies appropriately), confirming it is satisfiable. The full truth table is as follows:| p | q | r | p \lor \lnot q | \lnot p \lor r | Formula |
|---|---|---|---|---|---|
| \top | \top | \top | \top | \top | \top |
| \top | \top | \bot | \top | \bot | \bot |
| \top | \bot | \top | \top | \top | \top |
| \top | \bot | \bot | \top | \bot | \bot |
| \bot | \top | \top | \bot | \top | \bot |
| \bot | \top | \bot | \bot | \top | \bot |
| \bot | \bot | \top | \top | \top | \top |
| \bot | \bot | \bot | \top | \top | \top |