Manuscript Offprint
arXiv:2610.40105Diagonalization and Undecidability in Semi-Thue Systems
Abstract
We revisit classical diagonalization argument in the setting of semi-Thue systems, viewing computation as nondeterministic rewriting rather than sequential machine execution. Semi-Thue systems naturally generate derivation trees, making existential acceptance, reachability, and infinite derivations fundamental computational notions.
We formulate acceptance and decision directly in terms of derivation trees and study the associated assertion, word, and infiniteness problems. We prove that the complements of the assertion and word problems are not recursively enumerable by direct Post-style diagonal arguments. For the infiniteness problem, we give a constructive diagonalization based on a fixed universal semi-Thue system. Unlike the classical approach, the diagonal construction is carried out entirely within the rewriting formalism: the universal system remains an ordinary nondeterministic semi-Thue system while simulating encoded semi-Thue computations, including self-reference.
These results show that undecidability in semi-Thue systems arises naturally from universality and self-reference in nondeterministic rewriting, rather than from machine states or control mechanisms. This perspective clarifies the relationship between rewriting systems, recursive enumerability, and classical diagonal arguments originating in the work of Post and Turing.
1 Introduction
The unifying method behind the earliest undecidability results is diagonalization over effective descriptions of computational processes, conceptually rooted in Cantor's diagonal argument for the uncountability of the real numbers. This idea appears already in Turing's analysis of computable numbers, where the notion of circular-freeness is used to separate computable from non-computable real numbers by an explicit diagonal construction [10]. It is subsequently recast as an explicit decision problem in the formulation of the halting problem for Turing machines, as systematically developed by Davis [1]. Post's separation of recursive and recursively enumerable sets likewise relies on diagonal reasoning, carried out in the formalism of normal systems, an early nondeterministic rewriting model [6].
These results are standardly presented within machine-based formalisms and serve as canonical instances of undecidability obtained by diagonalization.
In this paper we revisit diagonalization in a markedly different computational model, namely semi-Thue systems, whose computations are inherently nondeterministic and tree-like, and whose derivations resemble proof search in a formal logical system rather than sequential machine execution. This perspective is already implicit in Post's use of normal systems as a rewriting formalism for recursively enumerable sets [6], where diagonalization is carried out over derivation trees rather than over machine-input pairs. Our contribution is to make this perspective explicit and systematic, and to formulate diagonal arguments directly at the level of semi-Thue derivations and their acceptance modes.
The first motivation of this work is to recall that diagonalization is not tied to the specific operational structure of Turing machines, but can be carried out directly in rewriting-based models of computation. Semi-Thue systems are among the simplest and most natural such models. They lack states, instruction counters, or explicit control mechanisms, yet they are computationally universal. This raises a conceptual question: how do classical undecidability arguments manifest themselves in a formalism where computation is given by a branching derivation tree rather than a linear run? Indeed, recall that universal Turing machines are deterministic with several papers investigating the boundaries of the universality with respect to the number of states and size of the input alphabet [9, 8, 12]. This makes it seem that the computational universality arises from computational devices that have sufficiently rich underlying structure.
From a contemporary perspective, tree-like and nondeterministic modes of computation are increasingly common. On one hand, they are present in SAT and SMT solvers, where an assignment can be nondeterministically restarted by the solver if the current computation takes too long. On the other hand, many modern computational systems, including large language models and related neural-symbolic architectures, operate operationally as forms of guided, branching search rather than as single linear executions. While such systems are not intended as formal models of effective computation, their prevalence highlights the naturalness of tree-structured computation as a basic computational paradigm.
Our primary technical goal is to give direct proofs of undecidability for natural problems of semi-Thue systems, treating these problems themselves as fundamental sources of undecidability, rather than establishing their undecidability by reduction from previously known undecidable problems for Turing machines. In particular, we study the assertion problem: given a semi-Thue system and a designated start word, does there exist a finite derivation in which a distinguished symbol occurs? This problem captures the recursively enumerable nature of semi-Thue computation in a particularly direct way. While assertion is semi-decidable by systematic enumeration of derivations, we show that it is not decidable; moreover, its complement is not recursively enumerable.
Closely related is the classical word problem for semi-Thue systems: given a system and two words, does there exist a finite derivation transforming one word into the other? Like assertion, the word problem is naturally formulated in existential terms over derivation trees and is therefore recursively enumerable. It provides a canonical notion of reachability in rewriting-based models of computation and serves as a standard benchmark problem for undecidability results in this setting.
We also consider non-termination properties, such as the existence of an infinite derivation. These correspond to non-halting or circular-freeness phenomena in Turing machine models and lie outside the class of recursively enumerable properties. We show that the undecidability of non-termination can likewise be obtained by a direct diagonalization argument using a universal semi-Thue system.
Historically, the approach taken here is closely related to that of Emil Post [5, 6]. In his work on normal systems, Post emphasized generative formalisms and treated computation as the production of assertions rather than as machine execution. Acceptance was represented by the appearance of a distinguished symbol. Our treatment follows this tradition.
At this point it is important to address the notion of control. What is commonly called control in a Turing machine—its states and halting states—is not intrinsic supervision of computation but a convention for communicating the result to an external observer. The machine itself merely follows local rules. The essential difference between Turing machines and semi-Thue systems is that the former compress an unbounded computation into a single finite observable configuration, whereas the latter distribute the result over a potentially infinite set of derivable words.
2.1 Semi-Thue systems
Let A be a finite alphabet. A word over A is a finite sequence of symbols from A. We denote by the set of all words over A; equivalently, is the free monoid generated by A under concatenation. The empty word is denoted by .
If with , then the length of is , and it is denoted by . In particular, .
A word is called a factor of a word if there exist words such that . In this case we also say that occurs in . If , then is a prefix of , and if , then is a suffix of .
A semi-Thue system is a pair , where is a finite alphabet and is a finite set of rewriting rules. A rule will usually be written as .
For words , we write if there exist words and a rule in such that
Thus a single rewriting step consists of replacing one occurrence of the left-hand side of a rule by its right-hand side, leaving the surrounding context unchanged.
The reflexive and transitive closure of is denoted by . Hence means that is obtainable from by a finite sequence of rewriting steps, possibly of length zero. Such a sequence of rewriting steps is called a finite derivation. In other words, a finite derivation in is a finite sequence of words
such that for all . We also write this as
An infinite derivation in S is an infinite sequence of words
such that for all .
A word is called irreducible with respect to if there is no word such that . Equivalently, no left-hand side of a rule of occurs as a factor of .
A derivation
is called maximal if either it is infinite, or it is finite
and the last word is irreducible.
Thus a finite maximal derivation is a derivation which cannot be extended. In other words, maximal derivation either continues forever, or it stops because no rule is applicable.
A brief remark on the encodings used throughout the paper. We fix an effective coding of finite alphabets, finite semi-Thue systems, words, and finite tuples of such objects by words over a fixed finite alphabet. We write these codes as
and so on.
The particular coding is irrelevant, provided that it is effective in the following sense. From a code one can effectively recover the finite alphabet and the finite list of rules of ; from codes of finite objects one can effectively form codes of finite tuples; and every effective transformation of semi-Thue systems and words induces a computable transformation of their codes.
When the fixed universal semi-Thue system U is used, we shall use a more specific encoding that is described in Section 2.3.
Thus there are two levels of coding in the paper. The notation denotes an arbitrary effective external code of an instance of a decision problem, whereas denotes the specific internal start word used by the fixed universal semi-Thue system U.
2.2 The word and termination problems
The word problem for semi-Thue systems is the following decision problem: given a semi-Thue system and two words , decide whether
In other words, the word problem asks whether v is reachable from u by finitely many applications of the rules of S.
The same problem can also be formulated as a membership problem for a set of encoded instances. Define
Here denotes an effective encoding of the finite object consisting of the system S and the two words .
Thus, given a triple , the task in the word problem is to decide whether
Let S be a semi-Thue system and let w be a word. We say that S terminates from w if every derivation beginning with w is finite. Equivalently, there is no infinite derivation
It is now easy to define the termination problem for the semi-Thue systems: given a semi-Thue system and a word , decide whether terminates on . One can easily see how the termination problem for semi-Thue systems is analogous to the halting problem of the Turing machines; see [1].
We define the set
.
Thus means that does not terminate from in the existential sense: at least one infinite branch exists in the derivation tree rooted at .
The complementary universal termination property is now defined by
Thus TERM = .
2.3 A fixed universal semi-Thue system
For the diagonal argument concerning infinite derivations we use a fixed universal semi-Thue system. The system is the one constructed by Halava, Matiya-sevich and Niskanen [3]. It is universal with respect to the existence of infinite derivations. We recall here only the part of the construction that is needed below: the coding of an arbitrary semi-Thue system and its initial word into a single initial word of the fixed universal system. The construction is related to
Tseitin’s famous seven-rule semi-Thue system with undecidable word problem, see [4] for a survey on the topic.
The universal construction is stated for semi-Thue systems whose rule words are nonempty. This entails no loss of generality for the termination/finiteness problem as can be seen by the following Lemma.
Lemma 1. There is an effective construction which, given a semi-Thue system and a word , produces a semi-Thue system , where , and a word such that no rule of has the empty word as either of its sides, and
there exists an infinite derivation from w in S
if and only if
there exists an infinite derivation from in .
The simplest way of proving the above lemma is to add a new symbol before, after, and between the symbols of the words, and to replace each occurrence of in the rules of by .
Thus, when applying the fixed universal system to the infiniteness problem, we may assume without loss of generality that all rule words are nonempty. In the following description, let be a semi-Thue system, where and , with and for all .
We first encode words over A by words over the two-letter alphabet . If
we define
We also put
Thus each letter is encoded by the block , and the final letter a marks the end of the encoded word.
The fixed universal semi-Thue system defined in [3] is denoted by , where . We do not present the full rule set of . Instead we highlight the key purposes of different letters.
The letters a, b are used for the encoded current word, whereas the letters c, d are used for the encoded rule system. We define morphism
by
In other words, changes the alphabet into the alphabet . Together with it encodes rules into the alphabet . To be more precise, for a word
we define
The rules of S are encoded by setting
and
Since the rule words are assumed to be nonempty, the word determines the finite list of rules uniquely.
Now the pair consisting of the semi-Thue system and the initial word w is encoded into the single word
over the alphabet of the fixed system . This is the specific internal encoding used by the fixed universal semi-Thue system . It should be distinguished from the external code of an instance of a decision problem.
The role of the marker is to separate the encoded rule table from the encoded current word . During a simulation step, the rules of move the markers through the word in order to compare an encoded left-hand side of a rule with an occurrence in the current word, replace it by the corresponding right-hand side, and finally restore the word to the form
Thus one simulated rewriting step of S corresponds to a finite derivation in U. The following proposition follows from the proof of the next theorem from [3].
Proposition 1. Let be a semi-Thue system whose rule words are nonempty, and let and be as above. If
is a finite derivation in S, then
Consequently, every infinite derivation
in S gives rise to an infinite derivation
in U.
The essential property of is the converse direction as well. Although a derivation in may pass through many intermediate words which are not themselves of the form , every infinite derivation from yields an infinite derivation from in the simulated system .
The theorem was proved in [3].
Theorem 1. For every semi-Thue system and every word , one can effectively construct a word with the following property:
there exists an infinite derivation from w in S
if and only if
there exists an infinite derivation from in U.
Equivalently,
Thus the existence of an infinite derivation for an arbitrary semi-Thue system can be represented as the existence of an infinite derivation in one fixed semi-Thue system.
This fixed-system formulation is the semi-Thue analogue of using a universal Turing machine. The input semi-Thue system is no longer part of the rule set being executed; it is part of the initial word. This is the form of universality needed for the diagonal constructions below.
3 Acceptance, Assertion, and Decision
3.1 Existential acceptance
Let be a semi-Thue system, and let be a distinguished symbol. The symbol is called the acceptance symbol.
We say that accepts a word if there exists a word such that and occurs in . Equivalently,
This is an existential notion of acceptance. It does not require that all derivations from w produce Y, nor does it require that a word containing Y be irreducible. Acceptance means only that some finite branch of the derivation tree reaches a word in which the distinguished symbol Y occurs.
This use of a distinguished symbol is close in spirit to Post’s use of normal systems. In Post’s formulation, computation is presented generatively: a system produces assertions rather than executing a linear sequence of machine instructions. In particular, recursively enumerable sets of positive integers may be represented by normal systems over an alphabet such as , where the integer n is represented by the word , and the occurrence of the distinguished symbol b serves to mark a generated assertion. Thus acceptance is not an internal act of decision by the system itself, but the external recognition that a word of the required form has appeared in the derivation tree. Our acceptance symbol Y plays the same formal role: it is a marker whose occurrence witnesses membership by the existence of a finite derivation. This is close to Post's formulation of recursively enumerable sets by normal systems, where generated words are treated as assertions; see Urquhart [11].
The assertion problem for semi-Thue systems is the set
Thus if and only if there exists a finite derivation such that occurs in .
The assertion problem is the natural reachability problem associated with existential acceptance. It asks whether the derivation tree rooted at w contains at least one accepting node.
3.2 Decision by semi-Thue systems
For the purpose of discussing decision rather than mere recognition, it is useful to distinguish two special symbols Y and N, where Y represents a positive verdict and N represents a negative verdict.
Let be a semi-Thue system with . A word is called verdict-bearing if either Y occurs in u or N occurs in u. We write
The symbols Y and N have no intrinsic computational meaning. They become acceptance and rejection symbols only through the external interpretation assigned to them.
Let be a language over a finite alphabet . To say that a semi-Thue system recognizes or decides , we need an effective way of associating to each input word a start word over the alphabet .
We therefore fix a computable map
The word start(x) is the initial word from which the derivation of S on input begins.
In many constructions the map start is simply an encoding of x into the alphabet of S. We keep it explicit in order to separate the input representation from the rewriting rules themselves.
Assume further that has distinguished symbols . We say that is existentially correct for if, for every input word , the following two conditions hold:
- if , then there exists a derivation
such that Y occurs in u, and there is no derivation
such that N occurs in v;
- if , then there exists a derivation
such that N occurs in u, and there is no derivation
such that Y occurs in v.
Thus existential correctness says that the correct verdict is reachable and the wrong verdict is not reachable. It does not yet say that every maximal derivation reaches a verdict. There may still be derivations which avoid both Y and N forever, or finite maximal derivations which stop without producing either symbol.
We say that is verdict-total with respect to start if, for every input , every maximal derivation from start() reaches a verdict. That is, for every maximal derivation
with
there exists an index i such that
Equivalently, there is no maximal derivation from start(x) which avoids both Y and N forever.
Verdict totality is the rewriting-theoretic analogue of the requirement that all computation branches eventually produce an observable outcome.
Let be a language. A semi-Thue system with distinguished verdict symbols decides if there exists a computable input map
such that:
-
S is existentially correct for L with respect to start;
-
S is verdict-total with respect to start.
Thus decision consists of two separate requirements. First, the system must be correct: the right verdict must be reachable and the wrong verdict must be unreachable. Second, the system must be total from the observer's point of view: every maximal derivation must eventually reach some verdict.
Existential acceptance alone is therefore a notion of recognition, not decision. Decision requires that nondeterministic branching cannot hide the answer in a verdict-avoiding branch.
The distinction between recognition and decision is central in what follows. A semi-Thue system recognizes a language by producing a positive witness on at least one branch of a derivation tree. This is the semi-Thue counterpart of recursive enumerability.
Decision is stronger. It requires both positive and negative verdicts, and it requires that every maximal derivation reveal one of them. In this sense, verdict totality is a semantic determination condition: the system may remain non-deterministic internally, but the nondeterminism must not prevent the observer from obtaining a final answer.
The undecidability results below are first proved at the level of existential acceptance and infinite derivations. The later discussion of decision explains how these non-recursive-enumerability results imply classical undecidability.
4 Assertion and Recursive Enumerability
4.1 RE sets via semi-Thue acceptance
A language is recursively enumerable if there exists a semi-Thue system such that for all ,
Post’s original formulation of recursively enumerable sets by normal systems is given in [6]; see also the reprints in Davis [2, pp. 305–337] and in Post’s collected works [7, pp. 461–494]. In Post’s formulation, computation is presented generatively: a system produces assertions rather than executing a linear sequence of machine instructions. Thus membership is witnessed by the appearance of a generated word of the required form.
This viewpoint is close to the use of the acceptance symbol Y above. The occurrence of Y is not an internal act of decision by the semi-Thue system itself, but an externally observed marker witnessing that a successful finite derivation has been produced. The diagonal reading of Post’s construction is discussed by Urquhart [11], who describes Post’s enumeration of normal systems and the associated diagonal set.
It is straightforward to see that the assertion problem is recursively enumerable. Indeed, given a semi-Thue system and a word , one can enumerate the finite derivation tree rooted at . At stage one lists all words reachable from by at most rewriting steps. If at some stage a word containing the acceptance symbol Y is found, the enumeration halts and answers positively.
Thus
is recursively enumerable.
We now show that the complement of the assertion problem is not recursively enumerable. The proof is the direct diagonal argument corresponding to Post's diagonal method for normal systems.
We include the following diagonal proof for two reasons. First, it makes the paper self-contained at the point where non-recursive enumerability enters the argument. Second, it exhibits in its simplest form the Post-style diagonal idea which motivates the present approach: enumerate all generative systems, apply the system to its own code, and reverse the resulting assertion.
Theorem 2. The complement of the assertion problem is not recursively enumerable. That is,
is not recursively enumerable.
Proof. Assume, for a contradiction, that is recursively enumerable. By the characterization of recursively enumerable sets by semi-Thue acceptance, there is a semi-Thue system T with acceptance symbol Y such that, for every semi-Thue system S and every word w,
In other words, T recognizes precisely the negative instances of the assertion problem.
Consider now the diagonal set
The map
is computable. Since recognizes , it follows that is recursively enumerable: on input , form the code and simulate on this code. Thus there exists a semi-Thue system such that, for every semi-Thue system ,
By the definition of K, this means that
Now take S = D. We obtain
which is impossible. Hence the assumption that is recursively enumerable must be false.
4.2 The complement of the word problem
Recall that the word problem for semi-Thue systems is the set
We now show that the complement of the word problem is not recursively enumerable. The proof uses the result just proved for the assertion problem.
Theorem 3. The complement of the word problem for semi-Thue systems is not recursively enumerable. That is,
is not recursively enumerable.
Proof. We reduce the complement of the assertion problem to the complement of the word problem.
Let be a semi-Thue system with acceptance symbol , and let . We effectively construct a semi-Thue system and a word such that
Here Z is a new symbol, not in A.
Let
The rules of consist of all rules of S, together with the following additional rules:
and, for every ,
We may also include the rule
These extra rules have the following purpose. The marker Z can be created only from an occurrence of the acceptance symbol Y. Once Z has appeared, the rules and erase all neighbouring letters around it, and contracts possible multiple occurrences of Z. Thus any word containing Y can be reduced to the single word Z.
It is now obvious that
Therefore
The map
is effective. Hence, if were recursively enumerable, then would also be recursively enumerable. This contradicts Theorem 2. Therefore is not recursively enumerable.
5 Non-Termination and Universal Diagonalization
5.1 Why universality matters
The proofs in the previous section proceed by assuming the existence of a semi-Thue system recognizing or deciding the language under consideration. This is mathematically sufficient for obtaining the desired contradictions. Conceptually, however, a bare semi-Thue system is merely a rewriting relation: by itself it has no intrinsic notion of program, input, output, or decision. These notions become operationally explicit only after introducing a universal semi-Thue system together with an encoding of systems and inputs and an interpretation of observable outcomes.
In this sense, the universal semi-Thue system plays the same conceptual role as the universal Turing machine: it provides an interpreter in which rewriting becomes computation. Unlike a (deterministic) universal Turing machine, however, the universal semi-Thue system remains itself an ordinary nondeterministic rewriting system, and the encoded computation that it simulates is likewise an ordinary nondeterministic semi-Thue computation. At neither level is the simulated semi-Thue computation transformed into a deterministic process or endowed with an external control mechanism.
Thus diagonalization is not performed by first translating semi-Thue systems into machines with states and then applying the usual machine argument. Rather, self-reference is realized inside rewriting itself. The universal system allows a semi-Thue system and an input word to be coded as a single word, and the diagonal construction then acts on this code. In this way universality is not merely a technical device for reductions; it is the mechanism which makes self-reference available in the semi-Thue formalism.
5.2 A universal semi-Thue interpreter
Recall the infiniteness problem,
Thus means that the derivation tree rooted at has at least one infinite branch. Its complementary property is termination:
That is,
The problem INF is the semi-Thue analogue of non-halting or circularity phenomena in machine models. Since semi-Thue derivations are branching, the existential formulation is essential: non-termination means that at least one infinite derivation exists.
We now use the fixed universal semi-Thue system U described in Section 2.3. Recall that, for every semi-Thue system S and every word w, there is an effective encoding
such that
there exists an infinite derivation from w in S
if and only if
there exists an infinite derivation from in .
Equivalently,
The important point is that both sides of this equivalence are statements about semi-Thue derivations. The system U is not an external controller. It is a semi-Thue system whose derivations simulate the derivations of the encoded semi-Thue system. Hence the universal construction stays completely inside the rewriting model.
5.3 Diagonalization inside the universal system
We now prove that the infiniteness problem is not recursively enumerable. The proof is a diagonal argument, but it is important that the construction does not follow a single branch of a nondeterministic computation. Since acceptance by a semi-Thue system is existential, an accepting word may occur on one branch while other branches do not accept. Therefore the constructed system must enumerate finite levels of derivation trees.
We first record explicitly the finite objects which will be used in the construction. Let be a semi-Thue system and let . Define the frontiers of the derivation tree of from by
and
Thus is the set of all words reachable from by exactly rewriting steps. Each is finite, since has finitely many rules and each word has only finitely many one-step successors.
Moreover, these finite frontiers can be effectively written as finite coded lists. For example, using a separator symbol # not in A, a finite frontier
may be represented by a word of the form
A rewriting system can then scan such a list, inspect each listed word, and construct a new list. In particular, it can transform a coded list for into a coded list for by applying each rule of T at each possible occurrence in each listed word and writing all resulting words into a new output list.
In the present construction this manipulation of coded frontiers is carried out uniformly by iteratively writing out the non-deterministic derivation tree using the fixed universal semi-Thue system U. The point is that, in the diagonal construction, the simulated system S is not built into the rules of the constructed system. It is supplied as part of the input word. Thus D must be able to read a coded rule table and apply its rules to coded words. The universal system U provides exactly this kind of fixed rewriting interpreter. Given a coded semi-Thue system and a coded word, it can simulate one rewriting step of the coded system. By using this simulation repeatedly, and by adding bookkeeping markers, the constructed system can expand an entire coded frontier into the next coded frontier.
Thus D will not merely simulate a possible derivation of E or S. Rather, the current word of D will contain coded finite lists representing frontiers of derivation trees. These lists are part of the actual word being rewritten, and hence they can be inspected by further rules. In particular, D can search a coded frontier for the coded acceptance symbol Y, and it can test whether a coded frontier is empty.
We now give the diagonal construction.
Theorem 4. The set INF is not recursively enumerable.
Proof. Assume, for a contradiction, that INF is recursively enumerable. Then there is a semi-Thue system E, with acceptance symbol Y, such that for every semi-Thue system S and every word w,
We construct effectively a semi-Thue system . On input , the system carries out two synchronized frontier enumerations.
First, D enumerates the frontiers of the derivation tree of E on the diagonal input
That is, it successively writes coded lists representing
After each new frontier has been written, scans this finite coded list for the occurrence of the coded acceptance symbol . If such an occurrence is found, then rewrites to an irreducible terminal configuration. This is done by introducing rules and for every . Note, that these rules are not part of semi-Thue system (or ). Recall that an occurrence of does not influence the computation of E as within E it has no special meaning such as terminating the computation.
Second, enumerates the frontiers of the derivation tree of from . Thus it successively writes coded lists representing
Here the rules of are not part of the rules of ; they are read from the code . This is where the use of the universal system is essential. The universal rewriting component reads the coded rule table of , applies the encoded rules to each coded word in the current frontier, and writes the resulting coded words into the next frontier.
After each such expansion, checks whether the newly written frontier of the derivation tree of is empty. If the frontier is empty, then all derivations of from have terminated. In that case enters a fixed infinite loop, by introducing a new symbol, say %, and a rule . Thus producing configurations
using a simple nonterminating component.
The construction is arranged so that the two tests are performed at each stage in a fixed order. First D checks whether the current E-frontier contains Y. If it does, D stops. If not, D checks whether the current S-frontier is empty. If it is empty, D enters the infinite loop. If neither event occurs, D uses the universal component again to construct the next frontiers and repeats the procedure.
We now verify the behaviour of D. Suppose first that
Since recognizes INF, the system accepts . Hence there exists a finite derivation of from to a word containing . Therefore, for some , the frontier
contains a word in which Y occurs. Since D enumerates the frontiers of the E-tree level by level and writes them into its current word, D eventually finds this occurrence of Y. At that point D rewrites to an irreducible terminal configuration.
Moreover, in this case the derivation tree of from has an infinite branch, so its frontiers are never exhausted. Thus the “empty-frontier” test for never triggers before the accepting symbol is found during the enumeration of one of the -frontiers. Consequently has no infinite derivation from in this case.
Conversely, suppose that
Then, since recognizes INF, the system does not accept . Hence no frontier of the -derivation tree contains a word with .
On the other hand, the assumption
means that there is no infinite derivation of from . The derivation tree of a semi-Thue system is finitely branching. Hence, by König's lemma, if it has no infinite branch, then it is finite. Therefore there exists such that
Since enumerates and writes the -frontiers level by level, it eventually writes this empty frontier and detects that it is empty. Since the enumeration of the frontiers by has not found , the system then enters its fixed infinite loop. Thus has an infinite derivation from .
We have shown that, for every semi-Thue system S,
Now put S = D. We obtain
which is impossible. Therefore INF is not recursively enumerable.
The essential point of the construction is that the universal system U is used not merely to follow one branch of a simulated nondeterministic system, but to manipulate coded finite frontiers of whole derivation trees. The finite frontiers are written into the current word of D, where they can be examined. Thus an accepting branch of E, if it exists, is eventually found, and the absence of infinite branches in S is detected by exhaustion of a coded frontier. This is why the proof remains entirely inside the semi-Thue formalism while still handling nondeterminism correctly.
The proof idea of writing out frontiers is somewhat similar to the proof of the undecidability of the emptiness problem for linear-bounded automata (LBA). Recall, that in the emptiness problem for LBA, we are asked whether a given LBA accepts something. The undecidability is proven by giving an LBA a finite sequence of configurations of a Turing machine and checking that they correspond to a valid accepting run of the machine. Our construction has however a crucial difference, the proof relies on self-reference rather than a reduction from another Turing-complete model.
Since INF is not recursively enumerable, the termination problem
is not decidable. Indeed, if TERM were decidable, then INF would also be decidable, and hence recursively enumerable, contrary to Theorem 4.
Thus non-termination is a fundamental source of undecidability for semi-Thue systems. More importantly for the present paper, the proof shows that this undecidability arises from universality and self-reference inside nondeterministic rewriting itself. The universal semi-Thue system does not replace rewriting by a machine model; it shows that rewriting already contains the resources needed for diagonalization.
6 Recognition, Decision, and Observation
6.1 Recognition versus decision
The results of Sections 4 and 5 concern existential properties of derivation trees. The assertion problem asks whether there exists a finite derivation reaching a designated symbol, while the infiniteness problem asks whether there exists an infinite derivation. Both are naturally formulated in terms of the existence of a branch satisfying a given property.
These notions correspond to recognition rather than decision. Recognition requires only the existence of a successful derivation witnessing membership. This is precisely the rewriting-theoretic counterpart of recursive enumerability.
Decision is a stronger notion. Besides correctness of positive and negative verdicts, it requires that every maximal derivation eventually reveals one of them. Thus decision is recognition together with a global requirement that the observable outcome cannot be avoided by following another branch of the derivation tree.
The undecidability phenomena established in this paper therefore arise already at the level of recognition. The additional structure required for decision does not create undecidability; it merely provides an interpretation of the outcomes of computation.
6.2 Verdicts and observation
The symbols Y and N should not be viewed as computational primitives. From the viewpoint of a semi-Thue system they are merely ordinary symbols of the alphabet. Their interpretation as acceptance and rejection is supplied entirely by an external observer.
The same observation applies to the universal semi-Thue system. The universal system assigns no distinguished computational meaning to Y or N. If the simulated semi-Thue system derives one of these symbols, then the universal system merely simulates this derivation. It does not introduce a second level of acceptance or rejection. Thus universality preserves not only the rewriting dynamics but also the purely observational nature of verdicts.
This viewpoint is close in spirit to Post’s formulation of recursively enumerable sets by normal systems. A successful computation is not an internal decision made by the rewriting system itself; it is the external observation that a word of the required form has appeared in the derivation tree.
6.3 Computation trees and machine computation
A Turing machine presents computation as a single sequence of configurations. Although nondeterministic Turing machines admit branching computations, the classical presentation of computability theory is fundamentally based on the deterministic machine, where the computation is represented by one observable run.
Semi-Thue systems expose a different computational picture. Their natural object is not a single computation but an entire derivation tree generated by local rewriting rules. Existential acceptance, reachability, and infiniteness are all properties of this tree.
From this perspective, the states of a Turing machine may be viewed as a device for compressing an unbounded computation into a single observable execution. Semi-Thue systems perform no such compression. They expose the branching structure directly, making explicit that undecidability is fundamentally a property of computation trees rather than of machine states.
6.4 Universality and self-reference
The universal semi-Thue system plays a role analogous to that of the universal Turing machine. It provides a fixed interpreter capable of simulating arbitrary semi-Thue systems from encoded descriptions.
There is, however, an important conceptual distinction. The universal semi-Thue system is itself an ordinary nondeterministic semi-Thue system, and the computation that it simulates is likewise an ordinary nondeterministic semi-Thue computation. At neither level is rewriting replaced by deterministic control or by an external computational mechanism.
The significance of universality therefore goes beyond providing reductions. Universality makes self-reference possible entirely within the rewriting model. A semi-Thue system can simulate the computation of another semi-Thue system, including one obtained from its own description. The diagonal construction of Section 5 is carried out entirely inside this framework of nondeterministic rewriting.
6.5 Concluding remarks
The results of this paper suggest that undecidability in semi-Thue systems should be understood primarily as a consequence of universality and self-reference rather than as a property of machine states or control mechanisms. The universal semi-Thue system does not transform rewriting into a different computational model; it demonstrates that rewriting itself already contains the resources needed for universal computation and diagonalization.
Decision, by contrast, is an additional observational layer. It arises only after assigning external meaning to designated verdict symbols and requiring that every maximal derivation eventually reveals one of them. In this sense, semi-Thue systems separate two notions that are often intertwined in machine models: the generation of computations and the observation of their outcomes.
Acknowledgements. The authors acknowledge the use of ChatGPT, developed by OpenAI, as an editorial and mathematical discussion tool during the preparation of this article. ChatGPT was used to assist with language polishing, structural organization, formulation of explanatory passages, and critical review of draft arguments. In particular, it helped identify points where proofs required further clarification. All mathematical content, final formulations, and responsibility for the results remain entirely with the authors.
References
[1] Martin Davis. Computability and Unsolvability. McGraw-Hill, 1958.
[2] Martin Davis, editor. The Undecidable: Basic Papers on Undecidable Propositions, Unsolvable Problems and Computable Functions. Raven Press, Hewlett, New York, 1965.
[3] Vesa Halava, Yuri Matiyasevich, and Reino Niskanen. A universal semi-thue system. Fundamenta Informaticae, 153:23–45, 2017.
[4] Carl-Fredrik Nyberg-Brodda. G. S. Tseytin's Seven-Relation Semigroup with Undecidable Word Problem, pages 39–67. Springer Nature Switzerland, Cham, 2026.
[5] Emil L. Post. Formal reductions of the general combinatorial decision problem. American Journal of Mathematics, 65:197–215, 1943.
[6] Emil L. Post. Recursively enumerable sets of positive integers and their decision problems. Bulletin of the American Mathematical Society, 50:284–316, 1944.
[7] Emil L. Post. The Undecidable: Solvability, Provability, Definability. Birkhäuser, Boston, 1994.
[8] Yurii Rogozhin. Small universal turing machines. Theoretical Computer Science, 168(2):215–240, 1996.
[9] Claude E Shannon. A universal turing machine with two internal states. Automata studies, Annals of Mathematics Studies, 34:157–165, 1956.
[10] Alan M. Turing. On computable numbers, with an application to the entscheidungsproblem. Proceedings of the London Mathematical Society, 42:230–265, 1936.
[11] Alasdair Urquhart. Emil Post. In Dov M. Gabbay and John Woods, editors, Logic from Russell to Church, volume 5 of Handbook of the History of Logic, pages 429–478. Elsevier, Amsterdam, 2009.
[12] Damien Woods and Turlough Neary. The complexity of small universal turing machines: A survey. Theoretical Computer Science, 410(4):443–450, 2009.