PLOGHELP ARG Chris Mellish, August 1982
Revised by Kathryn Seifert October 1986
Predicate which determines the Nth argument of a given term
?- arg(N, Term, Arg).
Keywords: term, arguments, structure
A goal of the form
?- arg(N, Term, Arg).
will succeed if the Nth argument in Term is Arg. Both N and Term
must be instantiated.
For example:
?- arg(3, foo(a, b, c, d), A).
A = c ?
-- RELATED DOCUMENTATION ----------------------------------------------
PLOGHELP * FUNCTOR
Predicate which constructs a term with a given functor and arity
PLOGHELP * DOLLAR
Library package for using variables to hold predicate names