CSc 404 Assignment 6

Extended Family


Apr 15
40 pts
May 1

Extend the family example with the additional relations listed below. You'll want to download the family file for testing use, but don't modify it. Put your definitions an another file, then consult each of them.

If you like, you may use different female/male/parent/husband relations, perhaps to define your own family. Or perhaps the oddballs who live next door. Note, though, that I will test with the posted set, so you should be sure it works properly on those.

Holds when X is the aunt of Y.
Holds when X is the uncle of Y.
Holds when X is the nibling of Y. Nibling is a general term for neice or nephew, much as sibling is a general term for brother or sister.
Holds when X is the niece of Y.
Holds when X is the nephew of Y.
Holds when X and Y are first cousins. That is, they each have a parent who are siblings.

For instance:

[bennet@m-mcc-csc-01456 prolog]$ swipl ?- consult(family). true. ?- consult(family_ex). true. ?- aunt(X,bonnie). X = carrie ; false. ?- uncle(X,adam). X = tom ; false. ?- nibling(X,carrie). X = bonnie ; X = theo ; X = rachel ; false. ?- cousin(theo,Y). Y = adam ; false. ?- nibling(A,B). A = bonnie, B = carrie ; A = theo, B = carrie ; A = rachel, B = carrie ; A = adam, B = lola ; A = bonnie, B = dave ; A = theo, B = dave ; A = rachel, B = dave ; A = bonnie, B = dennis ; A = theo, B = dennis ; A = rachel, B = dennis ; A = adam, B = tom ; false. ?-


As noted, you should place your relations in a separate file. (Makes 'em easier to compress when they come over for Thanksgiving.) Submit it here.