Math 2.0

Computer science Definition

Chomsky hierarchy

Builds on Formal grammarUnrestricted grammarContext-sensitive languageContext-free languageRegular languageRecursively enumerable language

Definition

Let G=(N,Σ,P,S)G = (N, \Sigma, P, S) be a formal grammar, with A,B∈NA, B \in N, a∈Σa \in \Sigma, and α,β,γ∈(N∪Σ)∗\alpha, \beta, \gamma \in (N \cup \Sigma)^*. The grammar GG is of:

  1. type 0 always; these are the unrestricted grammars;
  2. type 1 if every rule has the form αAβ→αγβ\alpha A \beta \to \alpha \gamma \beta with γ\gamma nonempty, except possibly S→εS \to \varepsilon when SS occurs on no right side;
  3. type 2 if every rule has the form A→γA \to \gamma;
  4. type 3 if every rule has the form A→aBA \to aB, A→aA \to a or A→εA \to \varepsilon.

A language is of type ii if it is generated by a grammar of type ii. The Chomsky hierarchy is the chain of the four classes of languages of types 3,2,1,03, 2, 1, 0.

Remarks

The languages of types 0,1,2,30, 1, 2, 3 are the recursively enumerable languages, the context-sensitive languages, the context-free languages and the regular languages. They form a strictly increasing chain: type 3⊊3 \subsetneq type 2⊊2 \subsetneq type 1⊊1 \subsetneq type 00. Example: {anbn:n≥0}\set{a^n b^n : n \ge 0} is of type 2 but not of type 3, and {anbncn:n≥1}\set{a^n b^n c^n : n \ge 1} is of type 1 but not of type 2. Every type-1 language is decidable, so an undecidable recursively enumerable language, such as the halting problem, is of type 0 but not of type 1. Non-example: a grammar with the rule AB→aAB \to a is of type 0 but not of type 1, since the rule shortens the string. It is not of type 2 either, since its left side has two symbols.

Reading path

To understand this page from the ground up, read these 7 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Context-free language concept
  2. Context-sensitive language concept
  3. Formal grammar concept
  4. Recursively enumerable language concept
  5. Regular language concept
  6. Unrestricted grammar concept
  7. Chomsky hierarchy definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Chomsky_hierarchy
About this page
TagCE2FH977F8
URIm2://CE2FH977F8
Kinddefinition
WritingW0 stub
MSC68Q45, 68Q42, 03D05
DefinesChomsky hierarchy
UsesFormal grammar, Unrestricted grammar, Context-sensitive language, Context-free language, Regular language, Recursively enumerable language
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.