With yap running, I tested for the infamous occurs check. ?- assert( f(X,X) ). ?- f(X,f(X)). The unification of X with f(X) in the above query causes an infinite loop. -- See my web page: http://www.k7on.com