This specification generally relates to different types of computers and computing techniques.
The subject matter discussed in the background section should not be assumed to be prior art merely as a result of its mention in the background section. Similarly, a problem mentioned in the background section or associated with the subject matter of the background section should not be assumed to have been previously recognized in the prior art. The subject matter in the background section merely represents different approaches, which in and of themselves may also be inventions.
Classical Turing machines are well known. However, classical Turing machines rely on a linear tape, and moving to locations beyond the nearest tape positions is time consuming. Consequently, in the prior art, classical Turing machines are thought of as slow machines that are not practical to build. Nonetheless, it can be shown that the operations of any standard register machine may be reduce to that of a Turing machine, and because of the relative mathematical simplicity of computing operations on a classical Turing machine, classical Turing machines are discussed in the prior art primarily on a theoretical basis.
A problem with computers in general is it can be difficult to detect infinite loops. In fact, the undecidability of the Halting Problem suggests that whether or not a program has an infinite loop is not in general predictable a priori. One can make various heuristic tests, such as checking the exit conditions of various loops (of do-while or loop-until clauses) to make sure that it would appear that the loop will eventually exit, and follow certain practices, such as making sure that every loop has an index and every index has a maximum value after which the loop ends, which will reduce the likelihood of inadvertently putting an infinite loop into a program, however, such practices limit the capability of the programs (e.g., perhaps there really is a need to run the loop more time than the self imposed maximum), and are not fool proof.
In conventional computing, a machine runs a computer program, which includes a set of instructions, which does not change while the machine is running. This specification recognizes that the not allowing the computer program to change while the machine is running is constraint that limits the possibilities of what the computer can accomplish. Additionally, increasing the speed at which a computer can perform computations is often desirable.
In the following drawings like reference numbers are used to refer to like elements. Although the following figures depict various examples of the invention, the invention is not limited to the examples depicted in the figures.
Although various embodiments of the invention may have been motivated by various deficiencies with the prior art, which may be discussed or alluded to in one or more places in the specification, the embodiments of the invention do not necessarily address any of these deficiencies. In other words, different embodiments of the invention may address different deficiencies that may be discussed in the specification. Some embodiments may only partially address some deficiencies or just one deficiency that may be discussed in the specification, and some embodiments may not address any of these deficiencies.
A new computing machines and new mathematical concepts and methods of computing, executing and solving heretofore unknown computational problems are presented here. One computing machine, called a Dynamic Register Machine, is applied to hardware and software technology. The new machine and methods enable advances in machine learning, new and more powerful programming languages, and more powerful and flexible compilers and interpreters.
A dynamic register machine is described at the beginning of the specification. Towards the end of the specification, the design of a dynamic register machine program presented is explained. Then, a dynamic register machine program, called the IDYNAMIC REGISTER MACHINE, composed of 1590 dynamic register machine instructions is presented that can determine in a finite number of computational steps whether a given periodic Turing machine has any immortal configurations.
The other sections, describe and demonstrate mathematical concepts and computational methods for addressing the Turing Immortality problem for periodic Turing Machines and other computational problems. The Turing Immortality problem is unable to be solved by Turing machines. Furthermore, current computing machine implementations and software applications have been unable to solve this problem and other computing problems.
The undecidability of the Halting Problem states that it cannot be determined by a Turing Machine whether a Turing machine computation has definitive end, which suggests that one cannot develop a system for determining whether a program has an infinite loop. In this section, a dynamic register machine (DYNAMIC REGISTER MACHINE) is presented. Then in a later section a dynamic register machine program is demonstrated that can perform the following computation: for a periodic Turing machine (Q, A, η) as input, the dynamic register machine program can execute method 8.36 in a finite number of computational steps, and presents a method of finding infinite loop exhibiting a periodicity.
The dynamic register machine 100 is a new computing machine in which the program that is running on the dynamic register machine can change while the machine is executing. While the program is being executing, new instructions may be added to the program and/or instructions may be removed from the program. Dynamic register machine 100 is an enhancement of the register machine (John L. Hennessy and David A. Patterson. Computer Architecture. A Quantitative Approach. Fifth Edition. Elsevier, 2012). By allowing the programs to change mid-execution, the dynamic register machine 100 has fewer constraints on the types of operations that may be performed, which give the programmer more flexibility. Further, the program may become harder to understand, which may be useful in deterring malware and hackers.
Registers 102 are registers used for storing data, which a program running on dynamic register machine 100 operates. For example, if the program is a word processor, such as MS Word® or WordPerfect®, the data may include files that are documents prepared by the program. In an embodiment, registers 102 of the dynamic register machine 100 has a large enough number of registers, such that there are more registers than are needed for executing a program of interest, so that the number of registers is effectively unbounded. In this specification, the registers may be labeled R0, R1, R2, . . . each of which contains a natural number. In an alternative embodiment, some of the registers may contain other symbols. In an embodiment, the formal language for the dynamic register machine is represented as S-expressions: register Rn as (R n). The contents of all of the registers may be represented as a list of natural numbers, for example (17 3 22 5 . . . ), which are the contents of registers R0, R1, R2, R3, . . . , respectively, which may also be written as registers, (R 0), (R 1), (R 2), (R 3), . . . , respectively.
Set of instructions 104 are the basic set of instructions that are native to dynamic register machine 100. For example, set of instructions 104 may be hardwired and/or preprogrammed into the processor of dynamic register machine 104 or hardwired preprogrammed into the dynamic register machine in other ways.
Instructions manipulating data 106 may include those instructions that manipulate the data stored in registers 104. In an embodiment, the instructions can be divided into two categories—the first category is instructions that affect the content of the registers that store data, instructions manipulating data 106, and the second category is instructions that affect the lines of the program, which will be discussed below. A finite sequence of instructions is a dynamic register machine program, which maybe denoted as P. In an embodiment, the formal language for the dynamic register machine is represented as S-expressions: register Rn as (R n).
In an embodiment, there may be a Constant Instruction 108 writes a constant value to one of the registers. For example, Constant Instruction 108 may be represented as (C m v). For each pair of natural numbers m and v, the constant instruction 108 (C m v) stores natural number v in register (R m) i.e. the contents of register Rm=v.
For example, if the contents of the registers are (17 2 671 3 81 95 . . . ), then the instruction (C 1 55) stores 55 in register (R 1). Afterward, the contents of the registers are (17 55 671 3 81 95 . . . ).
Successor instruction 108 adds a 1 to the value of a register. For example, for natural number m, the successor instruction110 (S m) adds 1 to register (R m). For example, if the current state of the registers is (26 0 2 678 12 78 . . . ) then the instruction (S 3) adds 1 to 678 so the register contents afterward are (26 0 2 679 12 78 . . . ).
Transfer instruction 112 performs a copy operation. Transfer instruction 112 reads the value of a first register and writes the value read to a second register. For example, for natural numbers m, n the transfer instruction 100 (T m n) may copy the contents of register (R n) to register (R m), while leaving all other registers unchanged. If the current state of the registers is (17 0 2 679 3 81 . . . ) then the instruction (T 0 4) replaces (R 0) containing 17 with (R 4) which is 3 so the register contents are now (3 0 2 679 3 81 . . . ).
Address instruction 114 is also a copy instruction, but instead of the register being copied a fixed register, the value of the address of the register being copied is effectively a variable. For example, the address instruction stores 114 the destination address in another register. In an embodiment, for natural numbers m, n the address instruction 114 (A m n) copies the contents of register (R (R n)) to register (R m). Thus, if at a first instance of executing (A m n) the value stored register (R n) is 3, the content of register (R 3) is copied to register (R m), if at a first instance of executing (A m n) the value stored register (R n) is 14, the content of register (R 14) is copied to register (R m). All other registers are left unchanged.
If the current state of the registers is (17 0 2 679 3 81 . . . ) then (R 4)=3 and (R (R 4))=679. Thus, instruction (A 5 4) replaces (R 5) containing 81 with 679. After the execution of instruction (A 5 4) the register contents are (17 0 2 679 3 679 . . . ).
Program manipulation 116 are instructions that manipulate a program, thereby changing the manner in which the program runs, even while the program is in the midst of running.
Allowing the program to edit itself allows the program to perform tasks that a Turing machine cannot perform and facilitates machine learning. For instance, the program can experiment with random and/or carefully planned variations of its own code, perform tests, collect data on the performance of the code with the variations to provide metrics, so that the program can gauge whether the change was an improvement or a degradation of the program's performance, and then based on the metrics, reject or accept the change.
For example, similar to the android, Data from StarTrek®, building his own emotion algorithm/chip and then installing that algorithm/chip into himself, while he is still running, a bot programmed for interacting with humans could optically scan facial expressions, sense changes in the human's body temperature, acoustically detect changes heart beat, detect different degrees of perspiration, and/or detect changes in body odor, for example, as the program is interacting with the human. Then based on pattern recognition and/or other criteria, the program could determine whether the human is responding positively or negatively to the tone of voice, volume of the voice, other qualities of the voice, particular wording of the statements, images displayed to the human while the human is interacting with the program, and/or types of output provided to the human.
Based on the human response, the program can then determine whether the program is interacting with the human in a manner that the human finds pleasant, distasteful, humorous, relaxing, and/or stressful, for example. Next, the program could change those aspects and/or variations to attempt to better achieve the desired result as measured by the facial expression of the human.
Jump instruction 118 changes which instruction will execute next. For example, for natural numbers m, n, q, if the contents of register Rm equals the contents of register Rn i.e. (R m)=(R n), then the jump instruction 118 (J m n q) causes the program execution to jump to the instruction stored in (R q) i.e. the contents of register Rq. Otherwise, if (R m)≠(R n) the next instruction following instruction (J m n q) is executed. In the special case where (R q) is beyond the last instruction in program P, then the execution of program P terminates (halts).
Delete instruction 120 deletes the contents of a user-specified number of instructions of a program. Deleting the instructions of a program may simply involve changing a pointer associated with the prior instruction from pointing to the deleted instructions to pointing to a different instruction. For example, delete instruction 120 (D M N) reads the value, v, stored in register (R n), then starting with instruction (R m) delete instruction 114 (D M N) deletes the next v instructions. If the value of (R n), v=0, then no instructions are deleted.
If (R n)+(R m)−1 points to or is beyond the last instruction of the current program P, then the execution of delete instruction 120 (D m n) deletes instruction (R m) and all of the instructions in program P that follow instruction (R m). As a consequence, if the last instruction deleted is the end of the program and if the first instruction deleted precedes, includes, or immediately follows instruction (D m n) the execution of program P will halt, because after executing instruction (D m n) the program attempts to execute the next instruction, but there is no next instruction.
At execution time, the update instruction 122 (U k n q) inserts (R n) instructions at line (R q) into program P. The information determining the type of instructions and the arguments for the instructions are taken from a series of registers, starting with register k according to the following rules:
where [n]={m: m is a natural number and 7 divides m}
In other words, the register (R k) determines the type of instruction to insert, the successive registers are used as the arguments of the instruction. Once the argument of the instruction are all filled, if another instructions needs to be inserted the next register is used to determine the type of the next instruction, and the registers the next successive registers are used as the argument of the second instruction until all of the instructions are filled. The process of determining instructions to insert and retrieving the next argument for the current instruction continues until all of the instructions that need to be inserted have been determined and their arguments filled. The indexes of the program instructions after the instructions inserted need to be incremented by the number of instructions inserted. For example if n the instructions are inserted instruction (P k), the instructions have indexes k+1, k+2, and k+3, and each of the instructions following the last instruction inserted are incremented by the number 3, and (P k+1)old becomes (P k+4)New.
Although in the current embodiment, there are seven types of instructions included in the dynamic register machine, in other embodiments there may be fewer or more type of instructions. However, in another embodiment there may also be instructions that affect both the content of the registers and the content of the program simultaneously in addition to or instead of the instructions that only affect the content of the registers and/or the instructions that only affect the contents of the program.
Program memory 124 may store one or more programs. In an embodiment, when executing a program dynamic register machine 100 inspects program memory 124 to find the program being executed and to find the next instruction in the program being executed.
Although in
In an embodiment, program 126, a dynamic register machine program P, is a finite sequence of instructions such that each instruction in the program is either a Successor, Constant, Transfer, Address, Jump, Update, or Delete instruction. In an embodiment, before the execution of program 126 begins, the value of every register is 0 (or another value indicating that no data is present). In other words, in an embodiment, initially, (R k)=0 for every k.
The instructions in the program P (program 126) may be referenced by the Jump, Update, or Delete instructions in the following way. At the time of the execution of one of the Jump, Update, or Delete instructions, the first instruction in P (program 126) is the 0th instruction denoted as (P 0). In an embodiment, the instructions are each numbered consecutively from (P 0) to (P N). The next instruction after (P 0), if it exists, in P is (P 1). Inductively, the next instruction after (P k), if it exists, is (P k+1).
When the program P (program 126) begins execution, the 0th instruction (P 0) is executed first, if it exists. In an embodiment, if at some execution step program P (program 126) has no instructions, then the dynamic register machine execution of program P (program 126) halts. (It is possible for a Delete instruction to delete the whole program or the initial program P may be empty.)
Inductively, if the kth instruction, (P k), is being executed and it is not a Jump, Update, or Delete instruction, then the next instruction executed is (P k+1). If the instruction (P k+1) does not exist, the dynamic register machine execution of program P halts.
Returning to step 208, if v1=v2, then the instruction proceeds to step 212. In step 212, the reader of the instructions is moved to program instruction (P k). If the program memory is matrix addressed flash memory, for example, the reader of the instruction are the x-y address read circuits (which may apply a sense current or sense voltage to determine the contents of memory locations representing instruction (P k). If the program memory is an optical and/or magnetic disc for example, the read head is moved to the appropriate track(s) having the memory locations where (P k) is stored. Next in step 214, a determination is made whether instruction (P k) exists. If instruction P k) does not exist jump instruction proceeds to step 216, where the program terminates.
Returning to step 214, if instruction (P k) exists, the jump instruction proceeds to step 218, where the jump instruction terminates. Whether termination of the jump instruction occurred in step 210 or 218, after termination of the jump instruction, (or any instruction) the next instruction that reader reads is executed. Steps 214-218 are optional. As a result of reading a location in program memory 124 where there is no instruction, since there is no instruction to execute dynamic execution machine 100 may shut down and/or a timer may be set during which dynamic register machine 100 continues to re-read the instruction (in case there was a read error) and after the time times out, the machine stops attempting to continue to execute the program.
In an embodiment, each of the steps of method 200 is a distinct step. In another embodiment, although depicted as distinct steps in
In an embodiment, if (P k) is being executed and (P k)=(J m n q) then (R m) and (R n) are compared. If (R m)≠(R n) then the next instruction executed, if it exists, is (P k+1). If (P k+1) does not exist, then execution of program P halts.
In an embodiment, if (R m)=(R n) then the next instruction executed, if it exists, is (P (R q)). In other words, instruction (P j) is executed where j=(R q). If (P j) does not exist, then execution of program P halts.
Before presenting the rules that describe the execution of the Delete and Update instructions, in an embodiment, the deletion and insertion of instructions is that execution of the program P behaves like and/or may be stored in a linked list of instructions. Each time an instructions is deleted or changes the program P changes (which is the linked list). In an embodiment, if one or more instructions are deleted from the linked list Pold, then the instruction executed next is the one that immediately follows—in the sense of the new linked list Pnew—the previous instruction (D m n)=(Pold k) executed in the program Pold. If one or more instructions are inserted into the linked list Pold, then the instruction executed next is the one that immediately follows in the new linked list Pnew. The previous instruction (U m n q)=(Pold k) that was executed, executed in the old linked list Pold.
Below, an example of a dynamic register machine is presented first that illustrates the linked list behavior of the Delete and Update instructions. Then the formal rules are presented for determining the next instruction that is executed after a Delete or Update instruction.
Example of Dynamic Register Machine Program with Update, Delete Instructions
The above program begins execution with the instruction (P 0) which is (C 0 2). The third column headed by Program Comments describes the results of executing that instruction. After instruction (T 6 5), executes, the contents of the registers is (2 0 4 0 0 2 2 0 0 . . . ). Before instruction (A 7 5) executes, (R 5)=2 and (R 2)=4. Thus, the execution of (A 7 5) sets (R 7)=4. After instruction (A 7 5) executes, the contents of the registers are (2 0 4 0 0 2 2 4 0 0 . . . ).
After instruction (C 3 9) executes, the contents of the registers are (2 0 4 9 0 2 2 4 3 0 0 . . . ). Thus, when the instruction (U 5 0 5) executes (R 5)=2, (R 0)=2, (R 6)=2, (R 7)=4, and (R 8)=3 Thus, two instructions are inserted at (P 2) where they are determined starting at register 5. Since (R 5)=2, the first inserted instruction is a transfer instruction, as indicted by the table of equivalence classes. The arguments for the transfer instruction are indicated by the next two registers, which are (R 6) and (R 7).
Since (R 6)=2 and (R 7)=4 the first inserted instruction is (T 2 4). Since register 7 completes the first inserted instruction, the next register (R 8) determines the type of the next instruction. Since (R 8)=3, looking up 3 in the table of equivalence classes, the second inserted instruction is an address instruction, which requires two arguments. Consequently, the next two resisters, (R 9) and (R 10), are used to determine the arguments of the instruction. Consequently, the second inserted instruction is (A 0 0), because (R 9)=(R 10)=0. Thus instructions (T 2 4) and (A 0 0) are inserted. The insertions are performed without overwriting any instruction, thereby increasing the length of the program by two instructions.
After instruction (U 5 0 5) has executed, the next instruction executed is (J 2 5 2). The table on the following page shows program P before it executes instruction (J 2 5 2) and after it has been updated by the execution of instruction (U 5 0 5):
When instruction (J 2 5 2) is executed, 4=(R 2)≠(R 5)=2 so the next instruction executed is (D 3 2). Since (R 2)=4 and (R 3)=9, four instructions are deleted from program P starting at instruction (P 9). As a result, instructions (C 3 9), (U 5 0 5), (J 2 5 2), and (D 3 2) are deleted from program P and the current program is shown in the following table after (D 3 2) is executed:
The next instruction executed is (C 0 17). After instruction (S 0) is executed, there are no more instructions that follow (S 0), so the program execution halts. The final program is the same as in the previous table. When the program execution halts, the content of the registers is (18 0 4 9 0 2 2 4 3 0 . . . ).
If (Pold k) is being executed and (Pold k)=(D m n), then there are three cases for determining the next instruction that is executed. To define the three cases, it is first determined whether the execution of the delete command deletes itself—the kth instruction from Pold. The formal conditions for this to be true is that (R m)≦k<(R m)+(R n). If this condition is true, then CASE A shown below determines the next instruction that is executed.
CASE A. (R m)≦k<(R m)+(R n). After the deletion of the (R n) instruction(s) from program Pold starting at instruction (R m) in program Pold, the new program is Pnew, and the next instruction executed is (Pnew (R m)).
CASE B. k<(R m). The next instruction executed is (Pnew k+1). In other words, since k is an instruction that occurs earlier in the program than the first instructions deleted, (R m), the next instruction is the k+1 instruction, which would have been the next instruction in Pold also. Additionally, since the instructions deleted occur after the kth instruction, the index value numbering the kth instruction has not changed, and remains k, and consequently the next instruction executed has index k+1.
CASE C. (R m)+(R n)≦k. The next instruction executed is (Pnew k+1−(R n)). In other words, in Case C, the instructions deleted are instructions that precede the kth instruction. Although the next instruction has not changed (and is the same in both Pnew and Pold), the index of the next instruction has changed, because there are fewer instruction in the program. Since after renumbering the instructions so that the instructions are consecutively numbered and since the instructions deleted preceded the kth instruction, the index of the kth instruction is decreased by the number of instructions deleted. Since the number of instructions deleted is (R n), the decrement in the kth index is (R n), and consequently next instruction now has the index value k+1−(R n).
Returning to step 306, if v1 is greater than 0, the method proceeds to step 310. Next, in step 310, an index i is set equal to k, where k is the parameter of the update instructions that indicates where to insert the new instructions in the program. The index i is used to keep track of the registers from which the information to determine the details of the instruction are stored (in another embodiment, there may be an offset between k and i or the value of is may be determined in a different manner as a result of the information being stored in different registers).
The parameter k is also used as an index of the instructions being added. A parameter kmax is also set equal to k+v1. The parameter indicates what the value of k will be after the last instruction is inserted. As part of step 310, each of the original program instructions, starting with instruction (P k) have their index values incremented be v1+1, so that instruction (P k) become new instruction (P k+v1+1), thereby making room for the new v1 instructions that are about to be inserted.
In step 312, the value v2, stored in the register (R i), is read. The value v2 indicates the type of instructions the first added instruction will be. In step 314 a determination is made whether the value v1 is greater than 7. If v2 is greater than or equal to 7, method 300 proceeds to step 316, where v2 is divided by 7. After step 314, the method returns to step 312. In another embodiment, if v2 is greater than or equal to 7, the program terminates and optionally produces an error message, because it is assumed that v2 being greater than or equal to 7 is a result of a programming error.
In step 312, if v2 is less then 7, then the method proceeds to step 318. In step 318, the type of instruction is determined based on the value of v2. Step 312 may involve performing a lookup in a lookup table for example or performing a series of decisions to determine which function the value v2 corresponds to.
In step 320, based on the type of instruction determined in step 318, the number of arguments, v3, needed of the instruction are determined. Step 320 may also involve performing a lookup in a lookup table that indicates the number of arguments each instruction requires or performing a series of decisions to determine the number of the argument based on the type of function. Step 320 is optional, because the same lookup or series of decisions used to determine the type of function may also be used to supply the number of argument as the same time.
In step 322, an index j is set to 1. The index j keeps track whether all of the argument for the current function being added have been determined. In step 324, register (R i+j) is read, and the value read is used as the jth parameter of the function (the first time through the current loop the value read is used as the first parameter of the function. Next in step 326 a determination is made whether j is greater than or equal to v3. If j is not greater than or equal to v3 then there are more arguments to the current function that need values, so method 300 proceeds to step 328, where j is incremented by 1, and steps 324 and 326 are repeated.
If in step 326, j is equal or greater than v3, then all of the arguments of the current function have been determined, each one read from the next register, and so method 300 proceeds to step 330. In step 330, the new instruction is inserted just after position (P k−1), so that the new instruction is (P k). In step 332, a determination is made as to whether k is greater than or equal to kmax. If k is greater than or equal to kmax, the update instruction proceeds to step 334 where the update instruction terminates, because all of the instructions indicated by the update instruction were inserted.
Returning to step 332, if k is less then kmax, then there are more functions to insert. Consequently, the method proceeds to step 336, increments k by 1, so that the next program instruction is inserted in the k+1 position and index I is incremented by v3, so that the next register to read is after the last register containing an argument of the last function. After step 336, method 300 returns to step 312 to determine the type of the next function to insert, and steps 312 to 336 are repeated until k=kmax and the update instruction terminates at step 334. After step method 300 terminates, the next instruction, just after the last instruction inserted, is performed (if there is any such instruction).
There are many other ways of performing the insert instruction. For examples, the registers where the information about the program instructions to be inserted could be located and therefore labeled differently, which would change the indexes used during method 300. Alternatively, no indexes needs to necessarily be set, by a series of decisions (e.g., if statements) could be performed to accomplish the same thing. Also, the program could be left untouched until after the all of the information for each of the functions is determined and then old program steps could be relabeled and the new functions could be inserted all at once.
In an embodiment, each of the steps of method 300 is a distinct step. In another embodiment, although depicted as distinct steps in
If (Pold k) is being executed and (Pold k)=(U m n q), then there are three cases for determining the next instruction that is executed. To define the three cases, before (U m n q) is executed, consider the instruction (Pold k+1) the instruction that immediately follows (Pold k) in program Pold right before the instructions are inserted.
CASE A. (R q)≦k. After the (R n) instructions are inserted into program Pold at location (R q), then instruction (Pold k+1) now in Pnew is executed next. In other words, the next instruction executed is (Pnew k+1+(R n)).
CASE B. (R q)=k. After the (R n) instructions are inserted into program Pold at location (R q), then the first instruction inserted is executed next.
CASE C. (R q)>k. After the (R n) instructions are inserted into program Pold at location (R q), then instruction (Pold k+1) is executed next. In other words, the next instruction executed is (Pnew k+1).
In other embodiments, other instructions sets may be used instead o the above seven instructions. In the above embodiment, the reason why there are seven instructions is it can be shown that with just three basic instructions any type of manipulation of the content can be achieved. In the interest of keeping the instruction set small, there are only three instructions that are included in the instructions for manipulating the lines of the program. Similarly, in the interest of keeping the instruction set small, there are only four instructions for manipulating the contents of the registers. Of the four instructions, the successor instruction is optional, and could be built from the other instructions. However, since the successor instruction is so useful, in this embodiment, the addition instruction is provided in the basic instruction set rather than requiring the user to build the addition instruction from the other instructions.
Although the dynamic register machine 100 has many other uses, as just one example of the use of the dynamic register machine 100, in this specification it is shown, among other things, how to use the dynamic register machine 100 to find infinite loops. However, before proceeding further a discussion of Turing machines is useful.
Turing machine 400 is an example of one type of Turing machine that may be used with inventive methods of this specification. Other Turing machine may also be used. Head 402 reads and writes data to the data memory. In one embodiment head 402 may be a read-write head that reads and writes data to the data memory. In other embodiments, head 402 may be replaced with other mechanisms for reading memory, such as sensors that measure the change in resistance, capacitance, opacity, index of refraction, birefringence, and/or other properties in response to a current, heat, light, electric field, and/or magnetic field for example.
Data memory 404 may store data that is operated upon by a program. In an embodiment, data memory 404 is a magnetic tape. In other embodiments, the magnetic tape may be replaced with an optical drive, magnetic drive, flash drive, RAM and/or any other type of memory. In this specification, although the terms “tape” and “head” may be used, any other type of memory and mechanism for reading the memory may be substituted anywhere where the terms tape and head are used to obtain different embodiments.
Real 406a and real 406b are optional, and are not necessary in embodiments in which data memory 404 is not a tape. In an embodiment in which data memory 404 is a tape, real 406a holds one end of the tape and real 406b holds another end of the tape. Controller 408a and controller 408b control the portion of memory that is currently being read. In an embodiment in which data memory 404 is tape, controller 408a and controller 408b are motors that control the position of the tape.
Control line 410a sends control signals from a processor to controller 408a, and control line 410b sends control signals from a processor to controller 408b. Data line 411 carries signals from the head 402 to the processor. Processor 412 processes signals from the head 402 reading memory determines whether to send a signal to the head to write and determines whether to send a signal to controllers 480a and/or 408b to positions the head 402 at a different memory location. In the embodiment in which data memory 404 is tape, processor 412 sends signals to controller 408a and 408b to move the tape.
Cache 414 is an onboard memory within processor 412, which stores information that is needed frequently for performing tasks. Cache 414 may be accessed by processor 412 faster than other forms of memory. By storing information in cache 414, tasks requirement that information may be performed faster. State 416 is the state of the machine, which may be a single symbol. In an embodiment state 416 is store in cache 414. In other embodiments, state 414 is stored elsewhere. Program memory 418 stores a program that is currently running Program memory 418 may be RAM and/or flash memory for example, so that the program may be accessed quickly. In an embodiment when the program is not running the program is stored elsewhere.
Instructions 420 are machine instructions (e.g., a computer program), which determine how processor 412 behaves. Processor 412 reads data from data memory 404, and then uses that data as input to instructions 420. Processor 412 computes an output, based on the instructions of instructions 420 (and the input data), and then based on the output computed sends signals to controllers 408a and 408b to change the position in memory being read and/or sends signals to head 402 to read and write data from/to data memory 404. In an embodiment, instructions 420 include a table in which processor looks up a row and column determined by the current state and the symbol at the current memory position, and in response writes data to data memory 404 and changes the current memory position (e.g., by moving the head right or left on the tape).
In general, throughout this specification, it should be understood that since the behavior of any register machine computer can be duplicated with a Turing machine, the same remarks made about Turing machines, the Turing machine table, the state of the machine, the tape, and the head apply equally to a register machine computer with a program, no matter the programming language, no matter the means for tracking the appropriate behavior for a given set of input, no matter the type of data memory (matrix addressed memory, flash memory, Random Access Memory, harddrives, etc.), no matter the type of mechanism for reading and writing to the data memory, respectively.
More formally, a Turing machine may be represented as a triple (Q, A, η) where
In a classical Turing machine, the function η is the Turing machine's lookup table. The η function acts as the program for the Turing machine in the following manner. For each q in Q and α in A, the expression η (q, α)=(r, β, x) describes how machine (Q, A, η) executes one computational step. When in state q and scanning alphabet symbol α on the tape:
Turing Machine Tape
In an embodiment of Turing machine 400 that uses a tape, tape 500 is an example of the tape. Tape 500 includes tape positions 502a and 502b, which are illustrated as squares. There are several other tape positions represented on the tape, (which are not labeled with numerical labels). Each square contains a symbol. The symbol in tape position 502a is represented by a1 and the symbol in tape position 502b is represented by a2. Other symbols are also shown in other tape positions. After reading a tape symbol, the Truing machine writes a new symbol (which may be the same as the current symbol) and then moves right or left with respect to the tape to process the next tape position.
More formally, the Turing machine tape T is represented as a function T: Z→A where Z denotes the integers. The tape T is M-bounded if there exists a bound M>0 such that for T(k)=#, where a1=#, whenever |k|>M. The symbol on the kth square of the tape is denoted as Tk. The symbol # may be associated with a blank space on the tape. The integers Z of the tape numerically label positions on the tape. The tape is bounded if at a certain point on the tape, there are no symbols, and there are only blanks (or some other character that may be used to represent no data).
In an embodiment, the blank is a symbol that is different than the halt symbol, and the Turing machine table includes square defining how to respond to reading a blank for different states of the machine. In another embodiment, the same symbol that is used to represent no data (e.g., a blank or a #) may also be used to represent a halt, because when the machine reads the no data symbol, the program terminates.
Turing machine table 600 is the program of the Turing machine. Columns 602a, 602b, . . . , are labeled according to the input states, which is the current state of the machine prior to processing the symbol on the tape. Rows 604a, 604b, . . . , are labeled according to the input symbols, which are read from the tape. Squares 606aa, 606ab, . . . , 606ba, . . . , contain the output of the Turing machine program. When a particular symbol is read and the current state of the machine is input, the state and the symbol act as coordinates to identify one of squares 606aa, 606ab, . . . , 606ba, . . . . For example, square 608aa is retrieved in response to receiving the input symbol a1 and input state q1.
As an example of the information in each square, symbol 608a is the output symbol of a particular square, which is written to the tape. State 608b is the new state of the machine after processing the input symbol that was read on the tape. Direction 608c is the direction to move the head, which in the case of a tape would be right to left (but more generally may be an Indication of a new location to read the next symbol).
Putting together the above description of a Turing machine, the classical Turing machine mechanically operates on a tape. On the tape are symbols, which the machine can read and write, one at a time, using a tape head. An operation is fully determined by a finite set of elementary instructions. In other words, the tape is divided into cells, one next to the other. Each cell contains a symbol from a finite alphabet. The alphabet contains a special blank symbol (which may be written as a ‘0’) and one or more other symbols.
The tape is assumed to be so long that the tape is essentially arbitrarily extendable to the left and to the right. In other words, the tape is so long that, the Turing machine essentially always has as much tape as the machine needs for the computations of the program being executed. Cells that have not been written before are assumed to be filled with the blank symbol. In a physical Turing machine, the user may run the program and if the machine runs out of tape stop the machine replace the tape with a larger tape and rerun the program from the start with the larger tape.
The head can read and write symbols on the tape and move the tape left and right one (and only one) cell at a time. In some models the head moves and the tape is stationary. A state register that stores the state of the Turing machine. The state of the machine is one of finitely many states, which may be represented by symbols. The Turing Machine is provided with a finite table[4] of instructions. The table may be arranged in rows and columns. There may be one row for each possible symbol on the tape and one column for each state of the tape.
Alternatively there may be one row for each possible state and one column for each possible symbol. Each combination of one of the possible symbols and one of the possible states of the machine determines which square in the table is selected. Each square includes (1) a symbol to write to the tape, (2) an indication of a direction in which to move the head (one step to the left or one step to the right), and (3) the state to which the state of the machine should be updated.
Given the state(qi) the machine is currently in and the symbol(aj) the machine is reading on the tape (symbol currently under the head), the table indicates to the machine to do the following in set of steps (1) write a new symbol to the tape (based on the table entry for the particular combination of the current state the symbol on the table that was read), thereby replacing the symbol just read, (2) move the head one step to the left or one step to the right (based on the table entry for the particular combination of the state at the time of just reading the tape and the symbol on tape that was just read), and (3) Update the state of the machine (based on the table entry for the particular combination of the state at the time of just reading the tape and the symbol on tape that was just read). However, if the halting state is encountered, the Turing machine stops, and the Turing machine has finished executing the combination of the symbols on the tape and the table.
The Turing machine may include a register for storing the state of the machine and a servo drive for moving the head or the tape and may include a processor for that decodes the signals from the head when reading the tape, reads the state of the machine form the register, performs the look up on the table based on the symbol read and the state of the machine, sends signals to the head to write the new symbol of the tape (based on the table), send a signal to the register to change the state, and send signals to the servo drive to advance the tape or head.
For example, referring to the table
It should be understood, that although the following extensions may be referred to as “Turing machines” in this specification, the following extension are not a classical Turing machine. In an embodiment, the Turing machine may be simulated on a modern computer, which would have one region of the memory that represents the tape, one region of memory that stores the state of the system, one region in memory that stores the table.
In an embodiment, rather than the table just including an indication of whether to move right or left, the table may include an indication of the next memory cell to move to, and the tape may be replaced with a matrix of memory cells. The indication of where to move to may be provide as an address of the new memory cell to move to or as a direction (e.g., right, left, up, down) to move and the distance of the number of memory cells to move.
In an embodiment, as will be discussed below in further detail, the table is replaced with a collection of execution node pairs. Each execution node pair includes one input node and one output node, which are associated with one another as input and output. Optionally a point may connect the input and output nodes of the input-output pair. As another alternative the input node may include a memory address and/or another indicator as to where to find the output node. The machine may include a memory having one section that represents the tape, one section that represents the state of the machine, and another section in which the collection of execution node pairs are stored. Optionally, the input node and output node may be physically or logically juxtaposed with the memory of the machine. The machine reads symbols on the tape or other memory, and then finds the input node that contains the combination of symbols read and the current state of the machine.
Based on (e.g., as directed by) the input node, the machine next reads output node that corresponds to the input node. The output node includes a series of symbols of one or more symbols to write to the tape, a new state of the machine to which the current state is updated, and then a new location to move to on the tape or to move to within the memory storing the symbols. In an embodiment, there is a one to relationship between Input execution nodes and output execution nodes—each input execution node is associated with one and only one output execution node, and each output execution node is associated with one and only one input execution node. In an alternative embodiment, there may be some input execution nodes that share a common output execution node, and the common output node may be one memory location.
In an embodiment, the Turing machine is implemented on an active element machine, which is discussed below. In an embodiment, the Turing machine is simulated by a dynamic register machine, such as that of
An affine transformation is combination of rotation, while optionally scaling the coordinates, plus a translation. An affine transformation between one pair of coordinates and another pair of coordinates can be represented as a multiplications by a square matrix plus the addition of a column matrix (or row matrix, depending on the type of matrices involved). The matrix multiplication accomplishes the rotation and the scaling of the coordinates and the addition can be viewed as a translation of the coordinates.
Any transformation from one pair of coordinates to another pair of coordinates can be replaced by an affine transformation. As will be discussed, the significance of an affine transformation is that any square in the lookup table of a classical Turing machine can be replaced by a transformation from a first pair of coordinates (the current symbols on the tape and the current state of the machine) to a new pair of coordinates (the new symbol being written to the tape and the new state to which the state of the machine is updated). Additionally, although a single affine transformation, cannot necessarily replace all of the table entries of a table with more than six entries, a single transformation can in principle represent an infinite number of table entries of a classical Turing machine.
Each affine transformation may be represented as one or more execution node pairs, where the input nodes are the input to the affine transformation and each of the output nodes is the output of the transformation that corresponds to the input node having the input coordinates that result in the output coordinates of the transformation. Additionally, affine operations are a bit more flexible than the lookup table of a classical Turing table, because from a practical stand point, the collection of possible symbols and states cannot have a continuum of values, but affine transformations can accomplish the same thing as if there were a lookup table having a continuum of acceptable values for the symbols and/or the states of the machine, which in some situations, such as for the manipulation of a continuum of real numbers, may make the use of affine transformations more convenient than a classical Turing machine lookup table. An extensive discussion of Affine maps appears in parent application, U.S. application Ser. No. 12/499,749 (Docket # BP-2), entitled “Executing Machine Instructions Comprising Input/Output Pairs of Execution Node,” filed Sep. 14, 2009, by Michael Stephen Fiske, which is incorporated herein by reference.
Consider configuration (p, 2, . . . ##αβ## . . . ). The first coordinate indicates that the Turing machine is in state p. The second coordinate indicates that its tape head is currently scanning tape square 2, denoted as T2 or T(2). The third coordinate indicates that tape square 1 contains symbol α, tape square 2 contains symbol β, and all other tape squares contain the # symbol.
An example of a Turing Machine Halt Configuration being represented as natural numbers, a second example of a configuration is (1, 6, . . . 1111233111 . . . ). This configuration is a halted configuration. The first coordinate indicates that the machine is in halt state 1. The second coordinate indicates that the tape head is scanning tape square 6. The underlined 2 in the third coordinate indicates that the tape head is currently scanning a 2. In other words, T(6)=2, T(7)=3, T(8)=3, and T(k)=1 when k<6 OR k>8.
Given Turing machine (Q, A, η) with configuration (q, k, T) such that T(k)=α. After the execution of one computational step, the new configuration is one of the three cases such that for all three cases Tnew(k)=β and Tnew(j)=T(j) whenever j≠k:
In other words, after executing the operations dictated by the table as a result of reading the symbol at position k, after replacing the symbol read with the symbol indicated by the table, since the tape positions are labeled consecutively, the head is in the position one space to the left of k, which may be labeled k−1, which in the case of moving the head left is Tnew, one space to the right of k which may be labeled k+1, which in the case of moving the head left is Tnew, or still at space k, in the halt state (alternatively the labeling the tape positions could be in the other direction and the left position could be k+1 and right position could be k−1).
If Turing machine (Q, A, η) with initial configuration (s, k, T) reaches the halt state h after a finite number of execution steps, then the machine execution halts. Otherwise, it is said that the machine execution is immortal on initial configuration (s, k, T), meaning that it will never stop running unless the Turing machine is shut off (e.g., the Turing machine is in an infinite loop).
The program length is the number of elements in the domain of η The program length is denoted as |η|. Observe that |η|=|Q×A|=|Q∥A|. In [TURING] and [DAVIS], omit quintuples (q, a, r, b, x) are omitted when r is the halting state. In the representation shown here, η(q, a)=(1, b, x) or n(q, a)=(h, b, x).
If alphabet A={a}, then the halting behavior of the Turing machine is completely determined in |Q|+1 or less execution steps. In other words, if the behavior of the machine is completely determined after executing a number of steps that is equal to or less than the number of states plus 1. That is, within |Q|+1 steps of the program, the program will either terminate on a halt, or return to an earlier configuration and start repeating the same set of steps over again (because the machine is in an infinite loop).
For example, suppose the Turing machine has states Q={q1, q2, qκ} and only the symbol a. Observe that the program length is |η|=|Q|. Also, after an execution step every tape symbol on the tape must be a. Consider the possible execution steps: η(qS(1), a)→η(qS(2), a)→η(qS(3), a) . . . →η(qS(K+1), a), where qs(k), is the state prior to performing step k. The state, qs(k) and the symbol a (the only possible symbol other than a blank tape) or the inputs to the table. Since there are only |Q| different states and one symbol, the program can only exhibit |Q| different types of behaviors or take |Q| distinctly different actions.
If the program execution does not halt in these |Q|+1 steps (that is after taking all |Q| distinctly different actions) and does not run out of tape having symbols, then S(i)=S(j) for some i≠j; and the tape contents are still all a's, and the Turing machine started repeating the same sequence of steps over again. Thus, the program will exhibit periodic behavior whereby the program will execute η(qS(i), a)→ . . . η(qS(j), a) indefinitely. If the program does not halt in |Q|+1 execution steps, then the program will never halt.
Since a Turing machine with only one symbol has the simple property of either halting within in |Q|+1 execution steps or never halts, then the program will never halt, from now on, it is assumed that the number of symbols is |A|≧2. Further, since at least one state is needed, then from here on, it is assumed that the base B≧3.
With respect to Turing machine (Q, A, η), the two configurations (q, k, T) and (q, j, V) are translation equivalent if T(m)=V(m+j−k) for every integer m (the translational equivalence may also be used for the trivial case in which j=k and j−k=0). Thus, if a composition of a sequence of functions has a fixed point, or after series of instructions, one arrives at the same state and tape pattern is the same as it was previously when in that state except that the tape pattern has been translated to a different position on the tape, the point arrived at is an immortal point.
Different notations are introduced that represent a point corresponding to a Turing machine configuration. The coordinates of the point are not dependent on the integer value of the tape head with respect to the tape. For this reason, in these different notations, the position of the tape head is located without indicating the integer value of the tape head.
The expression p=[3, w12v] represents point p where the current state of the machine is 3; the tape head points to a tape square containing a 1; the tape square adjacent to the right of the tape head contains a 2; the remainder of the tape squares to the right of this 2 are represented by a variable v which may represent an arbitrary sequence of alphabet symbols on the right side of the tape; and the remainder of the tape squares to the left of the tape head are represented by a variable w which may represent an arbitrary sequence of alphabet symbols on the left side of the tape.
To express the configuration at a computational step, 3 1111222 represents that the machine is in state 3, the tape head is located at the underlined 1 and there are 2's to the right of the tape head and 1's to the left of the tape head. If a sequence of symbols is overlined then that means the remainder of the tape squares contain that periodic pattern. For example, p=[3,
The following examples demonstrate simple immortal periodic points.
The immortal point is non-hyperbolic. Specifically, if the machine starts its execution at point p, then the minimal number of computational steps, denoted C(p), for the machine to return to point p is called the computational period of p. One can define the hyperbolic degree of an immortal point as m(p)=|R|−|L| and the periodic degree of the immortal point as C(p)=|R|+|L|, where if p is an immortal periodic point with computational period C(p), then C(p)=|R|+|L| where |R| denotes the number of right tape head moves during these C(p) computational steps and |L| denotes the number of left tape head moves during these C(p) computational steps (a more formal statement of the terms computational period and hyperbolic degree appear below after the introduction of some new notation and the discussion of some examples).
The tape head moves for this non-hyperbolic immortal periodic point are {RLRL}n. All points p=[3, w22v] are non-hyperbolic immortal periodic points with period C=4. Program 1034 does not have any hyperbolic immortal periodic points.
The tape head moves for this immortal periodic point are {RLLRR}n where n is a positive integer. Point p=[3,
1
The point p=[2,
EXAMPLE a machine having Q={q, r, s, t, u, v, w, x} and symbols A={1, 2} and halting state=h. left pattern=12, spanning middle pattern=121 2212, right pattern=212, and table
Below are the machine execution steps with tape head initially at tape square 1. Tape head location is indicated by underline.
1
2
1
2
2
2
2
2
1
The tape head moves are {R6 LR}n. The point p=[q,
Computational Period Suppose the Turing machine (Q, A, η) has an immortal periodic point p. If the machine starts its execution at point p, then the minimal number of computational steps, denoted C(p), for the machine to return to point p is called the computational period of p. Observe that the computational period C(p) is the same number as the period of p with respect to the corresponding affine maps ƒk: Wk→P where 1≦k≦I and Wk is an element on the tape.
Suppose alphabet A={a1, a2, a3 . . . , an}. A k-sequence is a sequence of k symbols denoted as s1 s2 s3 . . . sk where each sj lies in A.
The two tape sequences TjTj+1 . . . Tm and TkTk+1 . . . Tn are identical if they are the same length (i.e. n−k=m−j) and Tk+1=Tj+1 for each i satisfying 1≦i≦n−k, because although k is not equal to j, there must exist some number l, such that Tk+1=Tj, for all j and k of the two tape sequences, and l would be the number of tape positions between the Tk=Tj.
Consider the set of symbols A={0, 1} and the sequence of symbols on the tape of 000 001 010 011 100 101 110 111 a1a2a3, where a1a2a3 are the next three symbols on the tape after the symbols 111. Since the first eight strings of three symbols lists all of the possible combinations of 0's and 1's that can appear in a string of three symbols, a1a2a3 must repeat one of the previous 3-sequences. In a sequence of length equal to |A|3+3 at least one 3-sequence is repeated.
In any sequence of length |A|2+2, two distinct overlapping 2-sequences are repeated. Consider the set of symbols A={0, 1}, |A|2+2=22+2=6, and consequently in any sequence two overlapping sequence will appear by the sixth element of the sequence or earlier, as in the sequences below.
Distinct overlapping n-sequences that are subsequences of any sequence of length L=|A|n+n implies that at least two subsequences are identical.
Any Turing tape sequence of length L=|Q∥A|n+n has at least one n-sequence that occurs |Q|+1 times. In other words, the tape sequence has |Q|+1 distinct, non-overlapping subsequences. If machine (Q, A, η) has an immortal configuration, then it has an immortal periodic point
Additionally, one can construct matrices that match an initial state, initial head position, and the symbols located on a portion of the current track (each symbol being in a different tape square) as an input with a final set of symbols on an output tape (each symbol being in a different tape square), head position, and direction to move the head (e.g., in an n×m matrix, where n is the number of track positions of the input plus the state and the head position, and m is the number of track positions in the output plus the state, head positions, and optionally plus the direction of movement of the head).
Additionally, one can construct matrices that match an initial state, initial head position, and the symbols located on a portion of the current track (each symbol being in a different tape square) as an input with a final set of symbols on an output tape (each symbol being in a different tape square), head position, and direction to move the head (e.g., in an n×m matrix, where n is the number of track positions of the input plus the state and the head position, and m is the number of track positions in the output plus the state, head positions, and optionally plus the direction of movement of the head).
The notion of an overlap match expresses how a part or all of one pattern may match part or all of another pattern. Let V and W be patterns. (V, s) overlap matches (W, t) if and only if V(s+c)=W(t+c) for each integer c satisfying λ≦c≦μ such that λ=min{s, t} and μ=min{|V|−1−s, |W|−1−t} where 0≦s<|V| and 0≦t<|W|. The index s is called the head of pattern V and t is called the head of pattern W. If V is also a subpattern, then (V, s) submatches (W, t).
If (V, s) overlap matches (W, t), then define the intersection pattern I with head u=λ as (I, u)=(V, s)∩(W, t), where I(c)=V(c+s−λ) for every integer c satisfying 0≦c≦(μ+λ) where λ=min{s, t} and μ=min{|V|−−1−s, |W|−1−t}.
Consider pattern V=v0 v1 . . . vn, pattern W=w0 w1 . . . wn with heads s, t satisfying 0≦s, t≦n and pattern P=p0 p1 . . . pm with head u satisfying 0≦u≦m. Suppose (P, u) overlap matches (V, s). Then define the edge pattern substitution operator ⊕ as E=(P, u)⊕[(V, s)(W, t)] according to the four different cases A., B., C. and D.
Set pattern P=0101 110. Set pattern V=11 0101. Set pattern W=01 0010. Then (P, 0) overlap matches (V, 2). The index 0 of (P,0) and the index 2 of (V,2) indicate the position of the reader prior to performing any operations. In other words if one aligns the element of P having the index 0 with the element of V having the index 2, one can perform an overlap match of P and V. Edge pattern substitution is well-defined (from above), so that E=(P, 0)⊕[(V, 2)(W, 4)]=01 0010 110.
In other words, let P represent the tape, for example, and let V represent the input of a function, and W represent the output of the function, for example. First construct the combined string of P (from the tape) and V, by aligning the part of the two strings that are common to both strings, as 11 0101 110, where the first two symbols 11 come from V, the next four symbols are common to both, and the last 3 symbols are from P. Then substituted the W for V (forming the combination of P and V is an optional step.
One could just directly from the combination of P and W, but in some ways adding the extra step simplifies the explanation of the process, because it makes it easier to see where to place the string W in relation to P). If the tape had two symbols prior to the first two symbols in P, they will be over written by the first two symbols of W. The head or index of pattern E=4. In other words, the number of symbols that overlapped is 4. In terms of the notation above, this example fits case D.
So, s-u=2, because the 3rd element of P is the first that matches an element in V and W, and since the first element of P is labeled 0, the third element of P is labeled 2. Since there are 7 elements in P and the first is labeled 0, m=6. Since there are 6 elements in each of V and W and the first element is labeled 0, n=5. Since s−u=2 and n=5, u−s=−2 and therefore n+u−s=5−2=3, indicating that the last element in P that matches an element in V and W is the fourth element, and since the third element is labeled 0, the fourth element is labeled 3.
In other words, in this example of case D, the values of the output string are the string W for first 6 symbols, when k has the values 0 to 5, and the last two symbols are taken from last two symbols of P, when the index values in P are 5 and 6, while the corresponding index values in the resulting output/combined string are 7 and 8.
Also, (P, 4) overlap matches (V, 0), thereby aligning the element of P having index 4 with the element of V having the index 0. F=(P, 4)⊕[(V, 0)(W, 4)]=0101 010010. In this case, the first 3 symbols of V (and therefore of W) are aligned with the last 3 symbols of P, resulting in the last 3 symbols P being replaced with the first three symbols of W (skipping the unnecessary intermediary step for first forming the combined string of P and V), and the entire combine string of symbols that results has the first four symbols of the pattern P, and the remainder are of the symbols are the symbols of output pattern W. This second example is an example of case B, above. In this example, u−s=4, because the the fifth element of P, which has the index 4 is the first element of P to align with an element of V and W. Accordingly the combined pattern is given by
The index of pattern F=u+t−s=4+4−0=8.
Consider N execution steps of Turing Machine (Q, A, η) After each execution step, the machine is in some state qk and the tape head is pointing to some alphabet symbol ak. Relabeling the indices of the states and the alphabet symbols if necessary and assuming the machine has not halted after N execution steps in terms of the input commands is denoted as: (q0, a0)(q1, a1) . . . (qN-1, aN-1)(qN, aN). In this notation, the first ordered pair represents the initial input, which includes a state of the machine and the symbol at the initial head position. The represents an operation that is dictated by the Turing table (or equivalent function).
In particular, (q0, a0)(q1, a1) indicates the output of as a result of operating on the previous input (which was (q0, a0)) is (q1, a1). A state cycle is a valid execution sequence of input commands such that the first and last input command in the sequence have the same state i.e. (qk, ak)(qk+1, ak+1) . . . (qN-1, aN-1)(qk, ak). The length of this state cycle equals the number of input commands minus one. A state cycle is called a prime state cycle if it contains no proper state subcycles (as a reminder a covering path [S(1), S(2), S(3), . . . , S(m)] is a covering cycle of length m if φ(S(m))∩WS(1)≠ø; if S(j)=S(k) and k≦m and 1<k−j<m then [S(j), S(j+1), . . . , S(k−1)] is a proper subcycle of [S(1), S(2), S(3), . . . , S(m)]). For a prime state cycle, the length of the cycle equals the number of distinct states in the sequence. For example, (2, 0)(3, 1)(4, 0)(2, 1) is called a prime 3-state cycle because it has length 3 and also 3 distinct states {2, 3, 4}.
This follows from the Dirichlet principle and the definition of a prime state cycle.
Given an alphabet A and states Q, consider an arbitrary prime state cycle with length 1, (q, a)(q, b). There are |Q∥A| choices for the first input command and |A| choices for the second input command since the states must match. Thus, there are |Q∥A|2 distinct prime state cycles with length 1. Similarly, consider a prime state cycle with window of execution whose length is 2, this can be represented as (q1, a1)(q2, a2)(q1, b1). For the tape head move sequence RL, the tape square diagram looks like
In
Then there are |Q∥A| choices for (q1, a1) and once (q1, a1) is chosen there is only one choice for q2 because it is completely determined by η(q1, a1)=(q2, b1) where η is the program in (Q, A, η). Similarly, there is only one choice for b1. There are |A| choices for a2. Thus, there are |Q∥A|2 distinct choices. For an arbitrary prime state cycle (q1, a1)(q2, a2) . . . (qn, an)(q1, an+1) with window of execution of length k then there are |Q∥A| choices for (q1, a1) and |A| choices for a2 since the current window of execution length after the first step increases by 1. There is only one choice for q2 because it is determined by η(q1, a1). Similarly, for the jth computational step, if the current window of execution length increases by 1, then there are |A| choices for (qj+1, aj+1). Similarly, for the jth computational step, if the current window of execution stays unchanged, then there is only one choice for aj+1 that was determined by one of the previous j computational steps.
Thus, there are at most |Q∥A|k distinct prime state cycles whose window of execution length equals k. Since (1) the window of execution denoted as [λ,μ] is the sequence of integers representing the tape squares that the tape head visited during N computational steps; the length of the window of execution is μ−λ+1—where μ and λ are the first and last indices of the sequence, respectively—which is also the number of distinct tape squares visited by the tape head during these N steps) and (2) if j≦k, then [λ(j), μ(j)]⊂[λ(k), μ(k)], therefore a prime k-state cycle has a window of execution length less than or equal to k. Thus, from the previous and since any prime state cycle has length ≦|Q|, therefore there are at most
distinct prime state cycles in (Q, A, η), even if the window of execution is longer than |Q| (note that the summation stops at |Q| regardless of how long the window of execution is).
The reason any state cycle contains a prime state cycle is as follows. Relabeling if necessary let S(q1, q1)=(q1, a1) . . . (qn, an)(q1, an+1) be a state cycle. If q1 is the only state visited twice, then the proof is completed. Otherwise, define μ=min{|S(qk, qk)|: S(qk, qk) is a subcycle of S(q1, q1)}. Then μ exists because S(qk, qk) is a subcycle of S(q1, q1). Claim: Any state cycle S(qj, qj) with |S(qj, qj)|=μ must be a prime state cycle. Suppose not. Then there is a state r≠qj that is visited twice in the state cycle S(qj, qj). But then S(qr, qr) is a cycle with length less than μ which contradicts μ's definition.
In other words, since (1) a prime state cycle is the smallest cycle without any subcycles and since (2) the state cycle is itself a cycle, therefore if the state cycle does not have any subcycles within the state cycle (other than the state cycle itself), then there are also no prime cycle with the state cycle, and the state cycle itself would be a prime cycle. If the state cycle has at least one state subcycle within, then the same argument applies to each subcycle.
Applying the same argument to each subcycle and to each subcycle of each subcycle for as many nestings of subcycles within subcycles as possible, for each subcycle, one either arrives at one or more subcycles of a length greater than one operation, that have no subcycles within and are therefore prime state cycles or else one arrives at one or more subcycles that are only of a length of one operation (involving an input symbol-state pair and output symbol-state pair), which for practical reasons cannot have any subcycles, because one cannot have a state cycle of length of less than 1 operation (while if sequence of states is not a prime state cycle and has no prime state cycles within, the sequences of states is cannot be state cycle).
If machine (Q, A, η) starts execution and repeats a state cycle two consecutive times i.e. (q1, b1) . . . (qn, bn)(q1, b1) . . . (qn, bn)(q1, b1), then (Q, A, η) has a consecutive repeating state cycle.
An execution node (or node) is a triplet Π=[q, w0 w1 . . . wn, t] for some state q in Q where w0 w1 . . . wn is a pattern of n+1 alphabet symbols each in A such that t is a non-negative integer satisfying 0≦t≦n. Intuitively, w0 w1 . . . wn is the pattern of alphabet symbols on n+1 consecutive tape squares on the tape and t represents the location of the tape head.
Suppose p is an immortal periodic point with period n. Then by the Turing-Affine correspondence theorem the kth iterate of p is ƒS(k) ƒS(k−1) . . . ƒS(1)(p) and the application of affine function ƒS(k) corresponds to the execution of input command
(qk, bk). Thus, let the input command sequence (q1, b1) . . . (qn, bn)(qn+1, bn+1) denote the first n input commands that are executed. Since p has period n, ƒS(n) . . . ƒS(k) . . . ƒS(1)(p)=p. Thus, (q1, b1)=(qn+1, bn+1). Thus, the first n steps are a state cycle (q1, b1) . . . (qn, bn)(q1, b1).
Since the n+1 computational step corresponds to applying ƒS(1) to p which corresponds to input command (q1, b1). By induction, the n+k computational step corresponds to applying function ƒS(k) to the point ƒS(k−1) . . . ƒS(1)(p) which by the previous paragraph corresponds to the execution of the input command (qk, bk). Thus, the sequence of input commands is (q1, b1) . . . (qn, bn)(q1, b1) . . . (qn, bn)(q1, b1).
Another way to view repeating immortal points, if for a given classical Turing machine program a periodic immortal point of a given period n is encountered, by the definition of an immortal periodic point, the Turning machine will proceed through a sequence of n operations (which are uniquely determined by the tape and that Turing machine table) until the Turning machine outputs the same periodic immortal point having the same period. Since the output of the one cycle is the input of the next operation, which is an immortal periodic point of having a period n, by the definition of the immortal periodic point, the Turing machine starts the cycle again and completes the same cycle again outputting the same immortal periodic point, which again is the input of the next operation, so that the same cycle repeats every n operations.
Suppose Turing machine (Q, A, η) begins or resumes execution at some tape square and repeats a state cycle two consecutive times, and the rest of the pattern of the tape is the same at the beginning of each stated cycle (other than possibly being translated). Then (Q, A, η) has an immortal periodic point and this state cycle induces the immortal periodic point.
The reason that every consecutive repeating state cycle induces an immortal periodic orbit is as follows. Let the state cycle that is repeated two consecutive times be denoted as (q1, b1) . . . (qn, bn)(q1, b1) . . . (qn, bn)(q1, b1). Let sk denote the tape square right before input command (qk, bk) is executed the first time where 1≦k≦n. Let tk denote the tape square right before input command (qk, bk) is executed the second time where 1≦k≦n.
Thus, the window of execution for the first repetition of the state cycle, right before input command (qi, bη) is executed a second time, denoted In={s1, s2, . . . , sk, Sk+1 . . . Sn, Sn+1} where Sn+1=t1. The window of execution for the second repetition of the state cycle is Jn={t1, t2, . . . , tn, tn+1} where tn+1=tn+t1−sn.
Furthermore, observe that the window of execution for the computational steps 1 thru k is Ik={s1, s2, . . . , sk, sk+1} where the tape square sk+1 is indicated after input command (qk, bk) is executed the first time. Also, observe that the window of execution for the computational steps n+1 thru n+k is Jk={t1, t2, . . . , tk, tk+1} where the tape square tk+1 is indicated after the input command (qk, bk) is executed the second time (in the second repeating cycle).
Next a useful notation represents the tape patterns for each computational step. Then the proof is completed using induction. Let V1 denote the tape pattern—which is the sequence of alphabet symbols in the tape squares over the window of execution In—right before input command (q1, b1) is executed the first time. Thus, V1(s1)=b1. Let Vk denote the tape pattern—which is the sequence of alphabet symbols in the tape squares over the window of execution In—right before input command (qk, bk) is executed the first time. Thus, Vk(sk)=bk.
Let W1 denote the tape pattern—which is the sequence of alphabet symbols in the tape squares over the window of execution Jn—right before input command (q1, b1) is executed the second time. Thus, W1(t1)=b1. Let Wk denote the tape pattern—which is the sequence of alphabet symbols in the tape squares over the window of execution Jn—right before input command (qk, bk) is executed the second time. Thus, Wk(tk)=bk. Using induction, it is shown that V1 on window of execution In equals W1 on window of execution Jn. This completes the proof Since (q1, b1) is the input command before computational step 1 and (q1, b1) is the input command before computational step n+1, then V1(s1)=b1=W1(t1). Thus, V1 restricted to window of execution I1 equals W1 restricted to window of execution J1.
From the definition, η(q1, b1)=(q2, a1, x) for some a1 in A and where x equals L or R. Note that L represents a left tape head move and R a right tape head move.
Then s2=s1+1, t2=t1+1 and V1(s2)=b2=W1(t2). It has already been observed that V1(s1)=b1=W1(t1). Thus, V1 restricted to the window of execution I2 equals W1 restricted on the window of execution J2. Furthermore, the tape head is at s1 right before computational step 1 and input command (q1, b1) is executed; the tape head is at t1 right before computational step n+1 and input command (q1, b1) is executed.
Also, V2(s1)=a1=W2(t1) and V2(s2)=b2=W2(t2). Thus, V2 restricted to the window of execution I2 equals W2 restricted to the window of execution J2. Furthermore, the tape head is at s2 right before computational step 2 with input command (q2, b2) is executed; the tape head is at t2 right before computational step n+2 with input command (q2, b2) is executed.
Then s2=s1−1, t2=t1−1 and V1(s2)=b2=W1(t2). And V1(s1)=b1=W1(t1). Thus, V1 restricted to the window of execution I2 equals W1 restricted on the window of execution J2. Furthermore, the tape head is at s1 right before computational step 1 and input command (q1, b1) is executed; the tape head is at t1 right before computational step n+1 and input command (q1, b1) is executed.
Also, V2(s1)=a1=W2(t1) and V2(s2)=b2=W2(t2). Thus, V2 restricted to the window of execution I2 equals W2 restricted to the window of execution J2. Furthermore, the tape head is at s2 right before computational step 2 and input command (q2, b2) is executed; the tape head is at t2 right before computational step n+2 and input command (q2, b2) is executed. This completes the base case of induction.
Induction Hypothesis.
Suppose that for the 1, 2, . . . , k−1 computational steps and the corresponding n+1, n+2, . . . , n+k−1 steps that for every i with 1≦i≦k
Induction Step.
Since η(qk, bk) is the input command before computational step k and before computational step n+k, then Vk(sk)=bk=Wk(tk). From the definition, η(qk, bk)=(qk+1, ak, x) for some ak in A and x equals L or R. Note that L represents a left tape head move and R a right tape head move.
By the inductive hypothesis Vk restricted to window of execution Ik equals Wk restricted to window of execution Jk and the only change to the tape and tape head after executing η(qk, bk)=(qk+1, ak, R) for the steps k and n+k is that Vk+1(sk)=ak=Wk+1(tk) and Vk+1(sk+1)=bk+1=Wk+1(tk+1) and that the tape heads move right to Sk+1 and tk+1 respectively.
Thus, Vk+1 restricted to the window of execution Ik+1 equals Wk+1 restricted on the window of execution Jk+1. And for each j satisfying 1≦j≦k, then Vj restricted to the window of execution Ik+1 equals Wj restricted on the window of execution Jk+1.
By the inductive hypothesis Vk is restricted to window of execution Ik equals Wk restricted to window of execution Jk and the only change to the tape and tape head after executing η(qk, bk)=(qk+1, ak, L) for the steps k and n+k is that Vk+1(sk)=ak=Wk+1(tk) and Vk+1(sk+1)=bk+1=Wk+1(tk+1) and that the tape heads move left to Sk+1 and tk+1 respectively.
Thus, Vk+1 restricted to the window of execution Ik+1 equals Wk+1 restricted on the window of execution Jk+1. And for each j satisfying 1≦j≦k, then Vj restricted to the window of execution Ik+1 equals Wj restricted on the window of execution Jk+1.
Before proceeding further, in the process of discussing finding infinite loops in programs, the specification has also described a new type of computer, which is different than the dynamic register machine computer, which is described below.
Computer 900 is a new type of computer that runs programs written as pairs of execution nodes. Processor 902 is circuitry that performs computations of based on the execution node pairs. In an embodiment processor 902 is a conventional processor. In another embodiment, processor 902 is hardwired for processing execution node paris. In another embodiment processor 902 is a portion of a network of active machine elements that share the tasks of performing computations and storing information, which optionally may have been trained to process execution node pairs.
Cache 904 is onboard memory of processor 902. State 906 is a variable representing the state the machine, which when changed changes the response that the machine has to the same input data. Although in
Read-write mechanism 910 is a mechanism for reading and writing to data 908. Read-write circuitry 910 may be x-y electrodes for addressing memory cells, the read-write head of a hard drive, etc. Controller 912 controls the read-write mechanism 2210. In matrix addressed memory cells, controller 912 may include the circuitry that the addresses the x-y electrodes.
Regarding a harddrive, the controller may include the servo mechanism for positioning the head over the correct track and causing the head to read the track when over the correct position of the track.
Pairs of execution nodes 914 is a region of memory in which pairs of execution nodes are stored. In an embodiment pairs of execution nodes 914 and data 908 are physically separate regions of memory optionally different devices. In another embodiment, execution nodes 914 and data 908 are stored in the same memory dispersed with one another, but which computer 908 has grouped together as different logical regions of memory. Although only 3 execution node pairs are illustrated, there may be any number of execution node pairs in any given program.
In an embodiment, the execution node pairs are prime directed edges. The advantage of using execution node pairs is the many execution steps that are expected to be performed together are collapsed into one step. The advantage of using prime directed edges is that by breaking down a program in terms of state cycles of the program, which is likely to characterize the manner in which operations in the program are commonly grouped.
In this specification head node is used interchangeably is input node and tail node used interchangeably with output node either term may be substituted for the other, respectively to obtain different embodiments.
In another embodiment, other execution node pairs are included, in addition to or instead of prime directed edges. For example, the user may have certain operations that are performed frequently together, and it may be convenient to have one or more pre-computed execution node pairs that handle those groups of operations, so that the computations are performed faster.
As another example of a manner of using execution node pairs that are not prime directed edges, there may be a hierarchy of execution node pairs stored according to length, and for each length all of the possible execution node pairs are present. The machine first searches for the execution node heads having the largest combination of possible steps. The combinations of steps that do not lead to a halt before the last step are considered the possible combinations of steps. If none match then the next longest length set of execution node heads are searched. Once an execution nodes head is search the output node is implemented.
Head node 916 is an example of a head node of an execution node pair, which indicates the input that needs to be received to execute the execution node pair. In an embodiment, each execution each node head, such as head node 916, includes a series of symbols representing a series of tape positions each having a symbol in an equivalent Turing machine, a state of the machine, and the position of the equivalent Turing machine head. In other embodiments, tail node 916 may include other information instead, such as the data read from a two dimension pattern of data in a two dimensional array of memory locations (e.g., registers) an address the last piece of data that was read, and a current state of the machine.
Tail node 918 carries the output of executing the execution node head. In an embodiment, each node tail, such as tail node 918, includes a series of symbols representing a series of tape positions each having a symbol in an equivalent Turing machine, a state of the machine, the position of the equivalent Turing machine head, and direction to which to move the equivalent Turing head. In other embodiments, tail node 918 may include other information instead, such as the data to write to a two dimension pattern of data in a two dimensional array of memory locations (e.g., registers) an address of which data to read next, and a new state of the machine for updating the state of the machine.
Execution node pair 1000 may be any pair of execution nodes having an input node and an output node that are associated with one another, such that when the input to the program matches the input node, the output is the data in the output node. Optionally, there may be a pointer pointing from the input node to the output node. Head node 1002 is the input node. When at least a portion of the input matches the input that is in the head node (e.g., in an edge substitution process), the execution node pair is used to determine the output, based on the output node.
Current state 1004 is an indication of the current state of the machine. In a Turing machine, the state is just a symbol or value. In other embodiments, the state may be an indication or flag that tracks whether the machine is currently executing a do-loop or other programming loop and/or an indication of whether or not a logical variable is true or false, such as a logical variable for determining whether to execute an if statement or determining which prong of a select statement to execute, for example. More generally, the state of the system is information that determines which of multiple possible behaviors and/or operations to perform for the same input. In other words, when the machine is in a different state the operation performed for a given input is different than when the machine is in a different state, despite receiving the same input.
The input data 1006 is the data read from memory that is the current input of the program. In Turing machine input data 1006 would be a sequence of symbols found at multiple adjacent tape positions. In other embodiments, input data 1006 may be number for a mathematical computation, text for manipulation for composing machine generated articles, keyboard strokes for entering information into a word processor, spreadsheet, search engine, or other type program, and/or any other type of input. Current location 1008 is the current memory cell being read.
Current location 1008 may be a pointer value pointing to a particular location in memory. In a Turing machine, the current location 1008 is the position of read-write head on the tape where the head is located.
Tail node 1010 is the output node. Tail node 1010 is associated with head node 1002 as the output for the input associated with head node 1002. If the input information matches at least part of the input node, the machine goes to tail node to retrieve output information that, in an embodiment, at least partially replaces the input information.
New state 1012 is the new state to which the state of the machine is changed. In the context of a Turing machine, the new state may just be a new value stored in memory. However, the new state could be an indication of being in a different loop, no longer being in any loop, being in a different option of a selected statement or if else statement for example. In general, the new state 1012, when different form the old state, changes the manner in which the machine responds to the same input.
Output data 1014 is the data that is retrieved and stored in the data storage area of the machine. The output data may be changes in the formatting of a document, results of a mathematical computation, or any other results of performing tasks of a program. In the context of a Turing machine, the output data would be a sequence of symbols to be written to a series of adjacent tape positions.
New location 1016 is the new location in memory that is read next. New location 2316 may be pointer value pointing to a particular register in the machine. In an embodiment the new location 2316 is a location where that was written as part of writing output data 2316. In the context of the Turing machine, new location 1016 may be a new location with the data just written to the tape, where the head is moved to.
Current location 1008 and new location 1016 are optional. In an embodiment, current location 1008 and new location 1016 may be replaced with a current location and a new location in a sequence of steps in a program or left out completely. For example, after executing an execution node pair, the machine may automatically read the next chunk of information in the sequence of input information and use that information to find the next head node of the next execution node pair.
In step 1104, a search is performed for a matching head node of an execution node pair. In an embodiment, the matching head node only needs to having a portion of data that matches a portion of information in the head node. In an embodiment, the matching portion include a memory location where the reader is currently located or where a pointer is pointing indicating the last location read, which is matched with the indication of the position of the reader or the location that pointer points.
In step 1106, data is written to memory based on the content of the tail node, the read position, and the manner in which the data read matches the data in the head node. In step 1108, the state of the machine is updated according to the state indicated by the tail node. Step 1108 may be performed before, after, at the same time as step 1106. In step 1110, a determination is made whether the tail node indicates to halt the program. If the tail node indicated to halt the program the program terminates. Otherwise, the program returns to step 1102, where a new set of data is read from memory based on the new position of the reader or the pointer.
Optionally, in step 1110, the processor may not need to expressly compute a decision. The tail node may send the reader to a position having no data and/or may change the state of the system to the halt state, and as a result of having no data, the program may end.
In an embodiment, each of the steps of method 1100 is a distinct step. In another embodiment, although depicted as distinct steps in
In step 1202, a search is performed for a head node having data that at least partially matches the data in the head node. In an embodiment, the portion that matches is a set of data that are adjacent to one another. In the case of a tape, or a string of symbols, the portion that is matched is a string of contiguous symbols, which appear in the same order in both the head node and the tape. In the case of registers, the portion that matches may be a two dimensional pattern or a series of symbols that are treated as if the symbols are arranged in a string. In an embodiment, the read locations of the head node and the data read are also matched. In step 1204, the matching portions of the head node and the data read are aligned, so that the read locations are also aligned.
In step 1206, a determination is made whether there are any symbols in locations in the data read that align with different symbols in the head node. For example, on a tape, after aligning the read head and the symbols that are common to both the data read and the head node, a determination is made whether there are any symbols in the head node that align with non-matching symbols in the data read. If there is an alignment of non-matching data, there is no match between the data read and the head node, and consequently the method proceeds to step 2508, where the method terminates. After the method terminates, the machine searches for another head node with matching data.
Returning to step 1206, if there is no non-matching data aligned with one another, then in step 1210, the data in the tail node is aligned with the data read in the manner in which the data in the head node aligned. For example if the first three memory positions of the head node aligned with the last three positions of the data read, then the data in the tail node is aligned with the data read such that the first there memory positions of the tail node align with the last three memory positions in the data read.
In step 1212, the data of the tail node is written to memory in alignment with the manner in which the head node aligned with the data read. Continuing the example of 1210, the data in the last three positions of the data read is written over by data in the first three memory positions of the tail node. The read location is changed to the read location indicted by the tail node.
In an embodiment, each of the steps of method 1200 is a distinct step. In another embodiment, although depicted as distinct steps in
Prime Directed Edge from Head and Tail Execution Nodes
A prime head execution node Δ=[q, v0 v1 . . . vn, s] and prime tail execution node Γ=[r, w0 W1 . . . wn, t] are called a prime directed edge iff all of the following hold:
A prime directed edge is denoted as ΔΓ or [q, v0 v1 . . . vn, s][r, w0 w1 . . . wn, t]. The number of computational steps N is denoted as |ΔΓ|. In an embodiment, each head execution node is an input node that has a one-to-one correspondence with a tail node, and the tail nodes in an output node.
Above, input commands were introduced. (Specifically, it was stated that a state cycle is a valid execution sequence of input commands such that the first and last input command in the sequence have the same state, and the length of this state cycle equals the number of input commands minus one). If (q1, a1) . . . (qn, an) is an execution sequence of input commands for (Q, A, η), then (q1, a1) . . . (qn, an) is a prime input command sequence if qn is visited twice and all other states in the sequence are visited once. In other words, a prime input command sequence contains exactly one prime state cycle.
Using the same notation as used earlier, let V1 denote the initial tape pattern—which is the sequence of alphabet symbols in the tape squares over the window of execution of the prime input command sequence—right before the first input command (q1, a1) in the sequence is executed. And let s1 denote the location of the tape head, i.e., V1(s1)=a1. Let Vk denote the tape pattern right before the kth input command (qk, ak) in the sequence is executed and let sk denote the location of the tape head, i.e., in this notation Vk(sk)=ak.
Let (q1, a1) . . . (qn, an) and (r1, b1) . . . (rm, bm) be prime input command sequences where Vk denotes the tape pattern right before the kth input command (qk, ak) with tape head at sk with respect to Vk and Wk denotes the tape pattern right before the kth input command (rk, bk) with tape head at tk with respect to Wk.
Suppose (Vn, Sn) overlap matches with (W1, t1) and qn=r1. Then (qn, an)=(r1, b1). And the composition of these two prime input command sequences is defined as (q1, a1) . . . (qn, an)(r2, b2) . . . (rm, bm). The composition is undefined if (Vn, sn) and (W1, t1) do not overlap match or qn≠r1. If (q1, a1) . . . (qn, an)(q1, b1) is a prime state cycle, then it is also prime input command sequence. For simplicity in an upcoming, later part of this specification, a prime input command sequence is called a composition of one prime input command sequence.
The purpose of the next group of definitions is to show that any consecutive repeating state cycle is contained inside a composition of prime input command sequences. Since (1) every immortal periodic point induces a consecutive repeating state cycle) and (2) every consecutive repeating state cycle induces an immortal periodic orbit, therefore there is a one to one correspondence between a consecutive repeating state cycle and an immortal periodic point.
If this consecutive repeating state cycle is rotated (in other words, if the last k states are moved from the end of the sequence to the beginning of the sequence, but otherwise all of the states in the sequence are kept in the same order with respect to one another), then the resulting new sequence of states is still part of the same periodic orbit of the original periodic point. Next it is shown that there is a one to one correspondence between prime input command sequences and prime directed edges. Subsequently, it is explained how to link match prime directed edges. Then it is demonstrated how to find all prime directed edges for a particular Turing machine. If a particular Turing machine has any immortal periodic points, then that Turing machine will have corresponding consecutive repeating state cycles, which will be contained in an edge sequence of prime directed edges that are link matched.
Start with the finite state sequence (0, 4, 2, 3, 4, 1, 3, 0, 1, 2, 0, 4, 2, 3, 4, 1, 3, 0, 1, 2).
Partition Steps
(0 4 2 3 4 1 3 0 1 2 0 4 2 3 4 1 3 0 1 2)
((0 4 2 3) 4 1 3 0 1 2 0 4 2 3 4 1 3 0 1 2) 4 lies in (0 4 2 3) and is the next state after 3, so the each sequence ends just before the recurrence of a state in that sequence, which in the case of the first sequence, the recurrent state is state 4. Consequently, 0423 is the first sequence and the 4 is theist element found.
((0 4 2 3) (4 1 3 0) 1 2 0 4 2 3 4 1 3 0 1 2) 1 lies in (4 1 3 0) and is the first state after the 0 is 4130. Consequently, 4130 is the second sequence and 1 is the 2nd element found.
((0 4 2 3) (4 1 3 0) (1 2 0 4) 2 3 4 1 3 0 1 2) 2 lies in (1 2 0 4) and recurs just after 4, and consequently 1204 the third sequence and 2 is the 3rd element found.
((0 4 2 3) (4 1 3 0) (1 2 0 4) (2 3 4 1) 3 0 1 2) 3 lies in (2 3 4 1). 4th element found.
((0 4 2 3) (4 1 3 0) (1 2 0 4) (2 3 4 1) (3 0 1 2)) 0 lies in (0 4 2 3). 5th element found.
A tuple is a finite sequence of objects denoted as (σ1, σ2, . . . , σm). The length of the tuple is the number of objects in the sequence denoted as |(σ1, σ2, . . . , σm)|=m. For our purposes, the objects of the tuple may be states, input commands or natural numbers. For example, (3) is a tuple of length one, and (1, 4, 5, 6) is a tuple of length four. Sometimes the commas will be omitted as in the previous example. For example, (4 6 0 1 2 3) is a tuple of length six (despite the lack of commas). The term object is often used in connection with tuples to describe the elements of a tuple. For example, the 4 is called the first object in tuple (4 6 0 1 2 3). Similarly, the objects of a tuple are also referred to as members of a tuple. For example, 1 is called a member of tuple (4 6 0 1 2 3).
A tuple of tuples is of the form (w1, w2, . . . , wn) where each Wk may have a different length. An example of a tuple of tuples is ((3), (1, 4, 5, 6), (4, 5, 6)). Sometimes the commas are omitted: ((0 8 2 3) (1 7 5 7) (5 5 6)).
A directed partition is a tuple of tuples (w1, w2, . . . , wn) that satisfies Rules A and B.
Rule A. No object σ occurs in any element tuple Wk more than once.
Rule B. If wk and wk+1 are consecutive tuples, then the first object in tuple wk+1 is a member of tuple Wk.
((0 8 2 3) (8 7 5 4) (5 0 6)) is an example of a directed partition.
((0 8 2 3) (8 7 5 4) (5 0 6)) is sometimes called a partition tuple.
(0 8 2 3) is the first element tuple. And the first object in this element tuple is 0. Specifically, in the example of ((0 8 2 3) (8 7 5 4) (5 0 6)), each of the element tuples (0 8 2 3), (8 7 5 4), and (5 0 6) have sequence of numbers in which each number in the sequence only occurs once in that sequence in accordance with rule A. Also, in the example of ((0 8 2 3) (8 7 5 4) (5 0 6)), in accordance with rule B, the first object is 8, which is a member of the prior element tuple 0823, and the first object of the last element tuple, 506, is a 5, which is the third element of the prior element tuple, 8754.
Element tuple (8 0 5 7 0 3) violates Rule A because object 0 occurs twice. ((0 8 2 3) (1 7 5 4) (5 0 6)) violates Rule B since 1 is not a member of element tuple (0 8 2 3).
A consecutive repeating sequence is a sequence (x1, x2, . . . , xn, . . . , x2n) of length 2n for some positive integer n such that xk=xn+k for each k satisfying 1≦k≦n. An extension sequence is the same consecutive repeating sequence for the first 2n elements (x1 . . . xn . . . X2n . . . x2n+m) such that xk=x2n+k for each k satisfying 1≦k≦m.
A minimal extension sequence is an extension sequence (x1, . . . , x2n+m) where m is the minimum positive number such that there is at least one element in x2n, x2n+1 . . . , x2n+m that occurs more than once. Thus, x2n+k=x2n+m for some k satisfying 0≦k<m.
For example, the sequence S=(4 2 3 4 1 3 0 1 2 0 4 2 3 4 1 3 0 1 2 0) is a consecutive repeating sequence and
Directed Partition Extension with Last Tuple Satisfying Rule B
Suppose (x1 . . . xn . . . x2n, x2n+1, . . . x2n+m) is an extension of consecutive repeating sequence (x1 . . . , xn . . . x2n). Then (w1, w2, . . . , wr) is a directed partition extension if it is a directed partition of the extension: The last tuple wr satisfies Rule B (which states, that if wk and wk+1 are consecutive tuples, then the first object in tuple wk+1 is a member of tuple wk) if x2n+m is the last object in tuple wr and xm+1 lies in tuple wr.
For example, the extension
In step 1304, for each state and possible pattern of symbols that is length |Q|+1 or less, run the program instructions (e.g., following the Turing table until (1) one of the states repeats or until (2) a halt is encountered. Optionally, one may categorize the strings of operations into prime directed edges and halting edges (edges, which when implemented that halt execution of the program). In step 1304, there is no need to fully construct each possible pattern of symbols all the way to the last |Q|+1 symbol, because many of the patterns will arrive at a halt before the end of the pattern. Rather one can instead first figure out for which possible initial symbol has no pattern of symbols been constructed.
That symbol is the first symbol in the initial symbol pattern. Then one can determine which states have not been tested yet for that initial symbol. The state found is the initial state of the head node and also the first state is the state pattern. Then one can determine the result of reading that symbol, when the machine is in that state. If that symbol and state result in a halt or if the resulting state is the same as a previous state in the state sequence, then that is the end of the edge, the resulting final state, the resulting final pattern of symbols, and the direction to move the head next are stored.
If that symbol and state do not result in a halt to determine what are the next possible symbol in the location where the head is about to move that have not been tested. After finding a halt or a repeated state, then return to the latest point in the sequence where another symbols could have been inserted next, that results in a pattern of symbols and states that has not been computed, yet and determine the results and again proceed as before until running into either a halt or a repeated state.
In step 1306, the prime directed edges and the halting edges are each converted into execution node pairs. The initial state, the initial set of symbol patterns prior to running the operations in the Turing table, the initial state of the machine and the initial head position is placed into the head node. The final set of symbols resulting from running the set of operations prescribed by the Turing table (until arriving at a halt or a repeated state), the final state, and (at least for non-halting edges) the final position of the head, the direction to move the head next after performing the last Turing table operation on the sequence of symbols, are stored in the tail node.
In an embodiment, each of the steps of method 1300 is a distinct step. In another embodiment, although depicted as distinct steps in
In step 1406, the next instruction (which could be the first instruction is executed). In step 1408, the sequence of instructions executed during the current loop is updated and stored (which during the first time through the loop for any given pattern of data and state may include creating this new sequence of instructions and storing the new sequence of instructions).
In step 1410, a determination is made whether the execution of the last instruction would result in a halt or in a repetition of the prior state. If the execution of the prior instruction would not result in a halt or a repeated state, the method proceeds to step 1412. In step 1412, the current memory pattern is updated to include results of the most recent execution step. In the case of a Turing tape, the sequence of symbols of the current tape is updated. In other sorts of the machines other patterns in other forms of memory are updates.
Also, in step 1412, optionally, is the rest of the memory pattern was not already chosen, the data in the next memory location to be read is determined, so that the resulting initial memory pattern is unique and not an initial memory pattern that was already computed. After step 1412, the method 1400 returns to step 1406 to repeat the loop for the next memory location.
Returning to step 1410, if a halt or repeated state is encountered, this cycle through the loop (of steps 1406 to 1412) is terminated, and the method proceeds to step 1414. In step 1414, the current data pattern and state are stored as the output data pattern, output state, and the next read location of the tail node, and the initial data pattern, initial state, and initial read location are stored as the input data pattern, input state, and input location of the head node. The head node and tail node are associated with one another as an input-output pair, as a head node-tail node execution node pair.
In step 1416, a determination is made whether there are any more data patterns that have not been tested yet for the current state. If there are more data configurations, to test, method 1400 proceeds to step 1404 to choose a new data configuration that has not yet been computed, and restart the inner loop (of steps 1406 to 1412). As method 1400 is being performed, to improve efficiency, partial results that are expected to be reusable may be stored. For example is a Turing machine having 3 states (1, 2, and 3) and two symbols a and b (the halt state may be represented as 0), after method 1400 computes the result of the sequence of symbols aa for state 1, during the first time through the inner loop, the results may be saved.
Then (if a halt or a repeat o states is not encountered, method 1400 may compute the results of the sequence of symbols aaa for the initial state 1. Since there are only three states, the next computation must result in a halt or a repetition of states. Next, using the stored result of the computation of the sequence aa for the initial state 1 (which is in this example is not a prime directed edge and is not halt state, and therefore just a partial result), method 1400 may next compute the results of the sequence aab for the initial state 1 (and then may proceed to compute the results of ab for the initial state of 1, for example, and if a halt or repeated state is not encountered store the results as a partial result for use in computing another prime directed edge or halting edge).
Returning to the step 1416, if there are not more data configurations for the current state, the method proceeds to step 1418, In step 1418, a determination is made whether there are any more initial state for which the prime directed edges and halting edges have not been computed. If there are none, the method terminates. If there are more initial states, then the method 1400 proceeds step 1420, where the initial state is incremented to the next initial state for which the prime directed edges and halting edges have not yet been computed. Then, the method returns to step 1404, where the data pattern is initialized to the first data pattern, and the inner loop (steps 1404-1412) is started again.
In an embodiment, each of the steps of method 1400 is a distinct step. In another embodiment, although depicted as distinct steps in
Steps 1416, 1418, and 1420, are implemented as in method 1400 of
Although in the examples of
In an embodiment, each of the steps of method 1420 is a distinct step. In another embodiment, although depicted as distinct steps in
Given a finite sequence (x1 . . . xn) of objects.
Initialize element tuple w1 to the empty tuple, ( )
Initialize partition tuple P to the empty tuple, ( )
For each element xk in sequence (x1 . . . xn)
The final result is the current partition tuple P after element xn is examined in the loop. Observe that the tail of elements from (x1 . . . xn) with no repeated elements will not lie in the last element tuple of the final result P.
Directed Partition Method Implemented in newLISP, www.newlisp.org.
Every Consecutive Repeating Sequence has an Extension Sequence with a Directed Partition Such that the Last Tuple Satisfies the Rule B Property.
Above consecutive repeating sequence was defined (above it was stated that a consecutive repeating sequence is a sequence (x1, x2, . . . , xn, . . . , x2n) of length 2n for some positive integer n such that xk=xn+k for each k satisfying 1≦k≦n, and an extension sequence is the same consecutive repeating sequence for the first 2n elements (x1 . . . xn . . . x2n . . . x2n+m) such that xk=x2n+k for each k satisfying 1≦k≦m). The consecutive repeating sequence (x1, x2 . . . x2n) can be extended to the extension sequence (x1, x2 . . . x2n, x2n+1 . . . x2n+m), such that m is the minimum positive number such that there is one element in x2n, x2n+1 . . . x2n+m that occurs more than once. Thus, x2n+k=x2n+m for some k satisfying 0≦k<m.
Apply the method for finding directed partitions to
Any consecutive repeating state cycle is contained in a composition of one or more prime input command sequences. The reason that any consecutive repeating state cycle is contained in a composition of one or more prime input command sequences is as follows. Let σ=[(q1, a1) . . . (qn, an)(q1, a1) . . . (qn, an)] be a consecutive repeating cycle. Since for fining directed partitions since every consecutive repeating sequence has an extension sequence with a directed partition such that the last tuple satisfies the Rule B property, therefore the sequence of consecutive repeating input commands a may be extended to a minimal extension sequence: [(q1, a1) . . . (qn, an)(q1, a1) . . . (qn, an)(q1, a1) . . . (qm, am)]
For simplicity, let vk denote input command (qk, ak). Apply the method for finding directed partitions, from above, to (v1, . . . vn v1 . . . Vn V1 . . . Vm), so that the result is the partition tuple P=(w1, . . . wr). Then the sequence of element tuples in P represent a composition of one or more prime input command sequences. Rules A and B imply that for consecutive tuples wk=(vk(1 vk(2) . . . vk(m)) and Wk+1=(v(k+1)(1) v(k+1)(2) . . . v(k+1)(m)), each of vk(1) vk(2) . . . vk(m) are different from one another and each of v(k+1)(1) v(k+1)(2) . . . v(k+1)(m)w are different form one antoer (rule A) and where one of {vk(1) vk(2) . . . vk(m)}=v(k+1)(1) (according to rule B), then if one forms the a sequence form the first sequence plus only the first element of the second sequence, the new sequence has one and only one repeated element, which is v(k+1)(1) and correspondingly, (qk(1), ak(1))(qk(2), ak(2)) . . . (qk(n), ak(m))(q(k+1)(1), a(k+1)(1)) is a prime input command sequence, which is contained in the composition of the last two tuples. Also, the fact that every consecutive repeating sequence has an extension sequence with a directed partition such that the last tuple satisfies the Rule B property, implies that the last tuple wr corresponds to a prime input command sequence and that the consecutive repeating state cycle is contained in the partition P mapped back to the sequence of input commands.
Let (x0 x1 . . . xn) be a finite sequence. A k-rotation is the resulting sequence (xk xk+1 . . . xn x0 x1 . . . xk−1). The 3-rotation of (8 7 3 4 5) is (3 4 5 8 7). When it does matter how many elements it has been rotated, it is called a sequence rotation.
Let (q1, a1) . . . (qn, an)(q1, b1) be a state cycle. This state cycle is called a state-symbol cycle if a1=b1. A rotation of this state-symbol cycle is the state cycle (qk, ak) . . . (qn, an)(q1, a1) . . . (qk, ak) for some k satisfying 0≦k≦n. In this case, the state-symbol cycle has been rotated by k−1 steps.
Any consecutive repeating rotated state cycle generated from a consecutive repeating state cycle induces the same immortal periodic orbit. The reason that any consecutive repeating rotated state cycle generated from a consecutive repeating state cycle induces the same immortal periodic orbit is as follows. Let p be the immortal periodic point induced by this consecutive repeating state cycle. Rotating this state cycle by k steps corresponds to iterating p by the next k corresponding affine functions. Since the first symbol-state pair uniquely determine the entire sequence, and since the sequence repeats itself with a fixed period, if one starts anywhere in the cycle, the rest of the cycle will still repeat itself with the same period (as long as the symbols on the tape are shifted to match the states).
Prime directed edges and prime input command sequences have a 1 to 1 correspondence. The reason prime directed edges and prime input command sequences have a 1 to 1 correspondence is as follows. () Let Δσ be a prime directed edge where Δ=[q, v0 v1 . . . vn, s] and Γ=[r, w0 w1 . . . wn, t]. From the definition of a prime directed edge, over the next N computational steps some state r is visited twice, all other states in Q are visited at most once and there is a sequence of input commands (q, vs)(q1, a1) . . . (r, ak) . . . (r, wt) corresponding to these N steps.
This is a prime input command sequence.
() Let (q1, a1) . . . (qn, an) be a prime input command sequence with N computational steps. Then qn is visited twice and all other states in the sequence are visited only once. Let v0 v1 . . . vn be the initial tape pattern over the window of execution during the N computational steps. Now a1=vs for some s. Let w0 w1 . . . wn be the final tape pattern over the window of execution as a result of these N steps. Then an=vt for some t. Thus, [q, v0 v1 . . . vn, s][r, w0 w1 . . . wn, t] is a prime directed edge.
As an aside, regarding the above discussion of affine transformations, each execution node pair may be represented by a matrix transformation between the elements of the input node and the elements of the output node.
Each prime head node determines a unique prime directed edge so an upper bound for head nodes provides an upper bound for the number of distinct prime directed edges. Consider prime head node [q, V, s]. There are |Q| choices for the state q. Any pattern that represents the window of execution has length ≦|Q|+1. Furthermore, by the previous remark any pattern P such that (V, s) submatches (P, t) for some t, then the resultant pattern is the same since V spans the window of execution. Thus, |A||Q|+1 is an upper bound for the number of different patterns V.
Lastly, there are two choices for s in a |Q|+1 length pattern because the maximum number of execution steps is |Q| i.e. the tape head move sequence is L|Q| or R|Q|. Thus, |Q| is an upper bound for the number of choices for s unless |Q|=1. The following bound works in the trivial case that |Q|=1. Thus, there are at most |Q|2|A||Q+1 prime directed edges.
EXAMPLE of a 3-state machine prime directed edges and prime input command sequences Consider Turing Machine (Q, A, η). Q={2, 3, 4} and 1 is the halting state. A={0, 1} and η is specified in the following table.
There are 9 distinct prime state cycles. Observe that |Q|2|A||Q|+1=32(42)=144. Observe that |Q| (|A|+|A|2)=2(2+4)=12. The upper bound for the length of the program appears to not be sharp. Although sharp upper bounds for the number of prime directed edges are important, these types of results are not addressed here.
In what follows prime directed edges are link matched so that for a given Turing Machine a method for finding consecutive repeating state cycles is demonstrated. It is proved that this method will find immortal periodic points if they exist. The expression demonstrate a method for finding is used instead of describe an algorithm in order to not create confusion with the current notion of a Turing algorithm computed by a fixed Turing machine. Below, a dynamic register machine is described that can implement this new method of computing.
Suppose [q, v0 v1 . . . vn, s] is an execution node and over the next |Q| computational steps a prime state cycle is not found. In other words, a prime directed edge is not generated. Then the Turing machine execution halted in |Q| or less steps. Let W be a pattern such that (W, t) submatches (V, s) and W spans the window of execution until execution halts. Define the halting node as H=[q, W, t]. As a motivation for this definition, one can think of originally starting with a tape pattern (V,s). However, the execution of the machine halts after just processing a subsequence (W,t) of the original tape pattern.
Remark 8.20 provides an upper bound on the number of prime directed edges. Let P={Δ1Γ1, . . . , ΔkΓk, . . . , ΔNΓN} denote the finite set of prime directed edges for machine (Q, A, η).
Execution node Π overlap matches prime head node Δ iff the following hold:
If Δj=[q, P, u] and Δk=[q, V, s] are prime head nodes and they overlap match, then they are equal. (Distinct edges have prime head nodes that do not overlap match.) The reason that overlap matching prime head nodes are equal is as follows.
0≦u≦|Δj| and 0≦s≦|Δk|.
Let (I, m)=(P, u)∩(V, s) where m=min{s, u}
Suppose the same machine begins execution on tape I with tape head at m in state q. If s=u and |Δj|=|Δk|, then the proof is complete.
Otherwise, s≠u or |Δj|≠*|Δk| or both. has a window of execution [0, |Δj|−1] and Δk has window of execution [0, |Δk|−1]. Let the ith step be the first time that the tape head exits finite tape I. This means the machine would execute the same machine instructions with respect to Δj and Δk up to the ith step, so on the ith step, Δj and Δk must execute the same instruction. Since it exits tape I at the ith step, this would imply that either pattern P or V are exited at the ith step. This contradicts either that [0,|Δj|−1] is the window of execution for 0i or [0, |Δk|−1] is the window of execution for Δk.
Let ΔΓ be a prime directed edge with prime head node Δ=[q, v0 v1 . . . vn, s] and tail node Γ=[r, w0 w1 . . . wn, t]. If execution node Π=[q, p0 p1 . . . pm, u] overlap matches Δ, then the edge pattern substitution operator from 7.2 induces a new execution node Π⊕(ΔΓ)=[r, (P, u)⊕[(V, s)(W, t)], k] with head k=u+t−s if u>s and head k=t if u≦s such that 0≦s, t≦n and 0≦u≦m and patterns V=v0 v1 . . . vn and W=w0 w1 . . . wn and P=p0 p1 . . . pm.
A prime directed edge sequence is defined inductively. Each element is a coordinate pair with the first element being a prime directed edge and the second element is an execution node. Each element is abstractly expressed as (ΔkΓk, Πk).
The first element of a prime directed edge sequence is (Δ1 Γ1, Π1) where Π1=Γ1, and Δ1Γ1 is some prime directed edge in P. For simplicity in this definition, the indices in P are relabeled if necessary so the first element has indices equal to 1. If Π1 overlap matches some non-halting prime head node Δ2, the second element of the prime directed edge sequence is (Δ2Γ2, Π2) where Π2=⊕(Δ2Γ2). This is called a link match step.
Otherwise, Π1 overlap matches a halting node, then the prime directed edge sequence terminates. This is expressed as [(Δ1Γ1, Γ1), HALT]. In this case it is called a halting match step.
If the first k−1 steps are link match steps, then the prime directed edge sequence is denoted as [(Δ1Γ1, Π1), (Δ2Γ2, Π2) , . . . , (ΔkΓk, Πk)] where Πj overlap matches prime head node Δj+1 and Πj+1=Πj⊕(Δj+1Γj+1) for each j satisfying 0≦j<k.
Implementing C Code with Execution Node Pairs
Consider
Similarly, in C, the assignment statement
unsigned char x=a;
can be computed using the pair of execution nodes in
Consider the following two lines of C code:
unsigned char x=14, y=10, z;
z=x+y;
If z points to #18, then the pair of execution nodes in
Similarly, a for {statement1; . . . statementN;} loop in C can be constructed by making the state of the tail node perform the last statement (statement N) equal to one state upon entering the for loop. The exit condition of the for loop is similar to that shown in
The same operations as described above in conjunction with
Edge Sequence Notation E([p1, p2, . . . , pk], k)
To avoid subscripts of a subscript, pk and the subscript p(j) represent the same number. As defined in the prime directed edge sequence and link matching method, P={Δ1Γ1, . . . , ΔkΓk, . . . , ΔNΓN} denotes the set of all prime directed edges. E([p1], 1) denotes the edge sequence [(AP(1)Γp(1), Πp(1))] of length 1 where Πp(1)=Γp(1) and 1≦p1≦|P|. Next E([p1, p2], 2) denotes the edge sequence [(Δp(1)Γp(1), Πp(1)), (Δp(2)Γp(2), Πp(2))] of length 2 where Πp(2)=Πp(1)⊕(Δp(2)Γp(2)) and 1≦p1, p2≦|P|.
In general, E([p1, p2, . . . , pk], k) denotes the edge sequence of length k which is explicitly [(Δp(1)Γp(1), Πp(1)), (Δp(2)Γp(2), Πp(2)), . . . , (Δp(k)Γp(k), Πp(k))] where Πp(j+1)=Πp(j)⊕(Δp(j+1)Γp(j+1)) for each j satisfying 1≦j<k−1 and 1≦p(j)≦|P|.
The fact that prime directed edges and prime input command sequences have a 1 to 1 correspondence implies that an edge sequence corresponds to a composition of prime input commands. The expression an edge sequence contains a consecutive repeating state cycle is used if the corresponding sequence of prime input commands contains a consecutive repeating state cycle.
Any consecutive repeating state cycle of (Q, A, η) is contained in an edge sequence of (Q, A, IA The reason that any consecutive repeating state cycle of (Q, A, η) is contained in an edge sequence of (Q, A, η) follows immediately from the fact that (1) edge sequence contains a consecutive repeating state cycle is used to describe an edge sequence of prime directed commands containing an a consecutive repeating state cycle and (2) any consecutive repeating state cycle is contained in a composition of one or more prime input command sequences and (3) prime directed edges and prime input command sequences have a 1 to 1 correspondence.
If E([p1, p2, . . . , pr], r) contains a consecutive repeating state cycle, then the corresponding immortal periodic point has period
The reason that the corresponding immortal periodic point has period is
because a consecutive repeating state cycle induces an immortal periodic point. The length of the state cycle equals the period of the periodic point. Further, the number of input commands corresponding to the number of computational steps equals |Δp(k)Γp(k)| in directed edge Δp(k)Γp(k).
Given an edge sequence whose corresponding prime input command sequence (q0, a0)(q1, a1) . . . (qN, aN) has length N.
If exited outer for loop without finding a consecutive repeating state cycle, return NO consecutive repeating state cycles were found.
EXAMPLE of A newLISP function that finds a consecutive repeating sequence
Given Turing Machine (Q, A, η) as input, the search method works as follows.
Set P=Ø. For each non-halting state q in Q
For each pattern a−|Q| . . . a−2 a−1 a0 a1 a2 . . . a|Q| selected from A2|Q|+1
a
0
The prime directed edge search finds all prime directed edges of (Q, A, η) and all halting nodes.
PROOF. Let ΔΓ be a prime directed edge of (Q, A, η). Then ΔΓ has a head node
Δ=[r, v0 v1 . . . vn, s], for some state r in Q, for some tape pattern v0 v1 . . . vn that lies in An+1, such that n≦|Q| and 0≦s≦n. In the outer loop of the prime directed edge from head and tail execution nodes, when r is selected from Q and in the inner loop when the tape pattern a−|Q| . . . a−2 a−1 a0 a1 a2 . . . a|Q| is selected from A2|Q|1 such that
a0=vs a1=vs+1 . . . ak=vs+k . . . an−s=vn
a−1=a−2=vs−2 . . . a−k=vs−k . . . a−s=vO
then the machine execution in the prime directed edge from head and tail execution nodes will construct prime directed edge ΔΓ.
When the head node is a halting node, the machine execution must halt in at most |Q| steps. Otherwise, it would visit a non-halting state twice and thus, be a non-halting head node. The rest of the argument for this halting node is the same as for the non-halting head node.
Given a valid periodic Turing Machine (Q, A, η) as input, the method works as follows.
Use the prime directed edge search method, above, of
Note that |Φ(k)| is finite and |Φ(k)|≦|P|k
The reason that |Φ(k)| is finite and |Φ(k)|/≦|P|k is as follows. |Φ(1)|=|P|. Analyzing the nested loops, in the immortal periodic point search method
for each E([p1, p2, . . . , pk], k) in Φ(k)
for each ΔjΓj in P { . . . }
For each edge sequence E([p1, p2, . . . , pk], k) chosen from Φ(k), at most |P| new edge sequences are put in Φ(k+1). Thus |Φ(k+1)|≦|P∥Φ(k)|, so |Φ(k)≦|P|k.
When (Q, A, η) is a periodic machine, method the immortal periodic point search method terminates in a finite number of steps with either a consecutive repeating state cycle or for some positive integer J, then Φ(J)=Ø. The reason that the immortal periodic point search method terminates in a finite number of steps with either a consecutive repeating state cycle or for some positive integer J, then Φ(J)=Ø is as follows. If (Q, A, η) has at least one configuration (q, k, T) that is an immortal point, then by definition a Turing machine that has at least one periodic configuration, whenever it has an immortal configuration is said to be a periodic Turing machine, which implies the existence of a periodic point p with some finite period N.
Thus, since every immortal periodic point induces a consecutive repeating state cycle, there is a consecutive repeating state cycle that corresponds to the immortal periodic orbit of p. Since the immortal periodic point search method searches through all possible prime edge sequences of length k, a consecutive repeating state cycle will be found that is contained in a prime directed edge sequence with length at most 2N. Thus, this immortal periodic point of period N will be reached before or while computing Φ(2N). Otherwise, (Q, A, η) does not have any configurations with an immortal orbit. In other words, for every configuration, (Q, A, η) halts in a finite number of steps.
Claim: There is a positive integer J such that every edge sequence terminates while executing the immortal periodic point search method. By reductio absurdum, suppose not. Then there is at least one infinite prime directed edge sequence that exists: this corresponds to an immortal orbit, which contradicts that (Q, A, η) does not have any configuration with an immortal orbit.
Immortal and Mortal Configuration
If a configuration (which may also be referred to as an Instantaneous Description (ID)) upon execution of Turing Machine (Q, A, η) halts after a finite number of computational steps, then it is called a mortal configuration (which may be referred to as a mortal ID). Otherwise a configuration (ID) is called immortal.
Turing Machine (Q, A, η) is called a halting machine if it contains only mortal (halting) configurations.
A Turing machine (Q, A, η) that has at least one periodic configuration, whenever it has an immortal configuration is said to be a periodic Turing machine.
|Φ(k)| is finite and |Φ(k)|≦P|k determines whether (Q, A, η) is a halting machine when (Q, A, η) is a periodic machine. This follows immediately that since when (Q, A, η) is a periodic machine, method immortal periodic point search method terminates in a finite number of steps with either a consecutive repeating state cycle or for some positive integer J, then Φ(J)=Ø) and the immortal periodic point search method.
Turing Immortality Problem and Halting Problem
The classic result of Turing machine theory is the undecidability of the problem of determining for a given configuration of a Turing machine (Q, A, η) is whether this configuration is immortal or mortal. This is called the halting problem.
The immortality problem is the problem of deciding for a given Turing machine (Q, A, η) whether it is a halting machine; in other words, determining whether an immortal configuration exists for the machine (Q, A, η).
Immortal Dynamic Register Machine
In the next section, a complete description of a dynamic register machine program, called an IDRM, is presented. This embodiment of a computing system implements the prime directed edge search method and the immortal periodic point search method, which includes the method of finding a consecutive repeating state cycle in an edge sequence. In this section, the design of this machine is explained from a human-friendly perspective. This section describes how the Turing machine (Q, A, η) is represented and where it is located in the registers of the IDRM. This section also describes how the prime directed edge search method and the immortal periodic point search method are implemented and executed by the IDRM program.
Below, the complete program of 1590 instructions composed from the Constant (C m n), Successor (S m), Transfer (T m n), Address (A m n), Jump (J m n q), Delete (D m n), and Update (U m n q) Instructions. With a valid periodic Turing Machine as input in its registers, this IDRM solves the Turing Immortality problem for periodic Turing Machines after a finite number of execution steps.
The states Q of machine (Q, A, η) are represented with the natural numbers {1, 2, . . . , |Q|}. The alphabet symbols are represented with natural numbers {1, 2, . . . |A|}. The function η determines all the Turing machine commands. A Turing machine command is of the form (q a r b m) where 2≦q≦|Q|, where 1≦r≦|Q|, where 1≦a, b≦|A| where 1≦m≦2. The variable m=1 represents a left tape move and m=2 represents a right tape head move. As described in definition of a Turing machine, the design of the IDRM assumes that 1 with respect to Q is the halting state. This is why q≧2.
Registers 0 to 155 are reserved for computation, program flow and important constants. The design of the IDRM assumes that registers 156 through 160 contain the first Turing machine command, which is of the form (2 1 r b m). Further, it is assumed that the instructions for the Turing machine are dictionary ordered over the first two coordinates. In other words, each Turing machine command of the form (q a r b m) is stored as follows:
A.) q is stored in register number 5(q−1)a+151
B.) a is stored in register number 5(q−1)a+152
C.) r is stored in register number 5(q−1)a+153
D.) b is stored in register number 5(q−1)a+154
E.) m is stored in register number 5(q−1)a+155
F.)
The initial register contents starting at register 156 are shown in the table:
This means register 157 contains a 1; register 158 contains r2i; register 159 contains b21 register 160 contains m21; register (160+5|A|) contains m31 and so on.
The 0 in register number 5(|Q|−1)|A|+156 indicates the end of the Turing machine program. At the beginning of program execution, the design of the IDRM assumes that register 0 contains the address 5(|Q|−1)|A|+156. In other words, (R 0)=5(|Q|−1)|A|+156. This assumption is made so that the IDRM can determine if the Turing machine program is presented in a valid format in registers 156 through register 5(|Q|−1)|A|+155. This is analogous to the notion of a well-formed formula in mathematical logic. See [ENDERTON].
In other embodiments, the registers could be virtual registers, the registers could be numbered differently, and/or the contents of the memory could be stored in another manner. FIG. 28 shows a flowchart for a method of finding infinite loops.
As an overview of the computer program below, in the program below, overall, the purpose of instructions 0 to 296 in the IDRM program is to check that the Turing machine (Q, A, η) is stored in a valid format starting at register 156 and to set up registers for specific purposes based on ‥Q| and |A| in machine.
Overall, the purpose of instructions 297 to 857 in the IDRM is to construct a linked list of all, if any exist, the prime directed edges of the given Turing Machine (Q, A, η) whose command set starts at register 156. These 858 instructions execute the prime directed edge search method. After the prime directed edge search method described in the the prime directed edge search method is completed, instructions 858 to 1589 of the IDRM program execute the immortal periodic point search method. Next, further details of the IDRM program are discussed.
In step 1502, parameters of the program being checked are read into the system. In step 1504, a determination is made whether the input has the correct format. As an example, in the embodiment of the program below, instructions 0 through 126 in the IDRM determine whether the Turing machine represented in registers 156 through register (5(|Q|−1)|A|+155) is in a valid format.
If in step 1504, a determination is made that the instructions are not in the correct format, the method proceeds to step 1506, and in step 1506 the method terminates. Optionally, an error message may be returned. For example, in the program below, if not the format is not correct, then execution of the IDRM jumps to instruction 1570 and writes “ERROR TURING PROGRAM” in registers 0 through 19 using the ASCII code representation. In other words, 65 corresponds to “A”; 69 corresponds to “E”; 82 corresponds to “R” and so on. Checking the validity of the format helps assure that the execution of the IDRM always terminates regardless of the initial contents of the registers in the IDRM.
Returning to step 1504, if the format is correct, the method proceeds to step 1508. In step 1508, the parameters are placed in their proper registers. In step 1510, the registers are set up for performing computations. Observe that in the example below rather than omitting a Turing machine command, in contrast to the convention in [TURING] and [DAVIS], if η(q, a) halts, the IDRM uses the convention (q a 1 b m) to represent this halting instruction as specified in section 2. Regarding the representation of the instruction (q a 1 b m) in the example below, the natural number q is stored in register 5(q−1)a+151; the number a is stored in register 5(q−1)a+152; 1 is stored in register 5(q−1)a+153; b is stored in register 5(q−1)a+154; and m is stored in register 5(q−1)a+155.
Regarding the setting up of the registers, in the example, below, after the 0 in register (5(|Q|−1)|a|+156) there are four unused registers, followed by the A offsets: A2, A3, . . . A|Q|. The A offsets are used to help the IDRM more effectively lookup the next Turing command based on the prior state and tape symbol. The A offsets are determined and stored by instructions 127 through 153 of the IDRM.
After the A offsets, some registers are used to store information necessary to do the prime edge computations for each tape pattern element. The location of these registers are based on the values of |A| and |Q|. In more detail, instructions 154 through 296 set up a scratch pad of registers needed to execute the prime directed edge search method i.e. the finding and storing of all prime directed edges of (Q, A, η)—if any exist. In particular, instructions 154 through 167 set up registers to record the current prime input command sequence. Instructions 168 to 190 set up registers to record the current prospective head node. Instructions 191 to 212 set up registers to record the current prospective tail node.
Instructions 213 to 233 set up registers to record the execution tape during the computation of a prospective prime directed edge. Instructions 234 to 254 set up registers to store an iteration tape, which is used to iterate through every tape pattern in A2|Q|+1. Instructions 255 to 265 set up registers to record the tape head moves during the computation of the prospective prime edge. Instructions 266 to 292 set up registers to compute the window of execution. Instructions 293 to 296 set up memory pointers to record the number of prime edges found so far and store a linked list of prime edges. In instruction 296, a free heap pointer is stored in register 155. In step 1514, method 1500 searches for (e.g., by computing) the prime directed edges.
Description of the IDRM Program Implements Method 1400 (
For example, for each non-halting state q in Q and for each tape pattern in A2|Q|+1 the IDRM program executes machine (Q, A, η) for at most n≦|Q| computational steps of the Turing machine. As a result, this particular tape pattern and starting state q form a prime directed edge or they do not. If they do, the prime directed edge is stored in a prime edge linked list.
Each element (node) in the prime edge linked list is stored contiguously in registers as follows: next_node, pe_number, h_node, t_node, s_node, n, q, s, s_p, v0, v1 . . . vn, r, t, t_p, w0, w1 . . . wn, 2N, (q, vs), (q1, a1) . . . (qN, aN). In other words, if next_node is stored in register 7000, then pe_number is stored in register 7001. h_node (the head node) is stored in register 7002. t_node (the tail node) is stored in register 7003. s_node is stored in register 7004. n is stored in register 7005. q (the state) is stored in register 7006. s is stored in register 7007. s_p is stored in register 7008, and so on.
Now that the data structure for representing and storing prime directed edges in the registers has been described, more detail is provided on the instructions 297 to 857 that execute the prime directed edge search method.
In particular, instructions 297 to 313 initialize the tape pattern in A2|Q|+1 to all 1's. Instruction 314 begins the outer loop that iterates from state 2 up to state |Q|. This is the outer for loop in method the prime directed edge search, expressed as: For each non-halting state q in Q.
Instructions 331 to 349 copy the iterated tape pattern, starting at the register pointed to by register 68. Instruction 334 stores the value of 2|Q|+1 in register 2. Instructions 350 to 367 initialize the prospective head node state and the tape symbols. Instructions 371 to 395 initialize register 33 to the correct command (q a r b m) in the Turing command table. The current state q of the Turing machine is stored in register 65. The current tape symbol a is stored in register 66.
Instructions 396 to 408 store (qk ak) in the register that is pointed to by the contents of register 51. Instructions 409 to 483 execute one computational step of the Turing machine whose command table starts at register 156. Instruction 484 increments register 48 which stores the number of computational steps for this prospective prime directed edge.
Instructions 485 to 496 check to see if state qk+1 has already been visited. If so, the program execution jumps to instruction 497. Instructions 497 to 509 store (qN aN) starting at the register pointed to by the contents of register 51. Instructions 510 to 550 compute the window of execution. Instructions 551 to 578 increment the tape pattern which is an element of A2|Q|+1. Incrementing the tape pattern enables the program to search every element in A2|Q|+1 as a prospective head node.
Instructions 579 to 778 copy this new prime directed edge found to the end of the prime directed edge linked list, whose data structure format has already been described. Instructions 779 and 780 update the prime directed edge linked list pointers. Instructions 781 to 839 check if the new head node just found is the same as the head node at the end of the prime directed edge linked list. If yes, then the new prime directed edge is the same as the last one found and it is ignored.
Otherwise, the prime directed edge just found is new and so it is added to the end of the prime directed edge linked list. This is performed in instructions 840 to 854. The number of prime directed edges found so far is incremented in instruction 855.
Instructions 856 and 857 cause program execution to jump back to instruction 314, where the next tape pattern is examined to decide if the current state and the new tape pattern determine a new prime directed edge. When the tape pattern reaches all 1's again, instructions 328, 329 and 330 increment the state q and the next prime directed edge is searched for. Once all states have been exhausted up to the last state value |Q|, then the program jumps to instruction 858 where the immortal periodic search method starts.
Next in step 1516, the directed edges grouped into linked lists. In step 1516, a search is performed for prime directed edges having tail nodes that overlap match head nodes of other prime directed edges. For each match found, the edge substitution is performed to find the results. Each pair of overlap matching prime directed nodes may be stored as a sequence of overlap matching prime directed edges. Each sequence is compared to the prime directed edges to determine if any of the sequences overlap matches any of the prime directed edges. Optionally, instead of performing steps 1514 and 15I6 as separate consecutive steps, as each prime directed edge is added to the sequence, a check may be performed for consecutive repeated sequence of states.
After the prime directed edge search method is completed, instructions 858 to 1589 of the IDRM program execute the immortal periodic point search method. Following the notation of the immortal periodic point search method, Φ(k) is the set of all edge sequences of length k. The IDRM program, represents Φ(1), the set of prime directed edges as a linked list where each node is in square brackets:
The above representation of Φ(1) is constructed by the execution of instructions 858 to 1016 of the IDRM program. In other words, in the immortal periodic point search method, the expression
In more detail, instructions 858 to 875 set up an array of m prime edge pointers. Instructions 876 and 877 test if register 0 contains m, the number of prime directed edges. Instructions 878 to 885 initialize registers so that register 33 points to the next prime directed edge pointer, register 155 points to the free heap, and register 99 points to the head node of the edge sequence linked list. Also, register 97 is initialized to 1 which stores the number of distinct prime edges composed together in every element of Φ(1) i.e. the 1 in Φ(1). Register 96 is initialized to 1 which stores at that time during program execution the number of edge sequences in Φ(k). Instructions 886 and 887 test if the program is finished with constructing Φ(1).
Instructions 888 to 903 set up the h_node, t_node, and s_node pointers. Instructions 904 to 910 store state rj. Instructions 911 to 918 store idxj. Instructions 919 to 926 store ubj. Instructions 927 to 938 store lb_ptrj. Instructions 939 to 945 compute idx_ptrj. Instructions 946 to 951 store idx_ptrj. Instructions 952 to 957 compute ub_ptrj. Instructions 958 to 963 store ub_ptrj. Instructions 964 to 969 store p1,j which equals j. Instructions 970 to 987 store w0,j, . . . widx,j . . . wub,j. Instructions 988 to 1004 store (q0,j, a0,j), (q1,j, a1,j), . . . , (qNj,j, aNj,j). Instructions 1005 to 1016 update pointers and registers to jump back to instruction 886 and repeat this loop for the j+1st prime edge that is stored in E(1).
After Φ(1) is constructed, instruction 1018 is the start of the loop where Φ(k+1) is constructed from Φ(k). Instruction 1018 corresponds to the beginning of the while loop while (Φ(k)≠Ø) in the immortal periodic point search method. In particular, if Φ(k)=Ø is executed by instructions 1021 and 1022. If Φ(k)=Ø, then the IDRM program jumps to instruction 1551. After this the program writes “HALT” in registers 0 through 4 using the ASCII code representation. Then the IDRM program jumps to instruction 1590 which does not exist and this terminates the execution.
Instruction 1028 corresponds to the beginning of the for loop
for each E([p1, p2, . . . , pk], k) in Φ(k) in the immortal periodic point search method. Instruction 1032 corresponds to the beginning of the for loop: for each prime directed edge ΔjΓj in P in method the immortal periodic point search method. Next in method 2800, in step 2818, a search is performed for consecutive repeated state cycles (as in method 8.32).
In regard to if ΔjΓj link matches with Πp(k) in the immortal periodic point search method, instructions 1070 to 1461 test for an overlap match between the current prime edge found and the execution node Πp(k) in the loop starting at instruction 1032 if E([p1, p2, . . . , pk, pk+1], k+1) contains a consecutive repeating state cycle in method 8.36 is executed in instructions 1475 to 1537 of the IDRM program. Instructions 1475 to 1537 look for a consecutive repeating state cycle in (q0,j, a0,j) (q1,j, a1,j), . . . , (qNj,j, aNj,j).
If a consecutive repeating state cycle is found, the program jumps to instruction 1557. Then it writes “IMMORTAL” in registers 0 through 7 using the ASCII code representation. After the program writes the length of one repeat of the consecutive repeating state cycle in register 8. After the program writes the starting register of the first repeat of the state cycle in register 9 and writes the starting register of the second repeat of the state cycle in register 10. Then the IDRM program jumps to instruction 1590 which does not exist and this terminates the execution.
Next the representation of Φ(k) in the registers of the IDRM program is discussed. Similar to Φ(1) the jth element in Φ(k) is of the form:
[ptrj, 2Nj, rj, idxj, ubj, lb_ptrj, idx_ptrj, ub_ptrj, p1, p2, . . . , pk
w0,j, widx,j . . . wub,j, (q0,j, a0,j) (q1,j, a1,j), . . . , (qNj,j, aNj,j)]
In an embodiment, each of the steps of method 1500 is a distinct step. In another embodiment, although depicted as distinct steps in
This section presents a complete formal description of a dynamic register machine program, called the IDRM, that determines for a periodic Turing Machine, whether it is a halting machine or contains an immortal periodic configuration. This embodiment of a computing system is achieved with a program composed of 1590 instructions that are selected from the Constant (C m n), Successor (S m), Transfer (T m n), Address (A m n), Jump (J m n q), Delete (D m n), and Update (U m n q) Instructions. Mathematical concepts and computational methods are described in sections 1 through 8.
The dynamic register machine instructions and program execution were described in section 0. The design of this program has been described above. Due to the lack of space and U.S.P.T.O. font requirements, the program comments are listed first rather than next to or above the program instruction, which is a common practice in computer programs.
In instruction number 0, register 0 stores the register number of the terminating zero register that indicates the end of the Turing program. In instruction number 3, register 21 stores the jump address which is 6. In instruction number 3, check if terminating zero register contains zero. If not, exit IDRM program with ERROR in TURING PROGRAM.
In instruction 6, the terminating zero register is ok. Now check that this register number is >156 where stored the Turing program begins. In instruction 10, test if terminating register <=156, then exit ERROR TURING PROGRAM. In instruction number 14, register 21 stores the jump address. In instruction 16, prepare to find the maximum alphabet and state values in Turing program, In instruction 17, register 30 stores the maximum alphabet value. In instruction 18, register 29 stores the maximum state value.
In instruction 21, register 34 contains state q in Turing command (q a r b m). In instruction 23, register 35 contains alphabet symbol a in Turing command (q a r b m). In instruction number 25, register 36 contains state r in Turing command (q a r b m). In instruction number 27, register 37 contains alphabet symbol b in Turing command (q a r b m).
In instruction 29, register 38 contains move symbol m in Turing command (q a r b m). In instruction 31, if state q=0, then end of valid Turing program or invalid program. In instruction 33, store new state value from Turing program in register 0. In instruction 34, register 29 contains the current maximum state value. In instruction 35, register 20 stores the continue address 38 after the maximum subroutine exit.
Instructions 36 and 37 jump to program instruction 109 where the maximum subroutine starts. Instruction 38 copies the new maximum state value from register 2 into register 29. In instructions 41 and 42, if alphabet symbol a=0 in (q a r b m), then jump to instruction 1570 where “Error Turing program” is written to registers 0 through 19 in ASCII format.
In instruction 42, store new alphabet a value in (q a r b m) from Turing program in register 0. In instruction 43, store current maximum alphabet value in register 1. In instruction 44, register 20 stores the continue address 47 after max subroutine exit. In instruction 46, jump to program instruction 109 where the max subroutine starts. In instruction 47, copy new maximum alphabet value from register 2 into register 30.
In instructions 49 and 50, if state value r=0, (q a r b m), exit with ERROR. It is an invalid Turing program. In instruction 51, store current state r from Turing command in register 0. In instruction 51, store maximum state in register 0. In instruction 53, register 20 stores the continue address 56 after max subroutine exit. In instruction 56, copy new maximum state value from register 2 into register 29. In instruction 59, if symbol b=0, in (q a r b m) exit with ERROR, Invalid Turing program.
In instruction 60, store new alphabet “b” value in (q a r b m) from Turing program in register 0. In instruction 61, store current maximum alphabet value in register 1. In instruction 64, jump to program instruction 109 where the max subroutine starts. In instruction 65, copy new maximum alphabet value from register 2 into register 30. In instruction 68, check if move symbol m=1, LEFT move, in (q a r b m). In instruction 71, check if move symbol m=2, RIGHT move, in (q a r b m).
In instruction 72, if an invalid move symbol, exit with ERROR. Invalid Turing program In instruction 74, increment reg 33 to indirectly point to q in next (q a r b m) command. In instruction 76, jump to Line 21 to start checking the next command (q a r b m). In instruction 77, Turing program commands start at register 156.
Starting at instruction 78, now that maximum state and alphabet values are determined use these in a state and alphabet loop to check that there is a valid Turing program starting at register 156. In instruction 83, start Q_count loop. Q_COUNT is iterated from 2 to MAX_Q. The halt state is represented with 1, so Q_COUNT is initialized to 2. In instruction 87, the start of of alphabet A_COUNT loop. The alphabet symbols ranges from 1 to |A|=MAX_A. In instruction 90, store q from (q a r b m) command in register 34. In instruction 92, store a in command (q a r b m) in register 35.
In instruction 98, check that q=Q_COUNT in register 23. In instruction 100, if (q !=Q_COUNT), then it is an invalid Turing program. Exit with ERROR. In instruction 102, check that a=A_COUNT in register 25. In instruction 104, if (a !=A_COUNT), then it is an invalid Turing program. Exit with ERROR. In instruction 105, register 18 stores the number of insert instructions for Update (U m 18 q). In instruction 106, register 19 stores the number of instructions to delete in (D m 19). In instruction 107, line 127 is where the A OFFSETS program is located. In instruction 108, jump to A offsets.
Starting at instruction 109, the MAXIMUM program, compares registers 0 and 1. It returns the maximum of registers 0 and 1 in register 2. The A_offsets are determined and stored by instructions 127 to 153. In particular, the A_offsets A—2, A—3, . . . , A_|Q| are stored at (R (R 39)), (R (+(R 39) 1)), and so on. In instruction 128, register 156 contains 2 which is the first Turing command (2 1 r b m) in a valid Turing program. In instruction 135, offset A_k is stored in the next register, with A—2 in (R (R 39)). In instruction 138, add 5 to register 0 so that it points to the next Turing command (q a r b m).
Instructions 154 to 296 set up a scratch pad of registers to execute prime directed edge search method 8.34 described in section 8. Instructions 154 to 167 set up registers to record the prime input command sequence. Instructions 168 to 190 set up registers to record current prospective head node. Instructions 191 to 212 set up registers to record the current prospective tail node. Instructions 213 to 233 set up registers to record the execution tape during the computation of a prospective prime directed edge.
Instructions 234 to 254 set up registers to store an iteration tape, which is used to iterate through every tape patter in A2|Q|+1. Instructions 255 to 265 set up registers to record the tape head moves during computation of the prospective prime edge. Instructions 266 to 292 set up registers to compute the window of execution.
Instructions 293 to 296 set up memory pointers to record the number of prime edges found so far and store a linked list of prime edges. In Instruction 296 a free heap pointer is stored in register 155. Instructions 297 to 858 perform the Prime directed edge search method as defined in 8.34 Instructions 297 to 313 initialize the tape A2|Q|+1 to all 1's. Instructions 331 to 349 copy the iterated tape pattern, starting at the register pointed to by register 68. Instruction 334 stores the value of 2|Q|+1 in register 2. Instructions 350 to 367 initialize the prospective head node state and the tape symbols. Instructions 371 to 395 initialize register 33 to the correct command (q a r b m) in the Turing command table.
The current state q of the Turing machine is stored in register 65. The current tape symbol a is stored in register 66. Instructions 396 to 408 store (qk, ak) in the register that is pointed to by the contents of register 51. Instructions 409 to 483 execute one computational step of the Turing machine whose command table starts at register 156.
Instruction 484 increments register 48 which stores the number of computational steps for this prospective prime directed edge. Instructions 485 to 496 check to see if state qk+1 has already been visited. If state qk+1 has already been visited, jump to 497. Instructions 497 to 509 store (qN, aN) starting at the register pointed to by the contents of register 51. Instructions 510 to 550 compute the window of execution. Instructions 551 to 578 increment the tape pattern which is an element of A2|Q|+1. This enables the program to search every element in A2|Q|+1 as a prospective head node.
Instructions 579 to 778 copy this new prime directed edge found to the end of the prime directed edge linked list. Instructions 779 and 780 update the prime directed edge linked list pointers. Instructions 781 to 839 check if the new head node just found is the same as the head node at the end of the prime directed edge linked list. If yes, then the new prime directed edge is the same as the last one found and it is ignored.
The prime directed edge just found is new and so it is added to the end of the primed directed edge linked list. This occurs in instructions 840 to 854. The number of prime directed edges found so far is incremented and stored in register 81. In instruction 857, Jump back to instruction 314 where the next tape pattern is examined to decide if the current state and new tape pattern determine a new prime directed edge. Instructions 858 to 875 set up an array of m prime edge pointers.
Instructions 876, 877 test if register 0 contains m, the number of prime directed edges. Instructions 878 to 885 initialize registers so that register 33 points to the next prime directed edge pointer, register 155 points to the free heap, and register 99 points to the head node of the edge sequence linked list. In instruction 884, Register 96 stores the number of current edge sequences in E(k). In instruction 885, register 97 is initialized to 1 and stores the number of distinct prime edges composed together in every element of E(1).
Instructions 888 to 903 set up the h_node, t_node and s_node pointers. Instructions 904 to 910 store state r_j. Instructions 911 to 918 store idx_j. Instructions 919 to 926 store ub_j. Instructions 927 to 938 store lb_ptr_j. Instructions 939 to 945 compute idx_ptr_j. Instructions 946 to 951 store idx_ptr_j. Instructions 952 to 957 compute ub_ptr_j. Instructions 958 to 963 store ub_ptr_j. Instructions 964 to 969 store p1,j which equals j. Instructions 970 to 987 store w0,j . . . widx,j . . . wub,j. Instructions 988 to 1004 store (q0,j, a0,j) . . . (qNj,j, aNj,j)
Instructions 1005 to 1016 update pointers and pointers to jump back to instruction 886. In instructions 1015 and 1016, the program jumps back to instruction 886 and repeats this loop for the j+1st prime edge that is stored in E(1). Instruction 1018 is the start of the loop where E(k+1) is constructed from E(k). In instructions 1021 and 1022, check if E(k)=empty set i.e. if the number of edge sequences=0. If E(k)=empty set, jump to instruction 1551 and write HALT, using the ASCII representation, in registers 0 to 4.
Instruction 1028 corresponds to the start of for loop: for each E([p1, p2, . . . , pk], k) in E(k) in method 8.34. Instruction 1032 is the beginning of the for loop: for each prime directed edge (ΔjΓj) in prime edge set P if ΔjΓj link matches with Πp(k) then in method 8.34 is executed starting at instruction 1070. Instructions 1070 to 1461 test for an overlap match between the current prime edge found in the loop beginning at instruction 1032 and the execution node.
Instructions 1475 to 1537 search for a consecutive repeating state cycle in (q0,j, a0,j), (q1,j, a1,j), . . . , (qNj,j, aNj,j). if E([p1, p2, . . . , pk, pk+1], k+1) contains a consecutive repeating state cycle, as stated in 8.34, is executed in instructions 1475 to 1537. Instruction 1551 is reached if the Turing machine was valid and it is a halting machine. Instruction 1551 stores “H” in register 0. ASCII code 72=“H”. Instruction 1552 stores “A” in register 1. ASCII code 65=“A”. Instruction 1553 stores “L” in register 2. ASCII code 76=“L”. Instruction 1554 stores “T” in register 3. ASCII code 84=“T”. Instruction 1555 stores address 1590 in register 21. And instruction 1556 jumps to end of the IDRM program.
Instruction 1557 is reached if the Turing machine was valid and it has an immortal periodic point. Instruction 1557 stores “I” in register 0. ASCII code 73=“I”. Instruction 1558 stores “M” in register 1. ASCII code 77=“M”. Instruction 1559 stores “M” in register 2. ASCII code 77=“M”. Instruction 1560 stores “O” in register 3. ASCII code 79=“O”. Instruction 1561 stores “R” in register 4. ASCII code 82=“R”. Instruction 1562 stores “T” in register 5. ASCII code 84=“T”. Instruction 1563 stores “A” in register 6. ASCII code 65=“A”. Instruction 1564 stores “L” in register 7. ASCII code 76=“L”. Instruction 1565 stores the length of one repeat of the consecutive repeating state cycle. Instruction 1566 stores the register where the first repeat of the state cycle begins.
Instruction 1567 stores the register where the second repeat of the state cycle begins. Instruction 1568 stores address 1590 in register 21. Instruction 1569 jumps to the end of the IDRM program. Instruction 1570 is reached if the Turing program is in an invalid format. Instruction 1570 stores “E” in register 0. ASCII code 69=“E”. Instruction 1571 stores “R” in register 1. ASCII code 82=“R”. Instruction 1572 stores “R” in register 2. ASCII code 82=“R”. Instruction 1573 stores “O” in register 3. ASCII code 79=“O”. Instruction 1574 stores “R” in register 4. ASCII code 82=“R”. Instruction 1575 stores “ ” in register 5. ASCII code 32=“ ”. Instructions 1576 through 1589 store “TURING PROGRAM” in registers 6 through 19, using ASCII format as described in the previous instructions.
The complete IDRM program description starts below. The first column shows the instruction number starting at 0. The second column shows the dynamic register machine instruction. When the last number is reached (e.g., number 24 on this page), the table continues on the right side of the page (e.g., number 25 on this page).
The following patents describe active element machines, which are incorporated herein by reference, Patent Cooperation Treaty Application, Serial Number PCT/US06/26159 (Docket #11-11), entitled “Active Element Machine Computation,” filed Jul. 3, 2006; U.S. patent application Ser. No. 11/477,201 (Docket #11-9), entitled, “Register and Active Element Machines: Commands, Programs, Simulators, and Translators,” filed Jun. 27, 2006; U.S. Provisional Application Ser. No. 60/699,244 (Docket #11-10), “Abstract Register and Active Element Machines Commands, Programs, Simulators, and Translators,” entitled filed Jul. 14, 2005; U.S. patent application Ser. No. 11/178,665 (Docket #11-3) entitled, “Active Element Machine Computation,” filed Jul. 11, 2005; U.S. patent application Ser. No. 10/791,249 (Docket #11-2), entitled “Effector Machine Computation,” filed Mar. 2, 2004; and U.S. Provisional Patent Application Ser. No. 60/456,715, filed Mar. 24, 2003.
For example input active elements may receive input from a keyboard, tracking device, microphone, and/or a network of machines, such as the internet. Some of the active elements produce the output of the active element machine and may communicate with a monitor, speaker, and/or a network of other machines, for example. Optionally, the active element machine may also include computation active elements, which only send messages to and receive messages from other active elements.
Each active element may receive input from a plurality of active elements and send messages to a plurality of active elements. In response to receiving a set of one or more signals, if the sum of the signals received from other active elements cross a preset threshold within a given window of time, the active element fires, sending messages to other active elements.
The connections between the active elements may be altered and the pulse width and amplitude, may be changed while the active element machine is running. The basic instruction set for the active element machine addresses individual active elements connecting and disconnecting active elements to one another and altering the signals sent along the connections.
The active element machine instructions includes time as a parameter allowing the timing of the execution of the instructions to be timed to occur at precise times. The active element machine is a massively parallel processing machine in which instructions may be processed simultaneously. The active element machine may be programmed using a conventional compiler, which converts the convention programming language (e.g, C, JAVA, Visual BASIC) in the basic instructions set of the active element machine. Optionally the active elements may be grouped into different modules having different functions.
Alternatively, the active element machine may be given a training set of input-output pairs, and the active element machine implements an algorithm of changing its structure until a machine architecture is found that best implements the training set. Optionally the active elements may be grouped into different modules which during the training may be altered and/or switched with one another to create mutations and permutations of prior machines to experiment with which machine implements the training set the best.
In
Further, each module may have any number of active elements. Any of the machine and/or methods of this specification may be implemented on an active element machine. In other embodiments, active element machine 1600 may include additional components and/or may not include all of the components of
Machine 1700 is an example of machine that may be used for hardware of the specification. Although active element machine of
Output system 1702 may include any one of, some of, any combination of, or all of a monitor system, a handheld display system, a printer system, a speaker system, a connection or interface system to a sound system, an interface system to peripheral devices and/or a connection and/or interface system to a computer system, intranet, and/or internet, for example.
Input system 1704 may include any one of, some of, any combination of, or all of a keyboard system, a mouse system, a track ball system, a track pad system, buttons on a handheld system, a scanner system, a microphone system, a connection to a sound system, and/or a connection and/or interface system to a computer system, intranet, and/or internet (e.g., IrDA, USB), for example.
Memory system 1706 may include, for example, any one of, some of, any combination of, or all of a long term storage system, such as a hard drive; a short term storage system, such as random access memory; a removable storage system, such as a floppy drive or a removable drive; and/or flash memory. Memory system 1706 may include one or more machine-readable mediums that may store a variety of different types of information.
The term machine-readable medium is used to refer to any non-transient medium capable carrying information that is readable by a machine. One example of a machine-readable medium is a non-transient computer-readable medium. Another example of a machine-readable medium is paper having holes that are detected that trigger different mechanical, electrical, and/or logic responses.
Processor system 1708 may include any one of, some of, any combination of, or all of multiple parallel processors, a single processor, a system of processors having one or more central processors and/or one or more specialized processors dedicated to specific tasks.
Communications system 1712 communicatively links output system 1702, input system 1704, memory system 1706, processor system 1708, and/or input/output system 1714 to each other. Communications system 1712 may include any one of, some of, any combination of, or all of electrical cables, fiber optic cables, and/or means of sending signals through air or water (e.g. wireless communications), or the like. Some examples of means of sending signals through air and/or water include systems for transmitting electromagnetic waves such as infrared and/or radio waves and/or systems for sending sound waves.
Input/output system 1714 may include devices that have the dual function as input and output devices. For example, input/output system 1714 may include one or more touch sensitive screens, which display an image and therefore are an output device and accept input when the screens are pressed by a finger or stylus, for example.
The touch sensitive screens may be sensitive to heat and/or pressure. One or more of the input/output devices may be sensitive to a voltage or current produced by a stylus, for example. Input/output system 1714 is optional, and may be used in addition to or in place of output system 1702 and/or input device 1704.
Each embodiment disclosed herein may be used or otherwise combined with any of the other embodiments disclosed. Any element of any embodiment may be used in any embodiment.
Although the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted for elements thereof without departing from the true spirit and scope of the invention. In addition, modifications may be made without departing from the essential teachings of the invention.
This application is a continuation-in-part of U.S. application Ser. No. 12/499,749 (Docket # BP-2), entitled “Executing Machine Instructions Comprising Input/Output Pairs of Execution Node,” filed Sep. 14, 2009, by Michael Stephen Fiske, which is incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 12499749 | Sep 2009 | US |
Child | 14696467 | US |