Skip to content

Chomsky Normal Form

Restrict a context-free grammar to binary nonterminal or single-terminal productions, with only a bounded start-symbol exception for the empty word.

Version
v1 · 2026-10-03 · History
Domain-specific #
13056
Aliases
CNF, Chomsky Normal Form Grammar

Core Idea

Chomsky normal form (CNF) is a restricted form of context-free grammar. Its ordinary rules are A → B C for two nonterminals or A → a for one terminal. Under the stated convention, S → ε is allowed only when the language contains the empty word and the start symbol never appears on a right-hand side. The form belongs to the grammar's current rule inventory; conversion and parsing are separate procedures.[1]

How would you explain it like I'm…

Two-or-One Rule Recipe

Imagine building rules for making sentences, like recipes. In Chomsky Normal Form, every rule has to be one of two simple kinds: either it splits a piece into exactly two smaller pieces, or it turns a piece into exactly one word. Keeping the rules tidy like this doesn't change which sentences you can make.

The Tidy Grammar Shape

Computer scientists describe languages using grammars, which are sets of rules for building strings of symbols. Chomsky Normal Form is a tidy shape for those rules: each rule either turns one placeholder into exactly two placeholders, or turns one placeholder into exactly one real symbol. There's one special rule allowed for making an empty string, if the language needs it. You can check whether a grammar is in this form just by looking at its rules. Any grammar of this kind can be rewritten into this tidy form and still make exactly the same strings.

Binary-or-Terminal Grammar Form

Chomsky Normal Form (CNF) is a shape restriction on a context-free grammar, not a new kind of language and not a parser. In CNF, every production looks like A → B C (exactly two nonterminals) or A → a (exactly one terminal). Under the convention used here, the one exception is S → ε, allowed only if the language contains the empty string, and then S may never appear on the right side of any rule. You check whether a grammar is in CNF just by inspecting its rules. A theorem says every context-free language has some equivalent CNF grammar, meaning it generates the same set of strings. That does not mean the parse trees stay the same.

 

Chomsky Normal Form (CNF) restricts the shape of productions in a context-free grammar (CFG). It is not a different language family or a parsing algorithm. Each ordinary rule is either A → B C, with exactly two nonterminals, or A → a, with exactly one terminal. Under the convention used here, S → ε is the sole permitted empty production. It is included only if the language contains the empty word, and then the start symbol S must not occur on any right-hand side. Membership in CNF is a syntactic check on the productions, independent of whether the grammar was ever converted or parsed. The normal-form theorem guarantees that every context-free language has an equivalent CNF grammar. Here equivalence means language preservation: both grammars generate the same string set. Derivation trees are not necessarily preserved, and in weighted grammars parse probabilities are not automatically preserved either. The conversion algorithm is just a way of obtaining the form; it is not part of what makes a grammar CNF.

Scope of Application

Formal-language theory uses CNF to standardize derivations while retaining the generated set of strings. In language parsing, binary phrase rules and lexical emissions support a chart parser; a probabilistic CFG can also be written in CNF. Ordinary CFG conversion establishes language equivalence, not automatically identical parse trees or probability distributions.[1][2]

Clarity

A language itself is not “in CNF”: one grammar for it may pass the rule test while another does not. A remaining A → B C D or A → B rule disqualifies that grammar even though it is context-free. The bounded start-rule exception does not authorize arbitrary empty productions.[1]

Manages Complexity

Binary rules let a parser combine two spans at each internal step, and lexical rules ground spans in terminals. This regularity helps dynamic programming, but a particular runtime bound depends on the grammar and algorithm. Binarization may also introduce helper symbols that should be traced back to original rules when explaining a parse.[3][2]

Abstract Reasoning

Separate the form-membership test, a language-preserving normalization theorem, and a parser that exploits the result. The first is checked by inspecting rules, the second constructs an equivalent grammar, and the third is optional. Live Context-Free Grammar is the proposed strict genus; Chomsky Hierarchy and Kuroda Normal Form are different neighbors.[1]

Knowledge Transfer

A grammar for formal marker strings and a weighted phrase-structure grammar use unlike symbols, but both can have exactly the binary and lexical production shapes. That is genuine transfer of a grammar test, not a general claim that any binary tree is CNF.[1][2]

Relationships to Other Abstractions

Local relationship map for Chomsky Normal FormParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Chomsky Normal FormDOMAINDomain-specific abstraction: Context-Free Grammar — is a kind ofContext-FreeGrammarDOMAIN

Current abstraction Chomsky Normal Form Domain-specific

Parents (1) — outgoing typed relations

  • Chomsky Normal Form is a kind of Context-Free Grammar Domain-specific

    Every CNF grammar is a CFG with additional production-shape restrictions.

Hierarchy paths (2) — routes to 2 parentless roots

Neighborhood in Abstraction Space

Chomsky Normal Form sits in a moderately populated region (45th percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.

Family — Formal Grammar & Syntactic Structure (18 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] Jean Gallier and Jocelyn Quaintance, Introduction to the Theory of Computation: Languages, Automata and Grammars, University of Pennsylvania CIS5110 notes (18 March 2026), §7.3, PDF pp. 213–220. registry ↩a ↩b ↩c ↩d ↩e

[2] MIT OpenCourseWare 6.864, "Advanced Natural Language Processing," Lecture 4 (2005), PDF p. 18. registry ↩a ↩b ↩c

[3] Cornell CS6741, "Parsing" lecture notes (2015), PDF pp. 33–53. registry ↩