Chapter 3 Context-Free Grammars, Context-Free Languages, Parse ...
Chapter 3 Context-Free Grammars, Context-Free Languages, Parse ...
Chapter 3 Context-Free Grammars, Context-Free Languages, Parse ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
56 CHAPTER 3. CONTEXT-FREE GRAMMARS AND LANGUAGES<br />
Then, for any w ∈ Σ ∗ ,observethat<br />
w ∈ Φ 1 G,i(∅,...,∅)<br />
iffthereissomeruleAi → αi,j with w = αi,j, andthat<br />
w ∈ Φ n G,i(∅,...,∅)<br />
for some n ≥ 2 iff there is some rule Ai → αi,j with αi,j of the form<br />
αi,j = u1Aj1u2 ···ukAjk uk+1,<br />
where u1,...,uk+1 ∈ Σ ∗ , k ≥ 1, and some w1,...,wk ∈ Σ ∗ such that<br />
and<br />
We prove the following two claims.<br />
Claim 1: For every w ∈ Σ∗ ,ifAi<br />
Claim 2: For every w ∈ Σ ∗ ,ifw ∈ Φ n G,i<br />
p ≤ (M +1) n−1 .<br />
wh ∈ Φ n−1<br />
G,jh (∅,...,∅),<br />
w = u1w1u2 ···ukwkuk+1.<br />
n<br />
=⇒ w, thenw∈Φ p<br />
G,i (∅,...,∅), for some p ≥ 1.<br />
(∅,...,∅), with n ≥ 1, then Ai<br />
ProofofClaim1. We proceed by induction on n. If Ai<br />
rule A → αi,j, and by the remark just before the claim, w ∈ Φ 1 G,i (∅,...,∅).<br />
If Ai<br />
n+1<br />
=⇒ w with n ≥ 1, then<br />
for some rule Ai → αi,j. If<br />
Ai<br />
where u1,...,uk+1 ∈ Σ ∗ , k ≥ 1, then Ajh<br />
n<br />
=⇒ αi,j =⇒ w<br />
αi,j = u1Aj1u2 ···ukAjk uk+1,<br />
nh<br />
=⇒ wh, wherenh≤n, and<br />
w = u1w1u2 ···ukwkuk+1<br />
for some w1,...,wk ∈ Σ ∗ . By the induction hypothesis,<br />
wh ∈ Φ ph<br />
G,jh (∅,...,∅),<br />
p<br />
=⇒ w for some<br />
1<br />
=⇒ w, thenw = αi,j for some<br />
for some ph ≥ 1, for every h, 1≤ h ≤ k. Letting p =max{p1,...,pk}, since each sequence<br />
(∅,...,∅) for every h, 1≤ h ≤ k, andby<br />
(Φ q<br />
G,i (∅,...,∅)) is an ω-chain, we have wh ∈ Φ p<br />
G,jh<br />
the remark just before the claim, w ∈ Φ p+1<br />
G,i (∅,...,∅).<br />
ProofofClaim2. We proceed by induction on n. If w ∈ Φ1 G,i (∅,...,∅), by the remark<br />
1<br />
just before the claim, then w = αi,j for some rule A → αi,j, andAi=⇒<br />
w.