Comp 372 homework 3: roses Oct 15, 2004 Dordal Due: Wed, Oct 27, 2004 ROSES database The files roses.lisp and roses.hs contain a small database of geneological information on England's Royal House of York (whose emblem was the white rose). There are 36 names, with gender, mother, and father specified for each. You are to implement some additional functions (below), in both Lisp and Haskell. In the Lisp version, the atom *people* is set to the list of family members: (aEdward Phillipa Edmund-of-langley Isabelle-of-Castile bEdward ... eEdward eRichard). Because some royals had the same name, they are distinguished by adding an initial letter; e.g. aEdward through eEdward. The functions sex, father, and mother are also defined in the file: (sex 'eEdward) => male (mother 'eEdward) => Elizabeth-Woodville (father 'eEdward) => cEdward In addition to these basic three access functions, the file also contains definitions of grandmothers, children, and rose-siblings. Because each of these latter categories may contain several individuals (unlike the case for mother and father), these latter functions return lists: (rose-siblings 'eEdward) => (eRichard Elizabeth-of-York) The function names are plural nouns (children rather than child) to remind you of this. The rose-siblings function really returns the list of all full or half siblings; i.e. all people with at least one parent in common with the given individual. Some entries in the database are nil, representing unknown parents. The function nilfilter is used to keep nil from appearing in the output of grandmothers, children, and siblings. In the Haskell version, the names of the individuals are represented as a data type, complete with declarations for the classes Show and Eq. The variable "geneologydata" represents a list of 36 tuples. Various helper functions are defined in the file as well as sex, mother, father, siblings, and children. The function "nchildren" is like children, except that the special value Nil is checked for; nchildren Nil returns []. Your assignment is to provide some additional access functions, in both Lisp and Haskell versions, based on these existing functions. You are to define: brothers, sisters Start with (rose-)siblings and filter for the appropriate sex. uncles, aunts An aunt is a sister of either the mother or the father. Someone could conceivably be in both categories; the function union may be useful. (union lis1 lis2) is like append, except that duplicates are removed. A Haskell version of union is provided. (lineage person sex) The lineage -- either male or female depending on the sex parameter -- of the given person. That is, if sex is female, the list of (mother person), (mother (mother person)), ...., should be returned. Eventually this list will reach nil; at that point you can stop. The nil should not appear in the answer; nor should the original person: (lineage 'eEdward 'male) => (cEdward bRichard aRichard Edmund-of-Langley aEdward) lineage AEdward Female => [] -- Haskell Note that as you write your functions you may encounter some peculiarities of geneology; for example, there is no reason that the same person couldn't be both a maternal and paternal uncle (this need not even involve incest, since we're counting half-siblings as siblings). Summary of functions: These return atoms: sex, mother, father These return lists: grandmothers, children, siblings Lisp utility: nilfilter: removes nils in a list (corresponding to unknown parents). For example, (nilfilter '(aEdmund nil cRichard nil nil)) => (aEdmund cRichard) Haskell utility: union, remove