title: Query returning true/false
body: <p>I recently started learning <code>Prolog</code> and have come across an issue.</p>
  
  <p>The following has been loaded into <code>Prolog</code>:</p>
  
  <pre><code>likes(john, apple).
  likes(john, pear).
  likes(john, grapes).
  likes(bill, mango).
  likes(bill, apple).
  </code></pre>
  
  <p>I am writing a predicate <code>all_like(What, List)</code> that should return <code>True</code> if all the people in <code>List</code> like the fruit in <code>What</code>.</p>
  
  <p>Eg:</p>
  
  <pre><code>all_like(apple,[john, bill]).
  </code></pre>
  
  <p>should return:</p>
  
  <pre><code>true ;
  false.
  </code></pre>
  
  <p><code>all_like(grapes,[john, bill]).</code></p>
  
  <p>should return:</p>
  
  <pre><code>false.
  </code></pre>
  
  <p>I have the following code:</p>
  
  <pre><code>all_like(What,List) :- check_list(What,List).
  
  check_list(What,[]) :- write('true').
  check_list(What, [X|Rest]) :- likes(X,What), check_list(What,Rest).
  check_list(What, [X|Rest]) :- \+ likes(X,What), write('false').
  </code></pre>
  
  <p>My results are:</p>
  
  <p><strong>1st Query</strong></p>
  
  <pre><code>true
  true .
  </code></pre>
  
  <p><strong>2nd Query</strong></p>
  
  <pre><code>false
  true .
  </code></pre>
  
  <p>Would anyone know why I'm getting these results? </p>
  
  <p>What is the significance of the second boolean value being outputted?</p>
  
  <p>Finally, is the <code>.</code> appearing after a space of significance?</p>
  
  <p>Thank you for your help.</p>