LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN 510.84 I^6r no. 131 -140 cop. 3 The person charging this material is re- sponsible for its return to the library from which it was withdrawn on or before the Latest Date stamped below. Theft, mutilation, and underlining of books are reasons for disciplinary action and may result in dismissal from the University. To renew call Telephone Center, 333-8400 UNIVERSITY OF ILLINOIS LIBRARY AT URBANA-CHAMPAIGN NOV 1 m SFP 1 9 10^5 L161— O-1096 Digitized by the Internet Archive in 2013 http://archive.org/details/programminglangu132nara 510.84 UGr no. (32 OOP- 3 UNIVERSITY OF ILLINOIS DIGITAL COMPUTER LABORATORY GRADUATE COLLEGE Report No. 132 A PROGRAMMING LANGUAGE FOR THE PARALLEL PROCESSING OF PICTURES by R. Narasimhan January 9, I963 This work vas supported in part "by the Atomic Energy Conmiission Contract No. AT(11-1)-1018 1. INTRODUCTION 1.1 The Background . In a recent report a particular descriptive scheme vas suggested for the analysis of pictures composed of line-like elements. Briefly, the scheme envisaged a two-stage processing technique. In the first phase , the input picture vas converted to a labeled graph--with labeled vertices and branches -- by means of certain veil-defined labeling algorithms. In the second phase , the labeled graph so obtained vas reduced to a netvork composed of certain primitive strings. This reduction vas sought to be accomplished by making use of given "grammar rules" for string manipulation. These grammar rules vere to be defined in terms of the labels generated in the first phase and contained in themselves an implicit characterization of the class of pictures under consideration. While, ultimately, the adequacy of such a model as this has to be based on extensive empirical verifications, it might be of some interest to consider the folloving plausibility argument: the correspondence betveen a picture composed of line-like elements and a graph is intuitively evident. That, in fact, a graph vith labeled vertices and branches can be constructed needs substantiation and this is verified by the explicitly given algorithms. The connection matrix of this graph vhich describes it is clearly also a description of the underlying picture. By making use of the vertex labels the original matrix can be replaced by a reduced version incorporating only a subset of vertices. The matrix entries vill nov be strings (of labeled branches) rather than single branches. Grammar rules can nov be applied to transform and compose these strings into certain primitive categories (or types) . Finally, the matrix can be revritten to represent a netvork made up of these primitive strings. For a given class of pictures , the total descriptions scheme, then, is built out of the folloving: 1. An alphabet of primitive strings, and 2. A set of "veil-formed" netvorks of these primitive strings. * R. Narasimhan: A Linguistic Approach to Pattern Recognition, Report 121, Digital Computer Laboratory, University of Illinois, (1962) . CONTENTS Page 1. INTRODUCTION 1 1.1. The Background 1 1.2. Present Report 2 2. A FORMALISM FOR PICTURE PROCESSING 5 2.1. Introduction 5 2.2. The Formalism of Computation 5 2.3. Some Special Functions for Picture Processing 6 2.h. A System Structure for Machine Realization 10 APPENDIX TO SECTION 2 IJ A Preliminary List of Functions for Picture Processing . . I3 3. A PROGRAMMING LANGUAGE. 15 3.1. The Structure of ALGOL-60 15 3.2. A Formal Extension of ALGOL-60 17 3 •3' Examples of Picture Processing Routines 19 h. APPLICATIONS TO OTHER AREAS 21 ^.1. Address Computation in Associative Memories 21 -2- Any given input picture is nov to be described in terras of a statement that it consists of such and such primitive strings put together in such and such a network. This rather close analogy to language models and to the hierarchic levels in linguistic analysis is more than incidental. This was the reason for referring to this model in the earlier report as a linguistic approach to pattern recognition. 1.2. Present Report . To argue the adequacy of this models the earlier report contained several examples of input pictures processed according to the details set forth in the scheme ; making use of a few very rudimentary grammar rules. The principal concern of that report^ however ^ was one of exposition of the model and a discussion of its feasibility and some of its intrinsic merits for the treatment of the pattern recognition problem. Formalization of the processing details and their raachine realization were postponed for later consideration. We return to this aspect of the problem now and develop in this report a programming language in terms of which the labeling algorithms of phase I of our model can be effectively described and studied. Apart from the efficient description of the algorithms, a primary motivation for the formulation of the programming language is to aid in the system design of a computer in which these algorithms can be mechanically realized most readily; for, as was argued in the earlier report, it is our contention that the preprocessing of pictures (i.e., noise cleaning and other standardization aspects) and the labeling algorithms are intrinsically more efficiently handled in a parallel processing computer. One method of characterizing the structure of such a computer (for picture processing) would be to try and define, purely formally, the types of functions it should be capable of computing i.e., what types of functions on what types of structured * In "A System for the Automatic Recognition of Patterns" (Proc. I.E.E. 106(b), (1959)^ 210; see also, Comp. Jour, h (1961), 129), Grlmsdale et al describe a similar "linguistic" model. This work was brought to our attention sub- sequent to the publication of Report 121 and so was not referred to there . It is worth noting that Grlmsdale et al restrict their consideration to the recognition of alphanumeric characters and their primary concern is the efficient realization of their processing algorithms within the context of conventional arithmetic computers. operands yielding what types of values. A good systems organization for the computer can then "be considered as one which mirrors the structured operands in a natural way and has wired-in primitive operations in terms of which the required functions can be computed under programmed control. As applied to picture processing we shall consider this question in some detail in the next section. As we shall see there, by this procedure we arrive at a system structure which is almost identical to that currently envisaged for the PAU on the basis of quite different considerations. This, however, only solves partially the task we started out with. To complete the formalization of the parallel processing algorithms, it is necessary to develop an algorithmic language in terms of which a computer such as the one envisaged in the previous paragraph can be formally programmed c A natural approach to this problem would be to consider whether our structured operands and the special functions defined on them could be embedded in a suitable way in an extension of an already we 11 -developed programming language. We shall see that in fact this is readily accomplished and make use of a suitable extension of ALGOL-60 to this purpose. These details will be con- sidered in section 5 vhere we shall also give some examples of parallel pro- cessing routines written in this language. From a detailed consideration of picture processing routines we have now reduced parallel processing to computations of certain classes of functions defined on certain types of structured operands. It is natural to wonder at this stage whether the programming language so developed has any applicability to problems other than those which arise in picture processing. An answer to this question would also help to define a general purpose parallel processing computer applicable to a wider variety of problems. In section h we shall provide a partial answer to this by showing that address computations for content-oriented memories (the so-called associative memories) are strictly computations of functions on labels (or tags) included in the class of functions we have been considering and hence can be handled efficiently within our formalism. It is also our feeling that, when properly formulated. * B. H. McCormick: Design of a Pattern Recognition Computer. Part II: The Pattern Articulation Unit (PAU); Report 122, Digital Computer Laboratory, University of Illinois; (1962) . -k- one aspect of information retrieval problems should be expressible in terms of computations of suitably defined functions on labels (or indexes) vhose values are documents. A parallel processing computer with a basic structure similar to that described in this report vould seem to be applicable for the computation of a large class of functions of this type. 2. A FORMALISM FOR PICTURE PROCESSING 2.1. Introduction . In this section ve shall first develop a formalism to describe parallel processing and then introduce a variety of special functions of immediate use in picture processing. The motivations for the several details should be fairly obvious intuitively or from the context. Hovever, since the entire approach takes as its point of departure the specific processing schema discussed at length in DCL Report 121 (see footnote in Sec. l) , a knowledge of its contents might add to the perspicuity of the treatment which follows. 2'2. The Formalism of Computation . The basic domain of operation for parallel processing is a fixed, finite array of points. Without loss of generality we shall assume this to be a square array of points. "" Let P be a generic symbol denoting the points of this array. P can assume values or 1. A particular assignment of values to the points of the array constitutes a picture . Typically, in parallel processing, we start with an initial picture and generate from it, by well- defined operations, other pictures. In practice this is done by modifying the values of some of the P's in the old picture. It is important to note that, in general, we do not modify the values of all the points every time. Central to parallel processing, then, is the computation of functions defined over a square array of points, the values of the functions being dependent on specified pictures. In other words, the computation is done with respect to a specified picture. So, to specify a particular step in parallel processing, ve have to specify a function, a picture and a set of points where the values of the function are to be computed with respect to this picture. However, within the parallel processing schema, we cannot operate on individual points or even on sets of points by only on the entire array of points. The only way we can refer to a particular set of points is by constructing a character - istic__£icture of that set, i.e., a picture in which the points of the set have "" frj.n^'^S^' ^"^ ^^^ ^^^ ^"^^^ ^^^^g^ ^^^ s^^a^e a^^ay has a bit size of 4UX40 with a central picture area of 32x^2. -5- -6- the value 1 and all other points the value 0. Purely formally, then, we can say that each step in parallel processing consists in computing a given function vith respect to two pictures--the argument and the context , respectively- -and generating a third picture. To carry out such a computation we need at least 3 replicas of the basic square array. We will obviously need many more replicas to perform a sequence of such computations. Let us, then, visualize an entire column of such arrays, stacked one on top of another and assume that computations are performed within this set-up. This already provides a preliminary specifica- tion for a system structure to realize these computations. But we shall postpone till the end of this section further consideration of the details of this problem. Let S be a generic symbol representing these arrays and let particular pictures (i.e., specific arrays to whose points values have been assigned) be distinguished by the addition of subscripts. A step in parallel processing can now be formally represented by a statement of the form S, := F(S.,S.) with the following convention: l.h.s. is the resulting picture; the first symbol in the function (on r.h.s.) refers to the argument set (i.e., its characteristic picture) and the second symbol to the context. Sometimes, in defining a picture, the context may be left unspecified. In all such cases it is understood that the context is the universe , i.e., the picture with all P values equal to 1. As we shall see presently, the computations will, in general, depend not only on the context picture but also on certain given parameters. Thus the general form of parallel processing computation should actually be represented as follows: S, := F(S.,S.; parameter). 2-5. Some Special Functions for Picture Processing . Our next task is to define a set of functions in terms of which useful parallel processing routines can be developed. These functions will * It must be emphasized that this is just for notational convenience. These quantities should not be confused with subscripted variables in the sense of ALGOL - 6o . This is important to remember especially when we write programs in ALGOL-60 later on in this report. -7- clearly form a hierarchy in the sense that some of them will be primitive, others defined in terms of these (i.e., as routines involving these); and still others in terms of this new set and so on. In designing a computer to realize these functions one would naturally want the machine orders to fit into this hierarchy at a level such as to provide a good match between the programming language and the machine language. ¥e shall not, however, consider this problem in its complete generality here. In an appendix to this section we list a preliminary set of functions which we have arrived at on the basis of our work in picture processing. All the algorithms that have been developed so far can be efficiently described in terms of one or more of these functions . For our persent discussion we restrict ourselves to a consideration of these functions and introduce some additional notations and definitions towards this end. (As far as possible we use the terminology introduced in Report 12l) '. h 3 2 5 P 1 6 7 8 Fig. 1 Mark and Chain . For any point P, we shall denote by n(P) the set of 9 points consisting of P and its eight immediate neighbors in the array. The individual points of this set will be denoted by N.(P), i ^ 0, 1, 2, 5, oo., 8, where the subscript convention is as shown in Fig. 1. By a direction list (or direction or dir , for short) we shall mean an index string i-,i„...i with k < 9 and each i. =0,1,..., or 8, no index value being X d K — J repeated in the string. Using a direction list we can refer to a subset of N(P) as follows: Several of these algorithms were developed in conjunction with B. H. Mayoh and Ro K. Rice and will be reported on separately. A parallel processing simulator for IBM-709O to realize this set of functions has been written by James H. Stein and will be described by him in a separate report . -8- Z N.(P) = -Q Q = N.(P) for some i in the direction list ■> i£ dir If S is any picture ^ ve can define a context --dependent subset of N(p) as follows: N(P,S) = Jq I Q£N(p) and Q€ S^ . Clearly we can extend this notion of context -dependence to subsets of N(p) defined by a direction list. In terms of these sets^ the first two neighborhood operations listed in the appendix can be described. MARK (S; direction) = ^Q Q£ Z N^(P) and P £ S^ '^ i£ dir -^ CMARK (S^.S^; direction) = ^Q Q e MAE^ (S,; direction) and Q ^ S^ r . Thus, the operation MARK marks all those immediate neighbors of the points in S specified in the direction list. CMARK is a context-dependent operation which selects a subset of the above marked set which is also included in the context picture . Given a picture S and a point P in it, an i-chain , (i = 1,2,..., 8)^ R . . .R such that R -, k_ k k. 12m J ) for 2 < j < m. (For details and illustrations, see Report 121.) Clearly, an i-chain through P is a context dependent set » We shall dei CHAIN may now be described as follows^ GRAIN (S^^Sgj direction) through P is the longest line of points P, P., • • -P, such that P £ S for 12m j = l,2,...,m and R = P and R = N.(R ) for 2 < j < m. (For further 1 J J-1 itions, see Report 121.) a context dependent seto We shall denote it by co.(p_,s). The operation Q. Q £ w.(p,S„) for some i £ dir and some P £ S. -9- THRESHOLD : Denote by Weight N(P,S), the number of points in N(P,S) and by length oj.(p^s); the length of the chain w.(p^s) . We can now define the following new sets: tCnCS^^S^) > m) = Jp I P e S^ and weight N(P,S2) > m^ ; T(w.(S-,.S^) > ra) = ^P I P € S-, and length w.(p S^) > m^ . 1 1 2 — [^ \ 1 1^ 2' — J Here m is a positive integer. It is evident that these definitions can be extended to the general neighborhood operations MAEIK^ CMARK and CHAIN and to the other relational operators, =,<,>,<. This extension yields us the general THRESHOLD operation as given in the appendix. COMECT ; Given a picture S and a point P in it we define the k-th iterate of N(P,S), written as [N(P,S)] , by the following routine, (in writing this routine we anticipate some of our discussions in Sec. 3- of this report) ; Let us generate [N(P,S) ] in S, which Is assumed to contain, to begin with, P alone « begin for X : = 1 step 1 until k do S^ 1= N(S ,S) end In the above, by N(S ,S) we have denoted an obvious extension of the set N(P,S) to all points P in S » Define now a function C(P,S) = Jq for some k, Q e [n(P,S) ]^^ , i.e., the set of all points Q such that for some k, Q Is contained in the k-th iterate of N(P,S) . Clearly, C(P,S) defines the set of all points connected to P in the picture S. It is quite straightforward to extend this connectivity operation to the case where the function N(P,S) is replaced by the more general neighborhood operation CMARK. It is easily verified that CHAIN is actually a particular example of this more general connectivity operation. The operation CONNECT SET given in the appendix Is readily composed out of the function C(P,S) defined above. -10- ORD^ING^ Superimpose an x-y coordinate system on the square array in the obvious manner. Let x(P) , y(p) denote the x,y coordinates of P. Using these ve can now order the points of the set S as follows: for P^, P^ e S ve shall write P^ < P^ ("is smaller than") provided, x(P^) < x(l>^) or x(P^) = xCPg) and y(p^) < y(p^) . We can now refer to the first (i.e., smallest) point of S and last (i.e., largest) point of S. It is clear that many of the concepts of pointset topology can be borrowed for our use. For example, in a quite straightforward manner, we can define the notion of a simply-connected region, a rectangle, a rectangular cover for a set S and so on. -It is clearly possible to define parallel processing operations involving these. However, for our immediate purpose these additional functions are not required and hence we shall not discuss their implementation here. 2-^° A System Structure for Machine Realization. In 2.2 above we have already seen that the most natural machine organization to realize parallel processing computations consists of a stack of two-dimensional registers (referred to as planes ) arranged one on top of another in the form of a column, each being a replica of our basic domain of operation, i.e., the square array. In terms of the special functions we have been discussing in 2.3, it is evident that the control unit associated with this stack should be capable of performing certain primitive set-operations and thresholding operations. Consider now a stack consisting of m planes. Denote by z(p), the m-bit word consisting of the point P in each plane; (see Fig. 2). As has already been mentioned, in picture processing, typically, we start with the original picture in some plane (say, plane S^) and, by well-defined algorithms, we assign labels to each point P of this picture (i.e., we generate a sequence of pictures S.^, S.^, ..., each corresponding to a particular computed label). Thus, at any moment during the processing, the word z(P) contains all the -11- ;-word ^ Control Coordinates z(P), -^ J m < — 5 Input Output Fig, 2 presently generated labeling information about the point P. The natural thing to do would be to make use of this information in determining the course of the processing sequence. The facility required to be able to perform such conditional branching operations is the ability to read the vord z(p) for any specified point P. Closely related to this requirement isthe ability to list the coordinates of a specified set S of points. Figure 2 shows in a very rudimentary form a system organization for a parallel processing computer. It will be seen that^ schematically, this organization is almost identical to that described by McCormick in Report 122 {see footnote in Sec. l) for the design of the Pattern Articulation Unit. In this actual design, the division of the stack of planes into a "computing" part (the stalactites) , and a storage part ( the transfer memory from which the z-words are readout) , has been motivated solely by hardware considerations and by the resulting simplification in circuit realization. From his treat- ment it will also be evident that the order code and the micro-operations discussed at length in his report form a complete set of primitives to realize all the special functions we have been considering. All this, of course, is UNIVERSITY Of ,aWOI8 UBRA8X -12- not totally surprising since both these efforts stem from the sa^e set of preliminary studies in picture processing. But what is of great interest is that a system organization arrived at from micro-considerations (i.e., hardware/circuit oriented) and one arrived at from macro-considerations (i.e., problem oriented) should both turn out to be so nearly identical thus shoving that the resulting design is canonical, in some sense, for the class of problems under consideration. (Note APPENDIX TO SECTION 2 A PRELIMINARY LIST OF FUNCTIONS FOR PICUTRE PROCESSING S^.Sg.S are pictures, not necessarily different. For explanations about the functions, see text. A complete description of all the functions, including those mentioned only by title in this list, will be published separately by J. Stein, along vith an account of his IBM- 7090 simulator.) Group A; Set Operations 1. S^:=0 2. S, :=S2 3. S^:=S2 k. S^ ==82*83 5. 3^:= 82*83 6. 8,1=82-83 7. 311=82^83 3-roup B: Nen -ghborhood Operations (Note: (i-e., S^ ^ S^) (i.e., S2 0S) 8. S^ := MARK (s^; direction) 9. S^ := CMARX (S^,Sy direction) 10. S^ — CHAIN (S2,Sy direction) 1. direction is to be specified by a direction list of the form i^ig. . .i^ where k < 9 and each i^ = 0,1, . . .,7 or 8, without repetitions. 2. In (9) and (lO), S^ is the argument and S , the context.) Group C; Threshold Operations . 11. S^ := THRESHOLD (Weight Function; Relational Operator; m) . where: Weight Function ::= MARK | CMARK | CHAIN . Relational Operator ::=<|<|=|>|> m is a positive integer. ~ ~ -13- _14. (Note: In a threshold operation, always , S^ c s^ where S^ is the argument in the weight function.) Group D: Boolean Operation . 12. If S^ = then 13. If S^ / then Group E; Connectivity Operation . 1^. COOTECT (P,S ) 15" COMECTSET (P.S^jS ) (Note: P is a source point; S^ is a tag or lahel. S^ is a sink, usually a set of (connected) sets. In (ik) , all points in S^ connected to P are marked. In (15); the members of S connected to P by the label S are listed. (See below for list.)) Group F: List Operation . 16. LIST POINTS (Sj 1 17= LISTSETS (S^) (Note: In (16), the coordinates of the points in S are listed. In (17), S is a set of (connected); set$ and the operation lists one representative point for each set in S ,) G roup G: z-Read Operation . 18 „ Read z(P) . Group H: l/O Operation . 19 " Input 20. Output . (Note: These are picture input/output operations.) 5. A PROGRMiyCnNG LANGUAGE 5ol. The Structure of ALGOL - 60 . In Section 2, from a detailed consideration of the parallel Processing functions required for operating with pictures^ ve arrived at a rudimentary structure for a computer to carry out these operations under programmed control. To complete the task of formalization of picture pro- cessing algorithms, it is now necessary to describe a formal programming language in which such a computer can "be programmed. As we remarked in the introduction ; a natural approach would be to examine whether this formal language could be obtained as a suitable extension of some already well- developed programming language. In this section we shall try to accomplish this by using ALGOL-6O as our base language. But before attempting this, let us first recall that our motivation throughout these discussions has been two-foldi (1) to develop a formalism to describe picture processing; (2) to define a computer structure which would be a good match to the structure of our processing algorithms. With regard to (2), we have already reached some definite conclusions on the basis of our considerations in the previous section. Thus, in trying to extend ALGOL-60 to suit our purposes, we should want the extension to fit into this ground that has already been partially prepared . To do this, we shall first study the structure of AIjGOL-60 from the point of view, so to speak, of a system designer. Table I gives such an analysis. The colimin on the left is an approximate type-classification from the system view point. The middle column lists the syntactic categories of ALGOL-60 and that on the right, some of the implied semantics. The hierarchic levels of the language are immediately evident from the table. An analysis such as this also highlights very clearly some of the inherent inadequacies of the language, as at present constituted, both to match the algorithms it has been set up to specify and to match the structure of the class of computers presently available to realize the algorithms. Since some of the points are of broad, general interest and also have a bearing on our overall approach, we shall digress a little to discuss these. To begin with, it is clear that this language is designed preeminently to describe the algorithms of arithmetic computations. However, the power and -15- -16- ALGOL-60: Structure lo Primitive Symbols: 2. Primitive Operands: 5c Primitive Operations : 4o Primitive Functions: 5 . Primitive Subroutines; 6. Routines: lo Letters 2o Digits 3. T- values i|. Punctuations 1. Identifier 2 . Number 3. String 1. Arithmetic 2. Relational 3 o Logical 1. Arithmetic Expression 2. Boolean Expression 3 • De s 1 gnat 1 onal Expression 1. Assignment Statement 2 . Goto Statement 3. Conditional Statement h o For Statement 5 . Procedure Statement 6 . Dummy Statement 1. Block Simple variable^ array, label; switch; procedure + - X / 7 t < < = > > \ = 3 V A ■ Computes a number Computes a T- value Computes a label Input Specification Declaration: 1. Type declaration 2. Array declaration 3. Switch declaration k. Procedure declaration TABLE I -17- flexibility of the language in this respect are severely circumscribed by the exclusive restriction of its primitive operations to scalar operations. Thus vector and matrix operations can only be described ^thin the language in terms of the operations on their components. This limitation becomes all the more acute vhen it is realized that, at the operand level, the language, even as at present constituted, is able to point to and name non-scalar quantities. It might be argued that this is not as serious a limitation as d.- might seem at first since the language is intended as an input language for computers vhich themselves are capable of only scalar operations, A little consideration will, hovever, show that this argument is deficient in several respects. Firstly, this would imply that ALGOL-60 is in fact a machine-oriented language, (vizo, to the class of existing arithmetic computers), contrary to the pre- vailing opinion. But, even granting this, it will be seen that the present version of the language is ill-matched to the existing structure of these machines; for, practically all these machines are capable of performing some vector operations on binary vectors (like, logical sum, logical product, cyclic permutation, etc.) and, as we have just seen, these operations cannot be : : -.. expressed within the language except in a cumbersome way. These observations are, of course, not very original and most of these limitations we have been discussing are quite well known. But it is our view that the significance of the inadequacies is especially perspicuous when the language structure is viewed simultaneously from the points of view of system design and algorithmic descriptions, JoS, A Formal Extension of ALGOL-60. Table I also shows clearly the directions in which extensions both to the language and to a computer might profitably be attempted to improve the matching of their respective internal structures. For a given language structure, it also provides a basis for comparing two different computers as regards the efficiency with which they match that language. However, our main concern here is to consider a particular extension of ALGOL-60 in order to match efficiently descriptions of picture processing routines with a parallel processing computer whose structure we have already outlined. In Table II we have indicated one such extension to ALGOL-60. The notations in this table correspond to those in Table I and only the additions ■18- Extenslons to Picture Processing 2. Primitive Operand : 1. Identifier 3. Primitive Operations : 4. Picture operations ^o Primitive Functions: h-. Picture Expression 60 Routine: Picture^ direction Sum, product, complement mark, threshold, list, etc . Computes a picture » Boolean expression can "be extended to include picture expressions; e.g.. If clause: := If (< picture expression> = O) then Input Specifications : lo Type declaration: : = real | integer | Boolean | picture 5 . Direction Declaration TABLE II have been shown » As might have "been expected, ve have incorporated in the language Picture as a nev structured operand and have included the primitive operations required to realize the functions we have so far considered. Thus, a simple variable can identify a picture and must be declared to that effect in type-declarationo It is clear that a picture expression can be recursively defined completely analogous to an arithmetic expression » It is also clear that a Boolean expression can similarly be extended to incorporate picture expressions. We shall not consider the formal details here. Direction is introduced in the language somewhat like a switch « The following formal definitions should make this clear: < direction identifier > < direction number > < direction list > < direction declaration> = < identifier > = I 1 I 2 I 5 I ^ I 5 I ^ I ^ 1 8 = < direction nimiber > | < direction list > < direction number > = direction < direction identifier > Values can be assigned to a direction by means of an assignment statement in the usual way: ■19- direction identifier : = direction list . It will be noticed that ve have made no special provision to avoid repetitions in the direction list. This, however, is of no great consequence since the semantics can be set up to ignore any such repetitions that might occur. Also, to describe the "components" of a direction individually, it might be of assistance to introduce an additional definition: ::= [] . Clearly, a required semantic restriction is that a direction component exists for a particular direction identifier only if the corresponding direction number is included in the direction list that has been assigned to that identifier. It is readily verified that this extended ALGOL-60 is quite adequate for the formal specification of all the picture processing functions we have considered so far and the routines based on them. 3.3. Examples of Picture Processing Routines . Since our principal aim in providing these examples is one of illustration, we shall not attempt to be rigorously formal in the use of the language o We shall make explicit use of the functions listed in the appendix to Section 2 and shall also not trouble to indicate set operators by any special symbols, in as much as their use should be clear from the context. ^cam£le_l: To label a-roads in a given picture S^. It is assumed that the width of roads < k. (See Report 121..for explanations by the algorithm. a~ is the right -diagonal direction.) The roads are labeled in S . begin S, : = ; for K : - 1 step 1 until h do :begin Sg — THRESHOLD (CHAIN (S^,S^;i|8) = k) ; S^ := THRESHOLD (CHAIN {S^,S^;26) > 2 K") ; ^4 ° = ^5 + S|^ end ; S^ := CHAIN (S^,S^;26) end -20- Exainpl e_^; Given a picture S^, remove P if N^(p) and N (p) are present and ^^{F) is absent. This is one step in a thinning routine that has been used with some success. begin S^ := THRESHOLD (CMARK(S^,S^; 5?) = 2) ; S^ := THRESHOU) (CMARK (S^,S^; 2) = O) ; Sg : = S2 -^ S^; S^ := (S^ - Sg) end Example 3: Let S^ be the picture of a road, say a north-south road. ¥e wish to mark the "center-line" of this road in Sg. (The "line" will have a thickness < 2) begin Sg • - S^; 1: S^ 1= THRESHOLD (CMARK(S2,S2;015) = 3); Si, •= (Sg - S^) ; S^ :- THRESHOLD (C]MARK(S^,S ;15) = l) ; If (S = 0) then goto 2; Sg "= (Sg - S )j goto 1; 2: end k. APPLICATIONS TO OTHER AREAS k.l. Address Computation in Associative Memories . As ve pointed out In Section 1^ having developed a formalism to represent parallel processing algorithms exclusively within the context of computations on pictures, it is natural to wonder whether the formalism has any applications to problems arising in other areas . In this final section we shall show that problems arising in at least one other area fall within the class of computations we have been discussing. These are problems which require computations of addresses in an associative (ice., content-oriented) memory. In a recent paper Falkoff has considered this class of problems at length and has suggested definite algorithms for parallel-search of these memories. His is by far the most comprehensive treatment of the problem that we know of and we shall take that as our point of departure . In what follows we shall show that all the computations performed by his algorithms are strictly within the scope of the parallel-processing schema we have been outlining and hence can be readily handled by the formalism developed for this purpose. Consider an associative memory of r locations. With each location is associated a tag word of n bits, say. Call the tag word associated with location k, T, . T is a binary vector of dimension n, for k = l,2,.o.,r. In a simple search, (based on equality) , the main problem is the computation of a function of two given binary vectors of dimension n each. These are referred to as the mask (m) and the argument (x) . The value of the function is an index set S such that, for th th k = 1,2, o . .r; k e S "#=^ 1 bit of T = 1 bit of x for each 1 th such that 1 bit of m = 1. The significance of this search is obvious. It identifies those memory locations whose tagwords coincide with the argument word at all bit positions identified in the mask word. Falkoff specifies several algorithms to compute this function using the notation of Iverson's programming language. Let us * A. D. Falkoff: Algorithms for Parallel Search Memories; Jour. A. CM. 9 (1962), 1+88-511. -21- -22- first show that within the framework of the parallel processing computer introduced in Sec. 2 (see Fig. 2) this computation is almost trivial to carry out . We shall arrange the associative memory structure as follows: each point P of the square array stands for a distinct memory location. Thus an rxr array can represent r^ locations. Let the computer have m planes in the stack, (m > n), and let the first n bits of each z-word, z(P), be the tag word associated with that memory location. Thus each of the planes S , ... S contains one bit of the tag word of all the r^ locations. Writing x[i] and th m[i] for the i bits of the argument word and mask word respectively, the following simple routine, clearly, computes the value of the address function of a simple search. Let the result be computed in plane S , say: begin S : = : m ' S : = S ; m m for i : = 1 step 1 until n do begin if m[i] = 1 then T^egin if x[i] = 1 then S i^ S ■^ S. else S : = S ^ S. end — — - m m 1 — — end end A list operation will now list the coordinates of the memory locations which are the result of the search. This routine corresponds to the serial-by-bit algorithm of Falkoff . Next, Falkoff considers algorithms for what he refers to as complex searches. For these, the tag words are looked upon as binary numbers and the search is based on comparisons on the magnitudes of these numbers. Specifically he treats search operations based on selecting the locations [k} with tag word \ > T_^ for all -^ = l,2,,o,,r „ Similarly, for < replacing >; the locations whose tagwords lie within specified limits and so on. All these algorithms are based on the positional notation of number representation and involve systematic path computation in the search tree depending on the states of the tag words at each bit position. It is clear from our earlier discussion and the structure of the parallel processing programs that all these address -23- computations are perfomed with exceptional ease with a computer set-up such as the one ve have been considering. "To exhibit this explicitly, we shall consider here the address -computations based on maxima- comparison. For definiteness, let us suppose that the tag words have their most significant bit position at plane S^. Let us introduce a Boolean fiinction on pictures called WEIGHT(s) = 1 whose value is True if S contains exactly one point and False otherwise. Clearly, this computation can be readily made using the list operations already introduced. The required program can now be written using this function. ¥e shall again compute the result in S . m begin S i= : ' ' m ' m m' for i I = step 1 until n do begin if S. / then begin S := S * S. : ■ m m i ■' if WEIGHT(S^) = 1 then goto 1 end end; li end One major aspect of information retrieval- -the so-called "reference -providing" aspect--involves computing complicated Boolean functions on tag words. In concluding this section, let us remark that all such compu- tations are performed with maximum speed and ease within the frame work of a parallel processing schema of the type we have been discussing in this paper. ■3f ^- * -Sf UNIVERSITY OF ILLINOIS-URBANA 510 84 lUR no C002 no 131 140(1963 Internal report / 3 0112 088397689