Кіріспе
Кнут-Бендикс толықтыру алгоритмі (Дональд Кнут пен Питер Бендикс есімдерімен аталған) – терминдер бойынша берілген теңдеулер жиынтығын конфлюентті терминдік қайта жазу жүйесіне түрлендіретін жартылай шешім алгоритмі. Алгоритм сәтті аяқталған жағдайда, ол көрсетілген алгебра үшін сөздік мәселені тиімді шешеді. Бухбергер алгоритмі, Грёбнер базаларын есептеуге арналған, өте ұқсас алгоритм болып табылады. Бұл екі алгоритм тәуелсіз дамығанмен, оны көпмүшелік сақиналар теориясындағы Кнут-Бендикс алгоритмінің нақты бір түрі деп қарастыруға болады.
Кіріспе
E теңдеулер жиынтығы үшін оның дедуктивті жабылуы – E-ден теңдеулерді кез келген ретпен қолдану арқылы шығарылатын барлық теңдеулер жиынтығы. Формальды түрде, E екілік қатынас саналады, оның қайта жазу жабылуы және қайта жазу ережелерінің жиынтығы үшін оның дедуктивті жабылуы (∘) – екі жағына да солдан оңға қарай R-ден ережелерді қолдану арқылы расталатын барлық теңдеулер жиынтығы, олар сөзбе-сөз тең болғанға дейін. Формальды түрде R қайтадан екілік қатынас ретінде қаралады, оның қайта жазу жабылуы, оның керісі және (∘) олардың рефлексивті транзитивті жабылуларының қатынас құрамы ( және ). Мысалы, егер топ аксиомалары болса, деривация тізбегі a−1⋅(a⋅b) ∘ b – E дедуктивті жабылуының мүшесі екенін көрсетеді. Егер – E-нің "қайта жазу ережесі" нұсқасы, деривация тізбектері (a−1⋅a)⋅b ∘ b – R дедуктивті жабылуының мүшесі екенін көрсетеді. Алайда, a−1⋅(a⋅b) ∘ b жоғарыдағыдай шығаруға болмайды, өйткені (x⋅y)⋅z → x⋅(y⋅z) ережесін оңнан солға қолдануға рұқсат етілмейді. Knuth–Bendix алгоритмі терминдер арасындағы теңдеулер жиынтығы E мен барлық терминдер жиынтығында (>) редукция ретін алады және R-дің дедуктивті жабылуы бірдей болатын R-ді конфуэнтті және аяқталатын терминді қайта жазу жүйесін құруға тырысады. E-ден зардаптарды дәлелдеу үшін жиі адам интуициясы қажет болса, R-ден зардаптарды дәлелдеу қажет емес. Қосымша мәлімет үшін қараңыз Конфлюенция (абстрактілік қайта жазу) # Мотивациялық мысалдар, ол топ теориясынан дәлелдеу үлгісін береді, ол E және R арқылы орындалады.
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
Ережелер
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
E терминдер арасындағы теңдеулер жиынтығын ескере отырып, оны баламалы конвергентті терминді қайта жазу жүйесіне (мүмкін болса) түрлендіру үшін келесі тұжырымдама ережелерін қолдануға болады: Олар барлық терминдер жиынтығында пайдаланушы берген редукция реті (>) негізінде құрылады; егер (s → t) ▻ (l → r) анықталса, немесе s және l әдеби түрде ұқсас болса және t > r.
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
Жою ‹ E∪{s = s} , R › ⊢ ‹ E , R › Құрастыру ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › егер Оңайлату ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › егер Бағдарлау ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › егер s > t Қысқарту ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › егер l → r арқылы (s → t) ▻ (l → r) болса Шығару ‹ E , R › ⊢ ‹ E∪{s = t} , R › егер (s,t) R-дің сынды жұбы болса
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
Мысал
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
E теоремалық тексерушіден алынған келесі орындалу мысалы, Knuth, Bendix (1970) сияқты (қосымша) топ аксиомаларын толықтырады. Ол топтың үш бастапқы теңдеуімен (нейтралды элемент 0, инверс элементтер, ассоциативтілік) басталады, X + Y үшін f(X,Y) және −X үшін i(X) қолданады. 10 жұлдызды теңдеулер конвергентті қайта жазу жүйесін құрайды. "pm" – "парамодуляция" дегеннің қысқаша атауы, дедуциді іске асыру. Сынды жұптарды есептеу – теңдеу бірлік тармақтарының парамодуляциясының бір түрі. "rw" – қайта жазу, орындау, құрастыру, құлау және оңайлату. Теңдеулерді бағдарлау жасырын түрде жасалады және тіркелмейді.
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
Nr Lhs Rhs Көзі
1: * f(X,0) = X бастапқы("GROUP.lop", 9-жол, 1-бағана)
2: * f(X,i(X)) = 0 бастапқы("GROUP.lop", 12-жол, 1-бағана)
3: * f(f(X,Y),Z) = f(X,f(Y,Z)) бастапқы("GROUP.lop", 15-жол, 1-бағана)
5: f(X,Y) = f(X,f(0,Y)) pm(3,1)
6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3)
7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2)
27: f(X,0) = f(0,i(i(X))) pm(7,2)
36: X = f(0,i(i(X))) rw(27,1)
46: f(X,Y) = f(X,i(i(Y))) pm(5,36)
52: * f(0,X) = X rw(36,46)
60: * i(0) = 0 pm(2,52)
63: i(i(X)) = f(0,X) pm(46,52)
64: * f(X,f(i(X),Y)) = Y rw(7,52)
67: * i(i(X)) = X rw(63,52)
74: * f(i(X),X) = 0 pm(2,67)
79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74)
83: * Y = f(i(X),f(X,Y)) rw(79,52)
134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6)
151: i(X) = f(Y,i(f(X,Y))) rw(134,1)
165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
Сондай-ақ, осы мысалдың басқа бір ұсынысы үшін қараңыз Сөз мәселесі (математика). Топ теориясындағы тізбектерді қайта жазу жүйелері
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
Есептеулік топ теориясындағы маңызды жағдай – шекті ұсынылған топтың элементтеріне немесе косеттеріне каноникалық белгілер беру үшін пайдаланылатын тізбектерді қайта жазу жүйелері. Бұл ерекше жағдай осы бөлімнің басты тақырыбы болып табылады. Топ теориясындағы мотивация Критикалық жұптар леммасы терминді қайта жазу жүйесі жергілікті түрде (немесе әлсіз) конфуэнтті, егер және тек қана егер оның барлық критикалық жұптары конвергентті болса. Сонымен қатар, бізде Ньюманның леммасы бар, ол (абстрактілі) қайта жазу жүйесі қатты нормалданатын және әлсіз конфуэнтті болса, онда қайта жазу жүйесі конфуэнтті болады. Егер біз қайта жазу жүйесіне барлық сын жұптарды конвергентті болуға мәжбүрлеу үшін, мықты нормалау қасиеттерін сақтай отырып, ережелерді қоса алсақ, онда бұл қайта жазу жүйесіне конфуэнтті болуға мәжбүрлейді. X – генераторлардың шекті жиынтығы және R – X-тегі қатынастарды анықтайтын жиынтығы болатын шекті ұсынылған моноидты қарастырайық. X* – X-тегі барлық сөздердің жиыны (яғни X-тен құрылған еркін моноид) болсын. R қатынастары X* бойынша баламалық қатынас тудыратындықтан, M элементтерін R бойынша X* баламалық сыныптары деп қарастыруға болады. Әр сынып үшін {w1, w2, } стандартты өкілді wk таңдау қажет. Бұл өкіл кластағы әрбiр wk сөзiнiң каноникалық немесе қалыпты түрi деп аталады. Егер әр wк-тің wі нормальды түрін анықтау үшін есептеу әдісі болса, онда сөз мәселесі оңай шешіледі. Конфлюентті қайта жазу жүйесі дәл осыны жасауға мүмкіндік береді. Қасиетті форманы теориялық тұрғыдан кездейсоқ таңдауға болатынына қарамастан, бұл тәсіл жалпы алғанда есептеуге болмайды. (Тілдің эквиваленттік қатынасы шексіз сандағы шексіз сыныптарды шығара алатынын ескеріңіз.) Егер тіл жақсы реттелген болса, онда < тәртібі минималды өкілдерді анықтаудың бірізді әдісін береді, алайда бұл өкілдерді есептеу әлі де мүмкін болмауы мүмкін. Әсіресе, егер қайта жазу жүйесі минималды өкілдерді есептеу үшін қолданылса, онда < тәртібі келесі қасиетке де ие болуы керек:
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
A < B → XAY < XBY барлық сөздер A,B,X,Y үшін
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.
Бұл қасиет аударма инварианттылығы деп аталады. Аударма инвариантты және жақсы реттелген тәртіп – редукция тәртібі деп аталады. Моноид ұсынылысынан R қатынастарымен берілген қайта жазу жүйесін анықтауға болады. Егер A x B R-де болса, онда A < B болған жағдайда B → A ережесі қайта жазу жүйесінде болады, әйтпесе A > B және A → B. < – редукция тәртібі болғандықтан, берілген сөз W W > W1 > > Wn редукцияланады, мұнда Wn қайта жазу жүйесі бойынша төмендетілмейді. Алайда, әр Wi → Wi+1 кезінде қолданылатын ережелерге байланысты Wn ≠ W'm екі түрлі төмендетуге қол жеткізуге болады. Алайда, егер R қатынастарымен берілген қайта жазу жүйесі Knuth–Bendix алгоритмі арқылы конфуэнтті қайта жазу жүйесіне түрлендірілсе, онда барлық төмендетулер бірдей төмендетілген сөзді, яғни сөздің нормальды түрін шығаруға кепілдік беріледі. ... сипаттамасы
demonstrates that a−1⋅(a⋅b) b is a member of E'''s deductive closure. If is a "rewrite rule" version of E, the derivation chains
demonstrate that (a−1⋅a)⋅b ∘ b is a member of Rs deductive closure. However, there is no way to derive a−1⋅(a⋅b) ∘ b similar to above, since a right to left application of the rule (x⋅y)⋅z → x⋅(y⋅z) is not allowed. The Knuth–Bendix algorithm takes a set E of equations between terms, and a reduction ordering (>) on the set of all terms, and attempts to construct a confluent and terminating term rewriting system R that has the same deductive closure as E.
While proving consequences from E often requires human intuition, proving consequences from R does not. For more details, see Confluence (abstract rewriting)#Motivating examples, which gives an example proof from group theory, performed both using E and using R.
Rules
Given a set E of equations between terms, the following inference rules can be used to transform it into an equivalent convergent term rewrite system (if possible):
They are based on a user given reduction ordering (>) on the set of all terms; it is lifted to a well founded ordering (▻) on the set of rewrite rules by defining (s → t) ▻ (l → r) if
in the encompassment ordering, or
s and l are literally similar and t > r.
Delete ‹ E∪{s = s} , R › ⊢ ‹ E , R › Compose ‹ E , R∪{s → t} › ⊢ ‹ E , R∪{s → u} › if Simplify ‹ E∪{s = t} , R › ⊢ ‹ E∪{s = u} , R › if Orient ‹ E∪{s = t} , R › ⊢ ‹ E , R∪{s → t} › if s > t Collapse ‹ E , R∪{s → t} › ⊢ ‹ E∪{u = t} , R › if by l → r with (s → t) ▻ (l → r) Deduce ‹ E , R › ⊢ ‹ E∪{s = t} , R › if (s,t) is a critical pair of R
Example
The following example run, obtained from the E theorem prover, computes a completion of the (additive) group axioms as in Knuth, Bendix (1970). It starts with the three initial equations for the group (neutral element 0, inverse elements, associativity), using f(X,Y) for X+Y, and i(X) for −X. The 10 starred equations turn out to constitute the resulting convergent rewrite system. "pm" is short for "paramodulation", implementing deduce. Critical pair computation is an instance of paramodulation for equational unit clauses. "rw" is rewriting, implementing compose, collapse, and simplify. Orienting of equations is done implicitly and not recorded. Nr Lhs Rhs Source 1: * f(X,0) = X initial("GROUP. lop", at line 9 column 1) 2: * f(X,i(X)) = 0 initial("GROUP. lop", at line 12 column 1) 3: * f(f(X,Y),Z) = f(X,f(Y,Z)) initial("GROUP. lop", at line 15 column 1) 5: f(X,Y) = f(X,f(0,Y)) pm(3,1) 6: f(X,f(Y,i(f(X,Y)))) = 0 pm(2,3) 7: f(0,Y) = f(X,f(i(X),Y)) pm(3,2) 27: f(X,0) = f(0,i(i(X))) pm(7,2) 36: X = f(0,i(i(X))) rw(27,1) 46: f(X,Y) = f(X,i(i(Y))) pm(5,36) 52: * f(0,X) = X rw(36,46) 60: * i(0) = 0 pm(2,52) 63: i(i(X)) = f(0,X) pm(46,52) 64: * f(X,f(i(X),Y)) = Y rw(7,52) 67: * i(i(X)) = X rw(63,52) 74: * f(i(X),X) = 0 pm(2,67) 79: f(0,Y) = f(i(X),f(X,Y)) pm(3,74) 83: * Y = f(i(X),f(X,Y)) rw(79,52) 134: f(i(X),0) = f(Y,i(f(X,Y))) pm(83,6) 151: i(X) = f(Y,i(f(X,Y))) rw(134,1) 165: * f(i(X),i(Y)) = i(f(Y,X)) pm(83,151)
See also Word problem (mathematics) for another presentation of this example. String rewriting systems in group theory
An important case in computational group theory are string rewriting systems which can be used to give canonical labels to elements or cosets of a finitely presented group as products of the generators. This special case is the focus of this section. Motivation in group theory
The critical pair lemma states that a term rewriting system is locally confluent (or weakly confluent) if and only if all its critical pairs are convergent. Furthermore, we have Newman's lemma which states that if an (abstract) rewriting system is strongly normalizing and weakly confluent, then the rewriting system is confluent. So, if we can add rules to the term rewriting system in order to force all critical pairs to be convergent while maintaining the strong normalizing property, then this will force the resultant rewriting system to be confluent. Consider a finitely presented monoid where X is a finite set of generators and R is a set of defining relations on X. Let X* be the set of all words in X (i. e. the free monoid generated by X). Since the relations R generate an equivalence relation on X*, one can consider elements of M to be the equivalence classes of X* under R. For each class {w1, w2, } it is desirable to choose a standard representative wk. This representative is called the canonical or normal form for each word wk in the class. If there is a computable method to determine for each wk its normal form wi then the word problem is easily solved. A confluent rewriting system allows one to do precisely this. Although the choice of a canonical form can theoretically be made in an arbitrary fashion this approach is generally not computable. (Consider that an equivalence relation on a language can produce an infinite number of infinite classes.) If the language is well ordered then the order < gives a consistent method for defining minimal representatives, however computing these representatives may still not be possible. In particular, if a rewriting system is used to calculate minimal representatives then the order < should also have the property:
A < B → XAY < XBY for all words A,B,X,Y
This property is called translation invariance. An order that is both translation invariant and a well order is called a reduction order'. From the presentation of the monoid it is possible to define a rewriting system given by the relations R. If A x B is in R then either A < B in which case B → A is a rule in the rewriting system, otherwise A > B and A → B. Since < is a reduction order a given word W can be reduced W > W 1 > > W n where W n is irreducible under the rewriting system. However, depending on the rules that are applied at each Wi → Wi+1 it is possible to end up with two different irreducible reductions Wn ≠ W'm of W. However, if the rewriting system given by the relations is converted to a confluent rewriting system via the Knuth–Bendix algorithm, then all reductions are guaranteed to produce the same irreducible word, namely the normal form for that word. Description of the algorithm for finitely presented monoids
Suppose we are given a presentation , where is a set of generators and is a set of relations giving the rewriting system. Suppose further that we have a reduction ordering among the words generated by (e. g., shortlex order). For each relation in , suppose Thus we begin with the set of reductions
First, if any relation can be reduced, replace and with the reductions. Next, we add more reductions (that is, rewriting rules) to eliminate possible exceptions of confluence. Suppose that and overlap. Case 1: either the prefix of equals the suffix of , or vice versa. In the former case, we can write and ; in the latter case, and Case 2: either is completely contained in (surrounded by) , or vice versa. In the former case, we can write and ; in the latter case, and
Reduce the word using first, then using first. Call the results , respectively. If , then we have an instance where confluence could fail. Hence, add the reduction to
After adding a rule to , remove any rules in that might have reducible left sides (after checking if such rules have critical pairs with other rules). Repeat the procedure until all overlapping left sides have been checked. Examples
A terminating example
Consider the monoid: We use the shortlex order. This is an infinite monoid but nevertheless, the Knuth–Bendix algorithm is able to solve the word problem. Our beginning three reductions are therefore
A suffix of (namely ) is a prefix of , so consider the word Reducing using , we get Reducing using , we get Hence, we get , giving the reduction rule
Similarly, using and reducing using and , we get Hence the reduction
Both of these rules obsolete , so we remove it. Next, consider by overlapping and Reducing we get , so we add the rule
Considering by overlapping and , we get , so we add the rule
These obsolete rules and , so we remove them. Now, we are left with the rewriting system
Checking the overlaps of these rules, we find no potential failures of confluence. Therefore, we have a confluent rewriting system, and the algorithm terminates successfully. A non terminating example
The order of the generators may crucially affect whether the Knuth–Bendix completion terminates. As an example, consider the free Abelian group by the monoid presentation:
The Knuth–Bendix completion with respect to lexicographic order finishes with a convergent system, however considering the length lexicographic order it does not finish for there are no finite convergent systems compatible with this latter order. Generalizations
If Knuth–Bendix does not succeed, it will either run forever and produce successive approximations to an infinite complete system, or fail when it encounters an unorientable equation (i. e. an equation that it cannot turn into a rewrite rule). An enhanced version will not fail on unorientable equations and produces a ground confluent system, providing a semi algorithm for the word problem. The notion of logged rewriting discussed in the paper by Heyworth and Wensley listed below allows some recording or logging of the rewriting process as it proceeds. This is useful for computing identities among relations for presentations of groups. References
C. Sims. 'Computations with finitely presented groups.' Cambridge, 1994. Anne Heyworth and C. D. Wensley. "Logged rewriting and identities among relators." Groups St. Andrews 2001 in Oxford. Vol. I,'' 256–276, London Math. Soc. Lecture Note Ser., 304, Cambridge Univ. Press, Cambridge, 2003.