Original post by kordova
I'm still shaky about the "instance/instance-of" concept. I mean, I understand it to some extent, but to use your own example, if a an animal is a race-horse, is it's instance-of member (instance-of (horse)), (instance-of (race-horse)), (instance-of (horse race-horse)) ... ?
Ok, look closely. I'm going to refer to our structures as frames from here on out. The title of a frame is the name of the symbol which is set to the list of elements which follow it. We might have the following frame:
(friends (sylvester tweety foghorn-leghorn yosemite-sam)))
is the name of the symbol which is set equal to (use setf) the list which contains two sub lists. Each sublist in the
list contains what is called a slot/value pair. The first slot/value pair is
. The slot is
and the value is
. We put
in a list, because some slots allow multiple entries, and we can see that in action in the next slot/value pair, where we have four values for the slot
. Ok, so we now know how to structure our frames, and what a slot is, and what a value is. Now, forget about
, and lets move on to understanding instances.
Look at the following frames:
(categories (race-horse draft-horse thoroughbred quarter-horse)))
(categories (horse dog cat human gorilla tiger)))
(categories (mammals reptiles fish insects circus-animals)))
(instances (secretariat seabiscuit spectacular-bid ruffian)))
((instance-of (race-horse thoroughbred)))
Now, notice that
. That's perfectly valid. Also, it is also true that
is also an
(instance-of (horse mammal animal living-thing))
among others. We could cache these values on the
frame if we wanted to. We would get this:
((instance-of (race-horse thoroughbred horse mammal animal living-thing)))
For high speed retrieval, caching is better. But we can write code to make these determinations even if we don't cache it. The rule goes like this:
If something is an instance-of a category, then it is also an instance-of everything that the named category is a sub-category of.
An semi ideal solution is to have a piece of code be run once, at assertion time, to determine everything which
, and then cache those values. It gets a little complex though. That's because if we've already created the
frame, and later declare that
, then for completeness, we must percolate through our entries and update the
frame to now mention that
. This is absolutely necessary if at query time we only rely on cached values.
Obviously, we're digressing from the main thrust of this thread, and delving into the realms of truth maintenance and knowledge bases, but it is all relevant, and allows for some rather amazing generalizations to be made with regard to knowledge, and also it allows for using the knowledge in the knowledge base itself to enforce semantics. The real payoff is where the simple mention of one little fact actually creates a cascade of facts, creating real knowledge and supposed understanding and comprehension.
It kind of boils down to this: If I told you Citation was a race horse, you'd actually know a heck of a lot about Citation, certainly a great deal more than the simple fact that Citation is a race horse. [edited by - bishop_pass on November 1, 2003 11:43:51 PM]