creates a compound term or determines functor and arity.
If CompoundTerm is a compound term then Functor is the functor
and Arity is the arity of that CompoundTerm.
If CompoundTerm is an atomic term (an atom or a number) then Functor
is that atomic term and Arity is 0.
If CompoundTerm is a variable then Functor must
be an atomic term and Arity must be an integer between 0 and
max_arity (127). If
CompoundTerm compound term or atomic term Functor atomic term Arity integer or integer-expression (between 0 and 127)
| functor(f(a,b,c),F,A). | Succeeds with substitution F <- f, A <- 3. |
| functor(X,functor,3). | Succeeds with substitution X <- functor(_1, _2, _3). |
| functor(f(X),f,2). | Fails. |
This predicate is part of the ISO-Prolog Standard.
| scroll to top |
|