1 00:00:00,000 --> 00:00:02,450 PROFESSOR: [? Diagonal ?] arguments are elegant, 2 00:00:02,450 --> 00:00:06,060 and infinite sets-- some people think-- are romantic. 3 00:00:06,060 --> 00:00:09,990 But you could legitimately ask what is all this weird infinite 4 00:00:09,990 --> 00:00:12,935 stuff doing in a course that's math for computer science? 5 00:00:12,935 --> 00:00:15,410 And the reason is that diagonal arguments turn out 6 00:00:15,410 --> 00:00:19,180 to play a fundamental role in the theory of computing. 7 00:00:19,180 --> 00:00:20,950 And what we're going to talk about now 8 00:00:20,950 --> 00:00:22,910 is the application of diagonal arguments 9 00:00:22,910 --> 00:00:25,770 to show that there are noncomputable sets 10 00:00:25,770 --> 00:00:30,280 and examine a particular one. 11 00:00:30,280 --> 00:00:36,015 So let's look at the class of infinite binary strings. 12 00:00:39,260 --> 00:00:41,460 Now, we've seen that there are an uncountable number 13 00:00:41,460 --> 00:00:44,280 of infinite binary strings, and that's 14 00:00:44,280 --> 00:00:46,300 because there was a simple bijection 15 00:00:46,300 --> 00:00:48,405 between the infinite binary strings 16 00:00:48,405 --> 00:00:50,950 and the subsets of the natural numbers-- 17 00:00:50,950 --> 00:00:53,340 that is the power set of n. 18 00:00:53,340 --> 00:00:57,360 Let's look at the infinite binary strings 19 00:00:57,360 --> 00:00:59,977 that we might think of and call computable strings. 20 00:00:59,977 --> 00:01:01,560 And what I mean by a computable string 21 00:01:01,560 --> 00:01:04,519 is that there's simply a procedure that will tell me 22 00:01:04,519 --> 00:01:05,740 what its digits are. 23 00:01:05,740 --> 00:01:10,180 So what I mean is that the procedure applied to argument n 24 00:01:10,180 --> 00:01:13,140 will return the n-th digit of the string s. 25 00:01:13,140 --> 00:01:16,020 That's the definition of what I mean by saying s is computable. 26 00:01:16,020 --> 00:01:20,360 I can compute its digits, whichever digits are needed. 27 00:01:20,360 --> 00:01:23,840 Now, we saw that there were only a countable number 28 00:01:23,840 --> 00:01:26,480 of finite binary sequences, and I 29 00:01:26,480 --> 00:01:29,890 mention that now because I want to think about sequences 30 00:01:29,890 --> 00:01:32,854 over the slightly larger alphabet instead of 0 1, 31 00:01:32,854 --> 00:01:35,680 the 256 ASCII characters. 32 00:01:35,680 --> 00:01:40,130 And by the same argument, the set of finite ASCII strings 33 00:01:40,130 --> 00:01:42,242 is also countable. 34 00:01:42,242 --> 00:01:44,450 You just list them in order of length-- same argument 35 00:01:44,450 --> 00:01:46,360 that we used for the binary strings. 36 00:01:46,360 --> 00:01:49,430 Now, the point of looking at the ASCII strings-- the 256 37 00:01:49,430 --> 00:01:54,000 keyboard characters-- is that every procedure 38 00:01:54,000 --> 00:01:59,630 that we enter into a computer, we type in an ASCII string. 39 00:01:59,630 --> 00:02:04,010 Every procedure can be represented by an ASCII string. 40 00:02:04,010 --> 00:02:08,280 And since they're only countably many finite ASCII strings, 41 00:02:08,280 --> 00:02:11,620 it follows that there are only countably many computable 42 00:02:11,620 --> 00:02:13,370 procedures. 43 00:02:13,370 --> 00:02:17,280 Now, since in order to be a computable infinite string, 44 00:02:17,280 --> 00:02:20,270 there has to be a procedure which computes is digits, 45 00:02:20,270 --> 00:02:22,970 we can immediately conclude that there are only 46 00:02:22,970 --> 00:02:27,990 countably many infinite binary sequences that are computable-- 47 00:02:27,990 --> 00:02:32,040 only countably many computable infinite binary sequences. 48 00:02:32,040 --> 00:02:34,887 But I already said there are an uncountable number 49 00:02:34,887 --> 00:02:36,345 of those infinite binary sequences. 50 00:02:36,345 --> 00:02:40,630 So it has to be that there are noncomputable sequences, 51 00:02:40,630 --> 00:02:44,410 noncomputable infinite binary strings, that exist. 52 00:02:44,410 --> 00:02:46,530 So we can conclude that as a matter of fact, 53 00:02:46,530 --> 00:02:50,220 since the set of infinite binary strings is uncountable 54 00:02:50,220 --> 00:02:53,420 and the computable ones are a countable subset, 55 00:02:53,420 --> 00:02:56,430 there have to be an uncountable number 56 00:02:56,430 --> 00:02:59,730 of noncomputable infinite binary sequences. 57 00:02:59,730 --> 00:03:05,180 Most infinite binary sequences are actually noncomputable. 58 00:03:05,180 --> 00:03:06,110 OK. 59 00:03:06,110 --> 00:03:07,910 That's kind of abstract thing to know. 60 00:03:07,910 --> 00:03:10,330 They're out there, and you can't get a hold of them 61 00:03:10,330 --> 00:03:11,210 computationally. 62 00:03:11,210 --> 00:03:15,310 But the reasonable question to ask is what do they look like? 63 00:03:15,310 --> 00:03:20,410 And what we're going to see is that if you consider 64 00:03:20,410 --> 00:03:22,740 a sensible concrete computational 65 00:03:22,740 --> 00:03:26,600 problem of giving a procedure, figuring out 66 00:03:26,600 --> 00:03:31,180 whether it will run and turn a value successfully 67 00:03:31,180 --> 00:03:36,430 on some argument or not is called testing the halting 68 00:03:36,430 --> 00:03:37,881 property of procedures. 69 00:03:37,881 --> 00:03:40,130 I want to know-- given a procedure and argument that I 70 00:03:40,130 --> 00:03:43,350 could apply it to, does it return a value 71 00:03:43,350 --> 00:03:44,955 or does something else bad happen 72 00:03:44,955 --> 00:03:47,220 and it runs forever and returns an error? 73 00:03:47,220 --> 00:03:49,155 We don't get a satisfactory value out. 74 00:03:49,155 --> 00:03:51,030 And if it does [? satisfactorily ?] return 75 00:03:51,030 --> 00:03:53,470 something, we say it halts. 76 00:03:53,470 --> 00:03:58,940 And what I'm going to argue is that the halting problem is not 77 00:03:58,940 --> 00:03:59,710 decidable. 78 00:03:59,710 --> 00:04:02,750 That is, there's no procedure which 79 00:04:02,750 --> 00:04:06,600 given input that describes a procedure, 80 00:04:06,600 --> 00:04:09,370 the fixed procedure can figure out what its input is doing. 81 00:04:09,370 --> 00:04:12,370 Let's look at that in more detail. 82 00:04:12,370 --> 00:04:14,285 So let's think about string procedures 83 00:04:14,285 --> 00:04:16,660 because we're thinking about procedures being represented 84 00:04:16,660 --> 00:04:17,870 by ASCII strings. 85 00:04:17,870 --> 00:04:20,370 So let's think about procedures that take a string argument. 86 00:04:20,370 --> 00:04:22,530 So an example of a procedure P, it 87 00:04:22,530 --> 00:04:26,050 might be that when you apply P to the string no, it returns 2. 88 00:04:26,050 --> 00:04:29,700 When you apply it to the string albert, it returns meyer. 89 00:04:29,700 --> 00:04:33,660 When you apply it to this string of weird symbols, 90 00:04:33,660 --> 00:04:35,220 that causes an error. 91 00:04:35,220 --> 00:04:39,860 And you apply it to the sequence of characters what now, 92 00:04:39,860 --> 00:04:41,310 and it actually runs forever. 93 00:04:41,310 --> 00:04:44,670 These are just illustrations of the kind of behavior 94 00:04:44,670 --> 00:04:49,260 that some weird string procedure might exhibit. 95 00:04:49,260 --> 00:04:51,210 So what I want to think about is-- 96 00:04:51,210 --> 00:04:55,690 suppose I have an ASCII string s, a finite ASCII string. 97 00:04:55,690 --> 00:04:57,950 That's the one that defines this procedure P. When 98 00:04:57,950 --> 00:05:00,150 I'm trying to run P on the computer, 99 00:05:00,150 --> 00:05:02,210 I'll have to type in s in order to give 100 00:05:02,210 --> 00:05:05,410 the computer the definition of P to tell it what to do. 101 00:05:05,410 --> 00:05:07,650 And I'm going to say that s HALTS-- 102 00:05:07,650 --> 00:05:10,120 the string has this property called halting 103 00:05:10,120 --> 00:05:15,580 or HALTS-- if and only if this procedure P that s describes 104 00:05:15,580 --> 00:05:19,340 returns successfully when it's applied to s. 105 00:05:19,340 --> 00:05:21,690 This is where we're really doing a diagonal argument. 106 00:05:21,690 --> 00:05:25,940 We're taking the sth object-- the procedure 107 00:05:25,940 --> 00:05:28,560 that's described by s and applying it to s. 108 00:05:28,560 --> 00:05:32,280 And that's kind of going down the diagonal of s applied 109 00:05:32,280 --> 00:05:37,530 to s, where the n-th element of the n-th row 110 00:05:37,530 --> 00:05:39,817 in a pictorial diagonal argument. 111 00:05:39,817 --> 00:05:41,400 That's the idea that we're going here. 112 00:05:41,400 --> 00:05:43,200 But let's to go back to the definition. 113 00:05:43,200 --> 00:05:47,210 A string is said to HALT if when you interpret it 114 00:05:47,210 --> 00:05:50,400 as the description of a procedure that takes a string 115 00:05:50,400 --> 00:05:53,000 argument and you apply that string 116 00:05:53,000 --> 00:05:55,710 procedure to that very same thing, s, 117 00:05:55,710 --> 00:05:57,660 you successfully return. 118 00:05:57,660 --> 00:06:00,460 That's the halting problem. 119 00:06:00,460 --> 00:06:03,600 And what I want to argue is that it's impossible 120 00:06:03,600 --> 00:06:08,210 that there could be a procedure Q that decided the property 121 00:06:08,210 --> 00:06:09,970 HALTS of strings. 122 00:06:09,970 --> 00:06:12,890 That is to say, Q applied to a string returns 123 00:06:12,890 --> 00:06:17,270 yes if s does return successfully-- if s HALTS. 124 00:06:17,270 --> 00:06:19,310 And it returns no otherwise. 125 00:06:19,310 --> 00:06:23,740 Q applied to s will say no if s runs forever 126 00:06:23,740 --> 00:06:26,250 or if s has a type error or s does 127 00:06:26,250 --> 00:06:29,720 anything other than successfully return a value. 128 00:06:29,720 --> 00:06:32,050 Let's suppose, for the sake of contradiction, 129 00:06:32,050 --> 00:06:34,350 that there was this HALTS decider. 130 00:06:34,350 --> 00:06:39,410 I claim there can't be such a Q. For the sake of contradiction, 131 00:06:39,410 --> 00:06:41,650 let's assume there was one. 132 00:06:41,650 --> 00:06:44,000 Then this is the trick that I'm going to do. 133 00:06:44,000 --> 00:06:48,713 I'm going to modify Q to act as though it 134 00:06:48,713 --> 00:06:50,317 was complementing the diagonal. 135 00:06:50,317 --> 00:06:51,900 More precisely, this is what I'm going 136 00:06:51,900 --> 00:06:53,470 to do with Q. I'm going to modify 137 00:06:53,470 --> 00:06:56,380 Q to be another procedure Q prime, 138 00:06:56,380 --> 00:06:58,260 which just behaves a little bit differently. 139 00:06:58,260 --> 00:07:03,490 Namely, Q prime of s returns yes when Q of s returns no, 140 00:07:03,490 --> 00:07:06,766 and Q prime of s returns nothing-- 141 00:07:06,766 --> 00:07:10,990 that is, it doesn't HALT-- if you Q of s returns yes. 142 00:07:10,990 --> 00:07:14,510 So Q prime is like complementing the bits on the diagonal, 143 00:07:14,510 --> 00:07:16,390 but here's the precise definition. 144 00:07:16,390 --> 00:07:17,190 Q of s says no. 145 00:07:17,190 --> 00:07:19,410 Q of prime of s says yes. 146 00:07:19,410 --> 00:07:22,680 Q of s says yes. 147 00:07:22,680 --> 00:07:23,880 s HALTS successfully. 148 00:07:23,880 --> 00:07:27,070 Q prime then does not HALT successfully. 149 00:07:27,070 --> 00:07:28,960 It returns nothing at all. 150 00:07:28,960 --> 00:07:30,840 Let's go crank through the consequences 151 00:07:30,840 --> 00:07:32,660 of these definitions. 152 00:07:32,660 --> 00:07:38,550 So s HALTS means Q prime of s returns nothing. 153 00:07:38,550 --> 00:07:42,170 That was the way we define Q prime of s. 154 00:07:42,170 --> 00:07:47,310 Now, let's let t be the text for Q prime. 155 00:07:47,310 --> 00:07:49,190 If Q was a procedure, then surely we 156 00:07:49,190 --> 00:07:53,100 can tweak this procedure Q to get the procedure Q prime. 157 00:07:53,100 --> 00:07:55,940 So Q prime will have a text that describes. 158 00:07:55,940 --> 00:07:59,160 It'll be the ASCII string that defines Q prime. 159 00:07:59,160 --> 00:08:01,550 Let's let t be that ASCII string. 160 00:08:01,550 --> 00:08:02,530 What do we have? 161 00:08:02,530 --> 00:08:06,180 Then by definition of HALTS, t HALTS if and only 162 00:08:06,180 --> 00:08:10,010 if the procedure that t scribes-- namely Q prime 163 00:08:10,010 --> 00:08:13,790 applied to t-- returns a value successfully. 164 00:08:13,790 --> 00:08:14,660 OK? 165 00:08:14,660 --> 00:08:17,260 Now by definition of Q prime however, Q prime 166 00:08:17,260 --> 00:08:23,000 was the thing that on t, it returned a value successfully 167 00:08:23,000 --> 00:08:27,950 if and only if it was not the case that t HALTS. 168 00:08:27,950 --> 00:08:31,020 So if you put those two things together-- that is, 169 00:08:31,020 --> 00:08:35,320 we're looking at t HALTS if and only if Q prime of t returns, 170 00:08:35,320 --> 00:08:39,860 and Q prime of t returns a value successfully if only if not t 171 00:08:39,860 --> 00:08:42,270 HALTS-- then put the two together, 172 00:08:42,270 --> 00:08:43,990 and we have a contradiction. 173 00:08:43,990 --> 00:08:47,220 t HALTS if and only if t doesn't HALT. 174 00:08:47,220 --> 00:08:51,140 And that contradiction says that our original hypothesis 175 00:08:51,140 --> 00:08:54,770 that we had a Q that would decide the halting problem 176 00:08:54,770 --> 00:08:56,210 can't be right. 177 00:08:56,210 --> 00:09:00,450 It's impossible to write a procedure that determines 178 00:09:00,450 --> 00:09:03,610 of strings whether they describe a procedure that 179 00:09:03,610 --> 00:09:06,140 HALTS when applied to itself. 180 00:09:06,140 --> 00:09:07,000 OK. 181 00:09:07,000 --> 00:09:09,950 That at least gives us some concrete problem 182 00:09:09,950 --> 00:09:13,990 that we can say is not something that a computer can do. 183 00:09:13,990 --> 00:09:18,250 Even though it's a very well defined clear question, 184 00:09:18,250 --> 00:09:23,530 it's just not possible to get a computing procedure that 185 00:09:23,530 --> 00:09:27,220 will on an arbitrary string, figure out the right answer. 186 00:09:27,220 --> 00:09:30,840 Any program that applied to strings 187 00:09:30,840 --> 00:09:33,841 is trying to do this job, either it will give the wrong answer. 188 00:09:33,841 --> 00:09:35,340 Or if it never gives a wrong answer, 189 00:09:35,340 --> 00:09:40,650 it means it doesn't give an answer at all on some strings. 190 00:09:40,650 --> 00:09:41,231 All right. 191 00:09:41,231 --> 00:09:43,730 Well, you could say that I don't really care very much about 192 00:09:43,730 --> 00:09:45,120 whether a program HALTS or not. 193 00:09:45,120 --> 00:09:47,360 So let's look at how do you apply 194 00:09:47,360 --> 00:09:50,860 the same reasoning-- or more precisely, 195 00:09:50,860 --> 00:09:54,270 as a corollary of the fact that the halting problem is not 196 00:09:54,270 --> 00:09:56,240 computable, let's talk about something 197 00:09:56,240 --> 00:09:58,330 that sounds closer to a practical interest, 198 00:09:58,330 --> 00:10:00,200 mainly type-checking. 199 00:10:00,200 --> 00:10:02,990 So I want to think about the type-checking problem. 200 00:10:02,990 --> 00:10:06,160 And what I want to say is that in fact, there's 201 00:10:06,160 --> 00:10:10,080 no strict procedures that type-checks procedures 202 00:10:10,080 --> 00:10:12,350 perfectly. 203 00:10:12,350 --> 00:10:15,770 So what I mean is that I want to be 204 00:10:15,770 --> 00:10:20,880 able to write a program that will look at a program 205 00:10:20,880 --> 00:10:24,510 text, an ASCII string that describes a procedure, 206 00:10:24,510 --> 00:10:29,360 and figure out whether that ASCII string, if you ran it, 207 00:10:29,360 --> 00:10:31,926 would cause a run-time type error. 208 00:10:31,926 --> 00:10:33,800 That's what type-checkers are supposed to do. 209 00:10:33,800 --> 00:10:35,425 They're supposed to check your program, 210 00:10:35,425 --> 00:10:38,505 figure out whether the program will cause a run-time type 211 00:10:38,505 --> 00:10:39,005 error. 212 00:10:39,005 --> 00:10:40,400 If so, it reports it. 213 00:10:40,400 --> 00:10:43,530 If not, it says, this program is safe. 214 00:10:43,530 --> 00:10:45,530 Other things may go wrong, but it's not 215 00:10:45,530 --> 00:10:47,730 going to commit a run-time type error. 216 00:10:47,730 --> 00:10:51,380 So let's suppose that I had such a type checking procedure 217 00:10:51,380 --> 00:10:56,370 C. So what that means is that for program text s, C of s 218 00:10:56,370 --> 00:11:01,720 returns yes if running s would cause a run-time type error. 219 00:11:01,720 --> 00:11:05,880 And C of s returns no-- the output string no-- otherwise 220 00:11:05,880 --> 00:11:10,260 if s would not cause a run-time type error. 221 00:11:10,260 --> 00:11:12,238 In other words, s is safe. 222 00:11:12,238 --> 00:11:13,580 All right. 223 00:11:13,580 --> 00:11:16,050 Now, what I claim is that if you give me C-- 224 00:11:16,050 --> 00:11:18,780 if I have a procedure that's this perfect type-checker-- I 225 00:11:18,780 --> 00:11:23,870 can use C to build a tester for HALTS, which we said 226 00:11:23,870 --> 00:11:24,910 is impossible. 227 00:11:24,910 --> 00:11:29,450 So how would I use C to get a HALTS tester, H. 228 00:11:29,450 --> 00:11:31,430 Here's how. 229 00:11:31,430 --> 00:11:37,360 I'm going to tell you how to compute H of s. 230 00:11:37,360 --> 00:11:41,780 I'm describing the procedure that this tester H carries out 231 00:11:41,780 --> 00:11:43,390 on argument s. 232 00:11:43,390 --> 00:11:45,630 And what it does is given argument s, 233 00:11:45,630 --> 00:11:47,680 it's going to construct a new program that's 234 00:11:47,680 --> 00:11:49,520 a small modification of s. 235 00:11:49,520 --> 00:11:54,390 It's going to construct this new program s prime that acts 236 00:11:54,390 --> 00:11:56,450 like an interpreter for s. 237 00:11:56,450 --> 00:12:00,540 So s is a computer program or a procedure. 238 00:12:00,540 --> 00:12:03,410 I want to know whether if you just run it, it'll HALT or not. 239 00:12:03,410 --> 00:12:07,270 I'm going to tweak it a little bit so that s prime acts like s 240 00:12:07,270 --> 00:12:09,295 but in a slightly modified way. 241 00:12:09,295 --> 00:12:11,410 And here's how s prime works. 242 00:12:11,410 --> 00:12:14,480 S prime is going to be an interpreter that's simulating 243 00:12:14,480 --> 00:12:16,210 step-by-step how s behaves. 244 00:12:16,210 --> 00:12:18,430 But at the moment that it discovers 245 00:12:18,430 --> 00:12:21,530 that s is about to commit a run-time type 246 00:12:21,530 --> 00:12:24,230 error-- that the next instruction that s prime 247 00:12:24,230 --> 00:12:28,200 would execute in simulating s was going to be a run-time type 248 00:12:28,200 --> 00:12:30,620 error-- s prime would just skip it. 249 00:12:30,620 --> 00:12:33,470 And who knows what the consequences of skipping it 250 00:12:33,470 --> 00:12:36,770 will be, but it'll skip it and just keep going. 251 00:12:36,770 --> 00:12:37,270 OK. 252 00:12:40,828 --> 00:12:46,920 If s prime in simulating program s discovers that in fact s 253 00:12:46,920 --> 00:12:49,190 returns successfully-- those that is s 254 00:12:49,190 --> 00:12:54,530 HALTS-- then s prime will purposely make a type error. 255 00:12:54,530 --> 00:12:56,150 So let's think about what that means. 256 00:12:57,130 --> 00:13:00,470 Well, actually let me just wrap up what the definition of H is. 257 00:13:00,470 --> 00:13:03,430 So the way H works is given input s, 258 00:13:03,430 --> 00:13:06,550 it constructs the program s prime and applies 259 00:13:06,550 --> 00:13:11,100 the type-checker C to s prime and returns the same value 260 00:13:11,100 --> 00:13:13,190 that c does. 261 00:13:13,190 --> 00:13:15,920 So what we can figure out by these definitions 262 00:13:15,920 --> 00:13:21,320 is the s HALTS-- the string s is a cloud halting string-- 263 00:13:21,320 --> 00:13:24,450 if and only if the string s prime 264 00:13:24,450 --> 00:13:26,330 makes a run-time type error. 265 00:13:26,330 --> 00:13:28,510 Because remember, the interpreter, 266 00:13:28,510 --> 00:13:31,660 which is what s prime was behaving like, 267 00:13:31,660 --> 00:13:34,520 was simulating what s did. 268 00:13:34,520 --> 00:13:36,700 And if s was going to HALT successfully, 269 00:13:36,700 --> 00:13:39,110 s prime makes a run-time type error. 270 00:13:39,110 --> 00:13:43,390 That means that C is going to say yes to s prime-- yes, 271 00:13:43,390 --> 00:13:45,100 it has a run-time type error. 272 00:13:45,100 --> 00:13:48,550 And by definition of H, that means that H of s 273 00:13:48,550 --> 00:13:54,280 says yes because H of s constructed s prime to C. OK. 274 00:13:54,280 --> 00:13:58,220 On the other hand, if s does not HALT, 275 00:13:58,220 --> 00:14:02,610 that means that something else goes wrong with s. 276 00:14:02,610 --> 00:14:05,060 It's not going to successfully return. 277 00:14:05,060 --> 00:14:10,740 Then s prime-- when it's simulating s-- is never 278 00:14:10,740 --> 00:14:12,880 going to make a run-time type error because that's 279 00:14:12,880 --> 00:14:13,760 the way s prime goes. 280 00:14:13,760 --> 00:14:15,259 Whenever it detects that there would 281 00:14:15,259 --> 00:14:17,610 be about to be a run-time type error, it skips it. 282 00:14:17,610 --> 00:14:21,160 So s prime is likely to keep running forever because it's 283 00:14:21,160 --> 00:14:23,930 simulating this program s that doesn't HALT, 284 00:14:23,930 --> 00:14:26,500 but it won't make a type error. 285 00:14:26,500 --> 00:14:28,520 And that means that C of s prime is going 286 00:14:28,520 --> 00:14:30,600 to say no-- no type error. 287 00:14:30,600 --> 00:14:33,360 And H of s is going to say no. 288 00:14:33,360 --> 00:14:36,980 And that means that when s does not HALT, H of s 289 00:14:36,980 --> 00:14:38,210 properly says no. 290 00:14:38,210 --> 00:14:40,930 In other words, I've just walked through the argument 291 00:14:40,930 --> 00:14:44,820 that this procedure H that I've described actually 292 00:14:44,820 --> 00:14:47,480 is a decider for HALTS. 293 00:14:47,480 --> 00:14:49,810 And that's a contradiction. 294 00:14:49,810 --> 00:14:52,900 The H that I gave you would solve the halting problem 295 00:14:52,900 --> 00:14:55,230 if there was a perfect type-checker, 296 00:14:55,230 --> 00:14:58,230 and there can't be a halting problem decider. 297 00:14:58,230 --> 00:15:00,450 So there can't be a perfect type checker. 298 00:15:00,450 --> 00:15:02,210 C must make a mistake. 299 00:15:02,210 --> 00:15:06,520 It can't accurately predict run-time errors. 300 00:15:06,520 --> 00:15:10,490 And that is an example of how you 301 00:15:10,490 --> 00:15:14,050 reason from this kind of contrived halting problem 302 00:15:14,050 --> 00:15:18,370 that's sort of self-referential whether the string 303 00:15:18,370 --> 00:15:22,510 procedure applied to its own definition HALTS or not. 304 00:15:22,510 --> 00:15:26,024 And we can apply it to all sorts of questions and properties 305 00:15:26,024 --> 00:15:27,690 of procedures that we really care about. 306 00:15:27,690 --> 00:15:29,106 In fact, the same reasoning really 307 00:15:29,106 --> 00:15:30,840 shows that it's not just type-checking. 308 00:15:30,840 --> 00:15:32,640 That's a kind of arbitrary example, 309 00:15:32,640 --> 00:15:35,510 but there's more or less no perfect checker 310 00:15:35,510 --> 00:15:38,860 for any kind of property that procedure outcomes 311 00:15:38,860 --> 00:15:40,400 might exhibit. 312 00:15:40,400 --> 00:15:44,710 Which is why theoretical computer scientists 313 00:15:44,710 --> 00:15:47,170 interested in the theory of computation 314 00:15:47,170 --> 00:15:50,240 have great respect and interest in diagonal arguments 315 00:15:50,240 --> 00:15:53,730 because they crystallize a whole set of absolutely 316 00:15:53,730 --> 00:15:59,660 logical, intrinsic limitations on the power of computation.