Unification Algorithm

The basic unification algorithm is simple. However, it must be implemented with care to ensure that the results are correct.

We begin by making sure that the two expressions have no variables in common. If there are common variables, substitute a new variable in one of the expressions. (Since variables are universally quantified, another variable can be substituted without changing the meaning.)

Imagine moving a pointer left-to-right across both expressions until parts are encountered that are not the same in both expressions. If one is a variable, and the other is a term not containing that variable,

  1. substitute the term for the variable in both expressions,
  2. substitute the term for the variable in the existing substitution set [This is necessary so that the substitution set will be simultaneous.]
  3. add the substitution to the substitution set.

Contents    Page-10    Prev    Next    Page+10    Index