4. first_cousin and second_cousin. x is a first cousin of y if some parent of x and...

Question:

4. first_cousin and second_cousin.

x is a first cousin of y if some parent of x and some parent of y are siblings. (Note that first cousins will have a grandparent in common.) x and y are second cousins if some parent of x and some parent of y are first cousins. (Second cousins will share a great-grandparent.) These exercises will give you practice writing and running Prolog programs that reason in a simple way about family relationships, mostly exotic flavors of cousins. Begin your Prolog program by writing a collection of clauses for the child, male, and female predicates for some real or imaginary family. To make things interesting, make sure that more than four generations of people are represented. Note that nobody should have more than two parents (one male and one female), but some individuals will have fewer than two parents recorded. As you work on the following predicates, you should augment your family as necessary so that each of the predicates you define has at least one example in your family.

Figure 3.1 showed clauses for the predicates parent, father, and grand_father.

Now write clauses for each of the following predicates (and for any other auxiliary predicates you find useful)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: