Exercise 1.1 ------------ You can check it yourself using explain/1 predicate, as I did in the class Exercise 1.2 ------------ You can check it yourself using explain/1 and functor/3 predicates, as I did in the class. Note: "complex term" is what we call a "compound term", "arity" of the term is the number of arguments. Exercise 1.3 ------------ 4 facts, 3 rules, 7 clauses (4+3). person(X) :- man(X); woman(X). -------- ----------------- head body (each of the terms is a sub-goal) etc. Exercise 1.4 ------------ 1. Butch is a killer. killer(butch). <--- note the small letters ! 2. Mia and Marcellus are married. married(mia, marcellus). 3. Zed is dead. dead(zed). 4. Marcellus kills everyone who gives Mia a footmassage. kills(marcellus, X) :- gives(X, footmassage, mia). 5 Mia loves everyone who is a good dancer. loves(mia, X) :- good_dancer(X). 6. Jules eats anything that is nutritious or tasty. eats(jules, X) :- nutritious(X). eats(jules, X) :- tasty(X). This can also be shothanded using ; (we didn't talk about it yet): eats(jules, X) :- nutritious(X) ; tasty(X). ^ this stands for OR Exercise 1.5 ------------ You can check it yourself - save this program into a file, say hp.pl, start Prolog, load the file ([hp]. or consult('hp.pl').), and run the queries.