(Due Date: Wednesday 2, June) In this homework you will implement the following procedures: ---------------------------------------------------------------------------- * sreverse Here sreverse stands for super-reverse. Given a list of lists sreverse will reverse the outer list as well as it reverses the sub-lists. Here are some examples about how sreverse works: ?- sreverse([[1,2,3,4]],RL1). RL1 = [[4,3,2,1]] ? yes ?- sreverse([[1,2,3],[4,5,6]],RL2). RL2 = [[6,5,4],[3,2,1]] ? yes ?- sreverse([[a,b],[c,d],[e,f]],RL3). RL3 = [[f,e],[d,c],[b,a]] ? yes ---------------------------------------------------------------------------- * flatten flatten will take a list of lists and will create just one list, whose members are the members of the sub-lists. Here are some examples about how flatten works: ?- flatten([[1,2,3,4]], FL1). FL1 = [1,2,3,4] ? yes ?- flatten([[1,2,3],[4,5,6]], FL2). FL2 = [1,2,3,4,5,6] ? yes ?- flatten([[a,b],[c,d],[e,f]], FL3). FL3 = [a,b,c,d,e,f] ? yes ----------------------------------------------------------------------------- * sdelete Here sdelete stands for super-delete. Given a list of lists, and a member sdelete will delete all occurences of that member in the sublists. Here are some examples about how sdelete works. ?- sdelete([[1,2],[3,4]], 2, DL1). DL1 = [[1],[3,4]] ? yes ?- sdelete([[1,2],[1,3],[1,4]], 1, DL2). DL2 = [[2],[3],[4]] ? yes ?- sdelete([[a,a,b,b,c,c,d,d]], b, DL3). DL3 = [[a,a,c,c,d,d]] ? yes --------------------------------------------------------------------------------- * sublist Given two lists sublist will seek for an occurence of its first argument in its second argument. Here are some examples about how sublist works: ?- sublist([1,2,3],[1,2,3,4,5]). yes ?- sublist([c,d],[a,b,c,d]). yes ?- sublist([a,b],[a,d,g]). no