| OCR Text |
Show 86 Recall that we have referred to the following set of axioms as the cl as sica! theory of equality. Let X, Y, Z, z. be any terms in T{F,V). Then I 1. Reflexivity: X = X; 2. Symmetry: if X = Y, then Y = X; 3. Transitivity: if X = Y and Y = Z, then X = Z; 4. Substitutability: if X = Y, then f(X, Z1, ... , Zn) = f(Y, Z1, ... , Zn), for all nary function symbol f that occurs in the program E and each argument of f; 5. Instantiation: if X = Y, then cr(X) = cr(Y) for any substitution cr. The first three rules describe an equivalence relation, while the fourth rule makes it a congruence relation. The implication of the last rule is obvious: any instance of a valid equation is a valid equation. An equational logic program P denotes the set of all pairs of terms in T(F,V) such that for each pair < L, R > there is a substitution cr: V(L) u V(R) - > T(F,V) such that cr(l) =E cr(R). Thus, a computed answer is actually an E-unifier for the goal of equalities. Note that a goal of equalities ?- A0 = B0 , A1 = B1 , ••• , Am = Bm can be viewed as the problem of E-unification for the following the two terms H(A0 , A17 H(B0 , B17 ... ' ... ' where H is a function symbol that is not in F. The consistency of the algebraic semantics with the operational semantics is based on the fact that for the class of closed linear term rewriting system with the nonrepetition property, narrowing yields a complete E-unification alga-rithm. The completeness of using narrowing in the E-unification algorithm for an equational theory E guarantees that if L = R has a solution, there always exists a derivation to an empty goal from the goal ?- L = R. Furthermore, the user |