Go backward to Operator application.
Go up to Encoding A Task in Soar.
Go forward to Task operator termination.

Operator termination
====================

 
Operators are terminated by creating a reconsider preference.  A reconsider
preference will allow additional operators to compete for the operator slot.
In this example, the following production tests that the state has been
modified appropriately.  It does not test that the clear augmentations have
been correctly modified, only that the block being moved is in its correct
position.

(sp blocks-world*terminate*operator*move-block
  (goal <g> ^state.object-dynamic 
                  (^object-static <mblock> ^ontop <tblock>)
            ^operator <o>)
  (<o> ^destination <tblock> ^moving-block <mblock>)
  -->
  (<g> ^operator <o> @))

The action of a operator termination production is to create a reconsider
preference (@) for the current operator.  A reconsider preference signals
Soar that the decision procedure is to be run on the operator slot following
quiescence.  For context slots, the decision procedure is only run if a
reconsider preference exists, or there is currently no value for the slot.
Below is a (watch 3) trace of the next elaboration phase.  A (watch 3) trace
shows the creation of preferences in addition to changes in working memory.
Four new operators are created, the current operator is retracted and
reconsidered.  Note that the current operator is not changed during
elaboration.  That will not occur until quiescence is reached.  Thus, even
though there is no acceptable preference for operator O22, it is still
selected as the current operator.

Soar> watch 3

Soar> run 1

--- Input Phase ---
--- Preference Phase ---
Firing blocks-world*propose*operator*move-block 
       (65: G2 ^problem-space P2) (63: P2 ^name blocks-world) 
       (70: G2 ^state S1) (16: S1 ^object-dynamic B2) 
       (85: B2 ^clear yes) (17: S1 ^object-dynamic B1) 
       (20: B1 ^clear yes) (24: B2 ^object-static B5) 
       (19: B1 ^object-static B4) (23: B4 ^type block) 
       --> 
       (O6 ^destination B5 + [O] ) (O6 ^moving-block B4 + [O] ) 
       (O6 ^name move-block + [O] ) (G2 ^operator O6 +)
Firing blocks-world*terminate*operator*move-block 
       (83: G2 ^operator O3) (72: O3 ^moving-block B4) 
       (73: O3 ^destination T2) (70: G2 ^state S1) 
       (17: S1 ^object-dynamic B1) (19: B1 ^object-static B4) 
       (84: B1 ^ontop T2) 
       --> 

       (G2 ^operator O3 @)
Firing blocks-world*propose*operator*move-block 
       (65: G2 ^problem-space P2) (63: P2 ^name blocks-world) 
       (70: G2 ^state S1) (16: S1 ^object-dynamic B2) 
       (85: B2 ^clear yes) (15: S1 ^object-dynamic B3) 
       (30: B3 ^clear yes) (24: B2 ^object-static B5) 
       (29: B3 ^object-static B6) (33: B6 ^type block) 
       --> 
       (O7 ^destination B5 + [O] ) (O7 ^moving-block B6 + [O] ) 
       (O7 ^name move-block + [O] ) (G2 ^operator O7 +)
Firing blocks-world*propose*operator*move-block 
       (65: G2 ^problem-space P2) (63: P2 ^name blocks-world) 
       (70: G2 ^state S1) (15: S1 ^object-dynamic B3) 
       (30: B3 ^clear yes) (16: S1 ^object-dynamic B2) 
       (85: B2 ^clear yes) (29: B3 ^object-static B6) 
       (24: B2 ^object-static B5) (28: B5 ^type block) 
       --> 
       (O8 ^destination B6 + [O] ) (O8 ^moving-block B5 + [O] ) 
       (O8 ^name move-block + [O] ) (G2 ^operator O8 +)
Firing blocks-world*propose*operator*move-block 
       (65: G2 ^problem-space P2) (63: P2 ^name blocks-world)
       (70: G2 ^state S1) (17: S1 ^object-dynamic B1) 
       (20: B1 ^clear yes) (16: S1 ^object-dynamic B2)
       (85: B2 ^clear yes) (19: B1 ^object-static B4)
       (24: B2 ^object-static B5) (28: B5 ^type block) 
       --> 
       (O9 ^destination B4 + [O] ) (O9 ^moving-block B5 + [O] ) 
       (O9 ^name move-block + [O] ) (G2 ^operator O9 +)
Retracting blocks-world*propose*operator*move-block 
       (65: G2 ^problem-space P2) (63: P2 ^name blocks-world)
       (70: G2 ^state S1) (18: S1 ^object-dynamic T1)
       (34: T1 ^clear yes) (17: S1 ^object-dynamic B1)
       (20: B1 ^clear yes) (35: T1 ^object-static T2)
       (19: B1 ^object-static B4) (23: B4 ^type block)
       -->
       (G2 ^operator O3 +)
--- Working Memory Phase ---
=>WM: (101: G2 ^operator O9 +)
=>WM: (100: G2 ^operator O8 +)
=>WM: (99: G2 ^operator O7 +)
=>WM: (98: G2 ^operator O6 +)
=>WM: (97: O9 ^destination B4)
=>WM: (96: O9 ^moving-block B5)
=>WM: (95: O9 ^name move-block)
=>WM: (94: O8 ^destination B6)
=>WM: (93: O8 ^moving-block B5)
=>WM: (92: O8 ^name move-block)
=>WM: (91: O7 ^destination B5)
=>WM: (90: O7 ^moving-block B6)
=>WM: (89: O7 ^name move-block)
=>WM: (88: O6 ^destination B5)
=>WM: (87: O6 ^moving-block B4)
=>WM: (86: O6 ^name move-block)
<=WM: (80: G2 ^operator O3 +)
--- Output Phase ---

Now that new operators have been created, the productions that compare the
operators can fire:

<27 soar> (ms)
Assertions:
  blocks-world*compare*operator*move-block*into-place*better 
  blocks-world*compare*operator*move-block*into-place*better 
  blocks-world*compare*operator*move-block*into-place*better 
  blocks-world*compare*operator*move-block*into-place*better 
  blocks-world*compare*operator*move-block*lower*better 
  blocks-world*compare*operator*move-block*into-place*better 
  blocks-world*compare*operator*move-block*not-into-position*worst 
  blocks-world*compare*operator*move-block*into-place*better 
  blocks-world*compare*operator*move-block*into-place*better 
  blocks-world*compare*operator*move-block*into-place*better 
  blocks-world*compare*operator*move-block*not-into-position*worst 
Retractions:

Thus, within a single elaboration phase, an operator is applied, new
operators are created, and preferences are created to select the next
operator.