2025-10-27
In this presentation, we will show that haltsOnString is uncomputable.
We will use a Turing reduction from yesOnString, which is already known to be uncomputable.
By the end, we will understand the connection between these two problems and why the halting behavior of programs cannot be determined by any algorithm.
A problem is uncomputable if no Turing machine can decide it for all possible inputs.
That means there is no algorithm that always gives a correct yes/no answer.
Problems like the ones we are going to see today (yesOnString, haltsOnString) will help us understand the limits of computation.
It returns:
✅ yes — if the input program outputs “yes”
❌ no — otherwise
It returns:
✅ yes — if the program halts (eventually stops running)
❌ no — if the program never halts (runs forever)
If you can solve G, then you can use that solution to solve F.
So, if F is uncomputable and F reduces to G,
then G must also be uncomputable.
Let’s assume that haltsOnString is computable.
Then we’ll try to use it to build a program that decides yesOnString.
If we succeed, that would imply that yesOnString is computable —
but that’s impossible, since it’s already proven uncomputable.
How is that possible?
We create a program that:
from universal import universal
def alterYesToHalt(inString):
(progString, newInString) = utils.DESS(inString)
val = universal(progString, newInString)
if val == 'yes':
# return value is irrelevant, since returning any string halts
return 'halted'
else:
# deliberately enter infinite loop
utils.loop()from haltsOnString import haltsOnString # oracle function
def yesViaHalts(progString, inString):
singleStr = utils.ESS(progString, inString)
return haltsOnString(rf('alterYesToHalts.py'), singleStr)If haltsOnString were computable, then we could use it to decide yesOnString,
because we just built a program that does exactly that using haltsOnString as a helper.
But yesOnString is already known to be uncomputable.
This gives us a contradiction.
Therefore, our assumption must be false, and haltsOnString is also uncomputable.
Limits of computation:
Hierarchy of problems:
Simulation using Turing reduction:
No General Algorithmic Predictor:
Proofgrammers