Getting Around The Halting Problem
Getting Around The Halting Problem
Abstract
There are numbers k and s and a URM program A(n,m) satisfying the following conditions.
Here Cn(_) is a program with index n in some exhaustive enumeration of all possible programs.
This has implications for solving the liar paradox and for generalization of Gödel’s incompleteness
theorem to formal systems other than PA.
1
1. Introduction
Let A’(n,m) be a program1) with the following property2)
that is, A’() detects in some cases that a program Cn() with input m does not halt. Here
Cn() is a program with index n in some exhaustive enumeration of all possible programs.
The downward arrow ‘↓’ indicates that the program halts, the upward arrow ‘↑’ indicates
that the program diverges.
Let us define Ck(n) =def A’(n,n), Cs() =def Ck(s). The existence of Cs() is guaranteed by the
Recursion Theorem. In pseudocode it looks as follows
C_k(n) {
A’(n,n)
}
Figure 1.1
and
C_s() {
C_k(s)
}
Figure 1.2
1 Such as URM program or a Turing machine performing operations on natural numbers. It could be a program in any
general purpose programming language with the proviso that word length and memory size are infinite.
2 The idea of such a program A() is due to Penrose [5]. This approach greatly simplifies matters.
2
The proof is usually by constructing a counterexample:
But Cs()↓ = Ck(s)↓ = A’(s, _)↓ are all equivalent. So we can analogically prove Ck(s)↑ and
A’(s,_)↑. So Cs() does not halt, but A’() does not know it.
The question arises if there is any other way A’(n,m) can express that Cs() does not halt.3)
It is a thesis of this paper that there is. In particular it is the program A(n,m) such that
a) A(k,s)↓
b) A(s,_ )↑
(The underscore in place of a parameter indicates ‘don’t care’.) The condition a) together
with (1.1) imply that Ck(s)↑. But if Ck(s) does not halt then Cs() cannot possibly halt either.
(Figure 1.2) Thus A(k,s)↓ expresses indirectly that Cs() does not halt. Seemingly we have
a contradiction: Cs() = Ck(s) and yet A(k,s)↓ & A(s,_ )↑. The key observation here is that
A(k,s)↓ does not contradict A(s,_ )↑. The former ‘says’ that Ck(s) does not halt, the latter
says nothing; it does not say that Cs() does halt. And since <k,s> and <s,_> are two
different parameter tuples A() is under no obligation to react identically to them.
2. Formalization
Theorem 1: There are numbers k and s and a program A(n,m) satisfying the following
conditions.
3
Proof: Let K denote the halting problem, that is, K = {e : Ce(e) ↓}. It is known that the
complement of K, K, is productive and therefore contains an infinite recursively
enumerable (r.e.) subset. Let f be a recursive function such that f(0), f(1), f(2), . . . is a
one-one enumeration of an infinite r.e. subset of K.
Define a partial-recursive function A(x,y), and numbers k, s such that for all n
⎧ 1 if A(x,x) = 1
Ck(x) = ⎨
⎩ ↑ otherwise.
By the Recursion Theorem, there are infinitely many s’ such that for all y, Cs’(y) = Ck(s’).
Fix one such s’, say s, such that s ≠ k. The function f enumerates many functions that do
not halt on their own input (hopefully all of them except the equivalents of s.)
Condition 1: By the definition of A, A(x,y)↓ only if one of the following holds: (a) x = y =
f(n) ≠ s, or (b) (x = k & y = s). In case (a), one has by the definition of f that f(n) ∈ K, that
is, Cf(n)(f(n))↑. In case (b), since s has been chosen such that s≠ k, by the definition of
Ck(x), Ck(x)↑ if x≠ y.
Condition 2: For all n, Ck(n) = A(n,n) is immediate by the definition of Ck. Furthermore, by
the choice of s, for all y, Cs(y) = Ck(s).
Condition 3: It follows from the definition of A that A(k,s)↓= 1, and for all y, A(s,y)↑
since s≠ k. QED 4)
4
There is a compilable, executable version of another program in Appendix A written in
C, which satisfies the same conditions as A() above. It perhaps constitutes an alternative
proof.
Prog_i {
x := 0
loop {
if P_i(x) then exit loop
x := x+1
}
}
Thus proving ~∃xPi(x) is equivalent to proving that the corresponding program does
not halt. There certainly does exist a program Φ that proves ~∃xPi(x) iff Peano
Arithmetic proves it.
is recursively enumerable, and thus a counterpart of the range of f(n) from the
previous section.
Now let
be Gödel’s sentence, where Diag(k,z) is satisfied only by z = ⌜G⌝, while G is none other
than the Gödel number of G itself. Program Φ cannot prove G. And since in classical logic
5
is equivalent to G, Φ cannot prove H either.
However in Strawson’s Logic of Presuppositions G ≠ H! More about this in [3], [4], [6].
Using this logic we ought to be able to extend the proof predicate and in fact obtain
Computability Logic
~∃x(Prf*(x, ⌜G*⌝)
Self-reference Cs() G*
External reference Ck(s)
Table 3.1
Program A() does not explicitly ‘know’ that Cs() does not halt, but it does know that
Ck(s) does not halt. And while Strawson based arithmetic does not ‘know’ that G* is
the case it nevertheless does know that H* is the case. And all the information we
are interested in is already contained in H*.
6
4. The Liar Paradox
Consider the following two-line puzzle:
Line 1: This sentence is not true.
Line 2: "This sentence is not true" is not true.
The standard evaluation rule for a sentence of the form ‘The sentence X is true’ is
roughly this:
(*) Go to the sentence X and evaluate it. If that sentence is true, so is ‘The sentence X is
true’ , else the latter is false.
When we apply the above rule to line 1 we end up in an infinite loop. The
sentence cannot be evaluated, and hence is not true (and not false.) When we
apply it to line 2 we already know that "This sentence is not true" is not true,
and therefore the line 2 sentence is true. The “go-to” command makes the referring
by ‘The sentence ...’ operationally explicit.5)
Table 4.1
7
APPENDIX A: A() fragment
A reasonable strategy for A() to determine if C_s() does not halt is to call C_s() itself.
For C_s() is a program that is supposed to halt if C_s() does not halt. So A() can as
well ask it. And after all C_s() = C_k(s) = A(s,s) are computationally equivalent. In
this case when A() is called with s it will go into infinite recursion. The program
below will actually compile and execute.
8
#include <stdio.h>
#define DEPTH (1000)
#define INITIALIZE level = 0; k = (unsigned int)C_k; \
s = (unsigned int)C_s;
#define LEVEL_INC if ( checkStack() ) return;
#define LEVEL_DEC level--;
int checkStack(void) {
level++;
if (level >= DEPTH){
printf("Almost got there. Have run out of stack.\n\n");
level--; // Alternative return, decrease level
return 1;
}
return 0;
}
void C_s() {
C_k(s);
}
return 0;
}
9
Bibliography
[1] Gaifman, H. (2000) Pointers to propositions. In: A. Chapuis & A. Gupta, eds.
Circularity, Definition, and Truth, New Delhi: Indian Council of Philosophical Research:
79–121, Available at:
https://www.researchgate.net/publication/265448054_POINTERS_TO_PROPOSITIONS, p. 3
[Accessed 31 Aug 2020]
[2] Newberry, X.Y. (2016) Notes on Gaifman’s Solution of The Liar Paradox, The Reasoner,
Volume 4, Number 2
https://cdn-researchkent.pressidium.com/reasoning/wp-content/uploads/sites/
1804/2019/06/TheReasoner-42-screen.pdf
[3] Newberry, X.Y. (2015) The Diagonal Lemma Fails in Aristotelian Logic, The Reasoner
Volume 10, Number 1, https://blogs.kent.ac.uk/thereasoner/files/2015/01/TheReasoner-
101-1.pdf
https://www.scribd.com/document/362318420/The-Diagonal-Lemma-Fails-in-Aristotelian-
Logic
[5] Penrose, R. (1994) Shadows of the Mind, Oxford, Oxford University Press, pp. 73-75
[6] Strawson, P.F. (1952) Introduction to Logical Theory, London, Methuen, pp. 163-179
10