|
|
|
|
|
by mikeash
4212 days ago
|
|
The formalized generalization is called Rice's Theorem: http://en.wikipedia.org/wiki/Rice%27s_theorem It's pretty easy to figure out informally. If you had a program to figure out whether the output of a program is always correct for any definition of correctness, you could then write a trivial function around it that solves the halting problem: halts(program) {
testFunction() {
program()
return correctImplementation()
}
return isCorrect(testFunction)
}
In short, make a function that runs the candidate program and ignore its output, then correctly perform whatever task you have a checker for. That function is correct iff the program halts. Since you can't determine whether an arbitrary program halts, and you can use any working isCorrect() implementation to determine whether an arbitrary program halts, there's no working isCorrect() implementation. |
|