Lecture 15 Pumping Lemma - PowerPoint PPT Presentation

About This Presentation
Title:

Lecture 15 Pumping Lemma

Description:

Pumping Lemma (weak): For any CFL L, there exists a ... pumping lemma fo. regular languages that this lemma may ... Let K 0 be the constant in Pumping Lemma. ... – PowerPoint PPT presentation

Number of Views:180
Avg rating:3.0/5.0
Slides: 16
Provided by: ding8
Learn more at: https://www.utdallas.edu
Category:
Tags: lecture | lemma | pumping

less

Transcript and Presenter's Notes

Title: Lecture 15 Pumping Lemma


1
Lecture 15 Pumping Lemma
2
Consider a CFG G (V, S, R, S). Assume for any
rule A ? w in R, w lt c for a constant c gt 0.
For x in L(G), consider a parse tree T for x.
s
gt logc x
x
This tree would have at least x leaves.
Therefore, the depth of this tree gt logc x
3
v1
Let x gt K c .
Then the depth of parse tree T gt V1.
So, there is a path from root to a leaf with
length gt V1, That is, it contains at least
V1 internal nodes.
s
x
Thus, there exists a nonterminal symbol, say A
appearing twice.
4
Tree T is decomposed into three smaller trees I,
II, III.
S
S
S
I
A
I
u
z
A
A
A
z
u
u
z
III
v
y
II
A
A
w
y
v
y
v
III
w
w
Corresponding to this tree decomposition,
x uvwyz which has property that for any i gt 0
uv wy z L(G).
i
i
5
To make this property significant, we should have
vy ? e .
Choose T to be a parse tree for x with minimum
number of nodes. Then we would have vy ? e.
If vy e, then
S
I
A
u
v
III
w
is a parse tree for x with less number of node
than T. (-gt lt-)
6
Pumping Lemma (weak) For any CFL L, there exists
a Constant K gt 0 such that any x L with x gt
K can be Decomposed as x uvwyz satisfying
(1) vy ? e, (2) for any i gt 0, uv wy z
L.
i
i
It is similar to the situation od pumping lemma
fo regular languages that this lemma may not
easy to use.
Therefore, we would like to add some condition
which can restrict the location of v and y. The
following is such A condition.
(3) vwy lt K.
7
To get condition (3), choose A to be the lowest
one among nonterminal symbols appearing again in
the subpath from which to a leaf.
S
I
A
u
z
II
A
lt V1
y
v
III
w
Therefore subtree IIIII has depth lt V1.
Hence, it
Has at most Kc leaves, i.e., (3)
holds.
V1
8
Pumping Lemma (strong) For any CFL L, there
exists a Constant K gt 0 such that any x L with
x gt K can be Decomposed as x uvwyz
satisfying (1) vy ? e, (2) for any i gt
0, uv wy z L, (3) vwy lt K.
i
i
9
n
n
n
Example 1 La b c n gt 0 is not CF.
10
CFL is not closed under intersection!
m
m
n
A a b c m, n gt 0 B a b c m, n gt
0
m
n
n
Both A and B are CFL, but A n B a b c n
gt 0 is not.
n
n
n
11
Example 2. Lww w (01) is not CF.
12
CFL is not closed under complement!
For L ww w (01), L is a
CFL. However, L L is not.
13
L0 n is a prime is not regular.
n
  • Proof. For contradiction, suppose L is CF. Let K
    gt 0 be the constant in Pumping Lemma. Consider a
    prime p gt K. Then, 0 uvwxy such that vx?e and
    for any i gt 0
  • uv wx y is in L. Thus,
  • u w y i(vx) is a prime
  • for any I gt 0.

p
i
i
14
For i 0, uw y is a prime. For i
uwy, uwy i(vx)
(uwy)(1vx)
is a prime. (-gtlt-)
15
Theorem For a language L with one symbol, L is
CF if and only if L is regular.
Write a Comment
User Comments (0)
About PowerShow.com