Example of Unification:
Let now here, assume instead that we had these two sentences as:
knows(john,X) → hates(john, X)
knows(jack, mary)
Thus here the predicate names have not changed so rather than the arguments are holding us back from making any deductive inference is just as a first case as above given, whether we could allow the variable X to be instantiated to mary through the deduction if so then the constant john just before and after the deduction also matched without problem. Hence moreover there in the second case we see that although we could still instantiate X to mary but there we could no longer match john and jack means that they are two different constants. Just for the same we cannot deduce anything about john or anybody else from the latter two statements of course.
There is usually the problem comes from our inability just to make the arguments in knows(john, X) and the arguments in like knows(jack, mary) is match up. Here if notice for instance where we can make two predicates match up than we say that there we have unified them so we will look at an algorithm for unifying two predicates if they can be unified in this section. Furthermore remember there that unification plays a part in the way Prolog searches for matches to queries.