Center for Cognitive Brain Imaging

at Carnegie Mellon University

Projects

4CAPS Cognitive Neuroarchitecture

4CAPS Source Code & Documentation

The source code for 4CAPS is available here. To run 4CAPS, load this file into your Common Lisp environment. There are two caveats to be aware of.

* The first concerns interpretation vs. compilation. Some Common Lisps environments (e.g., Digitool's) automatically compile all source code. However, others (e.g., Franz's) use the interpreter by default. In this case, you will want to compile the 4CAPS source code before loading it. This is done via the compile-file function or via a menu choice; the result should be a so-called "fasl" (fast load) file. Compilation is not necessary, but will greatly speed performance.

* The second concerns packages. 4CAPS will be loaded into the "CL-USER" package. To gain access to its functionality, you will have to operate within this package. Perhaps the simplest way to do this is to type (in-package "CL-USER") after loading 4CAPS.

There is no 4CAPS tutorial or manual. Rather, there exist several manuscripts written by several people over the years, each documenting a slightly different version of the cognitive architecture.
Sashank Varma has written three manuals of varying completeness.
Varma manual 1
Varma manual 2
Varma manual 3
Scott Sanner has also written a 4CAPS manual.
Sanner manual

Sentence Comprehension Model

The Sentence Comprehension Model is briefly described in Just et al. (1999) and comprehensively described in Just and Varma (2007). Its source code is available here.

At the bottom of the file are a number of commands that are defined for simulating the comprehension of sentences used in a number of empirical studies. Some are for behavioral studies of neurotypical young adults: King & Just (1991): (king1991 &optional (summ-p t)) MacDonald et al. (1992): (macdonald1992 &optional (summ-p t)). One is for a behavioral study of lesion patients: Haarmann et al. (1997): (haarmann1997 &optional (summ-p t)). One is for an fMRI study that employs a block design: Just et al. (1996): (just1996 &optional (summ-p t)). Others are for event-related fMRI studies: Mason et al. (2003): (mason2003 &optional (summ-p t)) Caplan et al. (2001): (caplan2001 &optional (summ-p t)). One is for a block-design fMRI study of a lesion patient: Thulborn et al. (1999):(thulborn1999 &optional (summ-p t)). The :summ-p parameter is optional. It can be either t or nil. When t - its default value - the summ command is called after every simulation to pretty-print the results. The model defines a sim command for simulating comprehension of a sentence and a summ command for pretty-printing the temporal and resource utilization results. These are the components from which the above study-specific commands are built. The user can use them to write commands for simulating different studies. (The user must also extend the model's lexicon, which is defined in a straightforward fashion in the middle of the file.)

References
Caplan, D., Vijayan, S., Kuperberg, G., West, C., Waters, G., Greve, D., & Dale, A. M. (2001). Vascular responses to syntactic processing: Event-related fMRI study of relative clauses. Human Brain Mapping, 15, 26-38.
Haarmann, H. J., Just, M. A., & Carpenter, P. A. (1997). Aphasic sentence comprehension as a resource deficit: A computational approach. Brain and Language, 59, 76-120.
Just, M. A., Carpenter, P. A., Keller, T. A., Eddy, W. F., & Thulborn, K. R. (1996). Brain activation modulated by sentence comprehension. Science, 274, 114-116.
King, J., & Just, M. A. (1991). Individual differences in syntactic processing: The role of working memory. Journal of Memory and Language, 30, 580-602.
MacDonald, M. C., Just, M. A., & Carpenter, P. A. (1992). Working memory constraints on the processing of syntactic ambiguity. Cognitive Psychology, 24, 56-98.
Mason, R. A., Just, M. A., Keller, T. A., & Carpenter, P. A. (2003). Ambiguity in the brain: How syntactically ambiguous sentences are processed. Journal of Experimental Psychology: Learning, Memory, & Cognition, 29, 1319-1338.
Thulborn, K. R., Carpenter, P. A., & Just, M. A. (1999). Plasticity of language-related brain function during recovery from stroke. Stroke, 30, 749-754. &
Just, M. A., & Varma, S. (2007). The cognitive neuroarchitecture of sentence comprehension. Cognitive, Affective, & Behavioral Neuroscience, 7, 153-191.

Tower Of London

The Tower of London (TOL) Model is described in Newman et al. (2003) and Just and Varma (2007). Its source code is available here.

At the bottom of the file, five commands are defined for testing the model's performance on problems of increasing complexity. These are invoked as: (test1) (test2) (test3) (test4) (test5). The model defines a sim command for simulating the solution of a given problem and a summ command for pretty-printing the temporal and resource utilization results. These are defined at the bottom of the file and used by the various test commands. It is easy to infer how these work and to write new commands that have the model solve different problems.

There are two TOL studies. The "old" study is the published study Newman et al. (2003). The "new" study is the unpublished study conducted by Sharlene Newman and Greg Sliwoski. It uses different problems and more strictly varies problem complexity. The file for simulating the problems of these studies is located here.
The following command simulates solution of all old problems:
(old-sims)
This one simulates all new problems,
(new-sims)
and this one all old and new problems:
(all-sims)

The columns have the following meanings:
START: The starting state number. The state space is given in Newman et al. (2003), with each state numbered. (A problem is defined by a starting state and an ending state.)
END: The ending state number.
RESULT: Whether the model solved the problem.
MIN?: Whether the problem was solved in a minimum number of moves.
MINMOV: The minimum number of moves required to solve the problem.
MODMOV: The number of moves required by the model.
CYCS: Time required by the model.
BLOPOS: Don't worry about this for now.

The following commands also simulate the solution of old and new problems, respectively, but display the results as a function of increasing minimum-length solutions.
(fig-old-sims)
(fig-new-sims)

They clarify the aspects of model performance that vary with increasing problem difficulty.

References
Just, M. A., & Varma, S. (2007). The organization of thinking: What functional brain imaging reveals about the neuroarchitecture of complex cognition. Cognitive, Affective, & Behavioral Neuroscience, 7, 153-191.
Newman, S. D., Carpenter, P. A., Varma, S., & Just, M. A. (2003). Frontal and parietal participation in problem solving in the Tower of London: fMRI and computational modeling of planning and high-level perception. Neuropsychologia, 41, 1668-1682.

Mental Rotation Model

The Mental Rotation (MR) Model is described in Just and Varma (2007). Its source code is available here.

At the bottom of the file is a command for simulating the solution of the Shepard and Metzler (1971) (SM) problems used by Carpenter et al. (1999):
Carpenter et al. (1999): (mr1999)

The model defines a sim command for simulating the solution of a given problem:
(sim &key (angle 40) (mirror-p nil))
The angle parameter is the angular disparity between the two SM figures. When mirror-p is nil, the figures are congruent; when it is t, they are mirror-images of one another. All simulations run by the sim command currently use the same SM figure (and its mirror image). Why? The model itself is perfectly general. However, it is quite cumbersome to define new SM figures using the Marr and Nishihara (1977) representational scheme that the model adopts. The structure of the figure is documented in the header comment for the sim command, and can be changed by people of sufficient bravery.

The model also defines a summ command for pretty-printing the temporal and resource utilization results. These are defined at the bottom of the file and used by the mr1999 command. They can be combined by the user into commands that simulate the results of other studies.

References
Carpenter, P. A., Just, M. A., Keller, T., Eddy, W. F., & Thulborn, K. R. (1999). Graded functional activation in the visuospatial system with the amount of task demand. Journal of Cognitive Neuroscience, 11, 9-24
Just, M. A., & Varma, S. (2007). The organization of thinking: What functional brain imaging reveals about the neuroarchitecture of complex cognition. Cognitive, Affective, & Behavioral Neuroscience, 7, 153-191.
Marr, D., & Nishihara, H. K. (1978). Representation and recognition of the spatial organization of three-dimensional shapes. Proceedings of the Royal Society of London B, 200, 269-294.
Shepard, R. N., & Metzler, J. (1971). Mental rotation of three-dimensional objects. Science, 171, 701-703

Driving Model

The Driving Model is not yet described in any publication. However, these slides provide an overview of its operation and its fit to the results of two (unpublished) fMRI studies. The Driving model implements the algorithm defined by Salvucci and Gray (2004). Its source code is available here.

At the bottom of the file is a command for simulating navigation of a road.
(sim &key (rv *ccbi-rv*) (time 60))

The :rv ("road view") parameter is the road to be driven. Several are defined in the model:
*ccbi-rv*
: Polynomial approximation of the road driven by subjects in CCBI driving experiments.
*easy-rv*
: A road defined by a single sin curve.
*medium-rv*
: A road defined by the sum of two sin curves of different frequencies.
*hard-rv*
: A road defined by the sum of three sin curves of different frequencies.

The idea of defining roads sinusoidally was taken from Strayer and Johnston (2001). New polynomial or sinusoidal roads can be defined using the provided Lisp functions. The :time parameter is the number of seconds of driving to be simulated.

The model also defines a summ command for pretty-printing the temporal and resource utilization results.

References
Salvucci, D. D., & Gray, R. (2004). A two-point visual control model of steering. Perception, 33, 1233-1248.
Strayer, D. L., & Johnston, W. A. (2001). Driven to distraction: Dual-task studies of simulated driving and conversing on a cellular telephone. Psychological Science, 12, 462-466.

Tower of Hanoi

The Tower of Hanoi (TOH) Model is described in Varma (2006). Its source code is available here.

At the bottom of the file, five commands are defined for testing the model's performance on problems of increasing complexity. These are invoked as:
(test3)
(test4)
(test5)


test3 simulates solution of the standard 3-disk problem, where a stack of 3 disks must be moved from the left peg to the right peg. test4 and test5 simulate solution of the standard 4-disk and 5-disk problems, respectively.

The model defines a sim command for simulating the solution of a given problem and a summ command for pretty-printing the temporal and resource utilization results. These are defined at the bottom of the file and used by the various test commands. It is easy to infer how they work and define commands for simulating the results of other studies.

There exist commands for simulating solution of problems used in behavioral studies of neurotypical adults (Anderson, 1993; Carpenter et al., 1990; Just et al., 1996; Ruiz, 1987), behavioral studies of patients with frontal lesions (Goel et al., 2001; Morris et al., 1997a; Morris et al., 1997b), and fMRI studies of neurotypical adults (Anderson et al., 2005; Fincham et al., 2002).

References
Anderson, J. R. (1993). Rules of the mind. Hillsdale, NJ: Erlbaum.
Anderson, J. R., Albert, M. V., & Fincham, J. M. (2005). Tracing problem solving in real time: fMRI analysis of the subject-paced Tower of Hanoi. Journal of Cognitive Neuroscience, 17, 1261-1274.
Carpenter, P. A., Just, M. A., & Shell, P. (1990). What one intelligence test measures: A theoretical account of the processing in the Raven Progressive Matrices Test. Psychological Review, 97 404-431.
Goel, V., Pullara, S. D., & Grafman, J. (2001). A computational model of frontal lobe dysfunction: working memory and the Tower of Hanoi task. Cognitive Science, 25, 287-313.
Fincham, J, M., Carter, C. S., van Veen, V., Stenger, V. A., & Anderson, J. R. (2002). Neural mechanisms of planning: A computational analysis using event-related fMRI. Proceedings of the National Academy of Sciences, 99, 3346-3351.
Just, M. A., Carpenter, P. A., & Hemphill, D. D. (1996). Constraints of processing capacity: Architectural or implementational? In D. Steier & T. M. Mitchell (Eds.), Mind matters: A tribute to Allan Newell (pp. 141-178). Hillsdale, NJ: Erlbaum.
Morris, R. G., Miotto, E. C., Feigenbaum, J. D., Bullock, P., & Polkey, C. E. (1997a). The effect of goal-subgoal conflict on planning after frontal- and temporal-lobe lesions in humans. Neuropsychologia, 35, 1147-1157. Morris, R. G., Miotto, E. C., Feigenbaum, J. D., Bullock, P., & Polkey, C. E. (1997b). Planning ability after frontal and temporal lobe lesions in Humans: The effects of selection quivocation and working memory load. Cognitive Neuropsychology, 14, 1007-1027.
Ruiz, D. (1987). Learning and problem solving: What is learned while solving the Tower of Hanoi (Doctoral dissertation, Stanford University, 1987). Dissertation Abstracts International, 42, 3438B.
Varma, S. (2006). A computational model of Tower of Hanoi problem solving. Unpublished doctoral dissertation, Vanderbilt University.

Dual Sentence Comprehension and Mental Rotation

The Dual Comprehension-Rotation Model is described in Just and Varma (2007). It is not a new model per se, but rather the result of loading two separate models, combined with a glue script found here. It is defined by the following steps: Start Common Lisp, load 4CAPS, and enter the "CL-USER" package. Type (setq *dual-task* t) Load the Sentence Comprehension Model (SCM) Load the Mental Rotation (MR) Model Load the glue script The glue script combines the SCM and mental rotation models into an aggregate model that can perform sentence comprehension or mental rotation in isolation or concurrently. The glue script first defines a new facility for defining a "model." This is necessary for informing the system which model or models of the multiple defined models are to run for the task at. It also defines a new version of the main recognize-act loop for matching productions against declarative memory that is sensitive to the presence of multiple models and that records the activity or dormancy of each. Finally, it defines a generalized sim command for running one or more simulations at the same time and a generalized summ command for pretty-printing the results of one or more simulations.

The sentence comprehension and mental rotation models are defined next, as are commands for simulating the single-task conditions. (jv2005): Simulates comprehension of the sentences described in Just and Varma (2007). (mr1999): Simulates solution of the Shepard-Metzler problems solved by the Carpenter et al. (1999) subjects. These commands demonstrate the utility of the generalized sim and summ commands.

Finally, a command for simulating the Just et al. (2001) study of dual sentence comprehension and mental rotation is defined. (dt2001 &optional (summ-p t)) The :summ-p parameter is optional. It can be either t or nil. When t - its default value - the summ command is called after every simulation to pretty-print the results.

References
Carpenter, P. A., Just, M. A., Keller, T., Eddy, W. F., & Thulborn, K. R. (1999). Graded functional activation in the visuospatial system with the amount of task demand. Journal of Cognitive Neuroscience, 11, 9-24.
Just, M. A., Carpenter, P. A., Keller, T. A., Emery, L., Zajac, H., & Thulborn, K. R. (2001). Interdependence of nonoverlapping cortical systems in dual cognitive tasks. NeuroImage, 14, 417-426.
Just, M. A., & Varma, S. (2007). The organization of thinking: What functional brain imaging reveals about the neuroarchitecture of complex cognition. Cognitive, Affective, & Behavioral Neuroscience, 7, 153-191.

Dual Sentence Comprehension and Driving

The Dual Comprehension-Driving Model is not yet described in any publication. However, these slides provide an overview of its operation and fit to the results of an (unpublished) fMRI study. It is not a new model per se, but rather the result of loading two separate models, combined with a glue script found here. It is defined by the following steps: Start Common Lisp, load 4CAPS, and enter the "CL-USER" package. Type (setq *dual-task* t) Load the Sentence Comprehension Model (SCM) Load the Driving Model Load the glue script The glue script combines the SCM and driving models into an aggregate model that can perform sentence comprehension or driving in isolation or concurrently. The glue script first defines a new facility for defining a "model." This is necessary for informing the system which model or models of the multiple defined models are to run for the task at hand. It also defines a new version of the main recognize-act loop for matching productions against declarative memory that is sensitive to the presence of multiple models and that records the activity or dormancy of each. Finally, it defines a generalized sim command for running one or more simulations at the same time and a generalized summ command for pretty-printing the results of one or more simulations.

The sentence comprehension and mental rotation models are defined next, as are commands for simulating the single-task conditions. (jv2005): Simulates comprehension of the sentences described in Just and Varma (2007). (drv2003 &key (time 15)): Simulates driving :time seconds on the *ccbi-rv* road view that subjects navigate in CCBI driving experiments These commands that demonstrate the utility of the generalized sim and summ commands.

Finally, a command for simulating dual-task sentence comprehension and driving is defined. (dt-driving &key (time (* 95 *secs-per-mcyc*))) The :time parameter is the number of seconds of driving to be simulated. It is converted in the parameter list to the temporal scale of 4CAPS, which is measured in cycles.

Dual Auditory and Visual Sentence Comprehension

The Dual (Auditory and Sentence) Comprehension (DC) model is not yet described in any publication. Its source code is available here.

The Dual Comprehension model differs from the other dual-task models in that it does not consist of two independent models running at the same time, but rather the same model processing two input streams simultaneously - think dual threads, not dual processes. It is defined as follows:
Start Common Lisp, load 4CAPS, and enter the "CL-USER" package.
Load the DC model.
Load the script found here.

The DC is a slight augmentation of the conventional SCM. It adds the task-goal class of declarative memory element - should the auditory input stream be attended, the visual input stream, or both - It also adds an Executive center to house these goals and Phonological and Orthographic centers to house percepts of the different modalities.

The sim command for simulating comprehension of a sentence has been elaborated into three separate commands:
(aud-sim sent)
(vis-sim sent)
(dual-sim aud-sent vis-sent)


The sent, aud-sent, and vis-sent arguments to these commands are lists of words. These commands are defined at the bottom of the file. The summ command has also been extended to pretty-print the resource utilizations of the three new centers (as well as the four existing centers). It is also defined at the bottom of the file.