### Program analogy.soar
### Started 5 Aug 93
### Version 18 Nov 94, based on analogy.soar v. 1 Nov 94 -- original by rmy
### NB: nnpscm version -- conversion by John Rieman
### Version 5 Dec 94, some concessions to improving the trace in NNPSCM -- rmy
### Soar 7 ...
### Version 19 Jan 96, picked up Soar 7 demo from distribution, minor
### corrections -- rmy
### Program to do simple 'deliberate analogy' for figuring out how to launch
### a program on the Mac, given that one or two specific ones are known.
### This version developed specifically for the purposes of the one-day
### Soar tutorial given by Frank Ritter and Richard Young. A set of
### Macintosh files containing OHP slides together with exercises and
### other handouts (either describing just this program, else covering
### the whole one-day tutorial) can be obtained by contacting
### ritter@psychology.nottingham.ac.uk
### Note that I have used state-elaboration rules instead of operators in many
### places, probably to a far greater extent than is justified in terms of
### cognitive modelling, but it shortens the program and perhaps makes its
### behaviour easier to follow.
### Correspondingly, there are several highly specific monitoring rules
### present, which we would not normally expect to see in this kind of
### program.
### ======================================================================
### DECLARATIONS, INITIALISATIONS, ETC.
### ======================================================================
### This format is specifically for monitoring the Imagine-Task space
# syntax won't work in nnpscm -jr
#trace-format -object -add p perform "%id (perform%ifdef[ %v[type] %v[alias]])"
### All right, so for NNPSCM we do the following, which is intended
### for watch 0 format, might be a little weird in anything else:
format-watch -stack -add s {%right[6,%dc]: %rsd[ ]==>S: %cs
%rsd[ ]}
sp {monitor*problem-space*nnpscm
(state ^problem-space (
^name | (| )
( ^type imaginary ^alias imagine-task)
-->
(write | type = imaginary alias = imagine-task|)}
### Ask what program to launch
sp {preamble*ask-program-to-launch
(state ^name perform)
( )}
sp {perform*initialise*state
(state )
( ^name action-proposal)}
### -- Assumed knowledge --
### Here we hand-code the assumed knowledge about how to launch Word or Draw
### by double-clicking. When used, this will give rise to specific chunks
### back in the Perform space.
### If the task is to launch Word or Draw, then propose an action to
### double-click.
sp {action-proposal*double-click-to-launch
(state )
( ^name use-analogy)
( ^problem-space