Unification rules
A constant unifies only with itself.
Two structures unify if and only if they have the same functor and the same number of arguments, and the corresponding arguments unify recursively.
A variable unifies with anything.
Unification = Matching + Occurs check
What happens when we ask Prolog:
?- X = f(X).
Matching succeeds, unification fails
Sunday, 18 January 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment