Advertisement

The annotated cellar: an experiment

Started by January 20, 2002 07:42 PM
32 comments, last by bishop_pass 22 years, 10 months ago
Whimsical example:

strategy(agent,find,key) & inside(key,y) & inside(x,y) -> strategy(agent,open,x);

inside(x,y) & inside(y,z) -> inside(x,z);

strategy(agent,unlock,door) -> strategy(agent,find,key);

strategy(agent,unlock,door);

inside(key,cellar);

inside(chest,cellar);

inside(shoebox,chest);

inside(key,shoebox); (world state, but not known to agent)

Here's a summary of the above statements:
A good strategy to emply when you want to find a key and that key is in something that is in something else like a room is to open things which are in the room. When a thing is inside something and that something is inside a bigger thing, then the original thing is also inside the bigger thing. When you wish to unlock a door, find the key. Your goal is to unlock the door. The key is in the cellar. The chest is inside the cellar. The shoebox is inside the chest. The key is inside the shoebox.

Translate above to clause normal form: This is an automatic preprocess.
Note: leave out fact about the key being in the shoebox, because the agent does not have that knowledge.

1) ~strategy(agent,find,key) v ~inside(key,y) v ~inside(x,y) v strategy(agent,open,x)

2) ~inside(x,y) v ~inside(y,z) v inside(x,z);

3) ~strategy(agent,unlock,door) v strategy(agent,find,key);

4) strategy(agent,unlock,door);

5) inside(key,cellar);

6) inside(chest,cellar);

7) inside(shoebox,chest);

Assume that the above has been compiled into partitions via a minimum vertex separator algorithm which essentially partitions the graph into a set of microtheories for constrained processing.

query:
strategy(agent,a,b)?

Negate the above to answer the question of what a and b would be bound to by adding the negated query to the knowledgebase to disprove it.

8) ~strategy(agent,a,b)

Resolve 8 with 4, derive NIL and get one possible binding:

a = unlock
b = door

That's a fact and we know it.

Let's continue.

Resolve 8 with 1 which yields:

9) ~strategy(agent,find,key) v ~inside(key,y) v ~inside(b,y);
a = open

Resolve 9 with 3 which yields:

10) ~strategy(agent,unlock,door) v ~strategy(agent,find,key) v ~inside(key,y) v ~inside(b,y);

Resolve 10 with 4 which yields:

11) ~strategy(agent,find,key) v ~inside(key,y) v ~inside(b,y);

Resolve 11 with 3 which yields:

12) ~strategy(agent,unlock,door) v ~inside(key,y) v ~inside(b,y);

Resolve 12 with 4 which yields:

13) ~inside(key,y) v ~inside(b,y);

Resolve 13 with 5 which yields:

14) ~inside(b,cellar);

Resolve 14 with 6 which yields:

NIL and b = chest;

But, additionally, resolve 14 with 2 yielding:

15) ~inside(b,y) v ~inside(y,cellar);

and resolve 15 with 6 yielding:

16) inside(b,chest);

And resolve 16 with 7 yielding:

NIL and b = shoebox.

So, our final bindings are:
a = open, b = chest or b = shoebox;

Let's substitute these back into our original query.

We queried: strategy(agent,a,b)?

So we get:

strategy(agent,open,chest);

and

strategy(agent,open,shoebox);

Oh what fun.


___________________________________



Edited by - bishop_pass on January 31, 2002 2:41:30 AM
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
Very impressive, but can prolog (or whatever) do this sort expansion itself? ie, something which choose what do resolve with what else? If you can, then sweet as! (as we say downunder )

However, doesn't this undercut the whole "annotated objects" thing? Unless you say that the annotatons are merely lists of actions to be performed on the object, the chest and shoebox don't call "open me!" to the agent...

Edited by - digitaleus on January 31, 2002 6:28:04 PM
Advertisement
*bump* - to keep it close to the "Annotated objects" thread.
I find all of this quite facsinating, and I have great interest in the developments in these threads due to I''ve been trying to conjure up a system that is just like this.

Having quietly studied these threads and taking notes whilst hanging out in the background, and although it''s been touched upon before, I feel the need to comment. (I know I know .. who am I to talk?)


One of thing that vexes me about this whole business of AO (Annotated Objects) is not so much as with the objects themselves but the Agents and their motivation. I would think that each Agent/NPC would need to have some sort of data structure/traits attached to it to define why it does things, instead of simply reacting to what the objects and areas of the world give it options to do.

For instance each Agent should be assigned a gender, age, healthpoints, stamina/fatigue, intelegence, focus, height, weight, hunger, intrests/likes, phobias/dislikes, perceptiveness, curiosity, mood. Each agent should also have a list of Short term goals, and Long term goals.

By defining many of these traits into the Agents/NPCs themselves potentialy plugs a lot of holes in the Annotated Objects scheme.

For instance: Say we have an Agent whom has a short term goal of ( Get Kite ), the system will check the agents perceptiveness to see if they can find a Kite object in the current location, as well as a myriad of other things such as focus to see how determined the agent is to get the Kite at this time, as well if there are any other Short or Long term goals that would take precidence over getting the Kite.

So say there is a Kite in the current setting and it happens to be stuck in a Tree, but the agent has a phobia of heights. So the Agent would evaluate the kite after identifying it in the scene. It sees that the Kite is ( In the Tree ) examining the Tree it will note the "Height" attribute of the Tree and immediatly discard the trees suggestion ( Climb Tree to get Kite ) since the agent has acrophobia. This opens up more possibilities, for if the agent is truly focused on getting the kite they may examine the scene for other solutions to the (Get Kite) problem.

Since the Kite is in the Tree and the agent is afraid to climb the tree a second examination of the kite might yield that there is a string attached to the kite, if the agent is perceptive enough or examines the kite/scene long enough, and has enough focus to do so. So the string would suggest (pull me to get kite), and the agent evaluating the scene would note that the string is on the ground, which isn''t high at all, and take that course of action. Of course this could be more complex such as the kite having a (tangled with tree) attribute which negates the strings effects..etc..etc. The agent might lose focus and delete the short term goal (Get Kite) from their agenda or shuffle it to the bottom of their stack once they realize that they can''t get it at this time, and focus on whatever else might be priority, such as (I''m hungry find snack)


But that was just a wordy example of how an agent/NPC would be motivated to do one thing or the other. Not to mention that if an agent were inadvertantly placed into a situation their Goals may suddenly be altered and reprioritized, such as if a Hungry Orc enters the scene, then the agents short term goals would change especially if the agent has a phobia of Orc''s or Evil Monsters in general which Orcs would be the Orc''s base class.

(Sorry for going offtopic and all)

Let''s return to the basement:

Say the sidekick has a long-term goal of ( Go home ), and a short term goal of ( follow player into basement). Well at the start of our scene the sidekick would have completed its short term goals, and may not have any more short term goals pending at the time. So it would look at it it''s long term goals, and realize that it wants to go home.

So it would have to query its environment and based upon it''s perception it would build a new list of short term goals based upon what the objects within perception tell it.

The trapdoor may declare itself an exit, that is locked, and located on the ceiling which is 9 feet high.

The secret door may declare itself an exit, that is hidden, and located on the far wall and is hidden (meaning that it will need to be searched for which uses up the agents focus) an impatient agent might not be able to find the secret exit in a situation like this.

The other objects such as the broom, and the chair, and other clutter would identify themselves as stated before. And dependant upon the placement of the items and the agents perceptiveness might put them in the agents short-term goals stack accordingly whilst the long-term stack might get updated with an (exit cellar) and a high priority, which overides the (Go home) goal.

The Agent could then go about parsing its short term goals by interacting with the environment and anything that gives the agent instant ability such as being able to get the chair wouldn''t detract too much from it''s focus as much as searching for the hidden exit would.


Perhaps I''m just being redundanat :~( I''m sure much of what I''ve said has been said before, but perhaps not as explicitly?


There are other things I might want to add but my brain is feeble, and senility is settling in, so I''ll silence myself at this time once again. Yet once again thanks Bishop_pass for the interesting topic(s).

This topic is closed to new replies.

Advertisement