Introduction to
Logic Programming
What
versus
How
 

Exercise 10.2 - Last


last is a binary relation that holds of an object and a list if and only if the specified object is the last element of the specified list. For example, last(c,[a,b,c]) is true. Write a logic program that defines the last relation.