Can't understand why is prolog looping infinitly – Artificial Intelligence
From Bratko's book, Prolog Programming for Artificial Intelligence (4th Edition) We have the following code which doesn't work - anc4(X,Z):- anc4(X,Y), parent(Y,Z). anc4(X,Z):- parent(X,Z). In the book, on page 55, figure 2.15, is shown that parent(Y,Z) is kept calling until…