In mathematics, computer science and logic, rewriting covers a wide range of potentially non-deterministic methods of replacing subterms of a formula with other terms. What is considered are rewrite systems (also rewriting systems, or term rewriting systems, though the latter term may imply a more specific system), which in its most basic form, consist of a set of terms, plus relations on how to transform these terms.
Term rewriting can be non-deterministic. One rule to rewrite a term could be applied in many different ways to that term. Rewriting systems then do not provide an algorithm for changing one term to another, but a set of possible substitutions that could be applied. When combined with an appropriate algorithm, however, rewrite systems can be viewed as computer programs, and several (experimental) declarative programming languages are based on term rewriting.
In the following, we denote plus(a, b) by a+b and likewise for times(a, b). Suppose we are given the expression
in which P and Q are polynomials. After some application of the conventional rules of algebra we may end with an equation
This is something like a normal form, though we may well have different signs (at least) for R found by different routes. If we insist that R is monic there is actually a normal form (as is usually tacitly assumed) in which R(x) is written in terms of decreasing powers of x.
Suppose the set of terms T = {a, b, c} and the rules are a → b, b → a, a → c, and b → c hold. From these rules, observe that these rules can be applied to both a and b in any fashion to get the term c. Such a property is clearly an important one. Note also, that c is, in a sense, a "simplest" term in the system, since nothing can be applied to c to transform it any further.
The property exhibited above where terms can be rewritten regardless of the choice of rewriting rule to obtain the same normal form is known as confluence. The property of confluence is linked with the property of having unique normal forms.
Formal languages | Formal methods | Logic in computer science | Mathematical logic | Theory of computation
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Rewriting".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world