1
Chapter Eleven: Non-Regular Languages
Formal Language, chapter 11, slide 1
Chapter Eleven: Non-Regular Languages Formal Language, chapter 11, - - PowerPoint PPT Presentation
Chapter Eleven: Non-Regular Languages Formal Language, chapter 11, slide 1 1 We have now encountered regular languages in several different places. They are the languages that can be recognized by a DFA. They are the languages that can be
1
Formal Language, chapter 11, slide 1
2
Formal Language, chapter 11, slide 2
3
Formal Language, chapter 11, slide 3
4
Formal Language, chapter 11, slide 4
5
a b
Formal Language, chapter 11, slide 5
6
a b b a
Formal Language, chapter 11, slide 6
7
a b b a a b
Formal Language, chapter 11, slide 7
8
– NFA needs a fixed, finite number of states – No fixed, finite number will be enough to count the unbounded n in {anbn}
Formal Language, chapter 11, slide 8
9
Formal Language, chapter 11, slide 9
10
Formal Language, chapter 11, slide 10
11
Formal Language, chapter 11, slide 11
12
Formal Language, chapter 11, slide 12
13
Formal Language, chapter 11, slide 13
14
Formal Language, chapter 11, slide 14
15
≠ {xxR}
– δ*(q0,ε), then δ*(q0,a), then δ*(q0,aa), and so on
– ∃ i and j with i < j such that δ*(q0,ai) = δ*(q0,aj)
Formal Language, chapter 11, slide 15
16
Formal Language, chapter 11, slide 16
17
Formal Language, chapter 11, slide 17
18
Formal Language, chapter 11, slide 18
19
Formal Language, chapter 11, slide 19
20
– We know such a state exists because we have |y| ≥ |Q|…
Formal Language, chapter 11, slide 20
21
Formal Language, chapter 11, slide 21
22
i) = r
iwz) = δ*(q0,xuvwz) = δ*(q0,xyz) ∈ F
iwz ∈ L
Formal Language, chapter 11, slide 22
23
1. ∀ L … 2. ∃ k … 3. ∀ xyz … 4. ∃ uvw … 5. ∀ i …
Formal Language, chapter 11, slide 23
24
Formal Language, chapter 11, slide 24
25
Formal Language, chapter 11, slide 25
26
1. Proof is by contradiction using the pumping lemma for regular
holds for L. Let k be as given by the pumping lemma. 2. Choose x, y, and z as follows: x = ak y = bk z = ε Now xyz = akbk ∈ L and |y| ≥ k as required. 3 Let u, v, and w be as given by the pumping lemma, so that uvw = y, |v| > 0, and for all i ≥ 0, xuviwz ∈ L. 4 Choose i = 2. Since v contains at least one b and nothing but bs, uv2w has more bs than uvw. So xuv2wz has more bs than as, and so xuv2wz ∉ L. 5 By contradiction, L = {anbn} is not regular.
Formal Language, chapter 11, slide 26
27
Formal Language, chapter 11, slide 27
28
1. Proof is by contradiction using the pumping lemma for regular
holds for L. Let k be as given by the pumping lemma. 2. 3 Let u, v, and w be as given by the pumping lemma, so that uvw = y, |v| > 0, and for all i ≥ 0, xuviwz ∈ L. 4 5 By contradiction, L = {anbn} is not regular.
Formal Language, chapter 11, slide 28
29
1. Proof is by contradiction using the pumping lemma for regular
holds for L. Let k be as given by the pumping lemma. 2. Choose x, y, and z as follows: x = akbb y = ak z = ε Now xyz = akbbak ∈ L and |y| ≥ k as required. 3 Let u, v, and w be as given by the pumping lemma, so that uvw = y, |v| > 0, and for all i ≥ 0, xuviwz ∈ L. 4 Choose i = 2. Since v contains at least one a and nothing but as, uv2w has more as than uvw. So xuv2wz has more as after the bs than before them, and thus xuv2wz ∉ L. 5 By contradiction, L = {xxR} is not regular.
Formal Language, chapter 11, slide 29
30
Formal Language, chapter 11, slide 30
31
Formal Language, chapter 11, slide 31
32
Formal Language, chapter 11, slide 32
33
Formal Language, chapter 11, slide 33
34
Formal Language, chapter 11, slide 34
35
Formal Language, chapter 11, slide 35
36
Formal Language, chapter 11, slide 36
37
Formal Language, chapter 11, slide 37
38
Formal Language, chapter 11, slide 38
39
Formal Language, chapter 11, slide 39
40
Formal Language, chapter 11, slide 40
41
Formal Language, chapter 11, slide 41
42
Formal Language, chapter 11, slide 42
43
Formal Language, chapter 11, slide 43
44
Formal Language, chapter 11, slide 44
45
Formal Language, chapter 11, slide 45
46
1. Proof is by contradiction using the pumping lemma for regular
as given by the pumping lemma. 2. Choose x, y, and z as follows: x = ε y = ak z = bak Now xyz = akbak ∈ A and |y| ≥ k as required. 3 Let u, v, and w be as given by the pumping lemma, so that uvw = y, |v| > 0, and for all i ≥ 0, xuviwz ∈ A. 1. Choose i = 1
Formal Language, chapter 11, slide 46
47
Formal Language, chapter 11, slide 47
48
1. Proof is by contradiction using the pumping lemma for regular
as given by the pumping lemma. 2. Choose x, y, and z as follows: x = ε y = ak z = bak Now xyz = akbak ∈ A and |y| ≥ k as required. 3 Let u, v, and w be as given by the pumping lemma, so that uvw = y, |v| > 0, and for all i ≥ 0, xuviwz ∈ A. 4 Choose i = 2. Since v contains at least one a and nothing but as, uv2w has more as than uvw. So xuv2wz has more as before the b than after it, and thus xuv2wz ∉ A. 5 By contradiction, A is not regular.
Formal Language, chapter 11, slide 48
49
Formal Language, chapter 11, slide 49
50
Formal Language, chapter 11, slide 50
51
Formal Language, chapter 11, slide 51