Go backward to Operator termination.
Go up to Encoding A Task in Soar.
Go forward to Monitoring the problem solving.

Task operator termination
=========================

Determining that the task operator has been successfully implemented involves
detecting that the current state has been changed into some new desired
state.  The test that the current state achieves some desired state can be
represented either explicitly or implicitly.  An explicit representation
would have the desired state represented as an augmentation of the operator
with an accompanying set of productions that can compare the current state of
the problem space to the desired state.  Alternatively, the desired states
may be represented implicitly; so that there may be a production, or a set of
productions, that *recognizes* that a given state satisfies the goal without
comparing it to an explicit description.  In the case where the operator is
applied in a subgoal, the test may also be made by the application of an
operator in the subgoal.  There can be many levels of explicit or implicit
representation in which parts of the desired state are explicitly
represented, and parts of the test are embedded in productions.

For this task, the termination of the operator can be detected by testing
that a tower object has been created for the blocks by
top-goal*elaborate*state*detect-tower.  The following production tests for
the tower object and then creates a *reconsider* preference for the
build-tower operator.

(sp top-goal*terminate*operator*build-tower
  (goal <g> ^problem-space.name top-ps 
            ^state.object-dynamic <tower>
            ^operator <o>)
  (<tower> ^top-block.name A
           ^middle-block.name B
           ^bottom-block.name C
  (<o> ^name build-tower)
  -->
  (<g> ^operator <o> @))

A reconsider preference is a signal to the decision procedure that a new
decision can be made for the the operator slot.  At the point when the
operator is terminated, the acceptable preference for the operator will have
been retracted, because the production that created it tested that blocks
were not stacked in a tower.  The following trace shows that the appropriate
operators are selected and following decision 9, the desired state is
achieved and the task operator is terminated.  Once the task operator is
terminated, the wait operator is selected and terminated.

<28 soar> (watch 0)

<29 soar> (d 4)
     8:       O: O8 (move-block)
     9:       O: O6 (move-block)
    10:    O: O1 (wait)
    11:    O: O1 (wait)