Other predicates in full Prolog allow you to test for the type of an expression:var(X) is true if X is a variable when var/1 is called. atom(X) is true if X is an atometc. Any Prolog textbook will have a section discussion such predicates.