r7, (,0, m) :1 LO, [7] U ibuco]
b wzob on ~iLet-Ajc
$0 1. :1 j gme Ab _+S Quays,
a, G b
5mm eat-3 4 \BU)
\ t w L:
* at S h x L:
a b 7 J h C,
E: ate) 8/ A 3 gm 6
k I 11.4,(3 CD
< S \aLt)\@ 0L1; + 18 _
a c a. I (octbbl)
Emu?» Em,L :; mom Leta) 04m: RED? S
CpSc 421
Homework 6
Solutions
1. (50 points) For each language below, determine whether or not the language is context-free, and justify your
answer. For example, if the language is context-free, you can give a CFG or PDA for the language. If it is not
co
CpSc 421
Homework 8
Extra Credit
Solutions
Attempt up to three of the problems below.
1. (15 points) Let G = (V, , R, Expr ) be a CFG with variables V = cfw_Expr , Factor , Term, and terminals
= cfw_CONSTANT, IDENTIFIER, PLUS, TIMES, LPAREN, RPAREN and r
CpSc 421
Homework 7
Solutions
1. (10 points) Let A1 = cfw_D1 #D2 | D1 and D2 describe DFAs and L(D1 ) L(D2 ). In English, D1 #D2 A1
iff D1 and D2 describe DFAs and every string that is recognized by the DFA described by D1 is also recognized
by the DFA de