unifies two terms, where the occurs check will be taken in account.
'='/2 succeeds when Term1 and Term2 are unifiable
in such a way that they are identical and fails if they are not unifiable
and identical.
The difference to =/2 is that the predicate fails, if
you try to create an inifite term.
Term1 term Term2 term
| unify_with_occurs_check(f(X,1), f(1,X)). | Succeeds with substitution X <- 1. |
| unify_with_occurs_check(f(X),X). | Fails. |
This predicate is part of the ISO-Prolog Standard.