More problems will be added. Keep looking... 1. Find all critical pairs in the following 2 rule rewrite system R g(h(g(x,y),a),g(h(u,v),x)) -> h(g(x,y),g(u,a)) h(g(y,h(x,y)),x) -> g(x,h(y,y)) Note: a is a constant and x, y, u, v are variables. 2)Assume that you have a number of facts of the form: mother(M, C). /* M is the mother of C */ father(F, C). /* F is the father of C */ male(X). /* X is male */ female(X). /* X is female */ Write Prolog rules for grandmother(G, X). /* G is a grandmother of X */ sister(S, X). /* S is a sister of X */ half_brothers(B1, B2). /* B1 and B2 are male and have the same mother or the same father, but not both. */ 3) Assuming that this program has been loaded into the Prolog interpreter: frog(kermit). tyrannosaurus(barney). purple(barney). green(grover). green(X) :- frog(X). tall(X) :- tyrannosaurus(X). little(X) :- archaeopteryx(X). little(X) :- frog(X). little(robin). Identify the goals which will succeed when given to the interpreter. frog(kermit). green(grover). seismosaurus(barney). little(kermit). tall(barney). green(robin). little(grover). green(kermit). frog(barney). frog(robin). 4. You may use the predicate 'append' without defining it. 1. Write the program for prefix(X, Y) this should succeed iff X is a list that it is a prefix of the list Y, e.g. ?- prefix([a, b], [a, b, b, a]). yes ?- prefix([a, b], [b, e, a, t, t, l, e, s]). no ?- 2. Assume given the code for a predicate rev(X, Y) (which succeeds iff Y is the reverse of the list X). Write the program for palindrome(X) This should succeed iff X is a palindrome, e.g. ?- palindrome([a, b, b, a]). yes ?- palindrome([b, e, a, t, t, l, e, s]). no ?-