ITT: Give me a program, and I'll tell you if it terminates.
Name:
Anonymous2008-01-20 21:42
Suppose you had a function, foo, which takes in as it's input a function, and returns 1 or 0, depending on whether that function terminates or not (1 if it does, else 0)
Consider the following program:
int main()
{
int x = foo(main);
return 0;
}
Since main terminates, x is assigned 1
Now consider
int main()
{
int x = foo(main);
while (x) {}
return 0;
}
If foo returned 1, implying main terminates, we would enter this infinite loop, hence main doesn't terminate. If main is self-terminating, then it isn't self-terminating
Suppose then, foo returned 0, implying main wasn't self-terminating, we would skip pass the infinite loop, and hence main would become self-terminating. If main isn't self-terminating, it terminates
The conclusion is that the problem of determinating whether a proposed function (which may be extended to a program) terminates or not is beyond the power of current computational models, and hence this thread is a complete sham.