Introduction to
Logic Programming
What
versus
How
 

Exercise 10.6 - Adjacency


adjacent is a ternary relation that holds of two objects and a list if and only if the first object and the second object are adjacent to each other in the specified list. For example, adjacent(b,c,[a,b,c,d]) is true. Write a logic program that defines the adjacent relation.