Title: Phrase Structure Grammars and the Chomsky Hierarchy
1Phrase Structure Grammarsand theChomsky
Hierarchy
- Dr. David A. Workman
- School of EE and CS
- May 22, 2006
2Phrase Structure Grammar
- Definition. A phrase structure grammar (psg) is
a 4-tuple, G (N,?, P, S),whereN nonterminal
alphabet? terminal alphabet
// N ? ? ?VG N ? ? (vocabulary of G)
// use "V" when G is understoodS ? N, unique
start symbolP finite set of productions
(possibly empty)P u ? v u ? VNV and v
? V
leftpart
rightpart
- A psg really is a "program" describing an
algorithm for generating a language over
theterminal alphabet, ? that is, L(G) ? ?.
To formalize this statement, we define a
relation,G?, from V to V defined by G.
Specifically, - ? G? ? if and only if ? ?1 u ?2 , ? ?1 v
?2 , where u ? v ? G we say that " alpha
directly rewrites (produces) beta". The strings
? and ? are called sentential forms of G. - G defines a computation (is a "program") in the
following way(1) initial state S (start
symbol)(2) if ? is the "current state" of the
computation, then any ? is a valid "next state of
the computation" whenever ? G? ?(3) A
computation ends whenever there does not exist a
valid next state for a given current state.
3Language defined by G
Definition. Let G (N,?, P, S) be a psg. Then
the language generated by Gis the set L(G)
x ? ? S G? x that is, x ? L(G) if and
only if thereis a computation in G satisfying
S ?0 G? ?1 G? ?n x, for some n?1.
4The Chomsky Hierarchy of Languages
Technical NoteType-1 languages
explicitlyexclude the null string.All other
languagefamilies permit the null string as a
member. (The Venn diagram is in slight error
because of this technicality.)