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()) assigned to the halting symbol is seen below to play no role in computations, but for convenience is taken to be
P() = ''''. 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 (described in the historical note below), 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: {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 . 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 (for even
n) or 3
n + 1 (for odd n). The value 3
n + 1 is even for odd
n, hence the next term after 3
n + 1 is always . 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: {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) == Turing-completeness of
m-tag systems ==