ArticleslgStudy

computer science

Knuth–Bendix completion algorithm

Knuth–Bendix completion algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Knuth–Bendix completion algorithm rather than just read about it. In short: The Knuth–Bendix completion algorithm (named after Donald Knuth and Peter Bendix) is a semi-decision algorithm for transforming a set of equations (over terms) into a confluent term rewriting system. When the algorithm succeeds, it effectively solves the word problem for the specified algebra.

Key takeaways

  • Knuth–Bendix completion algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Knuth–Bendix completion algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Knuth–Bendix completion algorithm from memory before moving on to harder problems.

Reference excerpt

The Knuth–Bendix completion algorithm (named after Donald Knuth and Peter Bendix) is a semi-decision algorithm for transforming a set of equations (over terms) into a confluent term rewriting system. When the algorithm succeeds, it effectively solves the word problem for the specified algebra. Buchberger's algorithm for computing Gröbner bases is a very similar algorithm. Although developed independently, it may also be seen as the instantiation of Knuth–Bendix algorithm in the theory of polynomial rings.

Introduction For a set E of equations, its deductive closure (⁎⟷E) is the set of all equations that can be derived by applying equations from E in any order. Formally, E is considered a binary relation, (⟶E) is its rewrite closure, and (⁎⟷E) is the equivalence closure of (⟶E). For a set R of rewrite rules, its deductive closure (⁎⟶R ∘ ⁎⟵R) is the set of all equations that can be confirmed by applying rules from R left-to-right to both sides until they are literally equal. Formally, R is again viewed as a binary relation, (⟶R) is its rewrite closure, (⟵R) is its converse, and (⁎⟶R ∘ ⁎⟵R) is the relation composition of their reflexive transitive closures (⁎⟶R and ⁎⟵R). For example, if E = {1⋅x = x, x−1⋅x = 1, (x⋅y)⋅z = x⋅(y⋅z)} are the group axioms, the derivation chain

a−1⋅(a⋅b) ⁎⟷E (a−1⋅a)⋅b ⁎⟷E 1⋅b ⁎⟷E b demonstrates that a−1⋅(a⋅b) ⁎⟷E b is a member of E's deductive closure. If R = { 1⋅x → x, x−1⋅x → 1, (x⋅y)⋅z → x⋅(y⋅z) } is a "rewrite rule" version of E, the derivation chains

(a−1⋅a)⋅b ⁎⟶R 1⋅b ⁎⟶R b and b ⁎⟵R b demonstrate that (a−1⋅a)⋅b ⁎⟶R∘⁎⟵R b is a member of R's deductive closure. However, there is no way to derive a−1⋅(a⋅b) ⁎⟶R∘⁎⟵R 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

s >e l in the encompassment ordering, or s and l are literally similar and t > 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.

See also Word problem (mathematics) for another presentation of this example.

String rewriting systems in group theory An important case in computational group theory is 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 M = ⟨ X ∣ R ⟩ {\displaystyle M=\langle X\mid R\rangle } 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:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Knuth–Bendix completion algorithm

Start with the simplest possible case. Write down what Knuth–Bendix completion algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Knuth–Bendix completion algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Knuth–Bendix completion algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Knuth–Bendix completion algorithm

In research
Knuth–Bendix completion algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Knuth–Bendix completion algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Knuth–Bendix completion algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorics on words, Computational group theory, Donald Knuth, so understanding it makes those chapters shorter.
In everyday life
Look for Knuth–Bendix completion algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Knuth–Bendix completion algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Knuth–Bendix completion algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Knuth–Bendix completion algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Knuth–Bendix completion algorithm in simple terms?

The Knuth–Bendix completion algorithm (named after Donald Knuth and Peter Bendix) is a semi-decision algorithm for transforming a set of equations (over terms) into a confluent term rewriting system. When the algorithm succeeds, it effectively solves the word problem for the specified algebra.

Why does Knuth–Bendix completion algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Knuth–Bendix completion algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Knuth–Bendix completion algorithm.

Tags

  • Combinatorics on words
  • Computational group theory
  • Donald Knuth
  • Rewriting systems

Keep exploring