Kinship in Prolog...
Prolog is a good computer programming language for dealing
with complex structural systems such as that presented by kinship. The following
applet will give you some experience with this.
You can reload the existing prolog database (if you mess it up) by clicking on the
"Kinsample" button. Enter a query in the first line, such as male(X), or
mother(Mother,Child), click the "Run Query" button, and the results will
appear in the second window.
When it first loads, the checkbox "All Solutions" is checked,
meaning that Prolog will present all known results to the query at one time. If you
uncheck this box, you can get subsequent solutions by clicking the "More?"
button.
You can modify the program in the top window, and these changes will be reflected
when you run a new query (including any syntax errors!).
You can email the program and the results by entering your email address in the second
line and clicking the "Email Prog/Results" button. (You can also use copy
and paste in either window).
You can also load a prolog program located on the Ethnographics Gallery by typing the URL in the
second line and clicking the "Get URL" button, though there aren't any
at present other than "kinstuff.p". We will make other choices available
in future.
Here is a paper
relating to representing knowledge about kinship by Michael
Fischer originally published in the Bulletin of Information for Computing and Anthropology
(BICA) in Feb. 1987. Most of the code in the paper is in the example file kinstuff.p.
There is a more sophisticated (and better documented) example in Chapters 6 and 7
of Michael Fischer's book, Applications in Computing for Social Anthropologists,
London, Routledge 1994 (ASA Research Methods Series).
The following applet implements the analysis given in the previous section. There
are a few omissions noted in the program left to you as an exercise. Read the first
section of the paper to
get an idea of how prolog works as a programming language. Or read the first section
of Chapter 7 of AISCA for a more cogent description.
Try a range of queries. A query can
be formed by taking any of the terms
defined in the program using the following pattern:
male(Who).
female(Who).
parent(Parent, Ego).
brother(Brother,Ego).
Note that the words in the parenthesis can be any terms, but MUST start with an uppercase
letter and be different from any other word used in the parenthesis. I used the terms
above to make clear what the output indicates, and this is generally a good idea.
In particular, look at the ancestor and in_lineage definitions near the end of the
file, as these provide an indication of the power of programming kinship.
Exercises
After looking throught the program and making some queries, try adding definitions for the following:
full sibling
grandfather and grandmother
Husband, Wife, Father-In-Law, Son-In-Law
Step-son, Step-daughter
and if you are a little ambitious:
patrilinage
matrilineage