Confluence (abstract rewriting)
In computer science, confluence is a property of rewriting systems, describing that terms in this system can be rewritten in more than one way, to yield the same result. This article describes the properties in the most abstract setting of an abstract rewriting system.
The usual rules of elementary arithmetic form an abstract rewriting system. For example, the expression can be evaluated starting either at the left or at the right parentheses; however, in both cases the same result is obtained eventually. This suggests that the arithmetic rewriting system is a confluent one.
This proof starts from the given group axioms A1-A3, and establishes five propositions R4, R6, R10, R11, and R12, each of them using some earlier ones, and R12 being the main theorem. Some of the proofs require non-obvious, if not creative, steps, like applying axiom A2 in reverse, thereby rewriting "" to "" in the first step of R6's proof. One of the historical motivations to develop the theory of term rewriting was to avoid the need for such steps, which are difficult to find by an unexperienced human, let alone by a computer program.
If a term rewriting system is confluent and terminating, a straight-forward method exists to prove equality between two expressions (a.k.a. terms) and : Starting with , apply equalities  from left to right as long as possible, eventually obtaining a term . Obtain from a term in a similar way. If both terms and literally agree, then and are (not surprisingly) proven equal. More important, if they disagree, and cannot be equal. That is, any two terms and that can be proven equal at all, can be so by that method.
The success of that method doesn't depend on a certain sophisticated order in which to apply rewrite rules, as confluence ensures that any sequence of rule applications will eventually lead to the same result (while the termination property ensures that any sequence will eventually reach an end at all). Therefore, if a confluent and terminating term rewriting system can be provided for some equational theory,  not a tinge of creativity is required to perform proofs of term equality; that task hence becomes amenable to computer programs. Modern approaches handle more general abstract rewriting systems rather than term rewriting systems; the latter are a special case of the former.
General case and theory
A rewriting system can be expressed as a directed graph in which nodes represent expressions and edges represent rewrites. So, for example, if the expression can be rewritten into , then we say that is a reduct of (alternatively, reduces to , or is an expansion of ). This is represented using arrow notation; indicates that reduces to . Intuitively, this means that the corresponding graph has a directed edge from to .
If there is a path between two graph nodes and , then the intermediate nodes form a reduction sequence. So, for instance, if , then we can write , indicating the existence of a reduction sequence from to . Formally, is the reflexive-transitive closure of . (Using the example from the previous paragraph, we have (11+9)×(2+4)→ and 20×(2+4)→20×6, so (11+9)×(2+4)→*20×6.)
With this established, confluence can be defined as follows. Let a, b, c ∈ S, with a →* b and a →* c. a is deemed confluent if there exists a d ∈ S with b →* d and c →* d. If every a ∈ S is confluent, we say that → is confluent, or has the Church-Rosser property. This property is also sometimes called the diamond property, after the shape of the diagram shown on the right. Some authors reserve the term diamond property for a variant of the diagram with single reductions everywhere; that is, whenever a → b and a → c, there must exist a d such that b → d and c → d. The single-reduction variant is strictly stronger than the multi-reduction one.
An element a ∈ S is said to be locally (or weakly) confluent if for all b, c ∈ S with a → b and a → c there exists d ∈ S with b →* d and c →* d. If every a ∈ S is locally confluent, then → is called locally (or weakly) confluent, or having the weak Church-Rosser property. This is different from confluence in that b and c must be reduced from a in one step. In analogy with this, confluence is sometimes referred to as global confluence.
The relation →*, introduced as a notation for reduction sequences, may be viewd as a rewriting system in its own right, whose relation is the reflexive-transitive closure of →. Since a sequence of reduction sequences is again a reduction sequence (or, equivalently, since forming the reflexive-transitive closure is idempotent), →** = →*. It follows that → is confluent if and only if →* is locally confluent.
A rewriting system may be locally confluent without being (globally) confluent. Examples are shown in picture 3 and 4. However, Newman's lemma states that if a locally confluent rewriting system has no infinite reduction sequences (in which case it is said to be terminating or strongly normalizing), then it is globally confluent.
The definition of local confluence differs from that of global confluence in that only elements reached from a given element in a single rewriting step are considered. By considering one element reached in a single step and another element reached by an arbitrary sequence, we arrive at the intermediate concept of semi-confluence: a ∈ S is said to be semi-confluent if for all b, c ∈ S with a → b and a →* c there exists d ∈ S with b →* d and c →* d; if every a ∈ S is semi-confluent, we say that → is semi-confluent.
A semi-confluent element need not be confluent, but a semi-confluent rewriting system is necessarily confluent.
Strong confluence is another variation on local confluence that allows us to conclude that a rewriting system is globally confluent. An element a ∈ S is said to be strongly confluent if for all b, c ∈ S with a → b and a → c there exists d ∈ S with b →* d and either c → d or c = d; if every a ∈ S is strongly confluent, we say that → is strongly confluent.
A strongly confluent element need not be confluent, but a strongly confluent rewriting system is necessarily confluent.
Examples of confluent systems
- Reduction of polynomials modulo an ideal is a confluent rewrite system provided one works with a Gröbner basis.
- Matsumoto's theorem follows from confluence of the braid relations.
- Term Rewriting Systems, Terese, Cambridge Tracts in Theoretical Computer Science, 2003.
- Term Rewriting and All That, Franz Baader and Tobias Nipkow, Cambridge University Press, 1998
- K. H. Bläsius and H.-J. Bürckert, ed. (1992). Deduktionsssysteme. Oldenbourg. p. 291.; here: p.134; axiom and proposition names follow the original text
- then called rewrite rules to emphasize their left-to-right orientation
- Such a system e.g. for groups is shown here. The Knuth–Bendix completion algorithm can be used to compute such a system from a given set of equations.