Series Anytime Algorithms for Non-Ending Computations

A program which eventually stops but does not halt “too quickly” halts at a time which is algorithmically compressible. This result — originally proved in [4] — is proved in a more general setting. Following Manin [11] we convert the result into an anytime algorithm for the halting problem and we show that the stopping time (cut-off temporal bound) cannot be significantly improved.


Introduction
Anytime algorithms exchange execution time for quality of results [8].Anytime algorithms can be executed in two modes: either by being given a contract time (a set amount of time to execute), or an interruptible method.To improve the solution, anytime algorithms can be continued after they have halted.Instead of correctness, an anytime algorithm returns a result with a "quality measure" which evaluates how close the obtained result is to the result that would be returned if the algorithm ran until completion.
Standard anytime algorithms eventually stop, albeit in a prohibitively long time.Following Manin [11] we use a more general form of anytime algorithm as an approximation for a computation which may not end.The proposed anytime algorithm for the halting problem works in the following way: to test whether a program eventually stops we first compute a temporal bound-the interruptible (stopping) condition-and execute the program for that specific time.If the computation stops then the program was proved to halt; if the computation does not stop, then we declare that the program never stops and evaluate the error probability.By running the program a longer time we can improve its performance either by getting to the halting time or by improving the probability error.
The essence of the algorithm proposed in this paper is based on the fact that programs which take a long time to halt stop at times with a specific property, namely algorithmically compressibility-a machine can generate such a time from a "smaller" input.
In the following we will denote by Z + the set of positive integers {1, 2, All logarithms (log) are implicitly binary.We denote by #S the cardinality of the set S. We assume familiarity with elementary algorithmic information theory, see [10,1,7].

A glimpse of algorithmic complexity
In this section we present a few elementary results in algorithmic information theory in an unconventional framework, i.e. for positive integers instead of strings.

Algorithmic complexity
The algorithmic complexity relative to a partially computable function That is, the algorithmic complexity of x is the smallest description/encoding of x with respect to the interpreter/decoder F , or infinity if F cannot produce x.
The algorithmic complexity is similar to the complexities studied in [10,6,5,4,11]; the plain Kolmogorov complexity is about the logarithm of the algorithmic complexity.While the Kolmogorov complexity is optimal up to an additive constant, the optimality of Ò is up to a multiplicative constant.As, in contrast with Kolmogorov complexity, the complexity Ò F is injective, there exist at most N positive integers with complexity bounded by N .

Proposition 1. Let F be a partially computable function. The following are true:
Anytime Algorithms For Non-Ending Computations 3 (1) For all x oe dom(Ò Proof. ( Comment.The property (4) above shows the existence of integers with high complexity leading to the definition of algorithmic incompressibility in Section 2.3.Choosing F (x) = x + 1 we see that the condition Ò F (x) > x/2 cannot be replaced with Ò F (x) > x.

Universality
In this section we give a new characterisation of universality which will be useful for some applications.
A partially computable function U is called universal if for every partially computable function F : Z + ≠ae Z + there exists a constant k U,F such that for every x oe dom (Ò F ) we have A partially computable function U is universal if it allows smaller descriptions for all positive integers (but for a multiplicative constant) than all other partially computable functions.

Theorem 2. A partially computable function U is universal i for every partially
computable function F : Z + ≠ae Z + there exists a constant c U,F such that for every x oe dom (F ) we have Proof.Assume U satisfies the condition (1).Taking F to be the identity we get a constant k U,id such that for every z oe Next take F satisfying (1) and x oe dom (F ).By definition of Ò U and the hypothesis, Conversely, assume F satisfies the condition (2).For every x oe Z + with Ò F (x) < OE we deduce in order the relations Ò F (x) oe dom (F ) and F (Ò Comment.The di erence between ( 1) and ( 2) is in the role played by F : in the traditional condition ( 1), F appears through Ò F (which sometimes can be incomputable), while in (2) F appears as argument of Ò U making the second member of the inequality always computable.

Comment.
A universal partially computable function U "simulates" any other partially computable function F in the following sense: if x oe dom (F ), then from (2), one can deduce that Ò U (F (x)) AE c U,F • x, hence there exists y AE c U,F • x in dom (U ) such that U (y) = F (x).In particular, Ò U (x) < OE, for all x oe Z + .Comment.In [11] a partially computable function U : Z + ≠ae Z + is called strongly universal (programmable universal in [3]) if for every partially computable function F : Z + ≠ae Z + there exists a constant k U,F such that for every x oe Z + there exists It is easy to prove that a partially computable function U is universal i it is strongly/programmable universal and the constant k U,F is the same in both definitions.
Comment.If U is a universal partially computable function, then using the identity function F (x) = x we get a constant k U,id such that for every Comment.If U 1 and U 2 are universal partially computable functions then there exists a constant c U1,U2 , c U2,U1 such that for all Corollary 3.For every universal partially computable function U , every partially computable function F : Z + ≠ae Z + and all x oe dom (F ) we have: where k U,F ¶U comes from (1).Proof.Applying (1) on F ¶ U and F (x) and using the definition of Ò, we get: In what follows we will fix a universal partially computable function U and write Ò instead of Ò U .
Proof.Assume by contradiction that Ò is computable.Then the partial function is partially computable, and, because dom(Ò) is infinite and Proposition 1(3), total.Clearly, Ò (F (x)) Ø x 2 , for all x oe Z + .
By the universality condition (2), there exists a constant c F = c U,F such that for all x oe Z + we have:

Algorithmic incompressibility (randomness)
Following [11], an incompressibility (randomness) cut-o function is a computable, increasing and divergent function r : Z + ≠ae R + such that the function x ' ae x r(x) is increasing and divergent.

Example 5.
The following are incompressibility cut-o functions: Let r be an incompressibility cut-o function.An integer x oe Z + is said to be r- . In view of Proposition 1(4), infinitely many r-(algorithmic) incompressible (random) integers exist.Theorem 6. [2] The set

it is infinite and contains no infinite computably enumerable subsets.
Proof.By the definition of r and Proposition 1(4), the set Incompress (r) is infinite.Assume by absurdity that Incompress (r) contains an infinite computably enumerable subset E. Let e : Z + ≠ae R + be a computable one-one function which enumerates E, that is, E = e(Z + ).The partially computable function r(e(i)) Ø x 2 }) has the following properties: (1) F is total, (2) there exists a constant c F such that Ò(F (x)) AE c F • x, for all x oe Z + , (3) F (x) r(F (x)) Ø x 2 , for all x oe Z + , hence for all x oe Z + , a contradiction.
Using Proposition 1 we get the following two corollaries.we have: Proof.We have: where the first equality is obtained by taking the complement, the second by set inclusion and the third by injectivity of Ò.

Incompressibility cut-o
In this section we generalise a result proved by Manin [11] which gives a su cient condition that the value of a partially computable function F in a point x from its domain is r-compressible.
Anytime Algorithms For Non-Ending Computations 7 Theorem 9. Let F : Z + ≠ae Z + be a partially computable function and x oe dom (F ).Assume that where k F comes from (1).Then, F (x) is r-compressible.

Example 10. [Manin's incompressibility cut-o ]
Assume that F is a partially computable function satisfying the following two conditions for some x oe dom (F ) and Á > 0: Then, F (x) is log-compressible.
Proof.We have: so by Theorem 9: .
The bound (4) used in Theorem 9 depends on Ò (x)-an incomputable quantity.This choice is due to the fact that by (3), Ò (x) = O (x), so a bound of the form g (Ò (x)) is better than the bound g (x).These bounds are asymptotically (up to a multiplicative constant) the same if x is r-incompressible, but the first one can be significantly smaller if Ò (x) π x.The disadvantage of bound (4) comes from its incomputability.We can get a computable bound in the following way: Corollary 11.Let F : Z + ≠ae Z + be a partially computable function and x oe dom (F ).Assume that where c F comes from (2).Then, F (x) is r-compressible.

Temporal bounds
Theorem 9 and Corollary 11 are general results in the sense that they apply to every partially computable function.In this section we will illustrate the use of Corollary 11 for a special partially computable function, the time complexity.This will lead to an anytime algorithm for the halting problem.
Let Steps : Z + ≠ae Z + be the partially computable function such that U (x) < OE i U (Steps (x)) < OE, and if U (x) < OE, then U (x) stops in Steps (x) steps.
If we apply Theorem 9 and Corollary 11 to Steps we get a similar result to the main theorem of [4], where the bound can be expressed with or without Ò (x).
Theorem 12. Assume that U (x) halts in t x steps, with t To get the entire power of Theorem 12 we need to use it in conjunction with the following result stating that the r-incompressible times (at which a computation can halt) is a "small" set of positive integers.To this aim we will work with the (natural) density on P (Z + ).The natural density is not a probability in Kolmogorov's sense (no such probability can be defined for all subsets of positive integers).However, if a positive integer is "randomly" selected from the set {1, 2, . . ., m}, then the probability that it belongs to a given set If lim N ≠aeOE p m (A) exists and is equal to ", then the set A µ Z + has density d (A) = ".
In a sense, the density d (A) models "the probability that a randomly chosen integer x oe Z + is in A".
A set A µ Z + is said to have constructive density zero if there exists a computable function b : Z + ae Z + such that for every i oe Z + we have p m (A) < 2 ≠i provided m Ø b (i).Proof.The map x ' ae x r(x) is increasing as r is an incompressibility cut-o function, so we have Consequently, because the injectivity of Ò, Anytime Algorithms For Non-Ending Computations 9 so the limit converges constructively to 0 because r is computable, increasing and divergent.
Assume that U (x) does not stop in time T x satisfying the second inequality in Theorem 12, i.e.
From ( 6), for every Given x, s oe Z + , compute M x s , and run U (x) for the contracted time M x s .If the computation doesn't stop in time M x s , then either • U (x) eventually halts and the halting time belongs to a set of density smaller than 1 s , or • U (x) never stops.
We have obtained the following interruptible divergence anytime algorithm: If U (x) doesn't stop in time M x s , then the probability (according to density) that U (x) never stops is larger than 1 ≠ 1 s .
Comment.Theorem 12 was formulated for the time complexity.In fact it works for every abstract Blum complexity measure for U , i.e. for every partially computable function B : Z + ≠ae Z + with the following two properties: a) B (x) < OE i U (x) < OE; and b) the predicate "B (x) = n" is computable.

Temporal bounds
Let us assume that we have some control over the number of computational steps taken by U .More precisely, we consider the following Assumption.For any n oe Z + , there exist a, b oe Z + and a computable family of programs ( Furthermore, a can be chosen arbitrarily large.This condition may seem artificial, but it is actually verified by all "reasonable" models of computation.Indeed, one can write a program x R executing the following instructions: (1) compute a large number b from a constant c hard-coded in the source code (for example, b = c 3 ); (2) read the input tape, on which we have placed R and execute a dummy loop b steps; (3) and halt.
The number corresponding to the program is bounded by K • c 2 • R, where K is constant: c needs 2 log (c) bits to be stored in the source code, while R needs log (R) bits to be written on the input tape.So, we have If we make c large enough then we have One can easily verify that this method allows to e ectively write a 2-tape Turing machine or a C/C++ program having the desired property.
The Assumption above allows us to show that the bound in Theorem 12 cannot be significantly improved.First we need the following independent more general result.
Lemma 13.Let f be a computable, strictly increasing function such that f (x) r(f (x)) = o (x).Then a + b • f (R) is r-incompressible for infinitely many R.

Proof.
Let g (R) = a + b • f (R).First we prove that g(x) r(g(x)) = o (x).Indeed, we have: Second, as g is injective, there exists a computable function g ≠1 such that for all x oe Z + , g ≠1 (g (x)) = x.Using the universality of U and Corollary 3, there exists a constant k g ≠1 such that Ò !g ≠1 (x) " AE k g ≠1 • Ò (x).Using Proposition 1(4) and the fact that g(x) r(g(x)) = o (x), we can choose R so that it satisfies the inequalities:

Final comments
In [4] it was proved that if a program doesn't stop quickly (meaning, before a temporal bound which can be computed from the program), then the program either stops at a time which is algorithmically compressible or never stops.Based on the fact that the set of algorithmically compressible times has constructive density zero (i.e. it is constructively negligible) we can construct an anytime algorithm for solving the halting problem.The analysis in this paper shows two facts: a) a positive one, in which the construction of the anytime algorithm can be done with respect to algorithmically very low compressible times, and b) a negative one, that the temporal bound cannot be significantly lowered.
It will be interesting to see if the same method can be applied to other incomputable problems, in particular, to program testing.

Corollary 7 .Corollary 8 .
The set {x oeZ + | Ò (x) Ø x/2} is immune.Proof.The set {x oe Z + | Ò (x) Ø x/2}is an infinite subset of the immune set Incompress (r), for any incompressibility cut-o function r.Let r be an incompressibility cut-o function.Then, for all N oe Z +