Towards an Object-Oriented Language for Cognitive Modeling

This paper describes work towards an object-oriented language for cognitive modeling. Existing modeling languages (such as C, LISP and Prolog) tend to be far removed from the techniques employed by psychologists in developing their theories. In addition, they encourage the confusion of implementation detail necessary for computational completeness with theoretically motivated aspects. The language described here (OOS) has been designed so as to facilitate this theory/implementation separation, while at the same time simplifying the modeling process for computationally non-sophisticated users by providing a set of classes of basic “cognitive” objects. The object classes are tailored to the implementation of functionally modular cognitive models in the box/arrow style. The language is described (in terms of its execution model and its basic classes) before a sketch is given of a simple production system which has been implemented within the language. We conclude with a discussion of on-going work aimed at extending the coverage of the language and further simplifying the modeling process. Introduction: Rationale The principle of “functional modularity”, whereby the behavior of a complete system is determined by the interaction of a number of semi-autonomous sub-systems, is a commonplace within cognitive science. Many cognitive models, including those from both the connectionist paradigm and the symbolic paradigm, are based on the principle. The former is exemplified by models such as Miikkulainen’s model of script processing (Miikkulainen, 1993) and Burgess & Hitch’s model of the articulatory loop (Burgess & Hitch, 1992). The latter is exemplified by models such as Barnard’s Interacting Cognitive Subsystems model (Barnard, 1985) and production systems such as Soar (Newell, 1990, which is modular in the sense of having separable working memory and production memory components). Hybrid symbolic/connectionist models also employ functional modularity (e.g., Wermter & Lehnert, 1989), and further models, such as Morton’s model of the processing of words and pictures (Morton, 1981), adopt functional modularity without making any commitment to the underlying implementation. Within cognitive psychology, functional modularity is often expressed in terms of box/arrow diagrams. These diagrams, which generally consist of a number of labeled interconnected boxes, have a long and checkered history stretching back to Lichtheim (1885). Early criticisms failed to differentiate between functional and structural modularity (see Shallice (1988) for a review). More recently, critics have argued that such diagrams are virtually contentless, but this accusation can be rebutted by observing that the diagrams do make theoretical claims about functional modularity and the flow of data between the modules. Such theoretical claims may be justified by, and tested against, empirically observed dissociations between functioning (cf. Morton, 1981; Shallice, 1988). Box arrow diagrams share a superficial resemblance to flow charts, and this too has led to criticism. However, the two diagrammatic notations differ on several substantive grounds. Crucially, flow charts encode algorithms and express the flow of control. They are rooted in the traditional model of computation as sequential processing, and (if taken to be more than purely descriptive of behavior) seem to imply that flow charts are somehow represented in the head and executed by some conventional computational device. Box/arrow diagrams, in contrast, express functional modularity and flow of data between functional modules. They make no claims about sequential processing, and do not suggest the existence of any program which the system deliberately follows. Independently of their use in cognitive psychology, ideas similar to those behind functional modularity have recently achieved prominence within computer science. In particular, the object-oriented paradigm (see, e.g., Rumbaugh et al., 1991) advocates the use of informationally encapsulated objects to which sub-computations can be allocated via specified communication channels. As a result, Object-Oriented Programming (OOP) offers the possibility of directly addressing, withina sound computational framework, the functional modularity implicit in box/arrow diagrams. Specifically, within an object-oriented paradigm, boxes might be directly modeled as objects (of various classes), with arrows being directly modeled as communication channels between those objects. OOP has considerable potential utility within the domain of cognitive modeling in virtue of the approach that it offers to functional modularity. There are further arguments, however, for OOP within the discipline. Firstly, an object-oriented class hierarchy may be used to facilitate modeling by providing a variety of object classes tailored to the requirements of cognitive modeling. The class hierarchy described in the following section, for example, includes various different forms of buffer common in psychological theorizing. By providing the psychologist with a library of such classes, he/she may implement a model without having to consider the detailed implementation of the boxes within the model. That is, the psychologist can work at the level of interacting buffers and processes, etc., rather than at the level of C, Lisp, or Prolog code. In this way, OOP can lessen the “distance” between the language of the cognitive psychologist and the language of