Tag system


A tag system is a deterministic computational model 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 —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, where
A halting word is a word that either begins with the halting symbol or whose length is less than m.
A transformation t is defined on the set of non-halting words, such that if x denotes the leftmost symbol of a word S, then t is the result of deleting the leftmost m symbols of S and appending the word P 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.
The term m-tag system is often used to emphasise the deletion number. Definitions vary somewhat in the literature, 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, in which the only halting word is the empty string.

Example: A simple 2-tag illustration

This is merely to illustrate a simple 2-tag system that uses a halting symbol.

2-tag system
Alphabet:
Production rules:
a --> ccbaH
b --> cca
c --> cc
Computation
Initial word: baa
acca
caccbaH
ccbaHcc
baHcccc
Hcccccca.

Example: Computation of Collatz sequences

This simple 2-tag system is adapted from . 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 or 3n + 1. The value 3n + 1 is clearly even for odd n, hence the next term after 3n + 1 is surely. In the sequence computed by the tag system below we skip this intermediate step, hence the successor of n is 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:
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

Turing-completeness of ''m''-tag systems

For each m > 1, the set of m-tag systems is Turing-complete; i.e., for each m > 1, it is the case that for any given Turing machine T, there is an m-tag system that emulates T. In particular, a 2-tag system can be constructed to emulate a Universal Turing machine, as was done by Wang 1963 and by Cocke & Minsky 1964.
Conversely, a Turing machine can be shown to be a Universal Turing Machine by proving that it can emulate a Turing-complete class of m-tag systems. For example, Rogozhin 1996 proved the universality of the class of 2-tag systems with alphabet and corresponding productions, where the Wk are nonempty words; he then proved the universality of a very small Turing machine by showing that it can simulate this class of tag systems.

The 2-tag halting problem

This version of the halting problem is among the simplest, most-easily described undecidable decision problems:
Given an arbitrary positive integer n and a list of n+1 arbitrary words P1,P2,...,Pn,Q on the alphabet, does repeated application of the tag operation t: ijXXPi eventually convert Q into a word of length less than 2? That is, does the sequence Q, t1, t2, t3,... terminate?

Historical note on the definition of tag system

The above definition differs from that of Post 1943, whose tag systems use no halting symbol, but rather halt only on the empty word, with the tag operation t being defined as follows:
The above remark concerning the Turing-completeness of the set of m-tag systems, for any m > 1, applies also to these tag systems as originally defined by Post.

Origin of the name "tag"

According to a footnote in Post 1943, B. P. Gill suggested the name for an earlier variant of the problem in which the first m symbols are left untouched, but rather a check mark indicating the current position moves to the right by m symbols every step. The name for the problem of determining whether or not the check mark ever touches the end of the sequence was then dubbed the "problem of tag", referring to the children's game of tag.

Cyclic tag systems

A cyclic tag system is a modification of the original tag system. The alphabet consists of only two symbols, 0 and 1, and the production rules comprise a list of productions considered sequentially, cycling back to the beginning of the list after considering the "last" production on the list. For each production, the leftmost symbol of the word is examined—if the symbol is 1, the current production is appended to the right end of the word; if the symbol is 0, no characters are appended to the word; in either case, the leftmost symbol is then deleted. The system halts if and when the word becomes empty.

Example


Cyclic Tag System
Productions:
Computation
Initial Word: 11001
Production Word
---------- --------------
010 11001
000 1001010
1111 001010000
010 01010000
000 1010000
1111 010000000
010 10000000
. .
. .

Cyclic tag systems were created by Matthew Cook and were used in Cook's demonstration that the Rule 110 cellular automaton is universal. A key part of the demonstration was that cyclic tag systems can emulate a Turing-complete class of tag systems.

Emulation of tag systems by cyclic tag systems

An m-tag system with alphabet and corresponding productions is emulated by a cyclic tag system with m*n productions, where all but the first n productions are the empty string. The Qk are encodings of the respective Pk, obtained by replacing each symbol of the tag system alphabet by a length-n binary string as follows :
a1 = 100...00
a2 = 010...00
.
.
.
an = 000...01
That is, ak is encoded as a binary string with a 1 in the kth position from the left, and 0's elsewhere. Successive lines of a tag system computation will then occur encoded as every th line of its emulation by the cyclic tag system.

Example

This is a very small example to illustrate the emulation technique.

2-tag system
Production rules:
Alphabet encoding: a = 100, b = 010, H = 001
Production encodings:
Cyclic tag system
Productions:
Tag system computation
Initial word: ba
abH
Hbb
Cyclic tag system computation
Initial word: 010 100
Production Word
---------- -------------------------------
* 010 010 010 100
100 010 001 10 100
001 0 100 100 010 001
- 100 100 010 001
- 00 100 010 001
- 0 100 010 001
* 010 010 100 010 001
100 010 001 00 010 001 010 010
001 0 010 001 010 010
- 010 001 010 010
- 10 001 010 010
- 0 001 010 010
* 010 010 emulated halt --> 001 010 010
100 010 001 01 010 010
001 1 010 010
- 010 010 001
... ...

Every sixth line produced by the cyclic tag system is the encoding of a corresponding line of the tag system computation, until the emulated halt is reached.