| OCR Text |
Show 29 Let the complexity of a term be measured by the number of function symbols present in the term. For an arbitrary linear term A with complexity n, denoted by Complexity(A) = n, the term construction process can be used to bui ld up a balanced tree of depth n, in which the term A is a leaf node. We therefore have shown: Proposition 3-1 : Consider a set of graded function symbols. For any linear term A, the term con struction process generates a f inite set of li near terms r such t hat A is in r, and for any lin ear term B, we have, up to variable renaming, Complexity(B) ~ Complexity(A) = > B E r. 0 Algorithm 1 described below uses the term construction process as the first phase and rewriting as the second phase. Algorithm 1. Let R be a confluent term rewriting system. Given two terms A and B to be unified, let V = {x1, ... ,xn} be the set of variables occurring in A and B, and W be a set of variables containing V. Let {x., ... ,x.} denote any subset of V, for i ~ j ~ n. I J Use the term construction process to build up a t-tree of depth 1, and then expand it to a t-tree of depth 2, and so on. Let the corresponding sets of generated terms be denoted by where r. cr. if i ~ J·. 1- J For each set of terms r k progressively obtained above, enumerate every substitution ~ = {x. <- t ., .•• , x. <- t .} I I J J for combination of the terms {ti, ... ,ti} in r k" As a special case, ~ may be an "empty" substitution, i.e., ~ = {} (a special case of the identity substitution). Let H .. be a function symbol not in F. From the term H .. (t ., ... ,t.), IJ IJ I J enumerate, using the variables in V(Hii(ti, ... ,ti)), all nonlinear terms that have the same structure as Hii (ti, ... ,ti). For each enumerated term Hii(t'i, ... ,t), construct a substit ution |