The Occurs Check
A unifier may not contain an elementary substitution of the form f(x)/x and may not cause an indefinite recursion.
In general the term in a term/variable pair is not allowed to contain any occurrences of that variable.
P(x) and P(f(x)) cannot be unified, since f(x)/x is illegal.
P(y, f(y)) and P(f(x), y) cannot be unified, since
S = { f(x)/y, f(y)/x } leads to an indefinite recursion.
Testing whether a variable appears in its corresponding term is called the “occurs check”.
Some automated reasoning systems purposely skip the occurs check in order to save time.