Otherwise, either Term is instantiated to a compound term, or List is instantiated to a list, or both. In which case, ``univ'' unifies Term with functor(Arg1, Arg2, ..., ArgN), and List with [Functor', Arg1', Arg2', .., argN'], where functor is unified with Functor', Arg1 is unified with Arg1', etc. functor must be an atom, and it must be possible to determine the length of List from either Term or List.
Success: Term =.. [likes,david,play]. (gives Term = likes(david,play)). s([1,4,5,6]) =.. List. (gives List = [s,[1,4,5,6]]). zero_arity =.. List. (gives List = [zero_arity]). 1234 =.. List. (gives List = [1234]). "string" =.. List. (gives List = ["string"]). 2.9 =.. List. (gives List = [2.9]). f(1,X,3) =.. [Y,Z,2,W]. (gives X=2; Y=f; Z=1; W=3). f(1,X,3) =.. [A,B,C,D]. (gives A=f; B=1; C=2; D=3). f(A) =.. List. (gives A=_g74; List=[f,_g74]). Term =.. [f,A]. (gives Term=f(_g76); A=_g76). f(1,2,3) =.. [f | A]. (gives A=[1,2,3]). a =.. [X]. (gives X=a) Fail: likes(man,play) =.. [likes,man,work]. Error: Term =.. List. (Error 4). Term =.. [Var,1,2,3]. (Error 4). % functor of Term is % not specified. Term =.. [f | A]. (Error 4). % arity of Term is % not specified. Term =.. [f,a,b | X]. (Error 4). Term =.. my_atom. (Error 5). Term =.. [1,2,3]. (Error 5). Term =.. [a|b]. (Error 5). Term =.. [f,a,b | c]. (Error 5).