Keywords

1 Introduction

What is computation? This question usually assumes that the Turing machineFootnote 1 [23] is the standard model [18, 19, 21]. We reexamine this question with a new model, called the ex-machine [12]. This model adds two special instructions to the Turing machine instructions. The name ex-machine comes from the Latin term extra machinam because the ex-machine computation is a non-autonomous dynamical system [10] that may no longer be considered a machine.Footnote 2 The meta instruction adds new states and new instructions or can replace instructions. The random instruction can be physically realized with a quantum random number generator [14, 15]. When an ex-machine uses meta and random instructions, its program complexity (machine size [3]) can increase, unlike a lever, pulley, or Turing machine. Two identical ex-machines can evolve to different ex-machines even when both start executing with the same tape input and initial state.

We combine self-modification and randomness and construct an ex-machine Z(x) whose program complexity |Q||A| increases as it executes.Footnote 3 Z(x)’s non-autonomous behavior circumvents the contradiction in an information-theoretic proof [4, 5] of Turing’s halting problem. The proof’s contradiction depends upon an information-theoretic property: each Turing machine is representable with a finite number of bits that stays constant during the entire execution. Some ex-machines violate this property. Z(x)’s circumvention occurs because its meta instructions increase the number of states and instructions in Z(x), based on random information obtained from its random instructions. Hence, the minimal number of bits that represent an ex-machine’s evolved program can increase without bound as execution proceeds.

1.1 Related Work—Computation

In [24], the notion of providing an oracle was introduced. Turing stated that an oracle cannot be a machine but did not provide a physical basis for its existence. For a summary of various physical realizations that use quantum events to generate random binary outcomes, see [14]. In [7], the following question was asked: Is there anything that can be done by a machine with a random element but not by a deterministic machine? They showed for a Turing computable probability p (e.g., \(p = \frac {1}{2}\)) that any set of output symbols that can be enumerated with positive probability by their probabilistic machine can also be enumerated by a Turing machine. Overall, they were unable to produce Turing incomputable computation when p is Turing computable. In [13], a framework is developed for self-modifying programs, but it does not include randomness and does not address computability. In [11], a parallel machine self-modifies with meta commands and takes quantum random measurements to execute a Turing incomputable black box. Prior hypercomputation models [8, 16, 17] are not physically realizable.

2 The Ex-machine

\(\mathbb {Z}\), \(\mathbb {N}\), and \(\mathbb {N}^+\) are the integers, non-negative integers, and positive integers, respectively. The finite set \({Q} = \{0, 1, 2, \dots , n-1 \} \subset \mathbb {N}\) represents the ex-machine states. As a subset of \(\mathbb {N}\), Q helps specify how new states are added to Q when a meta instruction executes. Let V = {a 1, …, a n}. The set A = {0,1,#}∪ V  consists of alphabet (tape) symbols, where # is the blank symbol and {0, 1, #}∩ V = ∅. In some ex-machines, A = {0,1,#,Y,N,a}, where V = {Y,N,a}. Sometimes, A = {0,1,#}. Alphabet symbols are scanned from and written on the tape. The tape is a function \(T : \mathbb {Z} \rightarrow A\). We say T is finite [21], whenever a finite number of tape squares T(k) contain non-blank symbols.

2.1 Standard Instructions

Definition 1 (Execution of Standard Instructions)

Standard instructions S satisfy S ⊂ Q × A × Q × A ×{−1, 0, 1} and a uniqueness condition: If (q 1, α 1, r 1, a 1, y 1) ∈ S and (q 2, α 2, r 2, a 2, y 2) ∈ S  and (q 1, α 1, r 1, a 1, y 1)≠(q 2, α 2, r 2, a 2, y 2), then (q 1, α 1)≠(q 2, α 2). Instruction I = (q, a, r, α, y) follows [19]. When the ex-machine is in state q and the tape head is scanning a = T(k) at tape square k, I executes as follows. The ex-machine state moves from state q to state r. Alphabet symbol a is replaced with α so that T(k) = α. If y = −1 or 1, the tape head moves one square to the left or right, respectively. If y = 0, the tape head does not move.

A Turing machine [23] has a finite set of machine states, a finite alphabet, a finite tape, and a finite set of standard instructions that execute according to Definition 1. An ex-machine that uses only standard instructions is called a standard machine and is computationally equivalent to a Turing machine. The Turing machine is the standard mathematical model of computation, realized by digital computers [1].

2.2 Random Instructions

This subsection defines two random axioms and the random instructions. Repeated independent trials are called quantum random Bernoulli trials [9] if all trials have a quantum random measurement [14] with only two outcomes and the probability of each outcome stays constant. Unbiased means that the probability of both outcomes is the same.

Random Axiom 1 (Unbiased Trials)

Quantum random outcome x i measures 0 or 1. Probability \(P(x_i = 1) = P(x_i = 0) = \frac {1}{2}\).

Random Axiom 2 (Stochastic Independence)

Prior measurements x 1, …, x i−1 have no effect on the next measurement x i. For each b i ∈{0, 1}, the conditional probabilities satisfy \(P(x_i = 1 | x_1 = b_1, \dots , x_{i-1} = b_{i-1}) = \frac {1}{2}\) and \(P(x_i = 0 | x_1 = b_1, \dots , x_{i-1} = b_{i-1}) = \frac {1}{2}\).

Definition 2 (Execution of Random Instructions)

Random instructions \(\mathfrak {R}\) are a subset of Q × A × Q ×{−1, 0, 1}. \(\mathfrak {R}\) satisfies uniqueness condition: If \((q_1, \alpha _1, r_1, y_1) \in \mathfrak {R}\) and \((q_2, \alpha _2, r_2, y_2) \in \mathfrak {R}\) and (q 1, α 1, r 1, y 1)≠(q 2, α 2, r 2, y 2), then (q 1, α 1)≠(q 2, α 2). When scanning symbol a and in state q, instruction (q, a, r, y) executes as follows:

  1. (1)

    Measure bit b ∈{0, 1} from a quantum random source that satisfies both axioms.

  2. (2)

    On the tape, an alphabet symbol a is replaced with a random bit b. Note {0, 1}⊂ A.

  3. (3)

    The ex-machine state q changes to state r.

  4. (4)

    The tape head moves left if y = −1, moves right if y = 1, and does not move if y = 0.

Example 1 lists a random walk ex-machine; it shows how the random instructions execute and how the ex-machine can exhibit non-autonomous dynamical behavior.

Example 1 (Random Walk Ex-machine)

Alphabet A = {0, 1, #, E}. Q = {0,1,2,3,4,5,6,h} with halting state h= 7. There are 3 random instructions (0,#,0,0), (1,#,1,0), and (4,#,4,0).

(0,#,0,0)      (0,0,1,0,-1)   (0,1,4,1,1)    ; Comments follow a semicolon. (1,#,1,0)      (1,0,1,0,-1)   (1,1,2,#,1)    ; Resume random walk to the left    of tape square 0 (2,0,3,#,1)    (2,#,h,E,0)    (2,1,h,E,0) (3,#,0,#,-1)   ; Go back to state 0.  Number of random 0's  =  Number of   random 1's. (3,0,1,0,-1)   ; Go back to state 1.  Number of random 0's  >  Number of   random 1's. (3,1,h,E,0) (4,#,4,0)      (4,1,4,1,1)    (4,0,5,#,-1)  ; Resume random walk to the right   of tape square 0 (5,1,6,#,-1)   (5,#,h,E,0)    (5,0,h,E,0) (6,#,0,#,1)    ; Go back to state 0.  Number of random 0's  =  Number of    random 1's. (6,1,4,1,1)    ; Go back to state 4.  Number of random 1's  >  Number of    random 0's. (6,0,h,E,0)

A valid initial tape contains only blank symbols. A valid initial state is 0. At step 1, random instruction (0,#,0,0) measures 0, so it executes (0,#,0,0,0). At step 3, instruction (1,#,1,0) measures 1, so it executes (1,#,1,1,0). (Per Definition 2, 0r means 0 was randomly measured, and 1r means 1 was measured.) In all executions shown, the tape head is reading the symbol to the right of the space. The sequence of tape symbols shows the tape contents after the instruction in the same row has executed.

First Execution of Random Walk Ex-machine. Steps 1–7.

For the second execution, at step 1, a random measurement returns a 1, so (0,#,0,0) executes as (0,#,0,1,0). Instruction (4,#,4,0) measures 0, so (4,#,4,0,0) executes.

Second Execution of Random Walk Ex-machine. Steps 1–7.

The first and second executions show that the execution behavior of the same ex-machine with identical initial conditions may be distinct at two different instances. Hence, the ex-machine is a discrete, non-autonomous dynamical system [10].

2.3 Meta Instructions

This subsection defines the meta instruction and the notion of evolving an ex-machine. The execution of a meta instruction can add new states and new instructions or replace instructions. Formally, the meta instructions \(\mathfrak {M}\) satisfy \(\mathfrak {M} \subset \{ (q, a, r, \alpha , y, J): q \in \mathfrak {Q}\) and \(r \in \mathfrak {Q} \cup \{|\mathfrak {Q}|\}\) and a, α ∈ A and instruction \(J \in \mathfrak {S} \cup \mathfrak {R}\}\). Define \(\mathfrak {I} = \mathfrak {S} \cup \mathfrak {R} \cup \mathfrak {M}\), as the set of standard, random, and meta instructions. To help describe how a meta instruction modifies \(\mathfrak {I}\), the unique state, scanning symbol condition is defined. For any two distinct instructions in \(\mathfrak {I}\), at least one of the first two coordinates must differ. More precisely, all six of the following uniqueness conditions must hold.

  1. 1.

    If (q 1, α 1, r 1, β 1, y 1) and (q 2, α 2, r 2, β 2, y 2) both are in \(\mathfrak {S}\), then (q 1, α 1)≠(q 2, α 2).

  2. 2.

    If \((q_1, \alpha _1, r_1, \beta _1, y_1) \in \mathfrak {S}\) and \((q_2, \alpha _2, r_2, y_2) \in \mathfrak {R}\), then (q 1, α 1)≠(q 2, α 2).

  3. 3.

    If (q 1, α 1, r 1, y 1) and (q 2, α 2, r 2, y 2) both are in \(\mathfrak {R}\), then (q 1, α 1)≠(q 2, α 2).

  4. 4.

    If \((q_1,\alpha _1,r_1,y_1) \in \mathfrak {R}\) and \((q_2,\alpha _2,r_2,a_2,y_2,J_2) \in \mathfrak {M}\), then (q 1, α 1)≠(q 2, α 2).

  5. 5.

    If \((q_1,\alpha _1, r_1,\beta _1,y_1) \in \mathfrak {S}\) and \((q_2,\alpha _2,r_2,a_2,y_2,J_2) \in \mathfrak {M}\), then (q 1, α 1)≠(q 2, α 2).

  6. 6.

    If \((q_1, \alpha _1, r_1, a_1, y_1, J_1) \in \mathfrak {M}\) and \((q_2, \alpha _2, r_2, a_2,y_2,J_2) \in \mathfrak {M}\), then (q 1, α 1)≠(q 2, α 2).

Given a valid machine specification, conditions 1–6 assure that there is no ambiguity on what instruction to execute. The execution of a meta instruction preserves conditions 1–6.

Definition 3 (Execution of Meta Instructions)

Meta instruction (q, a, r, α, y, J) executes as follows:

  1. (1)

    The first five coordinates (q, a, r, α, y) are executed as a standard instruction according to Definition 1 with one caveat. State q may be expressed as \(|\mathfrak {Q}|\) -c and state r may be expressed as \(|\mathfrak {Q}|\) or \(|\mathfrak {Q}|\) -d, where 0 <  c,d \(\le |\mathfrak {Q}|\). When (q, a, r, α, y) is executed, if q is expressed as \(|\mathfrak {Q}|\) -c , the value of q is instantiated to the current value of \(|\mathfrak {Q}| - c\). Similarly, if r is expressed as \(|\mathfrak {Q}|\) or \(|\mathfrak {Q}|\) -d, the value of state r is instantiated to the current value of \(|\mathfrak {Q}|\) or \(|\mathfrak {Q}| - d\), respectively.

  2. (2)

    Instruction J modifies \(\mathfrak {I}\), where J has the form J = (q, a, r, α, y) or J = (q, a, r, y). If \(\mathfrak {I} \cup \{ J \}\) satisfies the unique state, scanning symbol condition, then \(\mathfrak {I}\) is updated to \(\mathfrak {I} \cup \{ J \}\). Otherwise, there is an instruction I in \(\mathfrak {I}\) whose first two coordinates q and a equal instruction J’s first two coordinates. In this case, instruction J replaces instruction I in \(\mathfrak {I}\), and \(\mathfrak {I}\) is updated to \(\mathfrak {I} \cup \{ J \} - \{ I \}\).

Remark 1 (Ex-machine Instructions are Sequences of Sets)

This remark clarifies the definitions of machine states, standard, random, and meta instructions. The machine states are formally a sequence of sets. When the notation is formally precise, the machine states are expressed as \(\mathfrak {Q}(m)\), where m indicates that the mth computational step has executed. The standard, random, and all ex-machine instructions are also sequences of sets, represented as \(\mathfrak {S}(m)\), \(\mathfrak {R}(m)\), and \(\mathfrak {I}(m)\), respectively. Usually, index m is not shown in expressions \(\mathfrak {Q}\), \(\mathfrak {S}\), \(\mathfrak {R}\), \(\mathfrak {M}\), or \(\mathfrak {I}\).

Example 2 shows how to add an instruction to \(\mathfrak {I}\) and how to instantiate new states in \(\mathfrak {Q}\).

Example 2 (Adding New States and Instructions)

Consider a meta instruction \((q, a_1, |\mathfrak {Q}|\) -1, α 1, y 1, J), where \(J = (|\mathfrak {Q}|\) -1, \(a_2,|\mathfrak {Q}|,\alpha _2, y_2)\). After instruction \((q, a_1, |\mathfrak {Q}|\) -1, α 1, y 1) executes, this meta instruction adds a new state \(|\mathfrak {Q}|\) to the states \(\mathfrak {Q}\) and adds instruction J, instantiated with the current value of \(|\mathfrak {Q}|\). For clarity, states are red and alphabet symbols are blue. Set \(\mathfrak {Q} = \{\) 0, 1, 2, 3, 4, 5, 6, 7}. Set A = { #, 0, 1}. An initial configuration is shown below.

State     Tape

5     ##11 01##

Meta instruction ( 5, 0, \(|\mathfrak {Q}|-1\), 1, 0, J) executes with values q =  5, a 1 =  0, α 1 =  1, y 1 = 0, a 2 =  1, α 2 =  #, and y 2 = −1. Note \(J = (|\mathfrak {Q}|\) -1, 1, \(|\mathfrak {Q}|\), #, − 1). Since \(|\mathfrak {Q}| = 8\), instruction ( 5, 0, 7, 1, 0) is executed. Also, standard instruction J =  ( 7, 1, 8, #, − 1) is added as a new instruction. The instantiation of \(|\mathfrak {Q}| = 8\) in J adds state 8; the states are updated to \(\mathfrak {Q} = \{\) 0, 1, 2, 3, 4, 5, 6, 7, 8}. After ( 5, 0, \(|\mathfrak {Q}|-1\), 1, 0, J) executes, the new ex-machine configuration is shown below. State     Tape

7     ##11 11##

Now, the ex-machine is scanning a 1 and lying in state 7, so the standard instruction J =  ( 7, 1, 8, #, − 1) executes. (Note that J was just added to the instructions.) After J executes, the new configuration is shown below. State     Tape

8     ##1 1#1##

Remark 2 (Self-reflection of \(|\mathfrak {Q}|\) )

Consider an ex-machine \(\mathfrak {X}\) with a meta instruction I containing symbol \(|\mathfrak {Q}|\). The instantiation of \(|\mathfrak {Q}|\) invokes self-reflection about \(\mathfrak {X}\)’s current number of states, at the moment when \(\mathfrak {X}\) executes I. This type of self-reflection can be physically realized.

Definition 4 (Simple Meta Instructions)

(q,a, \(|\mathfrak {Q}|\) -d,b,y), (q,a, \(|\mathfrak {Q}|,\) b,y), ( \(|\mathfrak {Q}|\) -c,a,r,y), ( \(|\mathfrak {Q}|\) -c,a, \(|\mathfrak {Q}|\) -d,b,y), or ( \(|\mathfrak {Q}|\) -c,a, \(|\mathfrak {Q}|\) ,b,y) are valid expressions for simple meta instructions, where 0 <  c,d \(\le |\mathfrak {Q}|\). Symbols \(|\mathfrak {Q}|\) -c, \(|\mathfrak {Q}|\) -d, and \(|\mathfrak {Q}|\) instantiate to a state based on the value of \(|\mathfrak {Q}|\) when the simple meta instruction executes.

Herein, ex-machines self-reflect only with symbols \(|\mathfrak {Q}|\) -1 and \(|\mathfrak {Q}|\).

Example 3 (Execution of Simple Meta Instructions.)

A = {0,1,#} and \(\mathfrak {Q} = \{0 \}\). Instructions ( \(|\mathfrak {Q}|\) -1,#, \(|\mathfrak {Q}|\) -1,1,0)  ( \(|\mathfrak {Q}|\) -1,1, \(|\mathfrak {Q}|\) ,0,1)

STATE   TAPE    HEAD    INSTRUCTION     NEW INSTRUCTION

  0     # 1##     0     (0,#,0,1,0)     (0,#,0,1,0) 

  1     #0 ##     1     (0,1,1,0,1)     (0,1,1,0,1) 

  1     #0 1#     1     (1,#,1,1,0)     (1,#,1,1,0) 

  2     #00 #     2     (1,1,2,0,1)     (1,1,2,0,1) 

With an initial blank tape and starting state of 0, four computational steps are shown above. At step 1, \(\mathfrak {X}\) scans # and lies in state 0. Since \(|\mathfrak {Q}| = 1\), a simple meta instruction ( \(|\mathfrak {Q}|\) -1,#, \(|\mathfrak {Q}|\) -1,1,0) instantiates to (0,#,0,1,0) and executes. At step 2, \(\mathfrak {X}\) scans 1 and lies in state 0. Since \(|\mathfrak {Q}| = 1\), ( \(|\mathfrak {Q}|\) -1,1, \(|\mathfrak {Q}|\) ,0,1) instantiates to (0,1,1,0,1), updates \(\mathfrak {Q} = \{0, 1\}\), and executes (0,1,1,0,1).

Definition 5 (Finite Initial Conditions)

Ex-machine \(\mathfrak {X}\) has finite initial conditions if the 4 conditions hold before \(\mathfrak {X}\)’s instructions are executed: (1) The number of states \(|\mathfrak {Q}|\) is finite. (2) The number of alphabet symbols |A| is finite. (3) The number of instructions \(|\mathfrak {I}|\) is finite. (4) The tape is finite.

An ex-machine’s initial conditions are analogous to a differential equation’s boundary value conditions. Remark 3 assures that the ex-machine computation is physically plausible.

Remark 3 (Finite Initial Conditions )

If the machine starts its execution with finite initial conditions, then after the machine has executed l instructions for any positive integer l, the current number of states \(\mathfrak {Q}(l)\) is finite and the current set of instructions \(\mathfrak {I}(l)\) is finite. Also, tape T is still finite, and the number of quantum random measurements obtained is finite.

Proof

The execution of one meta instruction adds at most one new instruction and one new state to \(\mathfrak {Q}\). Using induction, Remark 3 follows from Definitions 1, 2, 3, and 5.

An ex-machine can evolve from a prior computation. Evolution is useful: random and meta instructions can increase an ex-machine’s complexity via self-modification.

Definition 6 (Evolving an Ex-machine)

Let T 0, T 1, T 2T i−1 each be a finite tape. Consider an ex-machine \(\mathfrak {X}_0\) with finite initial conditions. \(\mathfrak {X}_0\) starts executing with tape T 0 and evolves to ex-machine \(\mathfrak {X}_1\) with tape S 1 after the execution halts. Subsequently, \(\mathfrak {X}_1\) starts executing with tape T 1 and evolves to \(\mathfrak {X}_2\) with tape S 2. This means that when ex-machine \(\mathfrak {X}_1\) starts executing on tape T 1, its instructions are preserved after the halt with tape S 1. The ex-machine evolution continues until \(\mathfrak {X}_{i-1}\) starts executing with tape T i−1 and evolves to ex-machine \(\mathfrak {X}_{i}\) with tape S i after the execution halts. One says that the ex-machine \(\mathfrak {X}_0\) evolves to \(\mathfrak {X}_i\) after i halts.

When \(\mathfrak {X}_0\) evolves to \(\mathfrak {X}_1\), then \(\mathfrak {X}_1\) evolves to \(\mathfrak {X}_2\), and so on up to \(\mathfrak {X}_n\), then \(\mathfrak {X}_i\) is an ancestor of \(\mathfrak {X}_j\) if 0 ≤ i < j ≤ n. Similarly, \(\mathfrak {X}_j\) is a descendant of \(\mathfrak {X}_i\) when i < j. The sequence of ex-machines \(\mathfrak {X}_0 \rightarrow \mathfrak {X}_1 \rightarrow \dots \rightarrow \mathfrak {X}_n \dots \) is an evolutionary path.

3 Computing Ex-machine Languages

A class of ex-machines are evolutions of a fundamental ex-machine \(\mathfrak {Z}(x)\), whose 15 instructions are listed in Definition 9. These ex-machines compute languages L that are subsets of {a} = {a \(^n : n \in \mathbb {N} \}\). a n stands for n a’s. The empty string is a 0 and a 3 =  aaa. Set language space Function \(f: \mathbb {N} \rightarrow \{0, 1\}\) defines language L f.

Definition 7 (Language L f)

\(f: \mathbb {N} \rightarrow \{0, 1\}\) induces language L f = {a n : f(n) = 1}. String a n is in L f iff f(n) = 1.

Trivially, L f is a language in \(\mathfrak {L}\). Moreover, these functions f generate all of \(\mathfrak {L}\).

Remark 4 (Language Space)

\(\mathfrak {L}\) .

Definition 8 (\(\mathfrak {X}\) Computes Language L in \(\mathfrak {L}\))

Set alphabet A =  {#, 0, 1, N, Y, a}. Let \(\mathfrak {X}\) be an ex-machine. The language L in \(\mathfrak {L}\) that \(\mathfrak {X}\) computes is defined as follows. A valid initial tape has the form # #a n #. The valid initial tape # ## represents the empty string. After \(\mathfrak {X}\) starts executing with initial tape # #a n #, string a n is in \(\mathfrak {X}\)’s language if \(\mathfrak {X} \) halts with tape #a n # Y#. String a n is not in \(\mathfrak {X}\)’s language if \(\mathfrak {X}\) halts with tape #a n # N#.

The use of special alphabet symbols Y and N—to decide whether a n is in the language—follows [18]. For string # #a m , some \(\mathfrak {X}\) could first halt with #a m # N# and in a second execution could halt with #a m # Y#. The oscillation of halting outputs can continue indefinitely, and \(\mathfrak {X}\)’s language is not well defined per Definition 8. In this chapter, we avoid ex-machines whose halting outputs do not stabilize.

3.1 Ex-machine \(\mathfrak {Z}(x)\)

The purpose of Definition 9 is to show that \(\mathfrak {Z}(x)\) can evolve to compute any language L f in \(\mathfrak {L}\); and that evolutions of \(\mathfrak {Z}(x)\) compute Turing incomputable languages on a set of Lebesgue measure 1 in language space \(\mathfrak {L}\), where \(\mathfrak {L}\) also has measure 1.

Definition 9 (Ex-machine \(\mathfrak {Z}(x)\))

A = {#, 0, 1, N, Y, a}. States \(\mathfrak {Q} = \{\) 0, h, n, y, t, v, w, x, 8} where halting state h= 1 and states n= 2, y= 3, t= 4, v= 5, w= 6, x= 7. The initial state is always 0. For the reader’s benefit, letters represent states instead of explicit numbers. State n indicates NO that the string is not in the language. State y indicates YES that the string is in the language. State x helps generate a new random bit.

With initial state 0 and tape # #aaaa##, an execution instance of \(\mathfrak {Z}(x)\) is below.

This instance of \(\mathfrak {Z}(x)\)’s execution replaces (8,#,x,#,0) with (8,#,y,#,1). Instruction (w,a, \(|\mathfrak {Q}|\) ,a,1,( \(|\mathfrak {Q}|\) -1,a,|Q|,a,1)) replaces (8,a,x,a,0) with new instruction (8,a,9,a,1). Also, the simple meta instruction (|Q|-1,a,x,a,0) temporarily added instructions (9,a,x,a,0), (10,a,x,a,0), and (11,a,x,a,0). These instructions are replaced by (9,a,10,a,1), (10,a, 11,a,1), and (11,a 12,a,1), respectively. Instruction (|Q|-1,#,x,#,0) added (12,#,x,#,0) and instruction (12,#,n,#,1) replaced (12,#,x, #,0). Instructions (9,#,y,#,1), (10,#,n,#,1), (11,#,y,#,1), and (12,a,13,a,1) are added. Five new states 9, 10, 11, 12, and 13 are added to \(\mathfrak {Q}\). After halting, \(\mathfrak {Q} = \{\) 0, h, n, y, t, v, w, x, 8, 9, 10, 11, 12, 13}, and the evolved ex-machine \(\mathfrak {Z}(11010\,x)\) has 24 instructions.

Two different instances of \(\mathfrak {Z}(x)\) can evolve to two different machines and compute distinct languages according to Definition 8. After \(\mathfrak {Z}(x)\) has evolved to a new machine \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\) as a result of a prior execution with input tape # #a m #, then for each i with 0 ≤ i ≤ m, machine \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\) always halts with the same output when presented with input tape # #a i #. \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\)’s halting output stabilizes on all input strings a i where 0 ≤ i ≤ m. Example 4 shows this stabilization property.

Example 4 (Ex-machine \(\mathfrak {Z}(1101\ x)\))

New instructions (8,#,y,#,1), (9,#,y,#,1), and (11,#,y,#,1) help \(\mathfrak {Z}(11010\,x)\) compute that the empty strings a and aaa are in its language, respectively. Similarly, the new instructions (10,#,n,#,1) and (12,#,n,#,1) help \(\mathfrak {Z}(11010\,x)\) compute that aa and aaaa are not in its language, respectively. The 1’s in \(\mathfrak {Z}(11010\,x)\)’s name indicate that the empty strings a and aaa are in its language. The 0’s indicate that strings aa and aaaa are not in its language. Symbol x indicates that \(\mathfrak {Z}(11010\,x)\) has not yet determined for n ≥ 5 whether strings a n are in \(\mathfrak {Z}(11010\,x)\)’s language.

Starting at state 0, \(\mathfrak {Z}(11010\,x)\) computes that the empty string is in its language

STATE      TAPE          HEAD         INSTRUCTION   8        ## ###          1          (0,#,8,#,1)   y        ### ##          2          (8,#,y,#,1)   h        ### Y#          2          (y,#,h,Y,0)

Starting at state 0, \(\mathfrak {Z}(11010\,x)\) computes that string aa is not in its language.

STATE     TAPE           HEAD         INSTRUCTION   8       ## aa###         1          (0,#,8,#,1)   9       ##a a###         2          (8,a,9,a,1)  10       ##aa ###         3          (9,a,10,a,1)   n       ##aa# ##         4          (10,#,n,#,1)   h       ##aa# N#         4          (n,#,h,N,0)

Similarly, starting at state 0, \(\mathfrak {Z}(11010\,x)\) computes that a and aaa are in its language and \(\mathfrak {Z}(11010\,x)\) computes that aaaa is not in its language. For each of these executions, no new states are added and no instructions are added or replaced. Thus, for all subsequent executions, \(\mathfrak {Z}(11010\,x)\) computes that the empty strings a and aaa are in its language, and strings aa and aaaa are not.

Starting at state 0, below is an execution of \(\mathfrak {Z}(11010\,x)\) on input tape # #aaaaaa##.

\(\mathfrak {Z}(11010\,x)\) evolves to \(\mathfrak {Z}(11010\,01\,x)\). The first random instruction (x,a,t,0) measures a 0, so it executes as (x,a,t, 0_r,0). Instruction (13,#,n,#,1) is added due to the random 0 bit; in all subsequent executions of \(\mathfrak {Z}(11010\,01\,x)\), string a 5 is not in \(\mathfrak {Z}(11010\,01\,x)\)’s language. The second random instruction (x,#,x,0) measures a 1 and executes as (x,#,x,1_r,0). Instruction (14,#,y,#,1) is added. In all subsequent executions, string a 6 is in \(\mathfrak {Z}(11010\,01\,x)\)’s language.

Definition 10 specifies \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\) and covers \(\mathfrak {Z}(11010\,x)\)’s execution.

Definition 10 (Ex-machine \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\))

Let \(m \in \mathbb {N}\). Set \(\mathfrak {Q} = \{\) 0, h, n, y, t, v, w, x, 8, 9, 10, … m + 8, m + 9 }. For 0 ≤ i ≤ m, a i is 0 or 1. In \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\)’s instructions, symbol b 8 =  y if a 0 = 1, else b 8 =  n if a 0 = 0; symbol b 9 =  y if a 1 = 1, else b 9 =  n if a 1 = 0; and so on until the second to the last instruction ( m + 8,#, b m+8 ,#,1), b m+8 =  y if a m = 1, else b m+8 =  n if a m = 0.

(8,#, b 8 ,#,1)   (8,a,9,a,1)         (9,#, b 9 ,#,1)     (9,a,10,a,1)

(10,#, b 10 ,#,1)  (10,a,11,a,1) . . .  ( i + 8,#, b i+8 ,#,1)  ( i + 8,a, i + 9,a,1) . . .

( m + 7,#, b m+7 ,#,1)  ( m + 7,a, m + 8,a,1)  ( m + 8,#, b m+8 ,#,1)  ( m + 8,a, m + 9,a,1)

Lemma 1

If i satisfies 0 ≤ i  m, string a i is in \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\) ’s language if a i = 1, and string a i is not in \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\) ’s language if a i = 0. If n > m, it has not yet been determined whether a n is in \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\) ’s language or not in its language.

Proof

When 0 ≤ i ≤ m, the first consequence follows immediately from the definition of a i being in \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\)’s language and from Definition 10. In instruction ( i + 8,#, b i+8 ,#,1) , the state value of b i+8 is y if a i = 1 and b i+8 is n if a i = 0.

For the indeterminacy of strings a n when n > m, \(\mathfrak {Z}(a_0 \dots a_m\,x)\) executes its last instruction ( m + 8,a, m + 9,a,1) when scanning the mth a in a n. For each a to the right of #a m on the tape, \(\mathfrak {Z}(a_0 \dots a_m\,x)\) executes random instruction (x,a,t,0).

If (x,a,t,0) measures 0, then meta instructions (t,0,w,a,0,( \(|\mathfrak {Q}|\) -1,#,n, #,1)) and (w,a, \(|\mathfrak {Q}|\) ,a,1 (\(|\mathfrak {Q}|\) -1,a, \(|\mathfrak {Q}|\) ,a,1)) execute. Otherwise, (x,a,t,0) measures 1, so (t,1,w,a,0,( \(|\mathfrak {Q}|\) -1,#,y,#,1)) and (w,a, \(|\mathfrak {Q}|\) ,a,1, ( \(|\mathfrak {Q}|\) -1,a, \(|\mathfrak {Q}|\) ,a, 1)) execute. If the next alphabet symbol to the right is an a, then a new standard instruction executes, derived from an instantiation of ( \(|\mathfrak {Q}|\) -1,a,x,a,0). When the tape head scans the last a in a n, a new standard instruction executes, derived from ( \(|\mathfrak {Q}|\) -1,#,x,#,0).

For each a to the right of  #a m on the tape, the execution of random instruction (x,a,t,0) determines whether string a m+k, such that 1 ≤ k ≤ n − m, is in \(\mathfrak {Z}(a_0 a_1 \dots a_n\,x)\)’s language. After the execution of ( \(|\mathfrak {Q}|\) -1,#,x,#,0), the tape head is scanning a blank symbol, so the random instruction (x,#,x,0) is executed. If the random source generates 0, the meta instructions (x,0,v,#,0, ( \(|\mathfrak {Q}|\) -1,#,n,#,1)) and (v,#,n,#,1, ( \(|\mathfrak {Q}|\) -1,a, \(|\mathfrak {Q}|\) , a,1)) execute. Then, instruction (n,#,h,N,0) executes last, which indicates that a n is not in \(\mathfrak {Z}(a_0 a_1 \dots a_n\,x)\)’s language. If the execution of (x,#,x,0) measures 1, the instructions (x,1,w,#,0,( \(|\mathfrak {Q}|\) -1,#,y,#,1)) and (w,#,y,#,1,( \(|\mathfrak {Q}|\) -1,a, \(|\mathfrak {Q}|\) ,a,1)) execute. Then, instruction (y,#,h,Y,0) executes last, which indicates that a n is in \(\mathfrak {Z}(a_0 a_1 \dots a_n\,x)\)’s language. During the execution of the instructions, for each a on the tape to the right of #a m, \(\mathfrak {Z}(a_0 a_1 \dots a_m\,x)\) evolves to \(\mathfrak {Z}(a_0 a_1 \dots a_n\,x)\) according to the instructions, specified by Definition 10, where one substitutes n for m.

3.2 Some Turing Incomputable Properties of \(\mathfrak {Z}(x)\)

When the measurements in \(\mathfrak {Z}(x)\)’s two random instructions satisfy both axioms, all 2n finite paths of length n in the infinite binary tree of Fig. 1 are equally likely. The 1-to-1 correspondence between \(f: \mathbb {N} \rightarrow \{0, 1\}\) and an infinite downward path (red) in the binary tree helps show that \(\mathfrak {Z}(x)\) can evolve to compute any language L f in \(\mathfrak {L}\).

Fig. 1
figure 1

Infinite binary tree. A graphical representation of \(\{0, 1\}^{ \mathbb {N}}\)

Consider \(\mathfrak {Z}(x)\) and all \(\mathfrak {Z}(a_0 \dots a_m\,x)\) for each \(m \in \mathbb {N}\) and a 0a m in {0, 1}m+1.

Theorem 1

Each language L f in \(\mathfrak {L}\) can be computed by the evolving sequence of ex-machines \(\mathfrak {Z}(x)\), \(\mathfrak {Z}(f(0)\,x)\), \(\mathfrak {Z}(f(0)f(1)\,x)\), …, \(\mathfrak {Z}(f(0)f(1) \dots f(n)\,x)\), ….

Proof

Apply Definitions 9 and 10 and Lemma 1.

Corollary 1

For any \(f : \mathbb {N} \rightarrow \{0, 1\}\) and any n, the evolving sequence \(\mathfrak {Z}(f(0)\,x)\), \(\dots \mathfrak {Z}(f(0)f(1) \dots f(n) f(n+1)\,x)\), …. computes language L f.

Corollary 2

For each n, the evolution of ex-machines \(\mathfrak {Z}(x)\), \(\mathfrak {Z}(f(0) x)\), \(\mathfrak {Z}(f(0)f(1)\,x)\), …, \(\mathfrak {Z}(f(0)f(1) \dots f(n)\,x)\) have cumulatively used only a finite amount of tape, finite number of states, finite number of instructions, and finite number of instruction executions, and only a finite amount of quantum information is measured by the random instructions.

Proof

Remark 3 and Definitions 5 and 10 imply finite computational resources.

Theorem 2 and Corollary 3 come from the following intuition. A set X is countable if there exists a bijection between X and \(\mathbb {N}\). \(\mathfrak {L}\) is uncountable, so most languages L f in \(\mathfrak {L}\) are Turing incomputable. Since each L f is equally likely of being computed by \(\mathfrak {Z}(x)\), most languages computed by \(\mathfrak {Z}(x)\)’s evolution are Turing incomputable.

For each \(n \in \mathbb {N}\), define language tree \(\mathfrak {L}(a_0 \dots a_n) = \{ L_f : f \in \{0, 1\}^{\mathbb {N}}\) and f(i) = a i for i such that 0 ≤ i ≤ n}. Define subtree \(\mathfrak {S}(a_0 \dots a_n) = \{ f \in \{0, 1\}^{\mathbb {N}}: f(i) = a_i\) such that 0 ≤ i ≤ n}. Let Ψ be this 1-to-1 correspondence: \(\mathfrak {L}\) \({\overset {\varPsi }\leftrightarrow }\) \(\{0, 1\}^{\mathbb {N}}\) and \(\mathfrak {L}(a_0 \dots a_n)~ {\overset {\varPsi }\leftrightarrow }~ \mathfrak {S}(a_0 \dots a_n).\) Since random axioms 1 and 2 hold, each finite path f(0)f(1)…f(n) is equally likely. There are 2n+1 of these paths, so each path has probability 2−(n+1). The uniform probabilities on finite strings of the same length extend to Lebesgue [9, 22] measure μ on probability space \(\{0, 1\}^{\mathbb {N}}\). Subtree \(\mathfrak {S}(a_0 \dots a_n)\) has measure 2−(n+1), where \(\mu \big {(} \mathfrak {S}(a_0 \dots a_n) \big {)} = 2^{-(n+1)}\) and \(\mu (\{0, 1\}^{\mathbb {N}}) = 1\). Via Ψ, μ induces uniform probability measure ν on \(\mathfrak {L}\), where \(\nu \big {(} \mathfrak {L}(a_0 \dots a_n) \big {)} = 2^{-(n+1)}\) and \(\nu ( \mathfrak {L} ) = 1\).

Theorem 2

The Turing incomputable languages L f have measure 1 in \((\nu , \mathfrak {L})\).

Proof

The Turing computable functions \(f: \mathbb {N} \rightarrow \{0, 1\}\) are countable. Via the Ψ correspondence, the Turing computable languages L f have ν-measure 0 in \(\mathfrak {L}\).

Corollary 3

For all a 0a m in {0, 1}m+1, \(\mathfrak {Z}(a_0\)a m x) is not a Turing machine.

Proof

\(\mathfrak {Z}(x)\) can evolve to compute Turing incomputable languages on a set of ν-measure 1 in \(\mathfrak {L}\). \(\mathfrak {Z}(a_0\)a m x) can evolve to compute Turing incomputable languages on a set of ν-measure 2−(m+1) in \(\mathfrak {L}\). Each Turing machine only computes one language, so the measure of all Turing computable languages is 0 in \(\mathfrak {L}\).

4 An Ex-machine Halting Problem

In [23], Turing posed the question, does there exist a Turing machine \(\mathfrak {D}\) that can determine for any given Turing machine M and finite tape T whether M’s execution on tape T eventually halts? Turing proved that no Turing machine could solve this problem. His halting problem can be extended to ex-machines. Does there exist an ex-machine \(\mathfrak {X}(x)\) such that for any given Turing machine M, then \(\mathfrak {X}(x)\) can sometimes compute whether M’s execution on finite initial tape T will eventually halt? In order for this question to be well-posed, the phrase can sometimes compute whether must be defined.

From the universal Turing machine / enumeration theorem [21], there is a Turing computable enumeration \(\mathfrak {E}:\) \(\mathbb {N} \rightarrow \) {Turing machines M} × {Each initial state of  M} of every Turing machine. Similar to ex-machines, for each machine M, the set {Each initial state of  M} is realized as a finite subset {0, …, n − 1} of \(\mathbb {N}\). Since \(\mathfrak {E}(n)\) is an ordered pair, the phrase “Turing machine \(\mathfrak {E}(n)\)” refers to the first coordinate of \(\mathfrak {E}(n)\). The “initial state \(\mathfrak {E}(n)\)” refers to the second coordinate of \(\mathfrak {E}(n)\). Turing’s halting problem is equivalent to the blank-tape halting problem [19]. The blank-tape halting problem translates to: for each Turing machine \(\mathfrak {E}(n)\), does \(\mathfrak {E}(n)\) halt when \(\mathfrak {E}(n)\) begins executing with a blank initial tape and initial state \(\mathfrak {E}(n)\)?

Lemma 1 implies that the same initial ex-machine can evolve to two different ex-machines; these two ex-machines will never compute the same language no matter what descendants they evolve to. For example, \(\mathfrak {Z}(0\) x) and \(\mathfrak {Z}(1\) x) can never compute the same language in \(\mathfrak {L}\). Hence, sometimes means that for each n, there exists an evolution of \(\mathfrak {X}(x)\) to \(\mathfrak {X}(a_0 x)\), then to \(\mathfrak {X}(a_0 a_1 x)\), and so on up to \(\mathfrak {X}(a_0 a_1 \dots a_n\) x) …, where for each i with 0 ≤ i ≤ n, then \(\mathfrak {X}(a_0 a_1 \dots a_n\) x) correctly computes whether Turing machine \(\mathfrak {E}(n)\) halts or does not halt. The word computes means that \(\mathfrak {X}(a_0 a_1 \dots a_i\) x) halts after a finite number of instructions executed, and the halting output written by \(\mathfrak {X}(a_0 a_1 \dots a_i\) x) on the tape indicates whether machine \(\mathfrak {E}(n)\) halts. For example, if the input tape is # #a i #, then enumeration machine \({M}_{\mathfrak {E}}\) writes the representation of \(\mathfrak {E}(i)\) on the tape, and then \(\mathfrak {X}(a_0 a_1 \dots a_m\,x)\) with m ≥ i halts with # Y# written to the right of the representation for machine \(\mathfrak {E}(i)\). Alternatively, \(\mathfrak {X}(a_0 a_1 \dots a_m\,x)\) with m ≥ i halts with # N# written to the right of the representation for machine \(\mathfrak {E}(i)\). The word correctly means that ex-machine \(\mathfrak {X}(a_0 a_1 \dots a_m\,x)\) halts with # Y# written on the tape if machine \(\mathfrak {E}(i)\) halts and ex-machine \(\mathfrak {X}(a_0 a_1 \dots a_m\,x)\) halts with # N# written on the tape if machine \(\mathfrak {E}(i)\) does not halt.

Next, the ex-machine halting problem is transformed so that the results from Sect. 3 can be applied. Choose alphabet \(\mathfrak {A} = \{\) #, 0, 1, a, A, B, M, N, S, X, Y}. As before, identify the set of Turing machine states \(\mathfrak {Q}\) as a finite subset of \(\mathbb {N}\). Let \({M}_{\mathfrak {E}}\) be the Turing machine that computes a Turing computable enumeration Footnote 4as \(\mathfrak {E}_a: \mathbb {N} \rightarrow \{ \mathfrak {A} \}^* \times \mathbb {N}\), where the tape # #a n # represents natural number n. Each \(\mathfrak {E}_a(n)\) is an ordered pair where the first coordinate is the Turing machine and the second coordinate is an initial state chosen from \(\mathfrak {E}_a(n)\)’s states. Define the halting function \(h_{\mathfrak {E}_a}: \mathbb {N} \rightarrow \{0, 1\}\) such that for each n, set \(h_{\mathfrak {E}_a}(n) = 1\), whenever \(\mathfrak {E}_a(n)\) halts. Otherwise, set \(h_{\mathfrak {E}_a}(n) = 0\), if \(\mathfrak {E}_a(n)\) with blank initial tape and initial state \(\mathfrak {E}_a(n)\) does not halt. Function \(h_{\mathfrak {E}_a}(n)\) is well defined because for each \(n \in \mathbb {N}\), with blank initial tape and initial state \(\mathfrak {E}_a(n)\), Turing machine \(\mathfrak {E}_a(n)\) either halts or does not halt. Via function \(h_{\mathfrak {E}_a}(n)\) and Definition 7, define halting language \(L_{h_{\mathfrak {E}_a}}\).

Theorem 3

There exists an evolutionary path for ex-machine \(\mathfrak {Z}(x)\) that computes halting language \(L_{h_{\mathfrak {E}_a}}\) ; namely, \(\mathfrak {Z}(h_{\mathfrak {E}_a}(0)\) x) → \(\mathfrak {Z}(h_{\mathfrak {E}_a}(0)\) \(h_{\mathfrak {E}_a}(1)\) x) → … \(\mathfrak {Z}(h_{\mathfrak {E}_a}(0)\) \(h_{\mathfrak {E}_a}(1)\)\(h_{\mathfrak {E}_a}(m)\) x) …

Proof

Apply the mathematical developments in the previous three paragraphs, using halting function \(h_{\mathfrak {E}_a}\), language \(L_{h_{\mathfrak {E}_a}}\), and Theorem 1.

Theorem 3 implies that a proof by contradiction for Turing’s halting problem does not hold for ex-machines: the existence of path \(\mathfrak {Z}(h_{\mathfrak {E}_a}(0)\) x) → \(\mathfrak {Z}(h_{\mathfrak {E}_a}(0)\) \(h_{\mathfrak {E}_a}(1)\) x) → … \(\mathfrak {Z}(h_{\mathfrak {E}_a}(0)\) \(h_{\mathfrak {E}_a}(1)\)\(h_{\mathfrak {E}_a}(m)\) x) … circumvents the contradiction. From an information-theoretic perspective, almost every (w.r.t. to μ on \(\{0, 1\}^{\mathbb N}\)) evolutionary path \(\mathfrak {Z}(f(0)\) \(x) \rightarrow \mathfrak {Z}(f(0) f(1)\) x) →… \(\mathfrak {Z}(f(0) f(1)\)f(n) x) … avoids the contradiction in Chaitin’s information-theoretic proof [5] that the halting problem for Turing machines is unsolvable. The contradiction depends upon the following: the minimum number of bits needed to represent a Turing machine stays constant. In contrast, there is a set \(\mathfrak {F} \subset \{0, 1\}^{\mathbb {N}}\) with \(\mu (\mathfrak {F}) = 1\) such that for all \(f \in \mathfrak {F}\), the minimum number of bits needed to represent \(\mathfrak {Z}(f(0) f(1) \dots f(n)\) x) increases without bound as n increases.

5 A Research Direction

Theorem 3 and information-theoretic analysis both show that a proof by contradiction of the unsolvability of Turing’s halting problem does not apply to ex-machines. This capability suggests that novel self-modification procedures, cleverly integrated with randomness, should be explored to help enhance theorem proving [2, 6] and constructive type systems that use conservative workarounds [20] to avoid the halting problem.

6 Conclusion

We showed that ex-machines can compute Turing incomputable languages and that ex-machines are not limited by the halting problem for Turing machines. The language computed by an ex-machine reflects its computational capabilities. The problem of determining program correctness for a digital computer program is unsolvable by a Turing machine. The detection of an infinite loop in a computer program (i.e., a case of program correctness) can be reduced to Turing’s halting problem. For these reasons, it is important to understand how far methods of evaluating program correctness for digital computer programs can be extended with randomness and advanced self-modification procedures.