I can't decide whether to put the basic data in the format:
parents(nameKey, fatherNameKey, motherNameKey).
or to split it:
father(nameKey, fatherNameKey).
mother(nameKey, motherNameKey).
Since many of the predicates will need both mother and father it seems I
might as well keep them together and grab them at the same time.
Any thoughts on this, in particular if I use the first form am I going to
find problems down the line?
Many thanks.
--
Jeff Gaines Dorset UK
You can't tell which way the train went by looking at the tracks
There're many way to describe the world. Do not worry about what the
only correct story you can tell.
Parent is a general form of father or mother relationship.
parent(One, Elder) :- father(One, Elder).
parent(One, Elder) :- mother(One, Elder).
One of one's parents is either one's father or mother. And parents can
be defined as:
parents(One, Elder_1, Elder_2) :- father(One, Elder), mother(One,
Elder).
Parents Elder_1 and Elder_2 are one's father and mother,
correspondingly.
On syntax, when you write a literal with the first letter lower-case,
it means an object/instance. For example, the nameKey written means
some thing named "nameKey." It seems you treat nameKey, fatherNameKey,
and motherNameKey as variables, which can be replaced by some things,
thus you ought to write NameKey, FaterNameKey, and MotherNameKey.
>There're many way to describe the world. Do not worry about what the
>only correct story you can tell.
OK, thank you :-)
>On syntax, when you write a literal with the first letter lower-case,
>it means an object/instance. For example, the nameKey written means
>some thing named "nameKey." It seems you treat nameKey, fatherNameKey,
>and motherNameKey as variables, which can be replaced by some things,
>thus you ought to write NameKey, FaterNameKey, and MotherNameKey.
In this case it is a list of facts and the various keys are what I use to
identify different people - usually surname+initials+Year of Birth which
so far has given me unique identifiers.
--
Jeff Gaines Dorset UK
There are 3 types of people in this world. Those who can count, and those
who can't.