From: Thomas Walker Lynch Here is the programmed controller for a Turing Machine that reverses a binary string. Although by definition each state transition matches exactly one value under the head, as a practical matter, disjunctive selection is allowed via a comma list. A conjunctive phrasing for a state transition proposition would require stringing intermediate states in series. Provided the site is still alive, the following YAML can be entered at TuringMachine.io to watch the machine run. The total number of steps for reversing an symbol string: This shows string reversal to be an complexity problem, which might appear to some programmers as a peculiar result, as the same problem can be solved in time with a C program. This justifies further analysis. For a real machine, symbols are machine word encodings. For example, ASCII uses 7 data bits, so there are 128 symbols available. If the width of the word for encoding symbols is bits, then the total number of states required for this string reverse machine is: The number of arcs in the machine: These equations show that the state controller size explodes with word width. It would be impractical to implement for all but the smallest of word sizes. This is one of the reasons that computation theory books use modest-sized symbol alphabets in their examples, perhaps the first few letters of the Latin alphabet, or the letter 's' for unary arithmetic. Previous sections discussed challenges transitioning the Turing Machine to a real architecture due to the tape length, and discussed how this could be mitigated. In contrast, there is no practical mediation for implementing a Turing Machine controller even for modest-sized real problems. 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. In the language of mathematics an empty tape can be defined as a empty sets: Here, each tape member set is called a . This definition for an empty tape is specific to Turing Machines, as in mathematics an empty sequence has zero length. 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 is consistent for the model 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. 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 . Then using the language of mathematics, the mathematician defines an initial empty tape as: For machine B, no modifications are required to the native and functions. In the following, the middle dot acts as a namespace operator, . By doing this we assure there will be no aliasing with the symbols provided by the programmer when he defines a programmed state controller. The set of predefined states: The state controller always starts in the state. This is a symbol representing the state; it is not a register that holds a state. The 'F' values are all fixed. The programmer cannot add instructions to the machine definition, so there are no symbol aliasing issues here: where must be in . The set of predefined symbols: : is the current state of the machine. A set of programmed state symbols: A set of programmed data symbols: The programmed instructions. A set of pairs of the form: where is matched to the current state, and is a member of .
The conditional transition table. A set of state transition triples; each triple is of the form: Here and are two states from the total set of . They need not be distinct. While the machine is running, state is to be matched against the contents of the , the current state. Symbol is a member of the total set and is to be matched against the contents of the , the machine status. When matches the current state and matches the current status, then becomes the next state. The state default transition table. A set of state transition pairs; each pair is of the form: where is matched to the current state, and upon a match will be taken as the next state. The status default transition table. A set of state transition pairs; each pair is of the form: where matches the symbol in , and upon a match will be taken as the next state. The global default next state: This is the transition of last resort. It is unconditional; the next state becomes . A set of programmer-defined halting states: The variables used by the executor, . The complete set of states, uniting the fixed predefined states and the programmed states: The complete set of symbols, uniting the fixed control symbols and the programmed data symbols: All members of the set of available instructions are fixed: The table of state-instruction pairs is strictly programmed. The ordered sequence of next state transition rules: The set of halt states is strictly programmed, and thus could be empty. The total number of steps for reversing an symbol string using the TTCA Machine: The number of states has dropped from 24 to 18, while the speed increase is dramatic, with the former quadratic performance becoming linear performance. The total number of steps for reversing an symbol string using a two-head TTCA architecture: The two paths through the state machine, and the one loop, translate well into code: The prior chapter on the computation theoretic TTCA machine serves as the architectural template, with only a few modifications. The architecture requires explicit data rather than accepting meta-symbols like 'unspecified' as presumed initial values 'by definition'. Actual values are transacted. Now that data and control have been separated, the controller is practical to implement, and even more so because it was defined in terms of tables that can be built in hardware. As the read status instruction returns the cell type, it will in its current form be able to return 'rightmost', so the right end of the tape can be detected. In order to extend the tape, the machine will stop and ask the operator to mount a new reel. This could be signaled when the user attempts to step right of rightmost, either by a panel light that illuminates upon the machine finding a rightmost status, or by the program printing a message on the console teletype. As this is a constant-time operation, it is computation theoretic inconsequential. A person interprets these sequences as numbers by using a weighted sum. Here is a numeric value, so it is written in lower case. Each is the th component of the sequence . The value is also known as the 'th digit' of the number. The value ten is called the base or the radix of the number. It is fortunate that ten is so well known that it has a name, because otherwise an author is tempted to write the base while using the exact representation that he is trying to define. Although this function gives numeric meaning to our digit sequences, performing the suggested computation is pointless. The result is a number, and a person must represent that number, resulting in the exact sequence that was given as the input to the function in the first place. A person interprets a sequence of bits as a number by using this function: As with sequences of decimal digits, a person drops the sequence notation to yield strings of bits. Similar to decimal digit strings, there are two options for writing the string: most-significant-digit-first, or least-significant-digit-first. Figure 10 depicts a word featuring byte addresses represented in hexadecimal, running from c0 to c3. (In decimal these addresses represent 192, 193, 194, 195). The address of the byte before c0 is bf. The address after c3 is c4. The address for the word itself evaluates to c0, as it is the minimum byte address. This word holds a little-endian number. Treating a byte as an octet digit, the binary encoding for the least-significant digit of this number is 0001 1000. The most-significant digit is 1010 1110. In Figure 11, the same number populates the word using big-endian architecture. For all but very large numbers, the digit pointed at by the allocation pointer evaluates to zero. A system continues to scan zeros until reaching either the end of the allocation or the most-significant digit. If it reaches the end of the allocation, the contained number evaluates to zero. Because this is the exact same number shown in the prior figure, it retains the identical least-significant digit and most-significant digit. The following figure displays a stream of bytes arriving as data and being copied into a word. The digits of the word (the bytes) arrive in little-endian order and target a little-endian machine, so they are written in the exact order they are scanned off the channel. In the second case, the identical data stream arrives with words serialized as bytes in little-endian order, but the receiving machine is big-endian. The system must reverse the bytes strictly on a word-by-word basis.
+
The TTCA Machine fixed part
- Machine variables
- Programmable part
- The TTCA Machine definition in total
- Computation theoretic TTCA Machine executor
@@ -1039,7 +1048,7 @@
Q·Done
-
+
Analysis of the TTCA reverse machine
@@ -1103,15 +1112,14 @@
Two-headed reverse string example
@@ -1218,21 +1226,20 @@
Q·Done
-
+
Analysis of the two-headed reverse string machine
-
+
The machine block diagram
+
+
+
+
+
- -
+Because the binomial coefficient evaluates to exactly zero for any integer , the summation naturally truncates at index . This algebraic property perfectly mirrors the physical boundary established by the machine execution trace. Furthermore, the relationship is symmetric. A person can compute the specific components of the initial tape, , directly from the sequence of evaluated function calls, , using the alternating binomial sum:
-- -
+As a consequence of this lemma, we know that for any finite number of calls, i.e. finite , that a finite prefix of is used. @@ -3173,9 +3174,9 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos The main diagonal contains strictly non zero factorials, ensuring the matrix is invertible. By inverting this matrix, a person replaces the cascading back substitution with a direct, closed form equation to recover any constant . The inversion utilizes the signed Stirling numbers of the first kind, denoted (see the Appendix on Stirling numbers).
-- -
+Thus, extending this procedure times definitively recovers the constants for exactly a polynomial of degree . @@ -3185,9 +3186,9 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos This mechanical recovery of standard polynomial constants is completely analogous to Newton's interpolation formula . Instead of resolving the standard constants through an upper triangular matrix, a person can construct the polynomial directly by treating the initial tape components as the exact coefficients for a basis of binomial terms:
-- -
+
Because the th binomial coefficient expands into a polynomial of exactly degree , and the summation is bounded by the finite extent where is definitively nonzero, the constructed function is structurally guaranteed to be a polynomial of degree .
@@ -3284,7 +3285,7 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos
h(t) = \frac{f(t)}{g(t)} = \frac{2^t - 32}{3t - 15}
-
+
@@ -3386,7 +3387,7 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos So then, perhaps we set the value at the singularity to build out the difference table, then solve for ?
-
+
@@ -3415,9 +3416,9 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos
The resulting vector for the quotient is:
-
+
-
+
I find it fascinating to watch the transcendental difference values march down the table, then all cancel out after is generated. @@ -3514,7 +3515,7 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos
None of these computation systems, that of Boehm and Cartwright, Mathematica, nor my error analysis approach, makes use of the IEEE 754 standard floating point arithmetic. Rather they all require the use of variable precision. In the case of Boehm and Cartwright's this occurs through the serialization implied through lazy calls for more precision. In the case of Mathematica it is explicit in the significance arithmetic. In my error analysis approach, the means for variable precision was the High Radix Online Arithmetic . -
+Hence what would be useful for a replacement of the IEEE 754, would be a variable precision number standard. There is one being proposed by John Gustafson called the Posit number representation .
@@ -3727,9 +3728,9 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos However, in the calculus of finite differences, standard exponents are clumsy. Because the Turing Machine evaluates discrete jumps, the natural basis is the falling factorial, denoted as : -- -
+When a person applies the discrete forward difference operator, , to a falling factorial, it behaves identically to the continuous derivative: . @@ -3759,9 +3760,9 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos The signed Stirling numbers of the first kind perform the exact inverse operation. They reconstruct standard continuous powers from falling factorials:
-- -
+Combinatorially, the unsigned magnitude of represents the number of ways to arrange items into disjoint cycles. The alternating signs account for the algebraic expansion of the falling factorial terms , etc. @@ -3840,17 +3841,18 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos Recall the convolution formula for component of the product:
-- -
+ +To perform the deconvolution, we isolate the unknown component . This term occurs in the summation strictly when . When , the term equals 0, making the binomial coefficient . Factoring out of the sum yields:
-- -
+A person familiar with Newton's forward difference formula will recognize that the summation is exactly the evaluation of the original function at step , or . @@ -3860,9 +3862,9 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos We can now solve for recursively. For the base case , where :
-- -
+
For all subsequent components where and , we subtract the previously known terms of the convolution and divide by :
@@ -3886,4 +3888,4 @@ Now suppose defining a Turing Machine that initially has the head on the leftmos
- -->
+
diff --git a/setup b/setup
old mode 100644
new mode 100755
index 7603f3e..f750f1d
--- a/setup
+++ b/setup
@@ -1,61 +1,70 @@
-#!/usr/bin/env bash
+#!/usr/bin/env python3
# setup - enter a project role environment
-# (must be sourced)
-
-script_afp=$(realpath "${BASH_SOURCE[0]}")
-if [ "${BASH_SOURCE[0]}" == "${0}" ]; then
- echo "${script_afp}:: This script must be sourced, not executed."
- exit 1
-fi
-
-project_roles="administrator consumer developer tester"
-
-print_usage(){
- echo "usage: . setup