CPSC352 -- Artificial Intelligence -- Fall 2011
Third PROLOG Assignment -- Due Friday, October 14

We have considered two representations for the family database:

One shortcoming of this list representation is that it doesn't represent the chronological order of all the children. You can tell who is the oldest son and who is the oldest daughter but not who is the oldest child.

So we now want to rewrite our database using the following representation scheme:

   family([mom,dad],[[child1,female],[child2,male],[child3,male]]).

Using the proposed scheme to represent the family database, write PROLOG definitions for each of the following predicates.

   parent_of(Parent,Child)
   father_of(Father,Child)
   mother_of(Mother,Child)
   ancestor_of(Ancestor,Descendant)      %% Should be recursive
   sibling_of(Sib1,Sib2)
   sister_of(Sister, Sibling)
   brother_of(Brother,Sibling)
   oldest_child (Parent,Oldest)
   oldest_son (Parent,OldestSon)
   oldest_daughter(Parent,OldestDaughter)
   number_of_children(Parent,Num)        %% Should use the 'is' predicate
   number_of_sons(Parent,N).
   number_of_daughters(Parent,N).
USEFUL PREDICATES: Here is a collection of useful PROLOG files containing some predicates that may be helpful for this assignment: CPSC 352 Prolog Stuff. There are several PROLOG sample programs available there as well. Feel free to have a look there and borrow whatever is helpful.

HANDIN DIRECTIONS: