I am trying to understand Turing's halting problem proof by applying the same paradox to a similar problem where, instead of determining if a given code will halt, you instead determine if it will return True or False (assuming it will always return eventually). Obviously such a machine can exist, as it is simply a standard compiler. However, when run through the paradox:
We assume h is a function that determines if the return is True or False
We construct a machine P around h in the following way:
def P(i):
return not h(i, i)
P(P)
As we can see, if P returns True then P returns False, and vice versa. Thus compilers cannot exist, as a compiler is an example of h. Can someone please help me find the error in reasoning?