notes19 Chomsky Hierarchy - CS 373: Theory of Computation...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1 Unrestricted Grammars 1.1 Overview Grammars Definition 1. A grammar is G = ( V, Σ ,R,S ), where V is a finite set of variables/non-terminals Σ is a finite set of terminals S V is the start symbol R V ) * × V ) * is a finite set of rules/productions We say γ 1 αγ 2 G γ 1 βγ 2 iff ( α β ) R . And L ( G ) = { w Σ * | S * G w } Example Example 2 . Consider the grammar G with Σ = { a } with S $ Ca # | a | ± Ca aaC $ D $ C C # D # | E aD Da aE Ea $ E ± The following are derivations in this grammar S $ Ca # $ aaC # $ aaE $ aEa $ Eaa aa S $ Ca # $ aaC # $ aaD # $ aDa # $ Daa # $ Caa # $ aaCa # $ aaaaC # $ aaaaE $ aaaEa $ aaEaa $ aEaaa $ Eaaaa aaaa L ( G ) = { a i | i is a power of 2 } Grammars for each task Figure 1: Noam Chomsky What is the expressive power of these grammars? 2
Background image of page 2
Restricting the types of rules, allows one to describe different aspects of natural languages These grammars form a hierarchy 1.2 Expressive Power Type 0 Grammars Definition 3. Type 0 grammars are those where the rules are of the form α β where α,β V ) * Example 4 . Consider the grammar G with Σ = { a } with S $ Ca # | a | ± Ca aaC $ D $ C C # D # | E aD Da aE Ea $ E ± Expressive Power of Type 0 Grammars Theorem 5. L is recursively enumerable iff there is a type 0 grammar G such that L = L ( G ) . Thus, type 0 grammars are as powerful as Turing machines. Recognizing Type 0 languages Proposition 6. If G = ( V, Σ ,R,S ) is a type 0 grammar then L ( G ) is recursively enumerable. Proof. We will show that L ( G ) is recognized by a 2-tape non-deterministic Turing machine M , with tape 1 storing the input w , and tape 2 used to construct a derivation of w from S . Recognizing Type 0 Grammars Proof (contd). At any given time tape 2, stores the current string of the derivation; initial tape contains S . To simulate the next derivation step, M will (nondeterministically) choose a rule to apply, scan from left to right and choose (nondeterministically) a position to apply the rule, replace the substring matching the LHS of the rule with the RHS to get the string at the next step of derivation. 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/04/2011 for the course CS 373 taught by Professor Viswanathan,m during the Fall '08 term at University of Illinois, Urbana Champaign.

Page1 / 9

notes19 Chomsky Hierarchy - CS 373: Theory of Computation...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online