Provides access to the clauses of a predicate using their index number.
Counting starts at 1. If Reference is specified it unifies Pred
with the most general term with the same name/arity as the predicate and
Index with the index-number of the clause. Otherwise the name and
arity of Pred are used to determine the predicate. If Index
is provided Reference will be unified with the clause reference.
If Index is unbound, backtracking will yield both the indices and
the references of all clauses of the predicate. The following example
finds the 2nd clause of member/2:
?- nth_clause(member(_,_), 2, Ref), clause(Head, Body, Ref).
Ref = 160088
Head = system : member(G575, [G578|G579])
Body = member(G575, G579)