{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

notes19 Chomsky Hierarchy

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

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

CS 373: Theory of Computation Gul Agha Mahesh Viswanathan Fall 2010 1

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

View Full Document
1 Unrestricted Grammars 1.1 Overview Grammars Deﬁnition 1. A grammar is G = ( V, Σ ,R,S ), where V is a ﬁnite set of variables/non-terminals Σ is a ﬁnite set of terminals S V is the start symbol R V ) * × V ) * is a ﬁnite set of rules/productions We say γ 1 αγ 2 G γ 1 βγ 2 iﬀ ( α β ) 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
Restricting the types of rules, allows one to describe diﬀerent aspects of natural languages These grammars form a hierarchy 1.2 Expressive Power Type 0 Grammars Deﬁnition 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 iﬀ 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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online