This predicate is named in a very unfortunate fashion.
The correct name should be
var(X)" does not test whether "X" is a variable (we know that just by looking at the source code and the compiler should flag nonsense like "
var(foo)"), but whether "X" is a fresh variable (i.e. whether it unifies with anything) at the current state of computation (more precisely whether the variable name X references a fresh term at the current state of computation).
It is also the exact complement of "