title: not stop after true answer in prolog
body: <p>i write this programm for give me this result :
  "X=john"
  "Y=jane"</p>
  
  <pre><code>likes(john,mary).
  likes(mary,jane).
  likes(l,k).
  
  likes(X,Y) :- likes(X,Z), likes(Z,Y).
  </code></pre>
  
  <p>but if run this programm such that this result:
  i think the programm get in loop !
  i want to stop after true answer !</p>
  
  <pre><code>1 ?- likes(X,Y).
  X = john,
  Y = mary ;
  X = mary,
  Y = jane ;
  X = l,
  Y = k ;
  X = john,
  Y = jane ;
  ERROR: Out of local stack
  </code></pre>
  
  <p>i have the error !
  how solving this problem ?</p>
  
  <p>by debugging :</p>
  
  <pre><code>[debug] 3 ?- likes(john,Y).
   T Call: (6) likes(john, _G2162)
   T Exit: (6) likes(john, mary)
  Y = mary ;
   T Redo: (6) likes(john, _G2162)
   T Call: (7) likes(john, _G2267)
   T Exit: (7) likes(john, mary)
   T Call: (7) likes(mary, _G2162)
   T Exit: (7) likes(mary, jane)
   T Exit: (6) likes(john, jane)
  Y = jane ;
   T Redo: (7) likes(mary, _G2162)
   T Call: (8) likes(mary, _G2267)
   T Exit: (8) likes(mary, jane)
   T Call: (8) likes(jane, _G2162)
   T Call: (9) likes(jane, _G2267)
   T Call: (10) likes(jane, _G2267)
   T Call: (11) likes(jane, _G2267)
   T Call: (12) likes(jane, _G2267)
   T Call: (13) likes(jane, _G2267)
   T Call: (14) likes(jane, _G2267)
   T Call: (15) likes(jane, _G2267)
  </code></pre>
  
  <p>and so on .. 
  why likes(jane, _G2267) ??????</p>