In
theoretical computer science
Theoretical computer science is a subfield of computer science and mathematics that focuses on the Abstraction, abstract and mathematical foundations of computation.
It is difficult to circumscribe the theoretical areas precisely. The Associati ...
and
mathematical logic
Mathematical logic is the study of Logic#Formal logic, formal logic within mathematics. Major subareas include model theory, proof theory, set theory, and recursion theory (also known as computability theory). Research in mathematical logic com ...
a string rewriting system (SRS), historically called a semi-Thue system, is a
rewriting system over
strings from a (usually
finite)
alphabet
An alphabet is a standard set of letter (alphabet), letters written to represent particular sounds in a spoken language. Specifically, letters largely correspond to phonemes as the smallest sound segments that can distinguish one word from a ...
. Given a
binary relation between fixed strings over the alphabet, called rewrite rules, denoted by
, 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
, where
,
,
, and
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
In logic, mathematics, and computer science, arity () is the number of arguments or operands taken by a function, operation or relation. In mathematics, arity may also be called rank, but this word can have many other meanings. In logic and ...
of at most 1. As a formalism, string rewriting systems are
Turing complete. The semi-Thue name comes from the Norwegian mathematician
Axel Thue, who introduced systematic treatment of string rewriting systems in a 1914 paper. 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
Emil Leon Post (; February 11, 1897 – April 21, 1954) was an American mathematician and logician. He is best known for his work in the field that eventually became known as computability theory.
Life
Post was born in Augustów, Suwałki Govern ...
and
A. A. Markov Jr.
Definition
A string rewriting system or semi-Thue system is a
tuple
In mathematics, a tuple is a finite sequence or ''ordered list'' of numbers or, more generally, mathematical objects, which are called the ''elements'' of the tuple. An -tuple is a tuple of elements, where is a non-negative integer. There is o ...
where
*
is an alphabet, usually assumed finite. The elements of the set
(* is the
Kleene star
In mathematical logic and theoretical computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation on a Set (mathematics), set to generate a set of all finite-length strings that are composed of zero or more repe ...
here) are finite (possibly empty) strings on
, sometimes called ''words'' in
formal languages
In logic, mathematics, computer science, and linguistics, a formal language is a set of string (computer science), strings whose symbols are taken from a set called "#Definition, alphabet".
The alphabet of a formal language consists of symbol ...
; we will simply call them strings here.
*
is a
binary relation on strings from
, i.e.,
Each element
is called a ''(rewriting) rule'' and is usually written
.
If the relation
is
symmetric, then the system is called a Thue system.
The rewriting rules in
can be naturally extended to other strings in
by allowing substrings to be rewritten according to
. More formally, the one-step rewriting relation relation