| OCR Text |
Show 115 The te rmination of the semantic unification algorithm is obviously depend-ent on the characteri stics of the user defined f unctions. Smce we are dealing with term rewriting systems t hat may not have the termination property, certain restrictions need to be imposed in order fo r the algorithm to terminate Recall t hat we assume t hat EON repre sents a confluent term rewriting system, and that in general EON can be divided into two subsets of equations EON1 and EON2, where EON1 is a canonical (confluence and terminati ng) term rewriting system and EON2 is confluent, but may or may not be t erminating . The condition for termination of t he semantic unificat ion algorithm is as fol lows: 1. EON2 should not contain any cyclic functions. This restr iction is the same as in the case of biased semantic unification. 2. When an equation in the set I of the algorithm is of the form g(t'1, ... ,t 'P) = g'(s '1, ... ,s'q) and both g and g' are defined in EON, then both reduction sequences must terminate. The confluence property tells us that two terms are equal if and only if there exist reduction sequences that lead them to a common term. This implies that we should try every possible search path in order to prove that the two given terms are equal whenever they are indeed equal. It is obvious that this search space can grow very fast. Furthermore, the confluence property cannot guarantee the decidability of proving two terms equal. It is therefore necessary to make a tradeoff between the power and execution efficiency of the con-structs one chooses to incorporate in a language. In practice, when a user debugs his or her program, a warning should be issued if there exists a function that is defined in EON2. Under the two conditions described above, the ter-mination of the semantic unification algorithm can be proved in a manner similar to Lemma 6-3. Termination plus the confluence property for EQN guarantees that the algorithm will eventually produce a unifier for two given terms A and B if and only if A and B are unifiable and the ground term condition on A and B is observed. All the examples given in this chapter fall into this class of computations. The semantic unification algorithm can be implemented using the method of solving sets of multiequations given in [83]. |