0% found this document useful (0 votes)
8 views1 page

CFG Tutorial and Exercises

The document contains questions about context-free grammars including writing a CFG, finding leftmost and rightmost derivations and parse trees for strings, showing ambiguity in a grammar, designing a CFG and converting grammars to CNF and GNF forms.

Uploaded by

amsuperman977
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

CFG Tutorial and Exercises

The document contains questions about context-free grammars including writing a CFG, finding leftmost and rightmost derivations and parse trees for strings, showing ambiguity in a grammar, designing a CFG and converting grammars to CNF and GNF forms.

Uploaded by

amsuperman977
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Tutorial 8

1. Write the CFG for the language and give the the parse tree for the string
x000y11z.

2. Let G be CFG

For the string bbaababa find

(i) leftmost derivation

(ii) rightmost derivation, and

(iii) parse tree

3. Show that the following grammar is ambiguous.

4. Design a CFG for the language and convert that CFG into CNF form.

5. Convert the following CFG into GNF.

6. Convert the following CFG into GNF

You might also like