PROSS: a Process Control Programming Language
Total Page:16
File Type:pdf, Size:1020Kb
PROSS: A process control programming language 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 programmers 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 FORTRAN 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 programmer 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 operating system: 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