In Prolog, especially in it's metaprogramming aspects, people often talk about ground and non-ground variables. As well as using predicates such as var/1, nonvar/1 and ground/1. But what exactly is the distincion between them?
My current understanding is the following:
- A var is completely uninstantiated (eg. X)
- A nonvar 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.
- A ground var is completely instantiated, all the way down (eg. term(1,2,3)).
Is this correct?