These Soar productions implement the water-jug task. The task is to find the sequence of steps that fill the three gallon jug with one gallon of water. There are a well that has an infinite amount of water, a five gallon jug, and a three gallon jug.

The task problem space has three operators: empty, fill, and pour. Empty empties a jug into the well. Fill fills up a jug from the well. Pour pours some or all of the contents from one jug into the other jug. Pour can only pour out the contents of the jug until the source is empty or the destination is full.

State Structure

Each jug has slots to record its capacity (volume), the amount of water it contains (contents), and the capacity available (empty) which is the volume minus the contents.

  (state s1 ^jug j1)
  (jug j1 ^volume v1 ^contents c1 ^empty f1)
where v1, c1, and f1 are numbers.

This agent contains a set of commented-out record productions for recording its last operator. Using that knowledge to control search greatly reduces the time to find a solution. Uncomment to see how it affects problem solving.

Soar capabilities
  • Basic PSCM functions: State Elaboration, Operator Proposal, Operator Evaluation, Internal Operator Application
Download LinksExternal Environment
  • None.
Default Rules
  • None.
Associated Publications
  • The Soar Tutorial: Chapter 1
  • John Laird
Soar Versions
  • Soar 8,9
Project Type
  • VisualSoar