title: Prolog: difference between var, nonvar and ground
body: <p>In Prolog, especially in it's metaprogramming aspects, people often talk about <strong>ground</strong> and <strong>non-ground</strong> variables. As well as using predicates such as <strong>var/1</strong>, <strong>nonvar/1</strong> and <strong>ground/1</strong>. But what exactly is the distincion between them?</p>
  <p>My current understanding is the following:</p>
  <ul>
  <li>A <strong>var</strong> is completely uninstantiated (eg. X)</li>
  <li>A <strong>nonvar</strong> is instantiated, but might contain some variables deeper down (eg. term(1,2,Y)). This is similar to a weak head normal form from Haskell.</li>
  <li>A <strong>ground var</strong> is completely instantiated, all the way down (eg. term(1,2,3)).</li>
  </ul>
  <p>Is this correct?</p>