hw6-sol - ECS 120: Introduction to the Theory of...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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 context-free grammar G and test this grammar for infiniteness using the procedure given in class. Problem 2. Context-Sensitive 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 context-sensitive grammars. Once youve understood what they are, design a context-sensitive 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 context-free, 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.

Page1 / 4

hw6-sol - ECS 120: Introduction to the Theory of...

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

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