1 The Pumping Lemma for Context-Free Languages
2 Take an infinite context-free language Example: Generates an infinite number of different strings
3 A derivation:
4 Derivation tree
5 Derivation tree repeated
6
7 Repeated part
8 A possible derivation
9
10
11
12 Therefore, the string is generated by the grammar
13 We know This string is also generated:
14 We know This string is also generated:
15 Therefore, knowing that is generated, we also know that is generated
16 In general: We are given an infinite context-free grammar We take the derivation of a long enough string
17 Some variable must be repeated in the derivation Take the length ofBigger than = Productions * (largest production)
18 repeated
19 repeated Possible derivations:
20 We know: This string is also generated:
21 We know: This string is also generated: (the original )
22 We know: This string is also generated:
23 We know: This string is also generated:
24 We know: This string is also generated:
25 Therefore, any string of the form Is generated by the grammar
26 knowing that we also know that Therefore,
27
28
29 The pumping lemma: there exists an integer for any string we can write For context-free language with Such that: