HOMEWORK 8. Deadline: Monday, January 17, 2005. 1. Exercise 7.7 (from the book). 2. Write a Prolog program to solve the Riding Stable Puzzle (taken from Jonathan Mohr's Programming Languages course, Augustana, University of Alberta): Last Saturday, all six of the horses in Johnson Stables were rented to children for the day, all of them regulars. Each of the horses (whose names are Boris, Hunter, Lady, Ranger, Santa Fe, and Topper) lives in one of the six stalls, numbered one to six from west to east. The children included three boys (Brian, Curtis, and Roy) and three girls (Lily, Michelle, and Theresa), each a different age (15, 14, 12, 10, 9, and 7 years old). The following facts are known about the horses and the children who rode them that day: 1. Topper lives two or more stalls to the east of Theresa's horse. 2. The nine-year-old's horse lives somewhere to the west of Brian's horse. 3. Three horses in consecutive stalls, from west to east, are Boris, Brian's horse, and the 12-year-old's horse. 4. The child who rode Topper is three years older than the one who rode the horse in stall 4, while Roy is three years older than Michelle. (These are 4 different children). 5. Ranger's rider is three years older than Lily, who in turn is two years older than the girl who rode Lady. 6. Santa Fe lives somewhere to the west of Curtis's horse. 7. Brian is just one year older than Theresa. 8. Roy didn't ride the horse in stall 6. Can you determine each horse's stall number, and the name and age of the child who rode him or her that day?