Introduction to
Logic Programming
What
versus
How
 

Exercise 8.2 - Unification


For each of the following pairs of expressions, say which substitution, if any, is a most general unifier.

(a)p(X,X) and p(a,Y) 
  {Xa} 
  {Ya} 
  {Xa, Ya} 
  Not unifiable 
 
(b)p(X,X) and p(f(Y),Z) 
  {Xf(a), Ya, zf(a)} 
  {Xf(Y), zf(Y)} 
  {Xf(Y)} 
  Not unifiable 
 
(c)p(X,X) and p(f(Y),Y) 
  {Xf(a), Ya} 
  {Xf(Y), Yf(Y)} 
  {Xf(Y)} 
  Not unifiable 
 
(d)p(f(X,Y),g(Z,Z)) and p(f(f(W,Z),V),W) 
  {XW, YZ, Wg(Z,Z)} 
  {Xf(f(W,Z),V), YV, Wg(Z,Z)} 
  {Xf(g(Z,Z),Z), YV, Wg(Z,Z)} 
  Not unifiable