Semi-Thue system explained

R

between fixed strings over the alphabet, called rewrite rules, denoted by

st

, an SRS extends the rewriting relation to all strings in which the left- and right-hand side of the rules appear as substrings, that is

usvutv

, where

s

,

t

,

u

, and

v

are strings.

The notion of a semi-Thue system essentially coincides with the presentation of a monoid. Thus they constitute a natural framework for solving the word problem for monoids and groups.

An SRS can be defined directly as an abstract rewriting system. It can also be seen as a restricted kind of a term rewriting system, in which all function symbols have an arity of at most 1. As a formalism, string rewriting systems are Turing complete.[1] The semi-Thue name comes from the Norwegian mathematician Axel Thue, who introduced systematic treatment of string rewriting systems in a 1914 paper.[2] Thue introduced this notion hoping to solve the word problem for finitely presented semigroups. Only in 1947 was the problem shown to be undecidable - this result was obtained independently by Emil Post and A. A. Markov Jr.[3] [4]

Definition

(\Sigma,R)

where

\Sigma

is an alphabet, usually assumed finite.[5] The elements of the set

\Sigma*

(* is the Kleene star here) are finite (possibly empty) strings on

\Sigma

, sometimes called words in formal languages; we will simply call them strings here.

R

is a binary relation on strings from

\Sigma

, i.e.,

R\subseteq\Sigma* x \Sigma*.

Each element

(u,v)\inR

is called a (rewriting) rule and is usually written

uv

.

If the relation

R

is symmetric, then the system is called a Thue system.

The rewriting rules in

R

can be naturally extended to other strings in

\Sigma*

by allowing substrings to be rewritten according to

R

. More formally, the one-step rewriting relation relation

\xrightarrow[R]{}

induced by

R

on

\Sigma*

for any strings

s,t\in\Sigma*

:

s\xrightarrow[R]{}t

if and only if there exist

x,y,u,v\in\Sigma*

such that

s=xuy

,

t=xvy

, and

uv

.

Since

\xrightarrow[R]{}

is a relation on

\Sigma*

, the pair

(\Sigma*,\xrightarrow[R]{})

fits the definition of an abstract rewriting system. Obviously

R

is a subset of

\xrightarrow[R]{}

. Some authors use a different notation for the arrow in

\xrightarrow[R]{}

(e.g.

\xrightarrow[R]{}

) in order to distinguish it from

R

itself (

) because they later want to be able to drop the subscript and still avoid confusion between

R

and the one-step rewrite induced by

R

.

Clearly in a semi-Thue system we can form a (finite or infinite) sequence of strings produced by starting with an initial string

s0\in\Sigma*

and repeatedly rewriting it by making one substring-replacement at a time:

s0\xrightarrow[R]{}s1\xrightarrow[R]{}s2\xrightarrow[R]{}\ldots

A zero-or-more-steps rewriting like this is captured by the reflexive transitive closure of

\xrightarrow[R]{}

, denoted by

\xrightarrow[R]{*}

(see abstract rewriting system#Basic notions). This is called the rewriting relation or reduction relation on

\Sigma*

induced by

R

.

Thue congruence

In general, the set

\Sigma*

of strings on an alphabet forms a free monoid together with the binary operation of string concatenation (denoted as

and written multiplicatively by dropping the symbol). In a SRS, the reduction relation

\xrightarrow[R]{*}

is compatible with the monoid operation, meaning that

x\xrightarrow[R]{*}y

implies

uxv\xrightarrow[R]{*}uyv

for all strings

x,y,u,v\in\Sigma*

. Since

\xrightarrow[R]{*}

is by definition a preorder,

\left(\Sigma*,,\xrightarrow[R]{*}\right)

forms a monoidal preorder.

Similarly, the reflexive transitive symmetric closure of

\xrightarrow[R]{}

, denoted

\overset{*}{\undersetR\leftrightarrow}

(see abstract rewriting system#Basic notions), is a congruence, meaning it is an equivalence relation (by definition) and it is also compatible with string concatenation. The relation

\overset{*}{\undersetR\leftrightarrow}

is called the Thue congruence generated by . In a Thue system, i.e. if is symmetric, the rewrite relation

\xrightarrow[R]{*}

coincides with the Thue congruence

\overset{*}{\undersetR\leftrightarrow}

.

Factor monoid and monoid presentations

Since

\overset{*}{\undersetR\leftrightarrow}

is a congruence, we can define the factor monoid

l{M}R=\Sigma*/\overset{*}{\undersetR\leftrightarrow}

of the free monoid

\Sigma*

by the Thue congruence in the usual manner. If a monoid

l{M}

is isomorphic with

l{M}R

, then the semi-Thue system

(\Sigma,R)

is called a monoid presentation of

l{M}

.

We immediately get some very useful connections with other areas of algebra. For example, the alphabet with the rules, where ε is the empty string, is a presentation of the free group on one generator. If instead the rules are just, then we obtain a presentation of the bicyclic monoid.

The importance of semi-Thue systems as presentation of monoids is made stronger by the following:

Theorem: Every monoid has a presentation of the form

(\Sigma,R)

, thus it may be always be presented by a semi-Thue system, possibly over an infinite alphabet.[6]

In this context, the set

\Sigma

is called the set of generators of

l{M}

, and

R

is called the set of defining relations

l{M}

. We can immediately classify monoids based on their presentation.

l{M}

is called

\Sigma

is finite.

\Sigma

and

R

are finite.

Undecidability of the word problem

Post proved the word problem (for semigroups) to be undecidable in general, essentially by reducing the halting problem[7] for Turing machines to an instance of the word problem.

Concretely, Post devised an encoding as a finite string of the state of a Turing machine plus tape, such that the actions of this machine can be carried out by a string rewrite system acting on this string encoding. The alphabet of the encoding has one set of letters

S0,S1,...c,Sm

for symbols on the tape (where

S0

means blank), another set of letters

q1,...c,qr

for states of the Turing machine, and finally three letters

qr+1,qr+2,h

that have special roles in the encoding.

qr+1

and

qr+2

are intuitively extra internal states of the Turing machine which it transitions to when halting, whereas

h

marks the end of the non-blank part of the tape; a machine reaching an

h

should behave the same as if there was a blank there, and the

h

was in the next cell. The strings that are valid encodings of Turing machine states start with an

h

, followed by zero or more symbol letters, followed by exactly one internal state letter

qi

(which encodes the state of the machine), followed by one or more symbol letters, followed by an ending

h

. The symbol letters are straight off the contents of the tape, and the internal state letter marks the position of the head; the symbol after the internal state letter is that in the cell currently under the head of the Turing machine.

A transition where the machine upon being in state

qi

and seeing the symbol

Sk

writes back symbol

Sl

, moves right, and transitions to state

qj

is implemented by the rewrite

qiSk\toSlqj

whereas that transition instead moving to the left is implemented by the rewrite

SpqiSk\toqjSpSl

with one instance for each symbol

Sp

in that cell to the left. In the case that we reach the end of the visited portion of the tape, we use instead

hqiSk\tohqjS0Sl

,lengthening the string by one letter. Because all rewrites involve one internal state letter

qi

, the valid encodings only contain one such letter, and each rewrite produces exactly one such letter, the rewrite process exactly follows the run of the Turing machine encoded. This proves that string rewrite systems are Turing complete.

The reason for having two halted symbols

qr+1

and

qr+2

is that we want all halting Turing machines to terminate at the same total state, not just a particular internal state. This requires clearing the tape after halting, so

qr+1

eats the symbol on it left until reaching the

h

, where it transitions into

qr+2

which instead eats the symbol on its right. (In this phase the string rewrite system no longer simulates a Turing machine, since that cannot remove cells from the tape.) After all symbols are gone, we have reached the terminal string

hqr+2h

.

A decision procedure for the word problem would then also yield a procedure for deciding whether the given Turing machine terminates when started in a particular total state

t

, by testing whether

t

and

hqr+2h

belong to the same congruence class with respect to this string rewrite system. Technically, we have the following:

Lemma. Let

M

be a deterministic Turing machine and

R

be the string rewrite system implementing

M

, as described above. Then

M

will halt when started from the total state encoded as

t

if and only if

tl{\overset{*}{\underset{R}{\leftrightarrow}}}hqr+2h

(that is to say, if and only if

t

and

hqr+2h

are Thue congruent for

R

).

That

tl{\overset{*}{\underset{R}{ → }}}hqr+2h

if

M

halts when started from

t

is immediate from the construction of

R

(simply running

M

until it halts constructs a proof of

tl{\overset{*}{\underset{R}{ → }}}hqr+2h

), but

\overset{*}{\underset{R}{\leftrightarrow}}

also allows the Turing machine

M

to take steps backwards. Here it becomes relevant that

M

is deterministic, because then the forward steps are all unique; in a

\overset{*}{\underset{R}{\leftrightarrow}}

walk from

t

to

hqr+2h

the last backward step must be followed by its counterpart as a forward step, so these two cancel, and by induction all backward steps can be eliminated from such a walk. Hence if

M

does not halt when started from

t

, i.e., if we do not have

tl{\overset{*}{\underset{R}{ → }}}hqr+2h

, then we also do not have

tl{\overset{*}{\underset{R}{\leftrightarrow}}}hqr+2h

. Therefore, deciding

\overset{*}{\underset{R}{\leftrightarrow}}

tells us the answer to the halting problem for

M

.

An apparent limitation of this argument is that in order to produce a semigroup

\Sigma*/\overset{*}{\underset{R}{\leftrightarrow}}

with undecidable word problem, one must first have a concrete example of a Turing machine

M

for which the halting problem is undecidable, but the various Turing machines figuring in the proof of the undecidability of the general halting problem all have as component a hypothetical Turing machine solving the halting problem, so none of those machines can actually exist; all that proves is that there is some Turing machine for which the decision problem is undecidable. However, that there is some Turing machine with undecidable halting problem means that the halting problem for a universal Turing machine is undecidable (since that can simulate any Turing machine), and concrete examples of universal Turing machines have been constructed.

Connections with other notions

A semi-Thue system is also a term-rewriting system - one that has monadic words (functions) ending in the same variable as the left- and right-hand side terms,[8] e.g. a term rule

f2(f1(x))g(x)

is equivalent to the string rule

f1f2g

.

A semi-Thue system is also a special type of Post canonical system, but every Post canonical system can also be reduced to an SRS. Both formalisms are Turing complete, and thus equivalent to Noam Chomsky's unrestricted grammars, which are sometimes called semi-Thue grammars.[9] A formal grammar only differs from a semi-Thue system by the separation of the alphabet into terminals and non-terminals, and the fixation of a starting symbol amongst non-terminals. A minority of authors actually define a semi-Thue system as a triple

(\Sigma,A,R)

, where

A\subseteq\Sigma*

is called the set of axioms. Under this "generative" definition of semi-Thue system, an unrestricted grammar is just a semi-Thue system with a single axiom in which one partitions the alphabet into terminals and non-terminals, and makes the axiom a nonterminal.[10] The simple artifice of partitioning the alphabet into terminals and non-terminals is a powerful one; it allows the definition of the Chomsky hierarchy based on what combination of terminals and non-terminals the rules contain. This was a crucial development in the theory of formal languages.

In quantum computing, the notion of a quantum Thue system can be developed.[11] Since quantum computation is intrinsically reversible, the rewriting rules over the alphabet

\Sigma

are required to be bidirectional (i.e. the underlying system is a Thue system, not a semi-Thue system).On a subset of alphabet characters

Q\subseteq\Sigma

one can attach a Hilbert space

Cd

, and a rewriting rule taking a substring to another one can carry out a unitary operation on the tensor product of the Hilbert space attached to the strings; this implies that they preserve the number of characters from the set

Q

. Similar to the classical case one can show that a quantum Thue system is a universal computational model for quantum computation, in the sense that the executed quantum operations correspond to uniform circuit classes (such as those in BQP when e.g. guaranteeing termination of the string rewriting rules within polynomially many steps in the input size), or equivalently a Quantum Turing machine.

History and importance

Semi-Thue systems were developed as part of a program to add additional constructs to logic, so as to create systems such as propositional logic, that would allow general mathematical theorems to be expressed in a formal language, and then proven and verified in an automatic, mechanical fashion. The hope was that the act of theorem proving could then be reduced to a set of defined manipulations on a set of strings. It was subsequently realized that semi-Thue systems are isomorphic to unrestricted grammars, which in turn are known to be isomorphic to Turing machines. This method of research succeeded and now computers can be used to verify the proofs of mathematic and logical theorems.

At the suggestion of Alonzo Church, Emil Post in a paper published in 1947, first proved "a certain Problem of Thue" to be unsolvable, what Martin Davis states as "...the first unsolvability proof for a problem from classical mathematics -- in this case the word problem for semigroups."[12]

Davis also asserts that the proof was offered independently by A. A. Markov.[13]

See also

References

Monographs

Textbooks

Surveys

Landmark papers

Notes and References

  1. See section "Undecidability of the word problem" in this article.
  2. Book and Otto, p. 36
  3. Abramsky et al. p. 416
  4. Salomaa et al., p.444
  5. In Book and Otto a semi-Thue system is defined over a finite alphabet through most of the book, except chapter 7 when monoid presentation are introduced, when this assumption is quietly dropped.
  6. Book and Otto, Theorem 7.1.7, p. 149
  7. Post, following Turing, technically makes use of the undecidability of the printing problem (whether a Turing machine ever prints a particular symbol), but the two problems reduce to each other. Indeed, Post includes an extra step in his construction that effectively converts printing the watched symbol into halting.
  8. [Nachum Dershowitz]
  9. [Daniel I. A. Cohen|D.I.A. Cohen]
  10. Dan A. Simovici, Richard L. Tenney, Theory of formal languages with applications, World Scientific, 1999, chapter 4
  11. J. Bausch, T. Cubitt, M. Ozols, The Complexity of Translationally-Invariant Spin Chains with Low Local Dimension, Ann. Henri Poincare 18(11), 2017 pp. 3449-3513
  12. [Martin Davis (mathematician)|Martin Davis]
  13. [A. A. Markov]