PeteOlcott wrote: ↑Mon May 16, 2022 8:07 pm
bool H(P,P) is defined to return 0 meaning that its input is non-halting.
H is defined as a Boolean! Meaning that H can return a 1 or a 0 !
Which, in turn means that H(P,P) == 0 could be true when H returns 0; or false when H returns 1 !
PeteOlcott wrote: ↑Mon May 16, 2022 8:07 pm
If you disagree with this you are a a liar.
OK. So you are stupid.
You don't even understand the difference between the expression "1==0" which returns a Boolean,
and an assertion 1==0 which aborts the execution of the program because the assertion is false.
Here is the code.
Code: Select all
#include <stdio.h>
#include <assert.h>
int main()
{
0==1;
assert(1==0);
return 0;
}
Here is the warning you get when you compile the code
Code: Select all
➜ ~ gcc main.c
main.c:6:6: warning: equality comparison result unused [-Wunused-comparison]
0==1;
~^~~
1 warning generated.
Here is the
runtime error you get when you run the code (which contains warnings)
Code: Select all
➜ ~ ./a.out
Assertion failed: (1==0), function main, file main.c, line 7.
[1] 24650 abort ./a.out
And here is the
compile-time error you get when you make the compiler strict!
Code: Select all
➜ ~ gcc -Werror main.c
main.c:6:6: error: equality comparison result unused [-Werror,-Wunused-comparison]
0==1;
~^~~
1 error generated.