Laura Kovács
Problem 6.1
Apply the unification algorithm to the following atom pairs. Provide the most general unifier (MGU) when it exists, or explain why unification fails.
- p(a,f(y),y) and p(a,x,f(x))
- p(f(x,y),f(y,z)) and p(z,f(w,f(y,w)))
Solution
- Solving p(a,f(y),y)=p(a,x,f(x)) yields x=f(y) and y=f(x), which leads to y=f(f(y)). The occurs-check fails, so there is no MGU.
- Unification produces the substitution {x↦w, y↦w, z↦f(w,w)}, which is the MGU.