Are you wondering why Prolog loops so often? Read this reply and others using a failure-slice. Failure slices can also be used to determine a lower bound for the number of inferences like when Finding the largest integer or when Getting factors.
And now to purity. Whose mind is not touched by such beauty?
?- maplist(dif(X),Xs). Xs =  ; Xs = [_A], dif(X,_A) ; Xs = [_A,_B], dif(X,_A), dif(X,_B) ; Xs = [_A,_B,_C], dif(X,_A), dif(X,_B), dif(X,_C) ; ...
Still here? So I can tell you: my handle is vocative.
Q&A for professional and enthusiast programmers
Q&A for meta-discussion of the Stack Exchange family of Q&A websites
Q&A for Ubuntu users and developers
Q&A for professional programmers interested in conceptual questions about software development
Q&A for enthusiasts and power users of the Android operating system