Exercise 1.1 Which of the following sequences of characters are atoms, which are variables, and which are neither?
- ’big kahuna burger’
- big kahuna burger
Exercise 1.2 Which of the following sequences of characters are atoms, which are variables, which are complex terms, and which are not terms at all? Give the functor and arity of each complex term.
- (Butch kills Vincent)
- kills(Butch Vincent)
Exercise 1.3 How many facts, rules, clauses, and predicates are there in the following knowledge base? What are the heads of the rules, and what are the goals they contain?
Exercise 1.4 Represent the following in Prolog:
- Butch is a killer.
- Mia and Marsellus are married.
- Zed is dead.
- Marsellus kills everyone who gives Mia a footmassage.
- Mia loves everyone who is a good dancer.
- Jules eats anything that is nutritious or tasty.
Exercise 1.5 Suppose we are working with the following knowledge base:
wizard(X):- hasBroom(X), hasWand(X).
How does Prolog respond to the following queries?