In the theory of computation, a tag system is a deterministic model of computation published by Emil Leon Post in 1943 as a simple form of a Post canonical system. A tag system may also be viewed as an abstract machine, called a Post tag machine (not to be confused with Post–Turing machines)—briefly, a finite-state machine whose only tape is a FIFO queue of unbounded length, such that in each transition the machine reads the symbol at the head of the queue, deletes a constant number of symbols from the head, and appends to the tail a symbol-string that depends solely on the first symbol read in this transition. Because all of the indicated operations are performed in a single transition, a tag machine strictly has only one state.
Definitions A tag system is a triplet (m, A, P), where
m is a positive integer, called the deletion number. A is a finite alphabet of symbols, one of which can be a special halting symbol. All finite (possibly empty) strings on A are called words. P is a set of production rules, assigning a word P(x) (called a production) to each symbol x in A. The production (say P(H)) assigned to the halting symbol is seen below to play no role in computations, but for convenience is taken to be P(H) = 'H'. A halting word is a word that either begins with the halting symbol or whose length is less than m. A transformation t (called the tag operation) is defined on the set of non-halting words, such that if x denotes the leftmost symbol of a word S, then t(S) is the result of deleting the leftmost m symbols of S and appending the word P(x) on the right. Thus, the system processes the m-symbol head into a tail of variable length, but the generated tail depends solely on the first symbol of the head. A computation by a tag system is a finite sequence of words produced by iterating the transformation t, starting with an initially given word and halting when a halting word is produced. (By this definition, a computation is not considered to exist unless a halting word is produced in finitely-many iterations. Alternative definitions allow nonhalting computations, for example by using a special subset of the alphabet to identify words that encode output.) The term m-tag system is often used to emphasise the deletion number. Definitions vary somewhat in the literature (cf. References), the one presented here being that of Rogozhin. The use of a halting symbol in the above definition allows the output of a computation to be encoded in the final word alone, whereas otherwise the output would be encoded in the entire sequence of words produced by iterating the tag operation. A common alternative definition uses no halting symbol and treats all words of length less than m as halting words. Another definition is the original one used by Post (1943) (described in the historical note below), in which the only halting word is the empty string.
Example: A simple 2-tag illustration This illustrates a simple 2-tag system with a halting symbol. On each step, a production rule is matched from the beginning, the transformation appends tags to the end, and the leftmost two tags are deleted.
2-tag system Alphabet: {a,b,c,H} Production rules: a --> ccbaH b --> cca c --> cc
Computation Initial word: baa acca caccbaH ccbaHcc baHcccc Hcccccca (halt).
Example: Computation of Collatz sequences This simple 2-tag system is adapted from De Mol (2008). It uses no halting symbol, but halts on any word of length less than 2, and computes a slightly modified version of the Collatz sequence. In the original Collatz sequence, the successor of n is either n/2 (for even n) or 3n + 1 (for odd n). The value 3n + 1 is even for odd n, hence the next term after 3n + 1 is always 3n + 1/2. In the sequence computed by the tag system below we skip this intermediate step, hence the successor of n is 3n + 1/2 for odd n. In this tag system, a positive integer n is represented by the word aa...a with n a's.
2-tag system Alphabet: {a,b,c} Production rules: a --> bc b --> a c --> aaa
Computation Initial word: aaa <--> n=3 abc cbc caaa aaaaa <--> 5 aaabc abcbc cbcbc cbcaaa caaaaaa aaaaaaaa <--> 8 aaaaaabc aaaabcbc aabcbcbc bcbcbcbc bcbcbca bcbcaa bcaaa aaaa <--> 4 aabc bcbc bca aa <--> 2 bc a <--> 1 (halt)
… excerpt ends here. Continue reading the full article.