1
Chapter Eighteen: Uncomputability
Formal Language, chapter 18, slide 1
Chapter Eighteen: Uncomputability Formal Language, chapter 18, - - PowerPoint PPT Presentation
Chapter Eighteen: Uncomputability Formal Language, chapter 18, slide 1 1 The Church-Turing Thesis gives a definition of computability, like a border surrounding the algorithmically solvable problems. L ( a * b *) regular languages { a n b
1
Formal Language, chapter 18, slide 1
2
regular languages CFLs L(a*b*) {anbn} recursive languages {anbncn}
Formal Language, chapter 18, slide 2
3
Formal Language, chapter 18, slide 3
4
Formal Language, chapter 18, slide 4
5
Formal Language, chapter 18, slide 5
6
Formal Language, chapter 18, slide 6
7
Formal Language, chapter 18, slide 7
8
Formal Language, chapter 18, slide 8
9
Formal Language, chapter 18, slide 9
10
Formal Language, chapter 18, slide 10
11
Formal Language, chapter 18, slide 11
12
Formal Language, chapter 18, slide 12
13
String s = "boolean sigmaStar(String p) {return true;}"; run(s,"abc"); String s = "boolean ax(String p) { " + " return (p.length()>0 && p.charAt(0)=='a'); " + "} "; run(s,"ba");
Formal Language, chapter 18, slide 13
14
String s = "boolean anbncn1(String p) { " + " String as = \"\", bs = \"\", cs = \"\"; " + " while (true) { " + " String s = as+bs+cs; " + " if (p.equals(s)( return true; " + " as += 'a'; bs += 'b'; cs += 'c'; " + " } " + "} "; run(s,"abbc");
Formal Language, chapter 18, slide 14
15
Formal Language, chapter 18, slide 15
16
Formal Language, chapter 18, slide 16
17
Formal Language, chapter 18, slide 17
18
Formal Language, chapter 18, slide 18
19
Formal Language, chapter 18, slide 19
20
Formal Language, chapter 18, slide 20
21
Formal Language, chapter 18, slide 21
22
Formal Language, chapter 18, slide 22
23
Formal Language, chapter 18, slide 23
24
Formal Language, chapter 18, slide 24
25
Formal Language, chapter 18, slide 25
26
Formal Language, chapter 18, slide 26
27
Formal Language, chapter 18, slide 27
28
Formal Language, chapter 18, slide 28
29
– Lu is not recursive – The shortcut function is not computable – The machine-M-accepts-string-x property is not decidable
Formal Language, chapter 18, slide 29
30
Formal Language, chapter 18, slide 30
31
– A sentence can refer to itself as “this sentence”
– A method can receive its source as a parameter – A TM can get a string encoding of itself
Formal Language, chapter 18, slide 31
32
Formal Language, chapter 18, slide 32
33
Formal Language, chapter 18, slide 33
34
Formal Language, chapter 18, slide 34
35
Formal Language, chapter 18, slide 35
36
Formal Language, chapter 18, slide 36
37
Formal Language, chapter 18, slide 37
38
Formal Language, chapter 18, slide 38
39
Formal Language, chapter 18, slide 39
40
Formal Language, chapter 18, slide 40
41 regular languages CFLs L(a*b*) {anbn} recursive languages {anbncn} Lu Lh
Formal Language, chapter 18, slide 41
42
Formal Language, chapter 18, slide 42
43
1. I will drive my car to the airport 2. I will fly to my friend’s airport 3. My friend will pick me up
Formal Language, chapter 18, slide 43
44
Formal Language, chapter 18, slide 44
45
Formal Language, chapter 18, slide 45
46
Formal Language, chapter 18, slide 46
47
Formal Language, chapter 18, slide 47
48
Formal Language, chapter 18, slide 48
49
Formal Language, chapter 18, slide 49
50
Formal Language, chapter 18, slide 50
51
Formal Language, chapter 18, slide 51
52
Formal Language, chapter 18, slide 52
53
Formal Language, chapter 18, slide 53
54
Formal Language, chapter 18, slide 54
55
boolean sigmaStar(String p) {return true;}
Formal Language, chapter 18, slide 55
56
Formal Language, chapter 18, slide 56
57
Formal Language, chapter 18, slide 57
58
Formal Language, chapter 18, slide 58
59
Formal Language, chapter 18, slide 59
60
Formal Language, chapter 18, slide 60
61
Le = {p | p is a recognition method and L(p) is empty} Lr = {p | p is a recognition method and L(p) is regular} {p | p is a recognition method and L(p) is context free} {p | p is a recognition method and L(p) is recursive} {p | p is a recognition method and |L(p)| = 1} {p | p is a recognition method and |L(p)| ≥ 100} {p | p is a recognition method and hello ∈ L(p) } {p | p is a recognition method and L(p) = Σ*}
Formal Language, chapter 18, slide 61
62
{p | p is a recognition method and L(p) is RE} {p | p is a recognition method and L(p) ⊃ Σ*}
Formal Language, chapter 18, slide 62
63
Formal Language, chapter 18, slide 63
64
method for Lh
Formal Language, chapter 18, slide 64
65
method for Lh
Formal Language, chapter 18, slide 65
66
Formal Language, chapter 18, slide 66
67
{p | p is a recognition method and |L(p)| = 1}
– The language is of the form covered by Rice’s theorem – The property in question, |L(p)| = 1, is nontrivial: some RE languages have one element and others don’t
Formal Language, chapter 18, slide 67
68
– {p | p is a method that prints "hello world"} – {p | p is a method that never gets an uncaught exception} – {p | p is a method that produces no output}
Formal Language, chapter 18, slide 68
69
Formal Language, chapter 18, slide 69
70
Formal Language, chapter 18, slide 70
71
Formal Language, chapter 18, slide 71
72
Formal Language, chapter 18, slide 72
73
Formal Language, chapter 18, slide 73
74
Formal Language, chapter 18, slide 74
75
Formal Language, chapter 18, slide 75
76
Formal Language, chapter 18, slide 76
77
Formal Language, chapter 18, slide 77
78
Formal Language, chapter 18, slide 78
79
Formal Language, chapter 18, slide 79
80
Formal Language, chapter 18, slide 80
81
Formal Language, chapter 18, slide 81
82
– Given an enumerator class, construct a recognition method – Given a recognition method, construct an enumerator class
Formal Language, chapter 18, slide 82
83
Formal Language, chapter 18, slide 83
84
Formal Language, chapter 18, slide 84
85
Formal Language, chapter 18, slide 85
86
Formal Language, chapter 18, slide 86
87
Formal Language, chapter 18, slide 87
88
Formal Language, chapter 18, slide 88
89
Formal Language, chapter 18, slide 89
90
Formal Language, chapter 18, slide 90
91
Formal Language, chapter 18, slide 91
92
Formal Language, chapter 18, slide 92
93
u
h
Formal Language, chapter 18, slide 93
94
Formal Language, chapter 18, slide 94
95
regular languages CFLs L(a*b*) {anbn} recursive languages {anbncn} Lu RE languages Lu
Formal Language, chapter 18, slide 95
96
Formal Language, chapter 18, slide 96
97
Formal Language, chapter 18, slide 97
98
Formal Language, chapter 18, slide 98
99
Formal Language, chapter 18, slide 99
100
Formal Language, chapter 18, slide 100
101
– S ⇒ ε – S ⇒ abc – S ⇒ aBSc ⇒ aBabcc ⇒ aaBbcc ⇒ aabbcc – S ⇒ aBSc ⇒ aBaBScc ⇒ aBaBabccc ⇒ aaBBabccc ⇒ aaBaBbccc ⇒ aaaBBbccc ⇒ aaabbbccc
Formal Language, chapter 18, slide 101
102
Formal Language, chapter 18, slide 102
103
Type 3 (regular) Type 2 (CFL) Type 1 (CSL) (recursive) Type 0 (RE)
Formal Language, chapter 18, slide 103
104
– A superset of the CFLs, a subset of the regular languages – A large subset: there are languages that are recursive but not context-sensitive, but they’re hard to find
– Start with the NDTM model – Add the restriction that writing on B is not permitted – In effect, this limits the NDTM to that part of the tape occupied by the input – L is accepted by some NLBA if and only if L is a CSL
Formal Language, chapter 18, slide 104
105
Formal Language, chapter 18, slide 105
106
Formal Language, chapter 18, slide 106
107
Formal Language, chapter 18, slide 107
108
Formal Language, chapter 18, slide 108
109
– {(p,in) | p is a recognition method that halts on in}
– If there were a way to decide Le, we could use that to decide Lh – Conclusion: Le must not be recursive
Formal Language, chapter 18, slide 109
110
Formal Language, chapter 18, slide 110
111
Formal Language, chapter 18, slide 111
112
Formal Language, chapter 18, slide 112
113
Formal Language, chapter 18, slide 113
114
Formal Language, chapter 18, slide 114
115
Formal Language, chapter 18, slide 115
116
Formal Language, chapter 18, slide 116
117
Formal Language, chapter 18, slide 117
118
Formal Language, chapter 18, slide 118
119
Formal Language, chapter 18, slide 119
120
– Polynomial equations, such as x2 + y2 = z2, restricted to integer variables and constants – Find a general algorithm for these: Hilbert’s tenth problem – Matiyasevich “solved” this one in 1970, showing that it has no solution – For every TM M there is a Diophantine equation with one variable x which has a solution exactly where x ∈ L(M)
Formal Language, chapter 18, slide 120