Go backward to Initialization of Soar.
Go up to Initialization of Soar.
Go forward to Initializing Soar to run a task.
Running Soar
------------
Soar's execution of productions can be started with many different functions:
run, go, and d. All of these start executing Soar, but each allows for
different control of when Soar will stop. All can be used at any time during
a run, not just at the beginning. At anytime during a run, you can stop Soar
by typing ctrl-c.
When Soar starts with an empty working memory, the architecture creates a
goal that has nil as its supergoal: (goal <g> ^object nil ^type goal). This
is the top-goal and the only goal with nil as its supergoal.
Soar's default knowledge proposes a name for the top-level goal as well as a
top-level problem space and state (see Section See Default knowledge in Soar on page
See Default knowledge in Soar). These are proposed with accompanying worst preferences
so that they will be selected only if there are no other alternatives. If
they are selected by the decision procedure, the initial trace will look as
follows:
Soar> d 2
0: ==>G: G1
1: P: P1 (top-ps)
2: S: S1 (top-state)
A summary of the current goal stack can be printed using pgs, which stands
for {p}rint {g}oal {s}tack (see Section See pgs on page See pgs). In
this case, there is only the single goal and the results are as follows:
Soar> pgs
: ==>G: G1
: P: P1 (top-ps)
: S: S1 (top-state)
Structures in working memory can be printed using the print function (see
Section See print on page See print). Print can display a complete
object if called with the object's identifier:
Soar> p G1
(G1 ^object nil ^type goal ^desired D1 ^name top-goal ^state S1 ^state S1 +
^problem-space P1 ^problem-space P1 +)
Soar> p p1
(P1 ^name top-ps)
Soar> print s1
(S1 ^io-state S1 ^name top-state)
The selection of problem space P1 is represented in working memory as:
(goal G1 ^problem-space P1)
The acceptable preference created to select
P1 is also in working memory and is represented as:
(goal G1 ^problem-space P1 +)
Soar prints both of these together in a shorthand as:
(goal G1 ^problem-space P1 ^problem space P1 +)
Similarly, state S1 is the current state for goal G1 and has an acceptable
preference in working memory. The goal is also augmented with ^object nil
(created by Soar), signifying that it does not have a supergoal. The name of
the goal is contained in (^name top-goal) and a desired state (^desired D1).
Initially the desired does not have any augmentations.
The problem space has a single augmentation with its name (^name top-ps).
The state has an augmentation for its name (^name top-state) and an
augmentation called ^io-state that points to the top state in the goal stack,
which in this case it is itself: S1. All input and output goes through the
top state (see Chapter See Adding Input and Output Routines on page
See Adding Input and Output Routines) and a general convention is to augment
states with ^io-state pointing to the top state. This allows uniform access
to input and output for all levels of goals. States representing
hypothetical situations (as in lookahead) would not have this augmentation.