In
theoretical computer science
computer science (TCS) is a subset of general computer science and mathematics that focuses on mathematical aspects of computer science such as the theory of computation, lambda calculus, and type theory.
It is difficult to circumscribe the ...
and
mathematical logic a string rewriting system (SRS), historically called a semi-
Thue system, is a
rewriting
In mathematics, computer science, and logic, rewriting covers a wide range of methods of replacing subterms of a formula with other terms. Such methods may be achieved by rewriting systems (also known as rewrite systems, rewrite engines, or redu ...
system over
strings from a (usually
finite
Finite is the opposite of infinite. It may refer to:
* Finite number (disambiguation)
* Finite set, a set whose cardinality (number of elements) is some natural number
* Finite verb
Traditionally, a finite verb (from la, fīnītus, past particip ...
)
alphabet
An alphabet is a standardized set of basic written graphemes (called letter (alphabet), letters) that represent the phonemes of certain spoken languages. Not all writing systems represent language in this way; in a syllabary, each character ...
. Given a
binary relation
In mathematics, a binary relation associates elements of one set, called the ''domain'', with elements of another set, called the ''codomain''. A binary relation over sets and is a new set of ordered pairs consisting of elements in and i ...
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
substring
In formal language theory and computer science, a substring is a contiguous sequence of characters within a string. For instance, "''the best of''" is a substring of "''It was the best of times''". In contrast, "''Itwastimes''" is a subsequence ...
s, 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
In mathematical logic and theoretical computer science, an abstract rewriting system (also (abstract) reduction system or abstract rewrite system; abbreviated ARS) is a formalism that captures the quintessential notion and properties of rewriting s ...
. It can also be seen as a restricted kind of a
term rewriting
In mathematics, computer science, and logic, rewriting covers a wide range of methods of replacing subterms of a formula with other terms. Such methods may be achieved by rewriting systems (also known as rewrite systems, rewrite engines, or reduc ...
system. As a formalism, string rewriting systems are
Turing complete
Alan Mathison Turing (; 23 June 1912 – 7 June 1954) was an English mathematician, computer scientist, logician, cryptanalyst, philosopher, and theoretical biologist. Turing was highly influential in the development of theoretical com ...
. The semi-Thue name comes from the Norwegian mathematician
Axel Thue
Axel Thue (; 19 February 1863 – 7 March 1922) was a Norwegian mathematician, known for his original work in diophantine approximation and combinatorics.
Work
Thue published his first important paper in 1909.
He stated in 1914 the so-called w ...
, 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 and
A. A. Markov Jr.
Definition
A string rewriting system or semi-Thue system is a
tuple where
* is an alphabet, usually assumed finite. The elements of the set
(* is the
Kleene star
In mathematical logic and computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation, either on sets of strings or on sets of symbols or characters. In mathematics,
it is more commonly known as the free monoid ...
here) are finite (possibly empty) strings on , sometimes called ''words'' in
formal languages
In logic, mathematics, computer science, and linguistics, a formal language consists of words whose letters are taken from an alphabet and are well-formed according to a specific set of rules.
The alphabet of a formal language consists of sym ...
; we will simply call them strings here.
* is a
binary relation
In mathematics, a binary relation associates elements of one set, called the ''domain'', with elements of another set, called the ''codomain''. A binary relation over sets and is a new set of ordered pairs consisting of elements in and i ...
on strings from , i.e.,
Each element
is called a ''(rewriting) rule'' and is usually written
.
If the relation is
symmetric
Symmetry (from grc, συμμετρία "agreement in dimensions, due proportion, arrangement") in everyday language refers to a sense of harmonious and beautiful proportion and balance. In mathematics, "symmetry" has a more precise definit ...
, 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