Download AN INTRODUCTION TO SOAR PROGRAMMING

Transcript
removed. This is the start of a chain reaction that reaches right down to the point in the
robotÕs behavior that weÕre looking at now: if the agenda isnÕt lunch, then productions
proposing the eat-steak and the exercise operators no longer apply, so thereÕs no tie to
resolve, and... what should happen?
What happens is this: Because operators are sticky, the exercise operator stays in slot, even
after the conditions that caused it to be placed there have changed. This gives the
productions that actually ÒdoÓ the operation time to fire. And it makes it the programmerÕs
job to ensure that other productions test the state of the world and get the operator out of
slot when itÕs no longer appropriate. ThatÕs what the ÒreconsiderÓ production shown above
does (reconsider is another preference, symbolized @).
Besides being sticky themselves, operators also pass some of their glue on to things placed
in working memory as a result of the operation. If a productionÕs IF side tests for the
existence of a specific operator, then the items put into working memory as a result of that
production will stay in memory after the conditions described on the IF side, including the
operator being in slot, have changed.
For example: The production that sets the agenda to lunch if itÕs noon doesnÕt test any
operator, so the agenda will be taken out of working memory as soon as itÕs no longer
noon. (This is called, rather grandiosely, SoarÕs Òtruth maintenance system,Ó or TMS.) But
imagine that the production had been written this way:
IF time=noon and operator=set-agenda
THEN agenda=lunch
In that case, a Òset-agendaÓ operator would need to be in slot before the production would
fire. But once Òagenda=lunchÓ was placed in working memory, it would stay there, even
after the time and operator had changed. until it was explicitly removed by some other
production,
In review, then, the basic story is this: Things put into working memory by most
productions will only stay in memory while the IF side of the production still matches.
Those things are said to have ÒI-supportÓ (ÒIÓ for Òinstantiation). But operators stay in slot
even after the productions that proposed them are no longer valid. And things put into
working memory by productions that test operators will stay until theyÕre removed by some
other production. Those working memory elements are said to have ÒO-support.Ó
III. MORE ABOUT OPERATORS, PREFERENCES, AND SYNTAX
For anyone ready to actually write some Soar programs, here are some further details. All
of this is in the Soar UserÕs Manual, in much greater depth Ñ but when I started working
in Soar, I found that the manual actually gave too much information. So here are some
highlights that I found useful.
Process Review
HereÕs a review of the process described in the previous section:
An Elaboration cycle:
¥ Soar I/O is done, getting input from other programs or interfaces, or sending
information to them. (Input and output donÕt both happen exactly at the beginning
of the cycle, but they are each performed within every elaboration cycle.)
Soar Introduction
15