This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: ECS 120: Introduction to the Theory of Computation Homework 6 Due Wed, Nov 14, at the start of lecture or by 1pm in Kemper 2131 Problem 1. Find a decision procedure which determines if a given CFG (with alphabet { a,b } ) accepts infinitely many strings which contain exactly 3 a s. (you can assume that you have procedures that can convert PDAs into CFGs and CFGs into PDAs) Given a CFG G , build an equivalent PDA P using the procedure given in the proof of Lemma 2.13. A regular expression for the language of strings containing exactly 3 as is b * ab * ab * ab * . Let M be a DFA equivalent to that regular expression (which can be obtained by transforming the reg. exp into an NFA first, using the procedures we studied in class, and then converting the NFA into a DFA using the subset construction). Using the procedure seen in class build a PDA P which recognizes L ( P ) L ( M ). Using the procedure given in the proof of 2.15, convert this PDA into an equivalent contextfree grammar G and test this grammar for infiniteness using the procedure given in class. Problem 2. ContextSensitive Languages , CSLs, are those that can be derived by Context Sensitive Grammars , CSGs. Go to the Internet (e.g. Wikipedia) and find a formal definition of contextsensitive grammars. Once youve understood what they are, design a contextsensitive grammar for the language { a n b n c n  n } with 10 or fewer rules. Since we know that the above language is not contextfree, what does your grammar imply about the relationship between CFLs and CSLs? S aSBc  cB Bc 1 aB ab bB bb It follows that the class of CFLs is a proper subset of the class of CSLs....
View
Full
Document
This note was uploaded on 05/06/2008 for the course ECS 120 taught by Professor Filkov during the Fall '07 term at UC Davis.
 Fall '07
 Filkov

Click to edit the document details