How does the Halting Problem have a contradiction?

100 views

I’ve seen explanations about this, but I don’t see how will the program run in the first place. Example program that will be fed to itself:

define haltOrLoop(P):
if halt(P): loop forever
else: exit

If we run `haltOrLoop(haltOrLoop)` wouldn’t that be incomplete as `haltOrLoop` (the one inside the parenthesis) needs a program to run first?

In: 2

4 Answers

Anonymous 0 Comments

In the traditional definition, the program being tested is always given itself as its input.

In this case, `halt(program, progInput)` is the proper “halting problem” function call, and the program you wrote in your original post should read `halt(P,P)`

You are viewing 1 out of 4 answers, click here to view all answers.