title: Why does Prolog does not backtrack on comparison?
body: <p>I would expect that the following should always be true if a comparison backtrack, right? unless it goes into an infinite loop!</p>
  
  <pre><code> ?- Y=2 , random:random(1,3,X), X =\= Y.
   Y = 2,
   X = 1.
  
   ?- Y=2 , random:random(1,3,X), X =\= Y.
   false. 
  </code></pre>
  
  <p>but I got false!
  In general, my question is why doesn't comparison backtrack? </p>
  
  <hr>
  
  <p>Thanks for all the answers. My confusion seemed to come primarily from my expectation of random keep generating new-random numbers, so I confused that comparison was not backtracking, instead, the reason was that random does its thing only once and fails afterwards.
  I was unaware of semi-determinate nature of some predicates.
  But now I can be on a lookout ;) for cases like this. thanks again.</p>