I am working on creating a family tree in prolog. Where I am running into trouble is when I call on sister or brother. The results I get are correct, where julie is the sister of mike, julie is the sister of amanda, amanda is the sister of mike and amanda is the sister of julie. But what happens rather than ending there, if i keep hitting the 'n' key it will loop back through the results again. Why is this happening?
parent(pete,mike).
parent(pete,julie).
parent(pete,amanda).
parent(mary,mike).
parent(mary,julie).
parent(mary,amanda).
female(mary).
female(julie).
female(amanda).
male(mike).
male(pete).
mother(X,Y):-
parent(X,Y),
female(X).
father(X,Y):-
parent(X,Y),
male(X).
sibling(X,Y):-
parent(Z,X),
parent(Z,Y),
X\=Y.
sister(X,Y):-
sibling(X,Y),
female(X).
brother(X,Y):-
sibling(X,Y),
male(X).