5.1 Cot'lrnxr-FRer:ClR.nnrlunRs
135
16. Show that the cor[plefirent of t]re latrguage in Exercisc 8(h) is cotrtcxt*free. ' fu-f) Sir.,* that thc langrrageL : {wicll)z i'u.l,.tt)2e {o. tr} ,*, t urit}, with }j : {n,,b, c}, is context-free. 18', Show a tlerivation tree for the string aabbbbwit'h the grarntnar g +,481.\, A + ttB, B-Sb. Civc a verhal tlescription of the language gerreratcd by this gralrlmar' 4ti9)orrsicter
\_--.,"
the grarnrnar with prorluctions S *
aaB,
A * bBiiltr, fi+Aa. show that thc striilg gau,rrrrrt"a. w
aabbabba is rrot in the larrguaE;c generatecl by this
2O. Consider the tlerivation tree below.
I.'inrl a simplc graurrrrar G for which this is the clerivation tree of the strirtg Thcn find two ntore serrtettccsof I (G)' -rr:1ntrb' what one rrright mean bv properly rrested parenthesis stnrctures in/ Uu)n"ntte volving two kincls of pareflthescs, say 0 and []. Irrtuil,ivcly, properly nestetl strings irr this situatiort are ([ ]), (tt ll) t()l' but not (Dl o' ((ll Using vour clefirrition, give a t:ontcxt-free gramrnar for ge[erating all properly nested parelrtnescs. Fincl a rrrrrtext-free glalnlnar alphabet {a,b}. ffi
for the set of all regular exJrressions on the
Find a context-frec grallllllar that carr generate all thc production rules for context-freegrammars with T: {a,b} and V: {A,B,C}' ( 24. hrouo that if G is a context-fi'ee grammar, then every u E L (G) has a lcftmost V ancl riglrtnost clerivation, Give arr algorithm for finding sudr derivations from
,fa*"""^"
a derivatiotr tree.