Here is my simple Prolog program:
friend(X,Y):-
knows(X,Y).
friend(X,Z):-
friend(X,Y),
friend(Y,Z).
knows(brian,tom).
knows(tom,peter).
If I type the following query
friend(brian,peter).
Prolog will give the following output:
?- friend(brian,peter).
true
If a further type a semicolon, Prolog will say:
ERROR: Out of local stack
What am I doing wrong here?