CIS 573 Homework, due March 27
- For this problem, refer to the grammar in Example 5.9 (page 330).
- Give a derivation of bbabb from L.
- Give a parse tree for bbabb rooted at L.
- For this problem, refer to the grammar in Exercise 5.6-1 (page 353).
- Give a derivation of bbabb from A.
- Give a parse tree for bbabb rooted at A.
- Prove that
- the set of CFLs is closed under union
- the set of CFLs is closed under concatenation
- the set of CFLs is not closed under intersection
- the set of CFLs is not closed under complementation
If you are having trouble with this problem, see pages 10, 247-249, and 280.
- Exercises 5.1-1(a,b,c), 5.1-2, 5.2-7, 5.3-1(c,e,g,h,i,j,m),
5.5-2(b), 5.6-1, 5.6-2, 5.8-3(a,b,c)
-
A CFG is right-linear if every production is of the form of the
form X -> Λ, or X -> cY.
Prove that L is regular if and only if L is generated by
a right-linear CFG. (Note: c denotes a terminal character.)
Extra credit
- 5.3-1(f), 5.2-10(d), 5.8-1(a)
- Give a context-free grammar for
{x in {a,b}* : #b(x) = 2#a(x)}.