| OCR Text |
Show 107 6.1.2 A Biased Semantic Unification Algorithm We now provide a biased semantic unification algorithm which is described in Figure 14 and uses the procedure One Step Reduction detailed in Figure 15. As illustrated in Example 10, functions can have more than one set of parameters. For clarity of our exposition, however, we will write function terms with only one set of parameters. Note that in the algorithm of Figure 14, we assume that the subterms appearing in the lefthand side of an equation cannot contain common variables.'· As a result. the equations in the set I will not be interrelated, thus eliminating the necessity of processing equations that are interrelated by common vari-ables. Note also that we use the phrase compound term to refer to those terms that are built up from variables and function symbols (including constant functions). In implementing the procedure One_ Step_ Reduction, if the set S contains more than one equation, the order of choosing equations needs to be specified. We assume that equations are chosen in the order in which they ap-pear in the program. Biased semantic unification fails to terminate only in some unusual situa-tions. To show this, we first need a definition. * Definition 6-2: A function f is said to be eye/ ic if there is a defined function h which appears as the outermost functor infinitely many times in some reduction sequence of the function f. 0 The following functions are examples of simple cyclic functions: h(N) = h(N+ 1) f(N) = g(N+ 1) g(N) = f(N+1). Lemma 6-3: The biased unification algorithm terminates if there are no cyclic functions defined in EON. D It is possible to relax this condition although this increases the complexity of the resulting al-gorithm. |