Docsity

Module 28 Worksheet: Grammar and Language Theory Questions - Prof. Eric Torng, Assignments of Computer Science

Toggle sidebar
bg1
Module 28 Worksheet
In Class Questions
1) (S10) What is wrong with the following string derivation using the ABG grammar?
S โ†’ aSb โ†’ aaSbb โ†’ aaabbb
2) (S11) Does grammar ABG generate string aSb?
3) (S11) Is aSb ๏ƒŽ L(ABG)? Why or why not?
4) (S12) How do we prove that a language L is a context-free language (CFL)?
5) (S12) How could we prove that the regular languages are a subset of the context-free
languages?
pf2

Partial preview of the text

Download Module 28 Worksheet: Grammar and Language Theory Questions - Prof. Eric Torng and more Assignments Computer Science in PDF only on Docsity!

Module 28 Worksheet In Class Questions

  1. (S10) What is wrong with the following string derivation using the ABG grammar? S โ†’ aSb โ†’ aaSbb โ†’ aaabbb
  2. (S11) Does grammar ABG generate string aSb?
  3. (S11) Is aSb ๏ƒŽ L(ABG)? Why or why not?
  4. (S12) How do we prove that a language L is a context-free language (CFL)?
  5. (S12) How could we prove that the regular languages are a subset of the context-free languages?

Take home review questions

  1. What is the difference between the symbols --> and ==>?
  2. Give a derivation of the string aaa using the productions from the AG grammar.
  3. What is the difference between a grammar G generating a string x and a string x belonging to L(G)?
  4. How do we prove a language L is a CFL?