Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 The Pumping Lemma for Context-Free Languages. 2 Take an infinite context-free language Example: Generates an infinite number of different strings.

Similar presentations


Presentation on theme: "1 The Pumping Lemma for Context-Free Languages. 2 Take an infinite context-free language Example: Generates an infinite number of different strings."— Presentation transcript:

1 1 The Pumping Lemma for Context-Free Languages

2 2 Take an infinite context-free language Example: Generates an infinite number of different strings

3 3 A derivation:

4 4 Derivation tree

5 5 Derivation tree repeated

6 6

7 7 Repeated part

8 8 A possible derivation

9 9

10 10

11 11

12 12 Therefore, the string is generated by the grammar

13 13 We know This string is also generated:

14 14 We know This string is also generated:

15 15 Therefore, knowing that is generated, we also know that is generated

16 16 In general: We are given an infinite context-free grammar We take the derivation of a long enough string

17 17 Some variable must be repeated in the derivation Take the length ofBigger than = Productions * (largest production)

18 18 repeated

19 19 repeated Possible derivations:

20 20 We know: This string is also generated:

21 21 We know: This string is also generated: (the original )

22 22 We know: This string is also generated:

23 23 We know: This string is also generated:

24 24 We know: This string is also generated:

25 25 Therefore, any string of the form Is generated by the grammar

26 26 knowing that we also know that Therefore,

27 27

28 28

29 29 The pumping lemma: there exists an integer for any string we can write For context-free language with Such that:


Download ppt "1 The Pumping Lemma for Context-Free Languages. 2 Take an infinite context-free language Example: Generates an infinite number of different strings."

Similar presentations


Ads by Google