title: Probabilistic Clause Choice
body: <p>Its been a long time since I used Prolog in earnest, but I can't find any reference to this by googling, or in the texts I have. This may be a failure of terminology, so apologies if I massacre that.</p>
  
  <p>If I have a program that could have multiple solutions:</p>
  
  <pre><code>likes(mary, joe).
  likes(bob, joe).
  
  :- likes(X, joe)
  </code></pre>
  
  <p>Is there a simple built-in way to have the solver run matching predicates in random order, and therefore give results in a random order (or, equivalently, have the first solution be random)?</p>
  
  <p>Obviously you can get as sophisticated as you like with the word <em>random</em>. I'm thinking of some uniform random sampling from the set of valid predicates at each step of the solver. Something more complex like a uniform random sampling over valid <em>solutions</em> is also fine. The issue is general.</p>
  
  <p>I can probably build a program to do this, using a random number generator, and meta-programming. But I want to check if I'm missing something simple.</p>