Docsity

context free pumping Lemma, Lecture notes of Theory of Automata

Partial preview of the text

Download context free pumping Lemma and more Lecture notes Theory of Automata in PDF only on Docsity!

More Applications

of

The Pumping Lemma

The Pumping Lemma:

there exists an integer such that

m

for any string w ļƒŽ L, | w| m

we can write

For infinite context-free language

L

w  uvxyz

with lengths | vxy |ļ‚£ m and | vy | 1

and it must be:

uv xy z ļƒŽ L, for all i  0

i i

Theorem:

The language

L {vv :vļƒŽ{a,b }*}

is not context free

Proof:

Use the Pumping Lemma

for context-free languages

Assume for contradiction that

is context-free

Since is context-free and infinite

we can apply the pumping lemma

L

L

We can write:

with lengths and

| vxy |ļ‚£ m | vy | 1

a b a b uvxyz

m m m m

Pumping Lemma says:

uv xy z L

i i

for all i  0

We examine all the possible locations

of string in vxy

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

m m m m

a b a b

a ................ a b ...... b a ...... a b ...... b

2

v

1 2

m  k  k m m

u z

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

x

2

y

m

Case 1:

vxy is within the first

m

a

1

k

v  a

2

k

y  a

1 2

k  k 

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

Case 1:

vxy is within the first

m

a

1

1 2

k  k 

a b a b uv xy z L

m m m m k k

  2 2

1 2

is in the first

Case 2: is in the first

a ...... a b ...... b a ...... a b ...... b

v

m m m

u z

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

x y

m

m

a

m

b

v

y

1

k

v  a

2

k

y  b

1 2

k  k 

is in the first

Case 2: is in the first

a ............ a b ............ b a ...... a b ...... b

2

v

1

m  k

2

m  k m

u z

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

x

2

y

m

m

a

m

b

v

y

1

k

v  a

2

k

y  b

1 2

k  k 

is in the first

Case 2: is in the first

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

m

a

m

b

v

y

a b a b uv xy z L

m m m k m k

  2 2

1 2

uv xy z ļƒŽ L

2 2

Contradiction!!!

However, from Pumping Lemma:

is in the first

Case 3: overlaps the first

a ...... a b ...... b a ...... a b ...... b

v

m m m

u z

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

x y

m

m m

a b

m

b

v

y

1 2

k k

v  a b

3

k

y  b

1 2

k k 

is in the first

Case 3: overlaps the first

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

m m

a b

m

b

v

y

a b a b a b uv xy z L

m k k m k m m

 2 2

2 1 3

1 2

k k 

is in the first

Case 3: overlaps the first

| vxy |ļ‚£ m | vy | 1 a b a b uvxyz

m m m m

m m

a b

m

b

v

y

a b a b a b uv xy z L

m k k k m m

2 2

2 1 3

uv xy z ļƒŽ L

2 2

Contradiction!!!

However, from Pumping Lemma: