/* These notes correct pages 9 and 10 of worksheet 4. */
/* Only two lines are wrong: where I give clauses that */
/* have 3 arguments when they ought to only have two. */
/* But I present all the clauses here. */
/* Case 1 (Notes presently correct) */
derivative(0, 0).
derivative(s(N), 0).
/* Case 2 (Notes presently correct) */
derivative(x, s(0)).
/* Case 3 (Second of the two clauses is wrong in the notes) */
derivative(x^0, 0).
derivative(x^s(N), s(N)*x^N).
/* Case 4 (Notes are wrong) */
derivative(F+G, DF+DG) :- derivative(F, DF), derivative(G, DG).
/* With the above 4 clauses you can issue queries such as: */
/* ?- derivative(x^s(s(0)), Result). */
/* Result = s(s(0))*x^s(0) */
/* Your job is to add further clauses as requested in */
/* Exercise C.2.1 */