<<

PROSS: A process control

KARL W. SCHOLZ* statements with occasional computed GO TO University ofIllinois, Champaign. Illinois 61820 statements; the resulting code was thus difficult to write initially, difficult to debug, and perhaps most important PROSS, a programming language for small- and was difficult to teach to newcomers in the laboratory. medium-scale process control computers, is presented. The PROSS language was designed to circumvent The PROSS language, whose structure and syntax were these difficulties by providing a convenient means for expressly designed for ease of use by psychologists, is coding any experimental procedure which could be summarized and exemplified in a sample procedure. The structure of an existing PROSS compiler is briefly organized as a sequence of discrete events ordered in summarized. time. The development of PROSS's syntax and statement structure grew from a simple expedient. A The present discussion is divided into three segments. group of individuals, both and First, we shall discuss the genesis of the PROSS language nonprogramrners, were informally asked, "Assuming the at the Indiana University Math Psych Laboratory. existence of an appropriate hypothetical compiler, how Secondly, the major features of the language will be would you most conveniently express your intended outlined and summarized in a coded sample procedure. paradigm to a computer?" The various protocols Finally, we shall comment briefly on the structural produced in response to this question servedas the basis features of the PROSS compiler currently in use at the for the development of the PROSS syntax. The most Indiana Laboratory. important characteristics of the protocols were, first, an emphasis on the "readability" of source statements and, THE GENESIS OF THE PROSS LANGUAGE secondly, the presentation of an experimental procedure Prior to the implementation of the PROSS system, as an ordered sequence of discrete operations, spaced virtually all process programming in the Indiana appropriately in time by the introduction of delays laboratory was written in IBM's IV. The whose termination was either response-contingent or impetus to develop a new system was based on several time-contingent. Thus, the language was developed to profound inadequacies of FORTRAN as a process conform to the user's "way of thinking," rather than to control language. First and foremost, the Indiana 32K force the user to acquire an alien approach to problem IBM 1800 provided sufficient hardware resources to representation dictated by the structure of an unfamiliar support both multiple laboratory operation and language. As McLean (1969) concludes in his discussion foreground-background time sharing. Realization of of PSYCHOL, "additional work might be undertaken to these capabilities forced the to remain make the language more like the discourse of the constantly aware of the necessity for conforming to a psychologist, less like the programming language on variety of conventions which were relevant only to the which PSYCHOL is built [e.g., ALGOL]." The primary time-sharing operations, not to the actual process objective in the development of PROSS was the control application. For example, whenever the emphasis on psychological discourse as the man-machine programmer wished to introduce a timed delay into his communication medium. procedure, he had to set the appropriate programmed timer and then return control to the : at THE MAJOR FEATURES the termination of the timed interval, his program would OF THE PROSS LANGUAGE! be reentered at the first statement, thus necessitating The language contains three statement categories, execution of a complicated branch sequence to return to concerned respectively with declaration, processing, and that portion of the program designed to service the end I/O control. In order to facilitate learning the language, of the interval (the ENTRY statement is not included in similarity to FORTRAN has been maintained wherever 1800 FORTRAN). appropriate. The three statement categories, and the Secondly. much of the I/O equipment required special PROSS statements within each category, will be service routines for effective operation. Since a major discussed in turn. aspect of process control applications is the operation of specialized I/O equipment. frequent calls to these special Declarations subroutines were required in each FORTRAN PROSS includes two statements for the declaration of procedure. Thus, a complete procedure would typically data. COMMON statements are used to allocate storage degenerate into little more than a list of CALL areas used both for data disposition and for interprogram communication. Common storage is placed in specific installation-determined data buffering areas

'Send requests for reprints to Karl W. Scholz. Department of rather than within a user's program. CONSTANT Psychology. University of l llinois. Champaign. Illinois 61820. statements are used to declare variable or array storage

Behav. Res. Meth. & Instru., 1973. Vol. 5 (2) 245 within a user's program and to preassign specific values and ZERO statements. MOVE statements are used to to variable names. Both integer values and alphanumeric transfer an entire array. or any portion of an array. to strings may be preassigned. some other location. ZERO statements are used to zero an array or portion thereof. MOVE and ZERO arc Processing Statements provided primarily to facilitate transfer and Processing statements provide arithmetic processing manipulation of blocks of stimulus or response and program control which may be either information such as character strings used in CRT time-contingent or response-contingent. Arithmetic display devices. operations are expressed in arbitrarily complex. fully parenthesized notation, as in FORTRAN. The f requently used operations of incrementing or Input/Output decrementing a single variable (such as the index or PROSS uses a unique and highly general input/output counter in a loop) are facilitated by INCREMENT and facility. Process control installations will typically DECREMENT statements which replace the familiar I = develop a series of special-purpose input/output control 1+ J construction of FORTRAN. subroutines, each designed to control or monitor some Delay in prugram execution is effected by DELAY specific function. The appropriate calls to such and DEPART statements. The DELAY statement subroutines can easily be generated using the facilities of introduces a timed delay in program execution. and a a macro assembler, which are now available as standard DEPART statement introduces an untimed or indefinite software for most small- to medium-sized computers. delay. In either case, resumption of program execution The PROSS compiler generates calls to I/O subroutines may be made response-contingent through prior through direct transliteration of the source statement, execution of an *ALLOW statement (see I/O statement thus allowing each installation to establish its own macro discussion below). library which is accessible to the PROSS programmer Three statements are provided to allow the direction without compiler modification. PROSS I/O statements of program control. Unconditional transfer is directed contain one or more words, separated by blanks, by the GO TO statement as in FORTRAN, ALGOL, or commas, or parentheses. The compiler interprets the PL/l. Conditional transfer may be controlled by a first word as a macro name and interprets all remaining computed GO TO as in FORTRAN or by an IF words as parameters to that call. The resulting macro call statement. Since event-contingent transfer is frequently is then expanded by the assembler into either the required in process control. special emphasis has been appropriate subroutine call or into the actual code placed on the PROSS IF statement, and three distinct necessary to control the I/O operation. Effectively, the types are provided. All IF statements begin with a logical programming power normally provided by a macro expression, which is followed by (1) two labels separated assembler is brought into the reach of the beginning by a comma, (2) any statement in the language, or programmer instead of remaining accessible to only the (3) any two statements in the language separated by sophisticated machine-language programmer. ELSE. Iterative program control is directed by a The general structure of a PROSS program resembles statement of the form "DO label WHILE logical a FORTRAN program in external appearance (see expression." The PROSS DO-loop construction allows Table I). Each program begins with several compiler the programmer to specify both the index type control statements, indicating program type (e .g., in-core (subscripted or nonsubscripted variable) and the nature vs out-of-core) and data communication area. The of the index manipulation used for loop control. . communication area is one of several defined by the INCREMENT and DECREMENT statements are installation as being accessible to process programs and, typically used to manipulate the loop index; thus, for as such, is analogous to FORTRAN labeled COMMON. example, iteration count might be determined by The control statements are followed by conventional decrementing a subscripted variable by a second program declaration statements which allow the subscripted variable until smaller than a third programmer to define variables and arrays. Executable subscripted variable. The flexibility which PROSS IF statements consist of a temporally ordered sequence of and DO statements provide for the programmer is to a events spaced appropriately in time by DELAY large extent responsible for the acceptance which the statements. The exit and reentry coding which is language has received. required for effective time sharing in the PROSS provides two statements to direct interrupt-oriented time-sharing system is automatically interprogram communication. CALL statements operate inserted by the compiler. The user thus creates his identically to their FORTRAN namesake. QUEUE program with the idea that he is in control of the entire statements are used to transfer control to a system while his program is in execution, while in noncore-resident program. The QUEUE statement would actuality his and several other programs may be be omitted in an implementation of PROSS for a smaller simultaneously in execution, each entered by the computer lacking secondary storage. resident monitor upon recognition of the appropriate PROSS facilitates array manipulation through MOVE interrupts.

246 Behav. Res. Meth. & Instru., 1973, Vol. 5 (2) Table I Secondly. the complexity of bookkeeping details within A Sample PROSS Program the compiler is reduced (e.g., symbol table maintenance The following programming example executes a variation of and relocation). Finally and perhaps most important, the familiar Sternberg paradigm (Sternberg. 1970) for the study debugging is greatly facilitated by providing an of human memory. The example assumes the existence of a CRT opportunity to inspect compiler output in a readable display device and a simple two-choice response box. The array DIGIT contains the search sets in the appropriate display code. form. where each set is preceded by an integer representing the set size. The PROSS compiler operates without a complete Array PROBE contains the target for each trial. and array TORF symbol table: only a small forward reference table is contains the correct response for each trial. Ss' responses and maintained for processing DO and CONTINUE reaction times are stored in arrays BUFFR and LATCY. statements. Arithmetic statements are compiled using respectively. Procedure PSCAN is core resident for the duration of standard algorithms for Infix to Polish conversion. The experiment execution and supervises stimulus display, timing. remaining statements are compiled using simple and data acquisition. Utility l;SCAN is invoked by the QUEUE lexical-scan and correspondence-table techniques found statement at session initiation and termination and supervises in many language translators. data transfer to and from secondary storage. Compiler output consists primarily of macros which -PiOCIOUIU: IISCAN "011110 lOt are expanded by the 1800 Macro-assembler. Thus, the -loUT -L.AI ....."S actual object code sequences are retained as a macro COJIMOH MJ.. IGI T(200', '101f(0), ~Af< 50 >, SV,JI=_(SO),l,l,TCY 00i. 1,.1, T tOtf'''MT "U. TIUI~·COIU.!C'.FAI.S!=' .1.0...,1,05=5,01:1 library rather than as a part of the compiler itself. This CONST.....T TI"1111100, TI/III12-50, JTJ=20 C (. SANU ".OU 'IO"AAA -S TU~aU.G ,...... 01 GM method of code generation allows the object code C TH_U QutUE USCAH produced from an arbitrary string of source statements DlfIIUT DO TRIAL ,,"ILl! T .LoIL "'4:1 to be easily modified. a facility that is essential for any Illl • Ol5IT(J)J IHCIU'J'\f",r I -'1A1l .DU'U.Y DIGoIT (I),SIZlj l~CIlf"'!NT I,SIZE dynamic laboratory environment. Thus, any alterations DlUY T1"'1 -eiAII in an installation's operating system or in its available "DIS'LA,. ..IOUeT) tII."'LOV I/O equipment can be incorporated into the PROSS ·SUITTtMl! OIl••T 11M2 system by simply patching the macro library-the -IIfiOI ••UPOHIU IfrflO IU'U(-) MI.AtUtlU nfTO LATCY(T) compiler itself need not be altered. 1'(lU'"(T).fQ.TOI'(T» ::DISpL. ...y nUf,07 fL.SE wDIS"L.l~ FAU,£,'S OIL" IT] In conclusion, the PROSS system is designed to UIAI. C~TlNUI '0 TO T"IU provide the psychologist with an easy to use, simply .00 ·UTILITY usc.... ·OIIGiN 20' structured technique for conducting experiments with lI~IS' -1..\1 HUMIn t real-time computers. The implementation rests on the co~ "',0,0 I" T(1QO); PlI:OU:00): TOU (!Q); !w'F!H 50); ...A-cvc ~::l), I C~5TAIri'j ou i.,l>3vla3v;, i:n :);1: 100, ,.~"''" H H 3 assumption that. in general, a psychologist's interest is SAoWI'l.f "'IOSS VTI .. :~" - 5TUfrof8Ellli P,lUDIG/OIl focused on an experimental paradigm itself, rather than III' (J,I:Q.Fi."'" '0 TC 5100f on the programming techniques required for its "UA.D'IL( f'5'A'" 1"4'0 "I,A. .. c ic • hOI J !~Cl oJa'L"" realization. Thus. the precise syntactic definition and 011.4" Dl CAI.L UIT sophisticated data structures characteristic of high-level S10ll/.l"aITE'!l.f ~HS. 1111;0'" e.. ~~O< ,:~c te'IIlIIS" programming languages were abandoned in favor of an .00 approach which retained as much superficial resemblance t o plain English as possible.

THE PROSS COMPILER REFERENCES Carnpbeil. G D, An mvestigation of Markovian state change A system-independent version of the PROSS compileI languages. Publication No.7. 1972, University of Colorado written in FORTRAN II is currently being planned but CLIPR Publication Series, \lcLean, R S. PSYCflOL: A computer language for has not as yet been coded. The existing compiler is f'\:pl.'rifll(~ntation. Behavior Research Methods & coded in IBM 1800 and is segmcn ted l nst r orrcn t at io n. 1969. i. :323-328. Sc h ol:' :,.;. \\'. Computen zed process control in behavioral to allow execution in less than 5K of cure. Just as the s c i e n ce research. Behavior Research Methods & Colorado SCAT system (Campbell. 1(72) translates user Instrumentation, 1972. 4. 203-208. Sternberg. S. Me m o rv scanning. In J. S. Antrobus (Ed.), code into FORTRAN. the PROSS compiler translates Cogniti.,r: Gild ctiect Boston: Little. Brown, 1970. Pp. 13-58. user code into IBM 1800 ASM. The expedlenI ot translation from one source language to another (rather NOTE LA more detailed summary of the PROSS syntax and of the than directly into object code) has several advantages. machine environment in which PROSS is hosted is given in First. the burden of intcrmachine transfer is reduced. Scholz (1972).

Behav. Res. Meth. &.: Instru.. 1973. Vol. 5 (2) 247