<p>Provided the site is still alive, the following YAML can be entered at TuringMachine.io to watch the machine run.</p>
- ```yaml
+ <RT·code>
+ # YAML
# Reverses a binary string using a single marker and an EOM terminator.
input: '11001'
blank: ' '
[0, 1, ' ']: {L: done}
done:
- ```
+ </RT·code>
<p>This machine starts with the head on the leftmost symbol of the input string, requiring an empty symbol on both sides to operate. The machine begins by sweeping right to place an end of message marker, E, immediately after the string. It then enters a repetitive process: it walks left to locate the next unprocessed input symbol, overwrites it with an asterisk to mark it as read, and then carries that remembered value rightward to deposit it at the new end of the sequence. By executing this back-and-forth shuttle, the machine systematically builds the reversed string to the right of the E, finishing by sweeping through to erase its temporary markers.</p>
<p>Although by definition each state transition matches one value under the head, as a practical matter, disjunctive selection is allowed via a comma list. A conjunctive phrasing for the state transition proposition would require stringing intermediate states in series.</p>
- <h2>Blank, empty, SP</h2>
+<h2>Blank, empty, SP</h2>
- <p>Turing described a clerk writing symbols into squares, with the option to erase them. He states, "In some of the configurations in which the scanned square is blank (i.e. bears no symbol) the machine writes down a new symbol on the scanned square: in other configurations it erases the scanned symbol."<RT·endnote>Alan M. Turing, "On Computable Numbers, with an Application to the Entscheidungsproblem," Proceedings of the London Mathematical Society, Series 2, Volume 42 (1936): 231.</RT·endnote> So Turing's original article uses <em>blank</em> to mean <em>no symbol</em>. Later Turing says, "We also give numbers to the symbols ... in particular, blank = S₀ .." <RT·endnote>ibid: 239.</RT·endnote>.</p>
+ <p>Turing described a clerk writing symbols into squares, with the option to erase them. He states, "In some of the configurations in which the scanned square is blank (i.e. bears no symbol) the machine writes down a new symbol on the scanned square: in other configurations it erases the scanned symbol."<RT·endnote>Alan M. Turing, "On Computable Numbers, with an Application to the Entscheidungsproblem," Proceedings of the London Mathematical Society, Series 2, Volume 42 (1936): 231.</RT·endnote> So initially Turing's original article uses <em>blank</em> to mean <em>no symbol</em>. However, later Turing says, "We also give numbers to the symbols ... in particular, blank = S₀ ." <RT·endnote>ibid: 239.</RT·endnote>.</p>
- <p>The more abstract concept here is that of a container. A piece of paper is a container for symbols. When it contains no symbols, the container is empty. Only when we say the container is a piece of paper does it make sense to call it blank. But we are speaking of abstractions, not of paper. The question is not one of blankness, rather it is the more abstract question of emptiness. As a point of perspective, when computation theory texts are translated into French, the blank symbol is called the "symbole vide", or literally "empty symbol", as apparently blank paper is empty.
+ <p>The abstract concept here is that of a container. A piece of paper is a container for symbols. When it contains no symbols, the container is empty. Only when we say the container is a piece of paper does it make sense to call it blank. But we are speaking of abstractions, not of paper. As a point of perspective, when computation theory texts are translated into French, the blank symbol is called the "symbole vide", or literally "empty symbol", as apparently blank paper is empty.
</p>
- <p>So the actual question, which dates back to the very definition of the Turing Machine, is this: when a <em>square</em> from Turing's paper, what we are calling a tape cell, has not yet been written to, does it hold an empty symbol, or is it actually empty?</p>
+ <p>Because emptiness is a property of a container, Turing's first statement can be modeled with a sequence of sets. For a Turing Machine tape, each sequence member is either an empty set or a singleton set. The mathematician who desires an initial empty tape, in the language of mathematics, defines it as an open sequence of empty sets:
- <p>A Turing Machine cannot function when a tape cell does not read a symbol, because the next state function is defined to be given the read symbol as an argument. A Turing machine would be unresolvable, i.e. it would break, if a scanned cell were void of symbols.</p>
+ <div style="margin-left: 2em;">
+ <RT·math>
+ T_0 = [ \lbrace \rbrace, \lbrace \rbrace, \lbrace \rbrace, \dots ]
+ </RT·math>
+ </div>
- <p>So we might imagine a tape machine, called machine A, where, upon attempting to read an empty cell, the machine head instead returns a control symbol representing that the cell was empty. To accomplish this, the head would have to do some work; it would have to be able to detect emptiness, and then choose to return the empty symbol instead of a read value. This feature would fix the problem of not having any defined next state behavior for an empty cell. Furthermore, suppose the inverse process is also special in that upon attempting to write the empty symbol, the machine takes action, emptying the cell out. This would facilitate an erase operation.</p>
+ <p>Each tape member set is called a <RT·term>cell</RT·term>. So an empty tape has all empty cells.</p>
- <p>Now imagine machine B, where a yet-to-be-used cell on a tape directly holds the empty symbol. Because it is merely another symbol, reads and writes occur exactly as they do for other symbols.</p>
+ <p>An empty sequence container is one that has zero length, so this definition for an empty tape is custom to Turing Machine tapes. An empty tape is not an empty sequence, rather it is an infinite sequence where every member is an empty set. In one sense this is a little peculiar that something said to be empty is infinite, in another sense it makes sense that an empty Turing Machine tape keeps its defining characteristics. That is, it remains a single ended Turing Machine tape, where any cell of the tape could be written with a symbol value, while the basic form of the tape will not change.</p>
- <p>As long as the cost of the empty cell fix is constant time, the differences between machine A and machine B are computationally inconsequential. However, for machine A, the mathematician is greatly inconvenienced if he cares to write down the contents of the tape, as he will need some means of communicating that a tape cell is empty. As a mathematician is wont to do, he would invent a symbol to express this meaning. The cup, empty box, or null set symbol are all possible choices. As soon as a choice is made, the only difference between Turing Machine A and Turing Machine B becomes a translation step between the symbol that represents an empty cell, and the symbol that is used to communicate this same meaning to the Turing Machine. The same symbol could be used for both purposes, thus eliminating the need for the translation. When this is done Turing Machine A becomes identical to Turing Machine B.</p>
+ <p>A conventionally defined Turing Machine will break if reading a cell does not yield a symbol, because the next state function has the read symbol as an argument.</p>
- <p>To say that a tape cell has never been written, is to say that the history of the tape cell is known. But no history is required to look at a blank piece of paper and to know it has no symbols on it. In addition, Turing allows that a tape cell can be "erased", so an empty cell is not necessarily one that has never been written. There is no need to know the full history of the cell, i.e. how many times it has been written and erased, rather only a single bit of information is required. This bit can be toggled when the cell is written, then toggled back when it is erased. This toggle can be the empty symbol existence. If the cell is marked as being empty, because it is holding the empty symbol, it is said to be empty, otherwise it is not. This is a description of machine B.</p>
+ <p>So we might imagine a tape machine, say called machine A, where, upon attempting to read an empty cell, the machine head instead returns a control symbol representing that the cell was empty. To accomplish this, the head would have to do some work; it would have to be able to detect emptiness, and then choose to return the empty symbol instead of a read value. This feature would fix the problem of not having any defined next state behavior for an empty cell. Furthermore, suppose the inverse process is also special in that upon attempting to write the empty symbol, the machine takes action, emptying the cell out. This would facilitate an erase operation.</p>
- <p>Thus it seems that no matter what is done to try and save the machine A model, it turns into machine B. There is a simple reason for this. No structural definition has been given for emptiness, rather its existence is pushed on to a symbol. Consequently, discussion of machine A always brings back the symbol.</p>
+ <RT·code>
+ def read(c)
+ if is_empty(c):
+ return 'empty'
+ else:
+ return c.get()
+ </RT·code>
- <p>Computational theorists often describe a two-step process. First, a Turing Machine writes a string to be studied onto a tape initially filled with all empty symbols; second, the tape is moved to another Turing Machine whose purpose is to recognize a property of the string being studied. In this process, a tape is used as a communication medium, so it follows that communication theory can be applied to this messaging scenario. Messages sent on a channel must be formatted so they can be placed on the channel and later recovered. The specification for such structuring is called a communication <RT·term>protocol</RT·term>. The protocol implies a higher authority, as both the sender and the receiver must have knowledge of the same designed-in protocol. In a sense, a protocol is the meta-message sent before the message itself.</p>
+ <RT·code>
+ def write(c, x):
+ if x == 'empty':
+ if(is_empty(c): return
+ else:
+ c.pop()
+ return
+ else:
+ c.pop()
+ c.put(x)
+ </RT·code>
- <p>The intention of the later innovation of placing the empty symbol in <RT·math>Γ</RT·math> but not in <RT·math>Σ</RT·math> appears to be that of making the empty symbol serve additional duty: firstly as a default value for a cell that has never been written to, secondly to effect erasure, and now thirdly as a control component of a communications protocol. Accordingly then, this protocol was designed by mathematicians with a specific goal. They intended to make it impossible for programmers to send 'to be studied' string messages that cannot always be recovered by a receiving recognizer Turing Machine. In short, the empty symbol is also being used as an in-band EOT (end of transmission) symbol.</p>
+ <p>Now imagine machine B, where the concept of an empty cell is jettisoned, and what remains is the mere memory of emptiness, a symbol called <RT·code>empty</RT·code>. Then using the language of mathematics, the mathematician defines an initial empty tape as:</p>
- <p>However, if this is the intention, the protocol is flawed, because Turing Machines are bestowed with the ability to erase characters. An input machine could, for example, happily output an array of strings while using an arbitrary number of empty symbols to separate the elements of a variable-length array. It can put these empty symbols into the input by first writing another symbol, then erasing it. A receiving machine could then not know how many elements it should try to recover, or when to say a separator is sufficiently long to no longer be considered a separator. Nothing in the Turing Machine definition prevents this.</p>
-
- <p>Furthermore, the Universal Turing Machine can act as the aforementioned higher authority. In this case, Turing Machines, and sometimes their tapes, are written to a Universal Turing Machine's tape. Consequently, it is not only possible to want to terminate multiple strings in series, as mentioned in the prior paragraph; the termination issue itself is embedded in proofs such as the Halting Problem.</p>
+ <div style="margin-left: 2em;">
+ <RT·math>
+ T_0 = \[ mathtt{empty}, mathtt{empty}, mathtt{empty}, \ldots \]
+ </RT·math>
+ </div>
- <p>A common technique programmers use for embedding strings with terminators within other strings is to embed escape characters. This is another in-band protocol, and it is inefficient. The escape sequences grow exponentially with nesting levels. Also, such strings with embedded escape sequences cannot be interpreted without knowledge of the intended nesting level of the string author, which requires the interpreter of the string to know the author's intentions.</p>
+ <p>For machine B, no modifications are required to the direct sequence read and write functions.</p>
+
+ <p>It is possible to build a mapping between the machine A and machine B approaches. The read and write operations are placed into correspondence. The empty set as a member of tape sequence of machine A is placed into correspondence with the <RT·code>empty</RT·code> symbol of machine B. The other components are defined identically, and map directly. This creates an isomorphism between the two machines. Hence, they are equally expressive. However machine B is simpler, so it is understandable that computer theoreticians have settled on this definition.</p>
- <p>For the modified computational Turing machine presented later in this chapter, there will be a separate control alphabet, as for the Hopcroft-Ullman interpretation. However, due to the reasons presented in this section, that alphabet will be part of the alphabet <RT·math>Σ</RT·math> rather than distinct from it. Programmers then must explicitly design communication protocols that suit the problems they are working on, and those protocols become opaque for examination by a higher authority.</p>
+ <p>If we view the <RT·math>empty</RT·math> symbol from within the definition of machine B, we have a paradox. A symbol represents that there is no symbol. Hence, if we are to keep the meaning of <RT·math>empty</RT·math> as that of no symbol, we must keep machine A, and the mapping. The empty symbol is named because in the isomorphism with machine A it corresponds to an empty set. However, this feels unsatisfactory, because in all other respects, machine B is a perfectly well defined Turing Machine, so in all other respects we do not need machine A.</p>
- <p>Thus, the <RT·code>empty</RT·code> symbol is to mean that a tape cell "bears no symbol", it is to be the initializer for blank tape, it is the symbol to write to make a tape cell empty, and it is an <RT·code>EOT</RT·code> marker when communicating tape <em>input</em> data. However, it can not do all these things.</p>
+ <p>Going back to Turing's moniker of <RT·code>blank</RT·code>, does not really help get rid of machine A because the original paper by Turing has it with the definition of "no symbol", it is merely the same name colored by the science of wood pulp. There is a pleasing property of the blank, i.e. the <RT·code>empty</RT·code> symbol, that is valuable and unique to it. It prints as a space in diagrams given in text books, and Turing Machine simulators. There is an analogous symbolic system that also has this characteristic, and is being leveraged in these situations: the ASCII hex 20, called SP. It prints as a space leaving an area of the paper it is printed on blank. Perhaps a better name for the ersatz <RT·code>empty</RT·code> symbol is <RT·code>SP</RT·code>.</p>
+
+ <p>There is more to consider about the former <RT·code>blank</RT·code>, former <RT·code>empty</RT·code>, now <RT·code>SP</RT·code> symbol. Computational theorists often describe a two-step process. First, a Turing Machine writes a string to be studied onto a tape initially filled with all <RT·code>SP</RT·code> symbols; second, the tape is moved to another Turing Machine whose purpose is to recognize a property of the string being studied. In this process, a tape is used as a communication medium, so it follows that communication theory can be applied to this messaging scenario. Messages sent on a channel must be formatted so they can be placed on the channel and later recovered. The specification for such structuring is called a communication <RT·term>protocol</RT·term>. The protocol implies a higher authority, as both the sender and the receiver must have knowledge of the same designed-in protocol. In a sense, a protocol is the meta-message sent before the message itself.</p>
+
+ <p>The intention of the later innovation of placing the <RT·code>SP</RT·code> symbol in <RT·math>Γ</RT·math> but not in <RT·math>Σ</RT·math> appears to be that of making the <RT·code>SP</RT·code> symbol serve additional duty: firstly as a default value for a cell that has never been written to, secondly to effect erasure, and now thirdly as a control component of a communications protocol. Accordingly then, this protocol was designed by mathematicians with a specific goal. They intended to make it impossible for programmers to send 'to be studied' string messages that cannot always be recovered by a receiving recognizer Turing Machine. In short, the <RT·code>SP</RT·code> symbol doubling as an in-band EOM (end of message) symbol.</p>
+
+ <p>Firstly note that excluding <RT·code>SP</RT·code> from <RT·math>Σ</RT·math> does not prevent a Turing machine from writing <RT·code>SP</RT·code> to a tape to be used as a message. If an message writing machine wants to write an <RT·code>SP</RT·code> to the tape, it merely writes a different symbol then erases it.</p>
+
+ <p>Secondly, once it is realized that <RT·code>SP</RT·code> symbols can be written to tape as messages, the very reason of excluding it from <RT·math>Γ</RT·math>, to guarantee that received messages are parsable, is lost. A message authoring machine could, for example, happily output a variable length array of strings while using an arbitrary number of empty symbols to separate the elements. A receiving machine could then not know how many elements it should try to recover, or when to say a separator is sufficiently long to no longer be considered a separator. Nothing in the Turing Machine definition prevents this.</p>
+
+ <p>Furthermore, the Universal Turing Machine can act as the aforementioned higher authority. In this case, Turing Machines, and sometimes their tapes, are written to a Universal Turing Machine's tape. Consequently, it is not only possible to want to terminate multiple strings in series, as mentioned in the prior paragraph; the termination issue itself is embedded in proofs such as the Halting Problem.</p>
- <p>Firstly, let us address the elephant in the room: if a tape cell is holding the empty symbol, it is not empty, certainly not in the sense of Turing's statement, "bears no symbol". So that purpose was chimeric. Secondly, reserving a symbol but placing it in <RT·math>Γ-Σ</RT·math> does not solve the communication protocol problem. Thirdly, writing an <RT·code>EOT</RT·code> marker over other data does not universally constitute "erasure", particularly when the abstract distinction between erasing a cell and merely overwriting its contents is never formally defined.</p>
+ <p>A common technique programmers use for embedding strings with terminators within other strings is to embed escape characters. This is another in-band protocol, and it is inefficient. The escape sequences grow exponentially with nesting levels. Also, such strings with embedded escape sequences cannot be interpreted without knowledge of the intended nesting level of the string author, which requires the interpreter of the string to know the author's intentions.</p>
- <p>There is one pleasing property of the blank, the ersatz <RT·code>empty</RT·code> symbol, that is valuable and unique to it. It prints as a space in diagrams given in text books, and by Turing Machine simulators. There is an analogous symbolic system that also has this characteristic: the ASCII hex 20, called SP, prints as a space, leaving an area of the paper it is printed on blank. Perhaps a better name is then the <RT·code>SP</RT·code> symbol. However, at this point, <RT·code>SP</RT·code> is merely another symbol in the alphabet <RT·math>Σ</RT·math>, and if the programmer wants it he can put it there. If the programmer wants it to participate in protocols, he can design it in. It need not have any special place in the Turing Machine definition.</p>
+ <p>For the modified computational Turing machine presented later in this chapter, there will be a separate control alphabet of predefined symbols, as for the Hopcroft-Ullman interpretation. However, so as to support recursion, and because the current scheme doesn't work anyway, that alphabet will be part of the alphabet <RT·math>Σ</RT·math> rather than distinct from it. Programmers then must explicitly design communication protocols that suit the problems they are working on, and those protocols become opaque for examination by a higher authority. Using <RT·code>SP</RT·code> as an EOM provides a reasonable approach for specific problems, whereas the current discussion focuses on establishing a rigorous modified Turing Machine definition.</p>
<h2>The <RT·code>unspecified</RT·code> symbol</h2>
- <p>In the first edition of this book, I introduced a "read only after write" rule while working towards an architectural Turing Machine so as to sideline the empty symbol. This section presents a computation theoretic TTCA Turing Machine that intrinsically enforces the "read only after write" rule by giving built-in meaning to the <RT·code>unspecified</RT·code> symbol. The concept of <em>unspecified</em> then displaces the concept of <em>empty</em> for the Turing Machine tape cell.</p>
+ <p>In the first edition of this book, I introduced a "read only after write" rule while working towards an architectural Turing Machine because conventional architectures do not maintain a concept of empty memory. The approach described in this section moves the "read only after write" rule back into a computation theoretic machine by designing in the <em>unspecified</em> symbol, which then displaces the concept of an <em>empty</em> cell.</p>
- <p>The standard 9-track tape introduced by IBM in 1964 came from the factory unformatted. The format operation would write a header and an EOF marker to mark the end of the device file. Then, a standard library call such as open(), followed by write(), would write over the EOF marker, continue writing data, and finally append a new EOF marker, essentially pushing the EOF boundary back. EOF could be pushed back until the physical EOT marker was struck. This matches, in some ways, how the empty symbol is used on the computation theoretic Turing Machine in the Hopcroft and Ullman book if we consider it to be an EOF marker. However, a difference exists in that the real machine would never use an EOF to erase data characters.</p>
+ <p>The standard 9-track tape introduced by IBM in 1964 came from the factory unformatted. The format operation would write a header and an EOF marker to mark the end of the device file. Then, a standard library call such as open(), followed by write(), would write over the EOF marker, continue writing data, and finally append a new EOF marker, essentially pushing the EOF boundary back. EOF could be pushed back until the physical EOM marker was struck. This matches, in some ways, how the empty symbol is used on the computation theoretic Turing Machine in the Hopcroft and Ullman book if we consider it to be an EOF marker. However, a difference exists in that real machines do not use an EOF to erase data characters.</p>
- <p>While using the standard library to write tapes, the uninitialized part of the tape could not be read until after it was written, so early tape machines indeed enforced the "read only after a write" rule. However, if the programmer were to seek the head back into the device file to do fresh work and perform reads and writes, the device EOF would be nowhere in sight. The burden of the "read only after a write" rule would then fall on the shoulders of the programmer, as would the structuring of the data.</p>
+ <p>While using the standard library to write tapes, the uninitialized part of the tape could not be read until after it was written, so early tape machines indeed enforced the "read only after a write" rule. However, if the programmer were to seek the head back into the device file to do fresh work and perform reads and writes, the device EOF would be nowhere in sight. The burden of the "read only after a write" rule would then fall on the shoulders of the programmer, as would the task of structuring the data.</p>
- <p>Core memory, and later system memory, was random access and initially fully accessible. The data would be whatever scrambled mess the machine booted with, or in early virtual memory systems, whatever was left over from the prior use of the page. The approach of recycling pages was a security hazard, so today a page is initially allocated from a read-only zero page, and due to a copy-on-write trap, a new page will be created in memory then scrubbed with zeros. If the computational Turing Machine's empty symbol maps to a word of zeros, then the empty symbol remains a poor model, because generally the data message, say sent between the <em>input</em> writer and the <em>recognizer</em> receiver, will also contain many zeros. The advantage is that if a programmer attempts to dereference a zero pointer, a segmentation fault occurs. So in this system, the programmer is again burdened with maintaining the "read only after write" rule.</p>
+ <p>Core memory, and later system memory, was random access and initially fully accessible. The data would be whatever scrambled mess the machine booted with, or in early virtual memory systems, whatever was left over from the prior use of the page. The approach of recycling pages was a security hazard, so today a page is initially allocated from a read-only zero page, and due to a copy-on-write trap, a new page will be created in memory then the original page copied to it, thus scrubbing it with zeros. If the computational Turing Machine's empty symbol maps to a word of zeros, then the empty symbol remains a poor model, because generally the data message, say sent between the <em>input</em> writer and the <em>recognizer</em> receiver, will also contain many zeros. The advantage is that if a programmer attempts to dereference a zero pointer, a segmentation fault occurs. So in this system, the programmer is again burdened with maintaining the "read only after write" rule.</p>
<p>A violation of "read only after write" could be detected by a modified computation theoretic Turing Machine if, instead of an empty symbol, the initial tape is filled with the <RT·code>unspecified</RT·code> symbol. The end objective is to detect an erroneous condition, which is useful for debugging and testing. Conventionally, mathematicians do not concern themselves with the test and debug phases of programming a Turing Machine, but rather concern themselves with answering computation theoretic questions about known working Turing Machine programs. Though perhaps an algorithm could be studied for this very quality of not ever making decisions based on unspecified data. Nor do real machines have an <RT·code>unspecified</RT·code> symbol; rather, a program reads garbage from memory locations with unspecified data. There is precedent for an <RT·code>x</RT·code>, <em>unknown</em>, logic state in hardware simulators.</p>
- <p>Like the <RT·code>empty</RT·code> symbol, <RT·code>unspecified</RT·code> is a meta-symbol. It describes the data, or lack thereof, rather than being the data. Specifically, the <RT·code>unspecified</RT·code> symbol says that there is a singular alphabet symbol at the memory location, but the machine is not being instructed as to which symbol it is. Because the Turing Machine state transition function requires a specific symbol value, reading an <RT·code>unspecified</RT·code> symbol would break the machine. Of course, that would be a bad thing, so some sort of modification to the Turing Machine definition is required for working with an <RT·code>unspecified</RT·code> symbol.</p>
+ <p>Like the <RT·code>empty</RT·code> symbol, <RT·code>unspecified</RT·code> is a meta-symbol. It describes the data, or lack thereof, rather than being the data. Specifically, the <RT·code>unspecified</RT·code> symbol says that another machine, a machine A, would have a singular alphabet symbol at the memory location, but our machine B is not being instructed as to which symbol it is. Because the Turing Machine state transition function requires a specific symbol value, reading an <RT·code>unspecified</RT·code> symbol would break the machine. Of course, that would be a bad thing, so some sort of modification to the Turing Machine definition is required for working with an <RT·code>unspecified</RT·code> symbol.</p>
- <p>The three reasons that memory can be <RT·code>unspecified</RT·code>:</p>
+ <p>Reasons that memory can be <RT·code>unspecified</RT·code> include:</p>
<ol>
<li>The memory was not initialized.</li>
<li>The memory holds stale data written by an unrelated process, such as a reused memory allocation.</li>
- <li>The memory holds data that the program explicitly ignores, rendering it effectively unspecified.</li>
+ <li>The data is effectively unspecified because the program, by design, does not make decisions based upon its value.
</ol>
- <p>An example of effectively unspecified data would be a program that reverses a string without looking at the values being reversed. A string reverse function need not inspect the value of the string; it only needs to recognize the structural boundaries established by the writing protocol. So here is a second problem: under the conventional Turing Machine definition, treating data as effectively unspecified by ignoring it is impossible. Reading the value under the tape head is structurally integrated into the machine; it unavoidably gates the state transition function on every single step.</p>
-
+ <p>An example of effectively unspecified data would be a program that reverses a string without looking at the values being reversed. A string reverse function need not inspect the value of the string; it only needs to recognize the structural boundaries established by the writing protocol. Yet the conventional Turing Machine is incapable of doing this, and worse, as we saw, there is a proportional increase in the number of states for the reverse string controller when the number of symbols, symbols that could have been ignored for control purposes, is expanded.</p>
<h2>The TTCA computation theoretic Turing Machine</h2>
<p>There is a mechanical procedure for converting a Moore Machine into a Mealy Machine, and the reverse. Two such converted machines are equally expressive. Making the read operation an explicit action, instead of having it implied by a state transition, increases the number of states in a controller, and consequently the number of steps that must be taken. However, the new machine can do in two steps anything the former machine could do in one; consequently, this change affects the multiplier constant on the linear term of the step count formula but does not change the computation complexity class determined from such a step count. The layers of next-state functions can be collapsed into one layer, where the missing arguments are filled in with all possible unused values. This potentially increases the number of state transition arcs that must be specified, but the state transition logic and the number of states remain unchanged. Partitioning the machine definition by separation of concerns does not change the total specification. Hence, these modifications are computationally inconsequential.</p>
- <h3>The TTCA Turing Machine fixed part</h3>
-
- <div style="margin-left: 2em;">
- <RT·math>
- MF = (QF, ΣF, AF, δF_0)
- </RT·math>
- </div>
-
- <p>In the following the middle dot acts as a namespace operator, <RT·math>N{·}x</RT·math>. By doing this we assure there will be no aliasing with the symbols provided by the programmer when he defines the programmed state controller.</p>
-
- <p>The set of predefined <em>states</em>:</p>
- <div style="margin-left: 2em;">
- <RT·math>QF = \{QF{·}\mathtt{initial}, QF{·}\mathtt{unspecified\_decision}\}</RT·math>
- </div>
-
- <p>The state controller always starts in the <RT·code>QF·initial</RT·code> state. This is a symbol representing the state, it is not a register that holds a state. The 'F' values are all fixed.</p>
-
- <p>If a decision is attempted to be made on an <RT·code>ΣF·unspecified</RT·code> symbol, the machine transitions to the <RT·code>QF·unspecified_decision</RT·code> state, due to the global default transition defined in <RT·math>δF_0</RT·math>.</p>
-
- <p>The set of available actions:</p>
- <div style="margin-left: 2em;">
- <RT·math>
- \begin{aligned}
- AF = \{\\
- & \mathtt{no\_op} \\
- , & \mathtt{left} \\
- , & \mathtt{right} \\
- , & \mathtt{read\_d} \\
- , & \mathtt{read\_g} \\
- , & \mathtt{status} \\
- , & \mathtt{write\_σ}(σ) \\
- , & \mathtt{write\_d} \\
- , & \mathtt{write\_g} \\
- \}
- \end{aligned}
- </RT·math>
- </div>
- <p>where <RT·math>σ</RT·math> must be in <RT·math>Σ</RT·math>.</p>
-
- <p>The set of predefined symbols:</p>
- <div style="margin-left: 2em;">
- <RT·math>ΣF = \{ΣF{·}\mathtt{unspecified}, ΣF{·}\mathtt{on\_leftmost}\}</RT·math>
- </div>
-
- <p>The set <RT·math>δF_0</RT·math> holds one global default predefined transition of the form,
- <div style="margin-left: 2em;">
- <RT·math>
- \{\langle \mathtt{g{.}ΣF{·}unspecified}, \mathtt{QF{·}unspecified\_decision} \rangle\}
- </RT·math>
- </div>
- <p>In any state if the <RT·code>g</RT·code> register holds the symbol <RT·math>\mathtt{ΣF{·}unspecified}</RT·math>, then the next state will be <RT·math>\mathtt{QF{·}unspecified\_decision}</RT·math>, independent of all other defined next state transitions.</p>
+ <h2>TTCA computation theoretic TM executor directions</h2>
+ <p>To execute the programmed TTCA Turing Machine, a person must maintain the current machine variables <RT·math>MV</RT·math> and evaluate the programmed logic in an infinitely repeating two-phase cycle. Because this is a Moore-style architecture, the execution of an action is isolated from the evaluation of the next state transition.</p>
- <h3>The TTCA Turing Machine variables</h3>
-
- <div style="margin-left: 2em;">
- <RT·math>
- MV = (q, d, g)
- </RT·math>
- </div>
-
- <p><RT·math>q</RT·math>: is the current state of the machine.</p>
-
- <p><RT·math>d</RT·math>: is the data register.</p>
-
- <p><RT·math>g</RT·math>: is the gate register.</p>
-
-
- <h3>The TTCA Turing Machine programmable part</h3>
-
- <div style="margin-left: 2em;">
- <RT·math>
- MP = (QP, ΣP, λP, δ_1, δ_2, δ_3)
- </RT·math>
- </div>
-
- <p>A set of programmed <em>state</em> symbols:</p>
- <div style="margin-left: 2em;">
- <RT·math>QP</RT·math>
- </div>
-
- <p>A set of programmed data symbols:</p>
- <div style="margin-left: 2em;">
- <RT·math>ΣP</RT·math>
- </div>
-
- <p>The programmed actions. A set of pairs of the form:</p>
- <div style="margin-left: 2em;">
- <RT·math>λP = \{ \langle q_0, a \rangle, \dots \}</RT·math>
- </div>
- <p>where <RT·math>q_0</RT·math> is matched to the current state, and <RT·math>a</RT·math> is a member of <RT·math>AF</RT·math>.</p>
-
- <p>A set of state transition triples; each triple is of the form:</p>
- <div style="margin-left: 2em;">
- <RT·math>δ_1 = \{ \langle q_0, r{·}σ, q_1 \rangle, \dots \}</RT·math>
- </div>
- <p>where <RT·math>q_0</RT·math> is matched to the current state of the machine. <RT·math>r{·}σ</RT·math> is a symbol in register <RT·math>r</RT·math>, where <RT·math>r</RT·math> is either <RT·math>d</RT·math> or <RT·math>g</RT·math>. <RT·math>q_1</RT·math> is the next state. When <RT·math>q_0</RT·math> matches the current state, <RT·math>q_1</RT·math> becomes the next state. Both <RT·math>q_0</RT·math> and <RT·math>q_1</RT·math> come from the total set <RT·math>Q</RT·math>. <RT·math>σ</RT·math> comes from the total set <RT·math>Σ</RT·math>. </p>
-
- <p>The default transition table. A set of state transition pairs; each pair is of the form:</p>
- <div style="margin-left: 2em;">
- <RT·math>δ_2 = \{ \langle q_0, q_1 \rangle, \dots \}</RT·math>
- </div>
- <p>where <RT·math>q_0</RT·math> is matched to the current state, and upon a match <RT·math>q_1</RT·math> will be taken as the next state.</p>
-
- <p>A default next state:</p>
- <div style="margin-left: 2em;">
- <RT·math>δ_3 = q_1</RT·math>
- </div>
-
- <p>This is the transition of last resort. It is unconditional, the next state becomes <RT·math>q_1</RT·math>.</p>
-
- <h3>The TTCA Turing Machine in total</h3>
+ <h3>Initialization</h3>
+ <p>Before the first cycle begins, the tape is populated with data. The read/write head is positioned over the initial tape cell. The machine variables are initialized as follows:</p>
+ <ul>
+ <li>The current state <RT·math>q</RT·math> is set to <RT·math>QF{·}\mathtt{initial}</RT·math>.</li>
+ <li>The data register <RT·math>d</RT·math> is initialized to hold the <RT·math>ΣF{·}\mathtt{unspecified}</RT·math> symbol.</li>
+ <li>The gate register <RT·math>g</RT·math> is initialized to the value under the head, which will be the leftmost cell.</li>
+ </ul>
- <div style="margin-left: 2em;">
- <RT·math>
- M = (Q, Σ, AF, λP, δ)
- </RT·math>
- </div>
+ <h3>Phase 1: The action</h3>
+ <p>During the action phase, the executor looks up the operation mapped to the current state.</p>
+ <ol>
+ <li>Locate the current state <RT·math>q</RT·math> within the programmed actions set <RT·math>λP</RT·math>.</li>
+ <li>Perform the associated action <RT·math>a \in AF</RT·math>. This will instruct the machine to move the head (<RT·code>left</RT·code>, <RT·code>right</RT·code>), read the symbol under the head into a designated register (<RT·code>read_d</RT·code>, <RT·code>read_g</RT·code>), write a symbol to the tape (<RT·code>write_σ</RT·code>, <RT·code>write_d</RT·code>, <RT·code>write_g</RT·code>), perform a <RT·code>status</RT·code> check, or execute a <RT·code>no_op</RT·code>.</li>
+ </ol>
- <p>The complete set of states, uniting the fixed predefined states and the programmed states:</p>
- <div style="margin-left: 2em;">
- <RT·math>Q = QF \cup QP</RT·math>
- </div>
+ <h3>Phase 2: The state transition</h3>
+ <p>Following the completion of the action, the executor evaluates the next state by cascading through the ordered sequence of transition rules <RT·math>δ = [δF_0 | δ_1 | δ_2 | δ_3]</RT·math>. The evaluation follows this hierarchy, stopping and branching at the first valid match:</p>
+ <ol>
+ <li><strong>Evaluate <RT·math>δF_0</RT·math>:</strong> Inspect the gate register <RT·math>g</RT·math>. If it holds the <RT·math>ΣF{·}\mathtt{unspecified}</RT·math> symbol, the next state becomes <RT·math>QF{·}\mathtt{unspecified\_decision}</RT·math>. This halts standard programmed execution.</li>
+ <li><strong>Evaluate <RT·math>δ_1</RT·math>:</strong> Search the programmed conditional rules for a triple that matches the current state <RT·math>q</RT·math> and the exact symbol currently held in the gate register <RT·math>g</RT·math>. If a match is found, the next state updates to the specified <RT·math>q_1</RT·math>.</li>
+ <li><strong>Evaluate <RT·math>δ_2</RT·math>:</strong> If no conditional rule matches, search the programmed default rules for a pair matching the current state <RT·math>q</RT·math>. If a match is found, the next state updates to the specified <RT·math>q_1</RT·math>.</li>
+ <li><strong>Evaluate <RT·math>δ_3</RT·math>:</strong> If all prior evaluations fail to yield a match, unconditionally update the next state to the global fallback transition specified by <RT·math>δ_3</RT·math>.</li>
+ </ol>
- <p>The complete set of symbols, uniting the fixed control symbols and the programmed data symbols:</p>
- <div style="margin-left: 2em;">
- <RT·math>Σ = ΣF \cup ΣP</RT·math>
- </div>
+ <h3>Continuation</h3>
+ <p>After the state transition phase completes, the cycle repeats. The executor returns to Phase 1 using the newly updated state <RT·math>q</RT·math>. This loop continues until the machine transitions into a designated programmed halting state or triggers the <RT·math>QF{·}\mathtt{unspecified\_decision}</RT·math> trap, which requires external architectural resolution.</p>
- <p>The ordered sequence of next state transition rules:</p>
- <div style="margin-left: 2em;">
- <RT·math>δ = [δF_0 | δ_1 | δ_2 | δ_3]</RT·math>
- </div>
<h2>The TTCA programmed string reverse</h2>