| OCR Text |
Show 39 3.3 Review of the Knuth-Bendix Completion Procedure To facilitate the discussion on the generality of narrowing in the next sec-tion, we briefly review the notion of critical pairs and the Knuth-Bendix completion procedure. Let ai - > fji and ai - > fji be two rewrite rules in R. We assume that we have renamed variables appropriately, so that a i and ai do not share variables. Let u be a nonvariable occurrence in a . such that a./u and a . are unifiable, with I I J the minimum unifier ~ . The pair <~{a . [u < -fj .]), ~fj . > is then said to be critical in I J I R. Example: Consider the following two rewrite rules: f(x, g(h(y, x})} - > p(x, y) g{h{z, a)) - > q(z, z). Since g{h{z, a)) is unifiable with the subterm g(h(y, z)), with the most general unifier {y<-z, x<-a}, the second rule can be superposed into the first at the occurrence 2, obtaining the critical pair <f(a,q(z,z)), p(a,z) > . From the critical pair, a new rule can be formed; for example, f(a,q(z,z)) - > p(a,z). 0 Intuitively, the existence of a critical pair in R really implies that the two terms in the pair should be equivalent. This equivalence can be determined by reducing them to normal forms if R is terminating. If the normal forms are identical, then the critical pair does not pose any problem; in case they are not identical, a new rewrite rule is added to R with the "simpler" element of the critical pair placed in the righthand side. The complexities of terms that help determine which terms are simpler than others are usually measured by some partial orderings on terms {cf. [21 ]). The above process is called the Knuth- Bendix completion procedure, or superposition procedure, and can be used to obtain a canonical term rewriting system for a given set of equations in case the process terminates. A rigorous proof of the correctness of this procedure is presented in [49]. The system REVE [77] has been experimented with generating term rewriting systems using superposition. |