15.1 a. none b. p(Roy, Tim), [Roy/y, Tim/x] c. p(1,1) [1/x] d. none e. p(1,1) [1/x, 1/y] f. p(f(x,y)) [f(x,y)/z] g. none h. none (an occurs check) 15. 2 p(1,1,1) [1/r, 1/y, 1/w, 1/q, 1/x] 16.1 a. x is the parent of y if x is the father of y or x is the mother of y. x is the uncle of y if: x is the brother of z and z is a parent of y or x is the husband of z and z is the sister of w and w is a parent of y b. Vx1 x2 x3 x4 x5 y1 y2 y3 y4 y5 z3 z4 z5 w5| (is_father(x1,y1) => is_parent(x1,y1)) and (is_mother(x2,y2) => is_parent(x2,y2)) and (is_brother(x3,z3) and is_parent(z3,y3) => is_uncle(x3, y3)) and (is_husband(x5,z5) and is_sister(z5, w5) and is_parent(w5,y5) => is_uncle(x5, y5)) c. Vx1 x2 x3 x4 x5 y1 y2 y3 y4 y5 z3 z4 z5 w5| (~is_father(x1,y1) V is_parent(x1,y1)) ^ (~is_mother(x2,y2) V is_parent(x2,y2)) ^ (~is_brother(x3,z3) V ~is_parent(z3,y3) V is_uncle(x3, y3)) ^ (~is_husband(x5,z5) V ~is_sister(z5, w5) V ~is_parent(w5,y5) V is_uncle(x5, y5)) d. is_parent(x,y):-is_father(x,y). is_parent(x,y):- is_mother(x,y). is_uncle(x,y) :- is_brother(x,z), is_parent(z,y). is_uncle(x,y) :- is_husband(x,z), is_sister(z,w), is_parent(w,y). Extra Credit. 15.6 with Clause 1: A(f(x,y),x,y) Clause 2: ~A(z, g(z,1),3) Clause 3: ~A(r, w, u) v A(w, v, 3) v ~A(r, 3, t) v A (u, v, t) Clause 4: ~A(h(m), m, h(m)). C2, C3 |- C5: [z/w, g(z,1)/v] ~A(r, z, u) v ~A(r, 3, t) v A (u, g(z,1), t) C5, C2 |- C6: [z/u, 3/t] ~A(r, z, z) v ~A(r, 3, 3) C6, C1 |- C7: [f(x,y)/r, 3/x, 3/y] ~A(f(3,3), 3, 3) C7: C1 |- c8: [3/x, 3/y] empty clause. done. 16-16 1: adjective(the). 2: adjective(a). 3: adjective(an). 4: verb(solved). 5: verb(ate). 6: noun(student). 7: noun(problem). 8: noun(test). 9: noun(apple). 10: verbphrase((x.nil)):-verb(x). 11: verbphase((x.y)):-verb(x), nounphrase(y). 12: nounphrase((x.(y.nil)):-adjective(x), noun(y)). 13: sentence(x):-concat(n,v,x), nounphrase(n), verbphase(v). I assume concat defined elsewhere 14: ?-sentence((the student solved the problem)). 14, 13 |- 15: ?- concat((the student), (solved the problem)), nounphrase((the student)), verbphrase((solved the problem)). 15, 12 |- 16: ?-adjective(the), noun(student), verbphrase((solved the problem)). 16, 1 |- 17: ?-noun(student), verbphrase((solved the problem)). 17, 6 |- 18: ?-verbphrase((solved the problem)). 18, 11 |- 19: ?-verb(solved), nounphrase((the problem)). 19, 4 |- 20: ?-nounphrase((the problem)). 20, 12 |- 21: ?-adjective(the), noun(problem). 21, 1 |- ?-noun(problem). 22, 7 |- 23: empty. done