| OCR Text |
Show procedure Deduce( <U, T, p, w, ~ > ) begin if there exists a rewrite rule ai- >fJ, after p such that the subterm represented by w is narrowable then else begin begin end p' := a pointer to a ,- >fJ ,; w' := w w' := Order(U, w}; Let a . - > (J . be a rewrite rule such that J J w' is narrowable, and let /J be the corresponding unifier; p' := a pointer to aj - > (Jj; ~I := () ~ end; U' := perform narrowing at w'; for each multiequation N = M in U, do apply p to M; if x E V(N) and there is a substitution x <- B in fJ, add B to N; T' := T; return <U', T', p', w', ~ ' > end. Figure 12: The procedure Deduce 97 basic algorithm, where the blind search continues. For example, suppose we want to unify g(a) and h(f(x)}, where g and h are constructors. Further assume that the subterm f(x) is narrowable (possibly a nonterminating narrowing se-quence exists from there). Because of the conditions in case c, the procedure Transform will stop, producing no unifier, while the basic algorithm will perform narrowing on f(x): a narrowing sequence that will not generate any unifier at all. A combination of depth-first search and breadth-first search can produce a complete search strategy. The idea presented in LOG LISP [1 01, 1 02] is of this kind; the user can specify the desired depth for the search at his or her will. |