FIT 100
© Copyright 1999-2000
University of Washington
Halting Problem
vImagine someone claims to have a program that tells whether another
program halts or not
vtestHalt(programCode As String, data As
String,
answer As String)
vYou write a program
as follows
Private Sub refuteClaim(programCode As String)
Dim ans As String
Call testHalt(programCode, programCode,
ans)
If ans = “yes” Then
Do
While 0=0
Loop
End If
End Sub
testHalt(“Private Sub refuteClaim(…”, “Private
Sub refuteClaim(…”, reply)
There can be no reply … “yes”
implies “no”, “no” implies “yes”!
Text of your
test program
The claimed program cannot
exist since a task can be set up for it for which all outputs are logically inconsistent