complex_term(X) :- nonvar(X), not(atom(X)), not(number(X)).
Another, maybe mode elegant way to define complex terms, would
be to say that complex terms have an arity which is greater than
0. For this definition you would need the predicate
functor/3 (see above) and predicates for
comparing arithmetic expressions. We will see on day 3 how to do
arithmetic in Prolog.