• No results found

Proof pumped lemma for context-free languages Nima Chitgar

N/A
N/A
Protected

Academic year: 2021

Share "Proof pumped lemma for context-free languages Nima Chitgar"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Proof pumped lemma for context-free languages

Nima Chitgar

A parse tree for any CFG is of the following form:

ˆ Each internal node has 2 children. (Each variable produces two other variables)

ˆ At the very bottom of the tree, each variable produces exactly one child and these children are childless.

For the first point, we desire to prove that at least 1 variable will repeat from top to bottom. If we can prove this for a path that goes from roof-to-leaf (e.g. greenpath), this will meet the requirement.

Assume that the height of the tree is #variables + 1. This will ensure that the variable A must repeat because of the pigeon-hole-principle. This means that there are more variables going from top-to-bottom than there actually are. (height is #variables + 1, but there are only #variables, so there must be a repetition)

Let A be the variable that repeats. Because we know that the parse tree is a binary tree, we can say that the length of the tree is at least w ≥ 2#var+1. As A is a variable that repeats, we know that it can’t be a start variable so it must produce a part of the string. Below you can see that we can split our length w into 5 pieces, namely uvxyz.

1

(2)

We can say that A will eventually produce x. We can write this as A ⇒x

and will also produce

A ⇒vAy

This tells us something important about A: it will also produce vAy,vvAyy,vvvAyyy,. . . Thus,

A ⇒viAyi for any i ≥ 0.

The start variable S will also produce

S ⇒uAz This will give us eventually

S ⇒uvixyiz for any i ≥ 0 and the first point of our definition is proved.

Now we need to prove that |vy| > 0. The shortest |vy| possible is that when two A’s are as close as possible to each other. You can see this on the figure below.

As B is not the start variable, it creates a non-empty string. Now, part r of the figure above corresponds with part y and part l corresponds with x. So in this ’worst-case’ scenario, if y is non-empty, v is empty and vice-versa. So |vy| ≥ 1 as both of them can’t be simultaneously empty and point two of our definition is proved.

The last point is to prove that |vxy| ≤ p. Imagine that our string is huge, if we assure that the orange region vxy is at least 2#var+1, then we can guarantee that there must be a repetition within this region.

For creating the longest string, the variables must be very far from the bottom, but even in this case p ≥ 2#var+1= |vxy|.

2

Referenties

GERELATEERDE DOCUMENTEN

posite parts Principal Sentence Co-ordinate Sentence Sub-ordinate Sentence Complete Sentence Incomplete Sentence Elliptic Sentence Noun Sentence Adjective

This article seeks to examine that issue from the perspective of the free movement of workers, with the first section setting out the rights that migrant workers and their family

Although in the emerging historicity of Western societies the feasible stories cannot facilitate action due to the lack of an equally feasible political vision, and although

A–Eskwadraat kan niet aansprakelijk worden gesteld voor de gevolgen van eventuele fouten in dit

Universiteit Utrecht Mathematisch Instituut 3584 CD Utrecht. Measure and Integration

Let B be the collection of all subsets

Suppose that we consider a set of microarray experiments that contains expression levels for N genes gi (we call this set of genes Ň – so N = # Ň) measured under several

Yet this idea seems to lie behind the arguments last week, widely reported in the media, about a three- year-old girl with Down’s syndrome, whose parents had arranged cosmetic