quote:
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:
bugs-bunny:
((instance-of (cartoon-character))
(friends (sylvester tweety foghorn-leghorn yosemite-sam)))The symbol
bugs-bunny is the name of the symbol which is set equal to (use setf) the list which contains two sub lists. Each sublist in the
bugs-bunny list contains what is called a slot/value pair. The first slot/value pair is
(instance-of (cartoon-character)). The slot is
instance-of and the value is
(cartoon-character). We put
cartoon-character 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
friends. Ok, so we now know how to structure our frames, and what a slot is, and what a value is. Now, forget about
bugs-bunny, and lets move on to understanding instances.
Look at the following frames:
horse:
((sub-category-of (mammal))
(categories (race-horse draft-horse thoroughbred quarter-horse)))
mammal:
((sub-category-of (animal))
(categories (horse dog cat human gorilla tiger)))
animal:
((sub-category-of (living-thing))
(categories (mammals reptiles fish insects circus-animals)))
race-horse:
((sub-category-of (horse))
(instances (secretariat seabiscuit spectacular-bid ruffian)))
secretariat:
((instance-of (race-horse thoroughbred)))
Now, notice that
secretariat is an
instance-of both a
race-horse and a
thoroughbred. That's perfectly valid. Also, it is also true that
secretariat is also an
(instance-of (horse mammal animal living-thing)) among others. We could cache these values on the
secretariat frame if we wanted to. We would get this:
secretariat:
((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
secretariat is an
instance-of, and then cache those values. It gets a little complex though. That's because if we've already created the
secretariat frame, and later declare that
living-thing is a
sub-category-of of
physical-thing, then for completeness, we must percolate through our entries and update the
secretariat frame to now mention that
secretariat is an
instance-of physical-thing. 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]