| OCR Text |
Show Let A and 8 be input terms and let V(A,8} = {x1, ... ,xn } . Let the initial environment be Env = < U 0 , T 0 , p0 , w 0 , cr 0 >, where U 0 = { {x} = {A, 8}, {x1 } = {}, {x2 } = {}, ... , {xn} = {}} To = {}; p0 points to the first rewrite rule; w0 is a dummy address; cr0 is an identity un ifier. Other procedures used: Push{env, stack}: makes a copy of env and pushes it into stack. Top(stack): gets the top environment <U, T, p, w, cr tJ > in stack; return the environment with the substitution /J removed, i.e., <U, T, p, w, cr> . Variable declaration and initialization: stack := null_ stack; working_ env := Env; I abel: Select a multiequation N = M from U of working_ env such that the variables in N do not occur elsewhere in U, try the cases a to d in that order; * case a. U is empty output T; working_ env := Top(stack); if working_ env = null_ stack then stop else go to label; case b. M has common part* Push(working_ env, stack); working_ env := Transform(working_ env); go to label; case c. M has no common part and not narrowable, or has no common part because of constructor conflicts** working_ env := Top(stack); if working_ env = null_ stack then stop else go to I abel; case d. M (i) has no common part but narrowable Push{working_ env, stack); working_ env := Deduce(working_ env); go to label; Figure 13: An algorithm based on backtracking Note that in the case that M = {}, the common part is {} itself. ** A constructor conflict is, for example, g( ... ) and h( ... ), where both g and h are constructo r s. 98 |