Welcome to SWI-Prolog (threaded, 64 bits, version 8.3.4-11-g1db629e24)
On Windows 10
?- functor(a(),N,A).
ERROR: Domain error: `compound_non_zero_arity' expected, found `a()'
ERROR: In:
ERROR: [10] functor(a(),_18014,_18016)
ERROR: [9] <user>
?-
The example in the documentation shows it working.
This works
?- functor(a,N,A).
N = a,
A = 0.
EDIT
This fails as per the documentation.
?- a() =.. List.
ERROR: Domain error: `compound_non_zero_arity' expected, found `a()'
ERROR: In:
ERROR: [10] a()=.._20256
ERROR: [9] <user>
This works as per the documentation
?- compound_name_arguments(a(),N,A).
N = a,
A = [].
This also works
?- compound_name_arity(a(),Name,Arity).
Name = a,
Arity = 0.