title: Learn prolog exercise 2.3
body: <p>Im going thru the learn prolog website to try to learn some prolog and are trying to under stand exercise 2.3. I guess every call to word() goes one down into some sort of stack or so and that would explain why it seems to change the words from the end back to the beginning. But how come that it goes back down again if it changes one of the words a bit up?</p>
  
  <p>Like:</p>
  
  <p>a criminal eats a criminal</p>
  
  <p>a criminal eats a big kahuna burger</p>
  
  <p>a criminal eats <strong>every</strong> <em>criminal</em></p>
  
  <p>a criminal eats <strong>every</strong> <em>big kahuna burger</em></p>
  
  <pre><code>word(article,a).
  word(article,every).
  word(noun,criminal).
  word(noun,'big kahuna burger').
  word(verb,eats).
  word(verb,likes).
  
  sentence(Word1,Word2,Word3,Word4,Word5) :-
      word(article,Word1),
      word(noun,Word2),
      word(verb,Word3),
      word(article,Word4),
      word(noun,Word5).
  </code></pre>
  
  <p>Then an swi-prolog question is it possible to get it to say yes/no instead of true/false?</p>
  
  <p>Best Regards Anders Olme</p>