My understanding of unification is a little patchy. I understand basic unification, but I'm having issues getting my head round terms which are not unifiable.
I was watching a youtube tutorial on unification which stated if a variable is trying to be unified against a term which contains that variable, then it is not unifiable.
However when I type ?- f(X) = X
into prolog, it returns something along the lines of... f(f(f(f(f(f(...)))))) ?
I understand why this is... but I don't understand if this means it is unifiable or not, as I would have expected it just to return 'no' if it wasn't unifiable. Am I right in thinking that trying to unify f(X) = X fails the occurs check, thus making them not unifiable?
f(X) = X
unifiable? do you really mean, Isf(X)
unifiable withX
? By the way, which Prolog implementation are you using? DIfferent Prologs respond differently tof(X) = X
. – lurkerf(X) = X
, unification succeeds, creating an infinite tree ifoccurs_check
is set to false. Ifoccurs_check
is set to true, then unification will fail. – lurkerX
is unifiable withf(X)
depending upon the system and its settings. Unless you're asking if it should be unifiable, ever, logically, which is a matter of opinion. – lurker