Another termination criterium
The recursive list processing predicates that we have seen so far either terminate when the empty list is found or when an element with a particular property has been found. This exercise involves a different termination criterium.
Define a predicate get_nth_element(+N,+List,?R)
which is true if R
is the N
-th element
of the list List
.