| OCR Text |
Show 93 5.3.3.1 An Example Let us start from an example that illustrates the main ideas behind the method presented here and the differences with respect to the basic algorithm. lows: Example 8. Suppose we have a term rewriting systems as fol - { f(a, x) - > a A h(x) h(x) - > c(x, a) }, and we want to unify two terms c(a A c(a,a,), x) and c(x, f(y, z)). In the figures that follow, we use --:'>to denote an ordinary unification un1fy process, and assume that ~ni?v is performed before narrowing, should tt}~y start at the same term. The basic algorithm is illustrated in Figure 9. The E-unifier generated is uP 1P0 = {x <- a A (a,a), y <- a, z <- a}. Notice that the work done by ordinary unification is completely ig-nored; each time, the ordinary unification process started from the beginning. The method presented in this section does not ignore the work done by ordinary unification, i.e., whenever it is not necessary, it does not backtrack to the top in order to enumerate alternative narrowing sequences; instead, it goes to the nearest point from which there ex-ists a narrowing sequence. This is illustrated in Figure 10, where -- '> tran denotes a step of the transformation reduction described in Section 5.3.2. 0 Our method actually embeds the narrowing process into the ordinary unification process. It is clear that our method should enumerate unifiers more effectively than the basic algorithm. We now formalize the intuitive ideas discussed above. |