unifyp(expression,expression) → boolean
The subroutine unifyp takes two expressions as arguments and checks whether the two expressions can be unified. If so, unifyp returns true; otherwise, it returns false.
Call: unifyp(read('p(X,Y)'),read('p(a,b)'))
Exit: true
Call: unifyp(read('p(X,Y)'),read('p(a,a)'))
Exit: true
Call: unifyp(read('p(X,X)'),read('p(a,a)'))
Exit: true
Call: unifyp(read('p(a,b)'),read('p(a,b)'))
Exit: true
Call: unifyp(read('p(X,X)'),read('p(a,b)'))
Exit: false
User: unifyp(read('p(a,b)'),read('p(X,Y)'))
Exit: false
Two expressions can be unified if and only of there is a variable assignment that makes them look alike, i.e. the result of applying the variable assignment to the first expression is identical to the result of applying the variable assignment to the second expression.
|