title: Prolog anonymous variable
body: <p>Here is what I have understood about Prolog variables. </p>
  
  <ol>
  <li><p>A single underscore stands for anonymous variable, which is like a new variable each time it occurs.</p></li>
  <li><p>A variable name starting with underscore like _W is not an anonymous variable. Or, the variable names generated inside Prolog, like _G189, is not considered anonymous:</p></li>
  </ol>
  
  
  
  <pre><code>?- append([1,2],X,Y).
  X = _G189
  Y = [1, 2|_G189]
  </code></pre>
  
  <p>Could you please help me understand?</p>
  
  <p>By the way, I got the above example from some tutorials, but when I run it in SWI-Prolog version 6, I get the following:</p>
  
  <pre><code>?- append([1,2],X,Y).
  Y = [1, 2|X].
  </code></pre>
  
  <p>Thanking you.</p>