equal(X, X). "="(andy, andy_2639). "="(andreas, andy). ?- equal(andy_2639, X). "="(Y, nachbar_von(X), d) :- write("X: ", X, "; Y: ", Y), nachbarn(Y, X), write("X: ", X, "; Y: ", Y). nachbarn(a, b). nachbarn(b, c). nachbarn(X, Y) :- nachbarn(Y, X). ?- equal(nachbar_von(X), Y).