Chapter 10 The Chomsky Hierarchy Grammars Languages Accepting

  • Slides: 4
Download presentation
Chapter 10 The Chomsky Hierarchy

Chapter 10 The Chomsky Hierarchy

Grammars Languages & Accepting Machines Grammars Languages Accepting Machines Type 3 grammars: Regular grammars,

Grammars Languages & Accepting Machines Grammars Languages Accepting Machines Type 3 grammars: Regular grammars, Left-linear grammars, Right-linear grammars Regular languages DFA NDFA Type 2 grammars: Context-free grammars Context-free languages PDA Type 1 grammars: Contest-sensitive Context-sensitive grammars, languages Monotonic grammars Type 0 grammars: Phrase-structure grammars, Unrestricted grammars Recursively enumerable, Unrestricted Linear-bounded Automata DTM NDTM 2

Chapter 10. Unrestricted Grammars n n The highest class of the Chomsky hierarchy and

Chapter 10. Unrestricted Grammars n n The highest class of the Chomsky hierarchy and the largest class (i. e. , most powerful) of phrasestructured grammars, called type O grammars. Defn. 10. 1. 1 An unrestricted grammar is a quadruple (V, , P, S), where Ø V: a finite set of variables (i. e. , non-terminal symbols) Ø : the alphabet, a finite set of terminal symbols Ø Ø P: a set of production rules of the form u v, where u (V )+ and v (V )*, i. e. , u S: the start symbol 3

Unrestricted Grammars n Example 10. 1. 1 The unrestricted grammar V = { S,

Unrestricted Grammars n Example 10. 1. 1 The unrestricted grammar V = { S, A, C } = { a, b, c } P = { S a. Abc | A a. Ab. C | Cb b. C Cc cc } generates the language { aibici | i 0 } (which is not context-free) as i -1 S a. Abc ai. A(b. C)i-1 bc ai(b. C)i-2 b. Cbc ai(b. C)i-2 bb. Cc * ai(b)i(C)i-1 c i -1 aibici 4