A more declarative approach to verify the type of a prolog term
?- X = foo, atom_t(X). X = foo. ?- atom_t(X), X = foo. X = foo.
See LICENSE