Notice that what you call "complex terms" are normally called coumpound terms in Prolog. You can easily check for the arity of Prolog terms yourself in the following way:
?- functor(vertical(line(point(X,Y), point(X,Z))), _, Arity).
Arity = 1.
As you can see, your intuition was correct in this particular case!
SWI7-specific
Since you have added the SWI-Prolog tag to your question, it may be useful to know that in SWI 7 there is also compound_name_arity/3
, which works on compound terms of arity 0. (In other Prologs a compound term of arity zero would be an atom.) For example:
?- functor(f(), _, Arity).
ERROR: functor/3: Domain error: `compound_non_zero_arity' expected, found `f()'
?- compound_name_arity(f(), _, Arity).
Arity = 0.