Re: Can you find anything wrong with this solution to the Halting Problem?
stephen_at_nomail.com
Date: 07/14/04
- Next message: Acid Pooh: "Re: non-pseudo random number generators"
- Previous message: |-|erc: "Re: VOTE on whether 1/oo = 0"
- In reply to: Peter Olcott: "Re: Can you find anything wrong with this solution to the Halting Problem?"
- Next in thread: Peter Olcott: "Re: Can you find anything wrong with this solution to the Halting Problem?"
- Reply: Peter Olcott: "Re: Can you find anything wrong with this solution to the Halting Problem?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Jul 2004 00:39:34 GMT
Peter Olcott <olcott@att.net> wrote:
:> int f1(int y, int z)
:> {
:> int x=0;
:> for (int i=0; i<z; ++i)
:> if (i%y==0)
:> ++x;
:> cout << x << endl;
:> }
:>
:> int f2(int y, int z)
:> {
:> int x=0;
:> for (int i=0; i<z; ++i)
:> if (i%y==0)
:> ++x;
:> cout << x << endl;
:> while (1);
:> }
:>
:> According to his logic, adding a while(1) loop to a program
:> somehow causes the code prior to it to behave differently. It
:> is a curious logic.
:>
:> Stephen
: When the code prior to its has the job of analyzing the
: whole program, adding a line of code changes the program
: and thus necessarily changes the resulting analysis.
: You forgot to include the refernce to WillHalt()
Adding a line does not change the behavior of any code before it.
It cannot. An if or while statement does not change behavior
if you add a statement later. An if or while statement does not
know what problem it is trying to solve and does not change behavior
depending on the type of problem.
The following two functions will print the exact same thing, no
matter what code is used to evaluate the value x.
int f1(int y)
{
int x;
/*
some code to evaluate a value x
this code is identical in both f1 and f2
*/
cout << x << endl;
return x;
}
int f2(int y)
{
int x;
/*
some code to evaluate a value x
this code is identical in both f1 and f2
*/
cout << x << endl;
while (x);
return x;
}
How can you seriously claim that f1 and f2 will print different
things when given the same value for y? The code is identical.
The code does not "know" what it is trying to evaluate. Code
does not change its behavior because it "knows" what it is trying to
do.
Stephen
- Next message: Acid Pooh: "Re: non-pseudo random number generators"
- Previous message: |-|erc: "Re: VOTE on whether 1/oo = 0"
- In reply to: Peter Olcott: "Re: Can you find anything wrong with this solution to the Halting Problem?"
- Next in thread: Peter Olcott: "Re: Can you find anything wrong with this solution to the Halting Problem?"
- Reply: Peter Olcott: "Re: Can you find anything wrong with this solution to the Halting Problem?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|