Our best guess at the meeting was that you weren't keeping track of state and checking to see whether the current state had already been visited. As a simple example, we looked at code to determine a path through a directed graph:
% the graph definition:
edge(1, 5).
edge(1, 7).
edge(2, 1). edge(2, 7).
edge(3, 1). edge(3, 6).
edge(4, 3). edge(4, 5).
edge(5, 8).
edge(6, 4). edge(6, 5).
edge(7, 5).
edge(8, 6). edge(8, 7).
path(Node, Node, _, [Node]).
path(Start, Finish, Visited, [Start | Path]) :-
edge(Start, X),
\+(member(X,Visited)),
path(X, Finish, [X | Visited], Path).
...where Visited is the accumulating list of states, state being simply a node in the graph. The logic: there is a path from Start to Finish if it can be shown that there is an edge from Start to (unvisited node) X and a path from X to Finish.
This is kind of a fun program to play around with. path(1,8,[], P) will trace paths between node 1 and 8. But you can also throw in variables for the start and finish nodes and get some insight into how Prolog works.