Seeming* inconsistency between ground/1 and nonvar/2 predicates?

Because these are structures, rather than completely var/1, and that use of brackets is particularly unintuitive to newcomers, creating a “comma list” rather than a tuple: Surprising result with equals dot dot

?- (X,Y) == ','(X,Y).
true.

?- nonvar((X,Y)).
true.

?- nonvar([_]).
true.

var/1 means completely uninstantiated. A term or a list is not completely uninstantiated - check the variables within the term/list instead.

1 Like