Professional Documents
Culture Documents
»c%+*! ig surely not in L.
So we conclude that p, = p,. Observe that p, = |u| and p, = |x|.
By Theorem 2.24, there is a derivation
(2.6.1) S=> uAy => uv" Ax™y => uv™wxy for all m > 0
To particular, let m = k\/p,. Since 1 < p, < k, we know that m is an
integer. Then wv" wx"y = akthipktktok tht,
A symmetric argument starting with the word aX+*'b*c* shows that
there exist «’, o’, w’, x’, y’, where only w’ has an a, v’ is in b*, and there is
a nonterminal B such that
S=> u’ By’ => w’(o’y" Bx'y’y’ => uo’ 'w(x'y"y
(2.6.2)
me Qk thpkrki ck okt
If we can show that the two derivations of at**lpe+tick+*! have different
derivation trees, then we shall have shown that Z is inherently ambiguous,
since G was chosen without restriction and has been shown ambiguous,
Suppose that the two derivations (2.6.1) and (2.6.2) have the same deriva-
tion tree. Since 4 generates a’s and b’s and B generates b’s and c’s, neither
A sor B could appear as a label of a descendant of a node labeled by theEXERCISES 207
other. Thus there exists a sentential form 1, Ar,Br,, where the f’s are terminal
strings. For all i and j, t,o'wx't,(v’)w'(x’)t, would presumably be in L. But
|v) =|x| and |[v’| =|x’|. Also, x and v’ consist exclusively of b’s, v consists
of a's, and x’ consists of ¢’s. Thus choosing i and j equal and sufficiently
large wil) ensure that the above word has more b’s than a’s or c’s. We may
thus conclude that G is ambiguous and that L is inherently ambiguous. [J
2.6.1.
2.6.2.
2.6.3.
2.6.4.
42.65.
*2.6.6.
2.6.7.
*2,6.8.
EXERCISES
Let L be a context-free language and R a regular set. Show that the
following languages are context-free:
(a) INIT(L).
(b) FEN(Z).
(c) SUBC(L).
(d) L/R.
© LAR.
The definitions of these operations are found in the Exercises of Sec-
tion 2.3 on p. 135.
Show that if Z is a CFL and 4 a homomorphism, then A-'(Z) is a CFL.
Hint; Let P be a PDA accepting LZ. Construct P’ to apply / to each of
its input symbols in turn, store the result in a buffer (in the finite con-
trol), and simulate P on the symbols in the buffer. Be sure that your
buffer is of finite length.
Show that the following are not CFL’s:
(a) (albie!|j < i}.
) {albick|i