Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- These are sufficient criteria to induce the undecidability of the halting problem of the machine class by a member of the class itself:
- Exists x y in S such that x != y.
- Exists f : S → S such that x != f(x)
- Exists “loop forever”
- Exists “halt”
- Closed under function composition
- Closed under conditional branching
- Assume H is a machine in the class which takes as input a program p and input i and decides whether p halts on input i:
- H(p,i) = 1 if program p halts on input i
- = 0 otherwise
- Since the class has a loop-forever instruction, a halt instruction, is closed under conditional branching and function composition, and H is assumed to be a machine in the class, then this diagonalization machine is also a machine in the class:
- K(i) = if H(i,i) then loop forever, else halt
- since it’s closed under function composition, we could define K1(i) = H(i,i)
- since it’s closed under conditional branching, we could define K2(i) = if H(i,i) then A else B
- since it has a loop-forever instruction and a halting instruction, then we can set A = loop-forever, B = halt: K3(i) = if H(i,i) then loop-forever else halt
- Now let’s see our diagonalization in action:
- H(K,K) = 1 if program K halts on input K, else 0
- K(K) = if H(K,K) then loop forever, else halt
- assume H(K,K) = 1, then K(K) loops forever, and so H(K,K) = 0, contradiction
- assume H(K,K) = 0, then K(K) halts, and so H(K,K) = 1, contradiction
- Paradox.
- No class of machines that satisfies the constraints given above can solve its own halting problem.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement