Chomsky hierarchy
Within the field of
computer science, specifically in the area of
formal languages, the
Chomsky hierarchy (occasionally referred to as
Chomsky–Schützenberger hierarchy) is a
containment hierarchy of classes of
formal grammars.This hierarchy of grammars was described by
Noam Chomsky in 1956 (see
[1]). It is also named after
Marcel-Paul Schützenberger who played a crucial role in the development of the theory of
formal languages.
Formal grammars
A formal grammar of this type consists of:
- a finite set of terminal symbols
- a finite set of nonterminal symbols
- a finite set of production rules with a left and a right-hand side consisting of a sequence of these symbols
- a start symbol
A formal grammar defines (or
generates) a
formal language, which is a (usually infinite) set of finite-length sequences of symbols (i.e.
strings) that may be constructed by applying production rules to another sequence of symbols which initially contains just the start symbol. A rule may be applied to a sequence of symbols by replacing an occurrence of the symbols on the left-hand side of the rule with those that appear on the right-hand side. A sequence of rule applications is called a
derivation. Such a grammar defines the formal language: all words consisting solely of terminal symbols which can be reached by a derivation from the start symbol.Nonterminals are usually represented by uppercase letters, terminals by lowercase letters, and the start symbol by
S
. For example, the grammar with terminals
a b
, nonterminals
S A B
, production rules
S
→
ABS
S
→
ε (where ε is the empty string)
BA
→
AB
BS
→
b
Bb
→
bb
Ab
→
ab
Aa
→
aa
and start symbol
S
, defines the language of all words of the form
aarg∈-→(:-4(x;font-size:12(x;">n barg∈-→(:-4(x;font-size:12(x;">n
(i.e.
n
copies of
a
followed by
n
copies of
b
).The following is a simpler grammar that defines a similar language: Terminals
a b
, Nonterminals
S
, Start symbol
S
, Production rules
The hierarchy
The Chomsky hierarchy consists of the following levels:
Note that the set of grammars corresponding to recursive languages is not a member of this hierarchy.Every regular language is context-free, every context-free language is context-sensitive and every context-sensitive language is recursive and every recursive language is recursively enumerable. These are all proper inclusions, meaning that there exist recursively enumerable languages which are not context-sensitive, context-sensitive languages which are not context-free and context-free languages which are not regular.The following table summarizes each of Chomsky's four types of grammars, the class of language it generates, the type of automaton that recognizes it, and the form its rules must have. {| class="wikitable"
|
! Grammar! Languages! Automaton! Production rules (constraints)
|
| Type-0| recursively enumerable language>Recursively enumerable| Turing machine| | &al(ha; → &bη;
(no restrictions)
|
| Type-1| context-sensitive grammar>Context-sensitive | Linear bounded automaton > Linear-bounded non-deterministic Turing machine| | &al(ha; A&bη; → &al(ha;γ&bη;
|
| Type-2| context-free grammar>Context-free| Non-deterministic pushdown automaton| | A → γ
However, there are further categories of formal languages; a complete listing is given in the following table:{{Formal languages and grammars}}
See also
References
, Chomsky
, Noam
, 1959
, On certain formal properties of grammars
, Information and Control
, 2
, 137–167
, 10.1016/S0019-9958(59)90362-6
, 2
,
, Chomsky
, Noam
, Schützenberger, Marcel P.
, Braffort, P.; Hirschberg, D.
,
, Computer Programming and Formal Languages
, 1963
,
, North Holland
, Amsterdam
,
, 118-161
, The algebraic theory of context free languages
,
External links
{{Noam Chomsky}}Chomsky-hiërargieচম্স্কি স্তরক্রমChomskyjeva hijerarhijaJerarquia de ChomskyChomského hierarchieChomsky-HierarchieJerarquía de ChomskyHiérarchie de Chomsky촘스키 위계Chomskyjeva hijerarhijaGerarchia di ChomskyХиерархија на ЧомскиChomskyhiërarchieチョムスキー階層Hierarchia Chomsky'egoHierarquia de ChomskyIerarhia ChomskyИерархия ХомскогоChomského hierarchiaChomskyn hierarkia乔姆斯基谱系
(...as imported from WP)
article has not been saved locally