255 12 265MB
English Pages 635 [654] Year 1974
A. GUNTHER, 8. LEVRAT and H. LIPPS editors
international computing symposium 1973
north-holland /american elsevier
INTERNATIONAL COMPUTING SYMPOSIUM 1973.
International Computing Symposium 1973
Proceedings of the International Computing Symposium 1973, Davos, Switzerland, 4-7 September 1973
held by The European Chapters of the Association for Computing Machinery (ACM) under the patronage of the Swiss Federal Councillor H .P.Tschudi
edired hy
A. Gunther,CERN, Geneva B. Levrat, Cl.CE., Univasity of Geneva H. Lipps, CERN, Genei·a
1974 NORTH-HOLLAND PUBLISHING COMPANY - AMSTERDAM• LONDON AMERICAN ELSEVIER PUBLISHING COMPANY, INC. - NEW YORK
© NORTH-HOLLAND PUBLISHING COMPANY, 1974 All rights Reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the Copyright owner.
North-Holland ISBN: 0 7204 2097 0 American Elsevier ISBN: 0 444 10596 4 Library of Congress Catalog Card Number 73-91449
PUBLISHERS:
NORTH-HOLLAND PUBLISHING COMPANY - AMSTERDAM NORTH-HOLLAND PUBLISHING COMPANY, LTD. - LONDON SOLE DISTRIBUTORS FOR THE U.S.A. AND CANADA:
AMERICAN ELSEVIER PUBLISHING COMPANY, INC. 52 VANDERBILT AVENUE NEW YORK, N.Y. 10017
PRINTED IN THE NETHERLANDS
PREFACE The International Computing Symposium 1973 was the third in a series organized by the European Chapters of ACM. Arranged by Europeans primarily for Europeans, the Symposium - despite its title was intended to present a realistic picture of the current state of computing in this continent. At the same time, an effort was made to bring together people representing a broad spectrum of interests in computing, so as to encourage a large exchange of ideas. There was thus every reason for the Programme Committee to accept interesting contributions from any field and from no matter which country. These proceedings contain nearly all the papers, contributed or invited, presented at the Symposium, with the exception only of a few for which no text was provided. To allow fast publication, the papers have been reproduced by photo-offset from the typescripts submitted by the authors. When the Swiss Chapter of ACM asked the Federal Councillor H.P. Tschudi to patronize the International Computing Symposium 1973, he at once responded most positively. The Chapter and its two committees wish to take this opportunity to record their sincere thanks for the support given by Councillor Tschudi and by the Swiss Confederation. Many people worked in the preparation and running of the symposium; it is a pleasure to acknowledge their efforts, as well as the support of their institutions. Local arrangements were greatly helped by the Davos Congress Centre, where all went out of their way to meet our requirements. Acknowledgement is also due to the firms that provided financial support. Particular thanks go the publisher for the speedy publication of these Proceedings. The decision to hold the Symposium in a mountain resort at such a time of the year involved a calculated risk. In the event, it proved well worth taking and all the participants will long remember the beautiful surroundings, seen at their very best in the wonderful September weather. The Editors
Programme Committee B. Levrat, Universite de Geneve (Chairman) K. Bauknecht, Universitiit Zurich L. Dadda, Politecnico di Milano J.J. Duby, IBM, Paris E. Engeler, ETH, Zurich E. Gelenbe, LR.I.A., Paris · G. Goos, Technische Universitiit, Karlsruhe J.J. Stetter, Technische Hochschule, Wien F.H. Sumner, University of Manchester N. Wirth, ETH, Zurich P. Zanella, CERN, Geneve Symposium Committee H. Lipps, CERN, Geneve (Chairman) H.M. Bachler, IBM, Zurich K. Bauknecht, Universitiit Zurich R.H. Baumgartner, IBM, Ruschlikon A. Gunther, CERN, Geneve B. Levrat, Universite de Geneve F.L. Nicolet, Contraves, Baar F.T. Parke!, ETH, Zurich H. von Eicken, CERN, Geneve C.A. Zehnder, ETH, Zurich The European Chapters of A CM wish to acknowledge the support of the Symposium by Brown, Boveri & Cie A.G., Baden Gebr. Sulzer A.G., Winterthur Individual Computer Systems A.G., Basel IBM Schweiz, Zurich Oerlikon-Buhrle A.G., Zurich Schweizerische Kreditanstalt, Zurich
CONTENTS
OPENING SESSION Chairman: H. Lipps The future of higher level languages (in teaching), (invited paper) A. Ralston THEORY OF COMPUTATION Chairmen: H. Stetter (Plenary Session) E. Engeler (Parallel Session) Description of processes, (invited paper) P. Deussen
11
General context-free parsing in time n2, M. Snelling
19
Recursive functions not dependent on the computational rules, G. de Michelis
25
Listing the functional digraph structures, C. Bohm, M. Dezani-Ciancaglini
33
Functions describing interactive programming, I. Kupka, N. Wilsing
41
PROGRAMMING METHODS Chairmen: S. Crespi-Reghizzi (Plenary Session) N. Wirth (Parallel Session) From programming techniques to programming methods, (invited paper) N. Wirth
47
Some experiments in improving program documentation, R.S. Scowen, A.R. Lawrence
55
Programming by selection, H. -J. Hoffmann
59
Holon programming, P.A. de Marneffe, D. Ribbens
67
PROGRAMMING LANGUAGES Chairman: M. Tienari (Parallel Session) ALEPH, A Language Encouraging Program Hierarchy, R. Bosch, D. Grune, L. Meertens
73
Interactive structured programming, R. Schild
81
Identification of syntax-directed translation schemes, A. Celentano, P. Della Vigna, C. Ghezzi, F. Tisato
85
COMPILERS Chairman: H.J. Hoffmann (Parallel Session) The methog of structured programming applied to the development of a compiler, U. Ammann
93
Optimized translation process, application to ALGOL 68, P. Branquart, J.P. Cardinael, J. Lewi
101
The NAG library and its special function chapter, J.L. Schonfelder
109
A method for defining and implementing PL/ 1, P. Chatelin, B. Willis
117
OPERATING SYSTEMS Chairmen: G.R. Macleod (Plenary Session) R.M. Needham (Parallel Session) Protection - A current research area in operating systems, (invited paper) R.M. Needham The formal semantics of operating systems, E.J. Neuhold Deadlock prevention in real time systems, A. van Lamsweerde ORION - The OMEGA remote interactive on-line system, R.D. Russell, P. Sparrman, M. Krieger
123 127 135 143
CONCURRENT PROCESSES AND RESOURCE ALLOCATION Chairman: J.D. Haupt (Parallel Session) Description and asynchronous implementation of control structures for concurrent systems, F. Grandoni, P. Zerbetto A semantic approach to the theory of parallel processes, G. Belpaire, J.P. Wilmotte An approach to the communication and synchronization of processes, H.A. Schmid Approximate "open" priority queue model for determining total delay including overhead in a real-time virtual memory system, P.A. Johnson
151 159
165 173
SIMULATION AND SYSTEM MEASUREMENTS Chairman: E. Gelenbe (Parallel Session) An interactive facility for process-orientec;I simulations, K.G. Muller
179
Selecting the components of multi-purpose computer systems, S.E. Sutcliffe
187
OSSYOSCOPE: System on auxiliary processors for measuring operating systems, L. Boi, J.P. Drucbert
195
COMPUTER DESIGN Chairman: F.H. Sumner (Plenary and Parallel Sessions) Hardware innovation and computer design, (invited paper) D.B.G. Edwards
201
System design for scientific computation, B.D. Shriver
211
Multiunit register-transfer networks and pipeline concurrency, J.C. Huang
217
Fault-tolerant computing by using residue number systems, F. Barsi, P. Maestrini
225
High performance input/output channels, H. Spreen
231
MICROPROGRAMMING Chairman: D.G.B. Edwards (Parallel Session) The significance of microprogramming, R.F. Rosin
237
Microprogramming. A hardware point of view, P. -E. Danielsson
243
Logical organization of a problem-oriented microprogram-controlled processor, N. Haff
25 1
Procedural decision tables and their implementation, R. Thurner, K. Bauknecht
259
NETWORKS Chairman: M. Engeli (Parallel Session) Synchronization problems in a computer network, M. Somia
265
Introduction to POLI network design, C. Ghezzi, G. Le Moli, L. Mezzalira
27 1
"DATAPORT" - A control system for computer networks designed by the Inland Revenue (Finanzverwaltung) in Nordrhein-Westfalen, M. Molloy
279
ON-LINE APPLICATIONS Chairman: F.L. Nicolet (Parallel Session) So, A low level systems implementation language, B. Krieg, R. Gnatz, R. Hoellerer
285
CARINE - A multi-user real-time system for control and data acquisition of neutron beam experiments, A. Barthelemy, W. Kaiser, M. Le Sourne, M. Taeschner, P. Darier, A. Vinit, J.J. Girod
291
Process control system for test stand data acquisition and control in an automotive company, R. Bender. H. Reiter
299
NUMERICAL MATHEMATICS Chairman: H.J. Stetter (Plenary and Parallel Sessions) Problems related to the numerical treatment of stiff differential equitions, (invited paper) G. Dahlquist
307
On the control of floating-point mantissa length in iterative computations, M. Tienari
315
Computing analytical functions by means of power series or continued fractions, J. Patry, S. Gupta
323
The method of moments. A class of methods for the solution of nonlinear equations and systems of equations, D. Trigiante, S. Ciucani
331
APPLIED MATHEMATICS Chairman: G. Dahlquist (Parallel Session) La methode frontale pour la resolution des systems lineaires, M. Fremond
337
Finite-element-type solution of integral equations, R. Wait
345
An application of optimal control theory to a problem of hydrodynamics, J. Henry
349
PATTERN RECOGNITION METHODS Chairman: P. Zanella (Plenary and Parallel Sessions) Problems in automatic pattern recognition, (invited paper) H. Kazmierczak Reconstruction of binary pattern from a few projections, G.T. Herman Using the minimum spanning tree to recognize dotted and dashed curves,. C.T. Zahn Resultats recents concernant la methode des nuees dynamiques et application a la recherche de profils biologiques, G. Sandor, E. Diday, Y. Lechevallier
357 371 381
389
PATTERN RECOGNITION APPLICATIONS Chairman: H. Kazmierczak (Parallel Session) Computer identification of white blood cells, P.W. Neurath, J.F. Brenner, W.D. Selles, E.S. Gelsema, B.W. Poweil, G. Gallus, E. Vastola
399
Approaches to computer analysis of polio infection in HeLa cells, H.M. Aus, K. Kaschel, V. ter Meulen, P.H. Bartels
407
Identification of digitized particle trajectories, H. Grote, M. Hansroul, J.C. Lassalle, P. Zanella
413
COMPUTER-AIDED DESIGN Chairmen: F.H. Sumner (Plenary Session) I. de Lotto (Parallel Session) Sparse matrix techniques in computer-aided design, (invited paper) I. de Lotto, G. Pierini, P. Tiberio
423
Perspecitve geometry and computer graphics: Techniques a'nd applications in computer-aided design, J.W. Demic
435,
Interactive computer aided design of control systems, K.C. Daly, G.C. Goodwin
443
Computer-aided design of the layout of integrated circuits (CADLIC), H. Klamet
45 1
COMPUTER GRAPHICS Chairman: J. Nievergelt (Parallel Session) A. language for 3D graphics applications, M.E. Engeli
459
Optimizing curve segmentation in computer graphics, K. Reumann, A.P.M. Witkam
467
Finger input to a small graphic system, G. Vuilleumier, M. Sarret
473
COMPUTER-AIDED INSTRUCTION, COMPUTER EDUCATION Chairman: H.P. Frei (Parallel Session) Application of mathematical models of learning in the decision structure of adaptive computer-aided instructional systems, J.H. Laubsch, A. Chiang
481
Generative CAI in high school algebra, T.J. Gilkey, E.B. Koffman
489
The automation of introductory computer science courses, J. Nievergelt, E.M. Reingold, T.R. Wilcox
495
INFORMATION STORAGE AND RETRIEVAL SYSTEMS Chairmen: B. Levrat (Plenary Session) E.J. Neuhold (Parallel Session) Real time systems in administrative data processing, (invited paper) C. Toulet
503
Automatic file compression, J.P. McCarthy
5 11
A system for the definition of the syntax and semantics of data description languages, G.L. Wolfendale
517
Self-contained facilities to process sub-structures of more complex network structures, T.W. Olle
527
DATA BASES Chairman: J.J. Duby (Parallel Session) Retrieval in a set-theoretically structured data base: Concepts and practical considerations, K. -D. Kriigeloh, P.C. Lockemann
533
Specifying data base systems, J.J. Florentin
541
The prospects for large capacity set support systems imbedded within generalized data management.systems, W.T. Hardgrave An experimental query system: SYNTEX, A. Artaud, J.M. Nicolas
549 557
MEDICAL APPLICATIONS Chairman: L. Dadda (Parallel Session) Reliability of the ECG-interpretation by seven different computer-programs compared to that of three cardiologists, J. Meyer, K. -W. Heinrich, W. Merx, S. Effert
565
A method of sequential selection for information capture in a real-time information system, K.F. Bowden, G.I.L. Grafton, LR. MacCallum
575
Structure and functions of the patient data bank in the medical system Hannover, K. Sauter
585
NON-NUMERICAL APPLICATIONS Chairman: S. Crespi-Reghizzi (Parallel Session) Heuristic programming techniques applied to chemical mass spectrometry, A. Delfino, B. Levrat
591
Theme searches in French texts, P.A. Fortier, J.C. McConnelli
599
Synthesis in dynamic models, J.A. Richter
605
CLOSING SESSION Chairman: B. Levrat Past, present, and future in the computer world, (invited paper) M.V. Wilkes LIST OF PARTICIPANTS
615 621
A. Giinther et al. feds.), !ntema1io11al Computing Symposium /971 © North-/lolla11d Pub/. Co., 1974.
/11vi1ed paper
THE F'UTURE OF Hir.HER LEVEL LANGUAGES (IN TEACHING) Anthony Ralston
State University of New York at Buffalo Amherst, New York, U,S,A, Despite numerous competitors and despite the efforts of some very distinguished people, Fortran, almost 19 years old, continues to be the predominant language for scientific applications and for teaching in the United States, And the situation in Europe is not very different, Why is it that the past decade has seen so little actual change in this picture? Will the near or far future see substantial changes in this picture? What can be done to make professors profess and programmers use languages better suited to their purposes? This paper seeks neither to bury Fortran nor to praise it but rather to answer these questions in the context of the world as it is, not as we might perhaps like it to he, 1, INTRODUCTION
being One of the perquisites of President of ACM is invitations to speak at conferences such as this one and not only to speak but to speak on subjects of my own choosinq, even sub7ects I know nothinq about! In the case of MY topic for today, the parenthetical part of the title indicates the area I think I know somethincr about - teaching - and the rest represents an area where I, like everyone else in computing, have strong opinions, Since these opinions are more likely to be controversial - at least, unpopular in Europe than in America, it is quite appropriate that I air them at ICS73,
Revolution is the stuff of computing, In 25 years we have witnessed numerous major revolutions: the electronic computer itself
stored
program
revolutions various hardware epitomized by the "Generations" terJl\inolocry which is so familiar and, most recently, by large scale integration
revolutions in mode of use from console to batch debugqinq proc�ssinq to time-sharing
from software revolutions in binary to assembly absolute language to Fortran and higher level lanquages,
It would be foolhardy indeed to believe that there are not more revolutions in store for us. And yet my thesis here is founded on an assumption, whose truth I believe, although many will not, that there will be no more revolutions in higher level languages, at least in that category usually called general purpose hiqher level languages, Or, in other words, the state of the world of general purpose higher level language usage is very stable with a high degree of inertia and, for better or worse, there is little or nothing on the software or hardware horizon which will greatly or quickly change that state,
If this is true, there are some for both implications considerable researchers in the general area of higher level lanquaqes and for teachers of introductory computer science courses involving higher level languages, Much of this paper will concern these implications, In particular, I shall discuss my belief that the unwillingness of many leading experts and researchers to accept my thesis and its implications carries with it the real possibility of turning these pundits into pedants, 2, FORTRAN AND THE PUNDITS
Although my education and most of my research have been in numerical analysis, I have for 15 years now been considerably involved with basic teaching computer undergraduate courses in science, Except for the very first such courses I taught, all these courses have
OPENING SESSION
2
been hiqher level lanquage based , usually, hut not always , Fortran based. For some years I have found myself on the defensive about the use of Fortran in such a course particularly in discussions with sen ior computer researchers in the general area of programming languages , all of whom are supporters of other other languages than Fortran , languages than Fortran. is only rather recently that I have realized that there is no need to be defensive or diffident on the subject of Fortran and , therefore , today I intend to be offensive - perhaps in more ways than one about Fortran. I come then ne ither to bury Fortran nor to praise it but rather , warts and all , to put it in an appropriate context.
tny I
Still one cannot hide from the fact that the pundits of software have said some crue l thinqs about Fortran. "Fortran is dead" proclaims one [ B J . The " people responsible fnr it deserve our areat admiration " but "the sooner we can forqet that Fortran ever existed , the better " , says another [ 2 ] . It is "a vox populi a language of the streets • • • and it can be absorbed informally through conversations in din ing halls or from thoughts scribbled on the walls of publ ic toilets" , says a third [ 7 ] .
Some strong words are these. Are they appropri ate , even in j est? I think not. I do believe that , among all the languages one can reasonably propose for a first course in computer science , Fortran is probably the poorest using almost any metric on language quality you m ight propose. But I shall argue quite strongly that in such a metric the " distance " of Fortran from other languages is not great , certainly not areat enough for it to merit the opprobrium which has been heaped upon it or to disqualify it as a vehicle for teachi ng students about programming and computer sc ience. 3. FORTRAN TODAY
Recently the author of a computer language text sent a questionnaire to 5 2 of the leading universities i n computer science in the United States which asked various questions about the teachinq of basic undergraduate courses in computer science [ S J . The thirty-n ine received 35 , 0 0 0 covered questionnaires about students per year i n the first course i n computer science. A lthough the data is not entirely specific or definitive about
the language or languages used at these universities , the estimates for the maj or language taught to these students are 7 0 % Fortran , 1 3% Basic , 8 % PL/I and less than 3% for APL, Algol , Cobol ( ! ) and assembly language (! ! ) . (It is, I must admit, a source of ama zement to me that some students are still introduced to computers via assembly language , a practice which , while common 1 0 to 1 5 years aqo , should b y this time b e used only by those who wish computers to remain arcane and unapproachable by all except a select few. )
The dominance of Fortran is probably no great surprise to any of you. Indeed , of course , the true dominance of Fortran in the Un ited States is substantially greater than the 7 0 % f igure because , at less prestigious , less computer science oriented colleges and universities, the tendency to play it safe with Fortran is much greater than at leading universities.
More important probably than the percentages I have given is the trend. S i nce not much in the way of comparable data is available , it is dangerous to be too positive here. It is clear , I think , that Fortran ' s dominance of the f irst course in computer science has decreased somewhat in recent years. But this decrease and the conclusion to be drawn from it is rather akin to the erosion of IBM ' s percentage of the world market in computing ; yes , the percentage has decreased but , no , there is no sign of any end to the basic dominance. · Indeed , j ust as it has been predicted that competition with IBM will prove too much for some more or all of its leading competitors in the current decade , there is some danger that Fortran , too , may drive out or at least reduce to insign ificance - some or all of its main competi tors. To some this will sound like a Gresham ' s Law of programmi ng languages. The I BM-Fortran analogy is , in fact , more apt than might at first appear because the reasons for the dominance of both are quite simi l ar in various senses , a theme I shall return to later. What about these competitors? Is the appropriate question not "Is Fortran dead? " but rather "Is PL/I dead? " ? Or was it, in fact , ever alive? Of course it was and is and , I think , will continue to be. It may even increase its "share of the market " , But there are , I believe , almost no signs that PL/I will
The future of higher level languages ( in teaching )
be a ser ious competitor to Fortran in the forseeable future for the large maj ority of scientific programmers. And a simi lar statement can certainly be made about other algebraic languages l ike A lgol and Basic. P erhaps , however , since this is Europe , I shou ld say a word about Algo l which , of course , has al ways been much more popu lar - in the sense of being much more widely used in Europe than in Amer ica . But , un less my only occasionally close-up view of the European scene is much d istorted , it seems rather clear that Fortran has not on ly overtaken A lqol in Europe but also that it continues to make sizab l e qa ins.
APL is a lanquaqe which deserves some mention here. At one time in the United States the APL scene seemed quite analogous to a rel ig ious movement fu l l of fanatics on one side and heretic-burners on the other. In recent years , however , the fervor of the APL votar ies has outwardly , at l east - lessened and the opposition has become more temperate. The man ifest usefu lness of APL in a variety of settings and for a variety of appl ications has become clear to many but few bel ieve that APL is so generally useful that it is l ikely to attain more than a rather modest share of the market.
Final l y , I must , alas , say a few words about Cobol . Cobol , of course , is not and never has been viewed as a competitor of Fortran. It is pertinent To put her e , however , for two reasons. what I have to say in context , I should state my firm opinion that , wh ile the " distance" from Fortran to its ma in competitors is not great , the distance of Cobol from , say , PL/I is very great indeed , too great , in fact , to j ustify its use as a teachinq lanquage. But , on the other hand , the current dominance of Cobol for business data processing appl ications is much greater than that of Fortran for sc ientific applications and , therefore , the inertia in the "Cobol system" is greater than that in the "Fortran system" . The resu lt , I bel ieve , w i l l be that , despite its manifest inferiority as a language , Cobol ' s dominance , l ike Fortran ' s , w i l l continue for a long time .
f irst , rather melancholy My conclusion is then that not only is Fortran dominant today among scient i fic higher-l eve l languages but , looking onlv at conditions as they are today , one would have to conclude that 5 , 1 0 , even 20 years from now , this will sti l l b e true .
3
4. THE POTENTIAL FOR CHANGE
For there to be a real cha l lenge to IBM ' s dom inance of the computer market , other than a l egal one , either it must become manifest that IBM equipment simply does not do the j ob requ ired by its customers or another manufacturer would have to produce equipment which clearly was much super ior in some important sense to IBM ' s . And it is obvious as anything can be in computing that neither of these conditions w i l l be sat isf ied in the future. forseeabl e Simi larly with Fortran , I bel ieve it is clear that it does the j ob well enough and that there is no clear ly much better way to go than Fortran for mosrs'cientific appl ications. But is there anything on the hor i zon which might change that statement or is there some potential development that might end Fortran ' s dominance?
Suppose , for examp l e , al l the professors of computer science at a l l the co l l eges and universities in the world could all be persuaded to teach the same non-Fortran language in the fi rst course in computer science. Of course , this is a silly hypothesis for , whi le it may be true that the pundits of software are universal l y opposed to Fortran , that is almost the only thing they all agree on . Each has his favor ite language and most have harsh words for most of the others.
St i l l , suppose my hypothesis were satisfied: wou ld the result be in time to wean the worl d away from Fortran. Yes, probably but not nearly so fast nor comp letely as might be expected . One result of such pur ity on the part of computer science faculties wou ld almost certainly be analogous to what has happened at a number of American un iversities in mathematics where the mathematicians decided to teach a " pure" calculus course to al l comers. departments physics and Inevitably engin eer ing schools started to teach their own calculus courses . The result would surely be the same - it has already happened in some places - in computer science. Fortran and Cobol courses wou ld spring up l ike weeds in other departments. Not only wou ld this r educe substantial ly the influence of the computer science department but , i n addition , most o f these courses would be woefully bad : computer science should be taught by computer scientists and this usual ly means in computer science departments. One corol lary of this is that computer science departments must take into account the legitimate but not pander to the i nterests
4
OPENING SESSION
opinions of other un informed departments in specifyinq the content of the basic courses in computer science .
Furthermore, university professors should have no i l lusions about the ir abi l i ty to affect and overturn deeply entrenched interests outside the academy . No matter what language we decide to teach our students, business and industry are quite capable of ignoring us and of continuing to use Fortran and Cobol in which they have huge investments.
There is, nevertheless, one thing on the hor izon with the potential to upset the dominance of the Fortran-Cobol system . This is the very interesting and, from a theoretical point of view, crucial research in proving the correctness of programs which is now being act ively pursued at a number of institutions in Europe and the United States. Conceivabl y, just conceivably ·t here could be a breakthrough in this area which would so clear ly i l l uminate the task of programm ing that almost everyone would see the l ight and agree to a change of methodology and, because of this, a change of language . I wish such a breakthrough were l ike l y but I don ' t bel ieve it i s and will, therefore, discount this possibil ity in what fol lows .
If then the potential for ending Fortran ' s dominance is n i l, what can be done? On the one hand there is a multitude of programmers using a language - Fortran - which is far less than ideal . On the other hand there are better l anguages but they are not enough better to persuade many Fortran programmers to switch now or in the forseeable future . My solution is not original but, because it is most unesthetic and because of its unpopularity with the pundits of software, it has not been given the attention and effort it dese rves . It is this : We must work within Fortran to i mprove and extend it if substantial progress is to be made in the qua l i ty of higher leve l language programming over the n ext decade . The rest of this talk w i l l be concerned with e l aborating this theme .
Many leading computer scientists
or
theorems
or
even
basic principles , in the software area are quite sensitive to this , They bel ieve, as I do, that this situation is a transient, indeed an inevitable one for a new disciplin e , One result of what is almost embarrassment at the present state of software is, sometimes, an attempt to teach computer science from as pure, as pristine a point of view as possible , Ostensibly this is to qive students as firm a theoretical grounding as is possible but, perhaps unconsciously, it may a lso be an attempt to make the world of software seem less unt idy than it is, The result comes, I bel ieve, a l l too often per ilously c lose to pedantry, particularly as it relates to the appropriateness of languages l ike Fortran as teaching vehicles , To indicate why I bel ieve this, I would first l ike to look at the educational process in a more general context than just computer science ,
After they have been teaching awhile, most university professors at least would outside schools of education aqree with me that, if computer science is lacking in theoretical foundations and principles, education surely l acks them to a greater degree, The crux of the matter seems to be that the end result of education is affected very l ittl e over a wide ranqe of methodologies and course material . Indeed such matters seem to be almost complete ly secondary to the qua l ity of the instructor ,
A pictorial analogy to what I mean is the famil iar frequency response of an Let me give you amp l ifier (F igure 1 ) . two concrete examples of this analogy, one unre lated to computer science and the other directly re lated to the subject of this tal k , AMPLITUDE {TEACHING EFFECTIVENESS!
S . FORTRAN AND TEACHING
It is a truism that computer science is, in its heartland area of computer systems, a science without theoretical foundations . In contrast to the mathematical and physical sciences with which most of us would l ike to associate ourselves, we have in this core few laws
FREOUEHCY IT[ACHING METHOOOLOGT I
Figure 1
The ru ture of higher level languages ( in teaching)
Some years aqo in the United States there was a qreat deal of controversy on how to teach children to read . �uch of this controversy was focused around a book "Why Johnny C an ' t Re ad" ( 3 ) . Now the teachinq of readinq is an area where I have no special competence whatever but it seemed clear to me at the time and still does that the extremists in the arqument had to be wronq (Fiqure 2 ) . I think current educational · practice suqqests that many combinations of "see and say" on the one hand and " soundinq it out" on the other are viable methodoloqies but that entire reliance on one , part icularly the former , would be likely to put one o f f the flat part of the curve. TEACHING EFFECTIVENESS
SEE ANO SAY
SOUND \ T OUT
Figure 2
My second example concerns the lanquaqe used in the first course in computing. Does it matter what computer lanquaqe is used as a teaching vehicle e ither as regards the results of this course or in terms of how this basic grounding may affect results in later computer science education? My answer is , between wide limits , no ( Figure 3 ) , At one end of the curve , off the flat portion , is the teachinq of machine or assembly lanquaqe in the first course although , as noted earlier , this is still done occasionally , At the other end of the curve is Alqol 6 8 which , whatever its theorectical grandeur and value , would , in a first course , surely stupefy all but the best and hardiest students and tend to drive them forever away from computers ; On the flat part of the curve are lanquaqes which will be familiar to most of you except , perhaps , Pascal , an excellent language developed by Niklaus Wirth [ 9 ] , which is enjoying something of a vogue in some computer science departments in the United States and Canada , at least.
5
VAl_\1[91 LAN(iUAGE IN FIRST COURS( lt; C.OWPUIDISCl£NC(
lilt(HIN( OR
��
FCJ!lli.U
P'I JI
lPl.
Figure 3 No particular metric should be inferred from this figure and no ordering of the languages in the middle is implied. Let me now discuss this central group of languages and try to ind icate generally why I think they are close to each other and , in particular , why Fortran is close to each of the others .
The list of languages in Figure 3 is not intended to be exhaustive but it does seem to include all of those in use in first courses in computer science with , at most , rare exceptions , I have already admitted that Fortran is probably the " worst" of these languages under any reasonable metric on language qual ity but that does not necessarily mean that it is worse than others as a teaching vehicle , And , even if it i s , there may be other advantages to using Fortran which might overcome its possible deficiencies for teaching.
Let me point out f irst that the abstract quality of a language is not necessarily highly correlated with its value as a teaching tool , To believe the contrary· is to come close to the pedantry I have already mentioned . To be an adequate teaching vehicle in a first course , a computer language should a) have enough syntactic richness to allow illustration of most or all o f the concepts which a re important in such a course and b) have enough syntactic poorness to enable the student to be given some perspective on computer science and computer languages ,
C,
OPENING SESSION
I ndeed , even if the per fect lanquaqe exi sted , it is not clear that it wouid make the best teachinq tool because its very perfection might serve to hide the subtleties , the - intricac ies of the subj ect .
The requi rement of a certain l evel of syntact ic r ichness is c learly what relegates a languaqe l ike C obol to an extreMe of the curve in F'iqure 3 . The lack of any real subproqram structure and the utter riqidity of Cobol data structure s , for exffmple , mean that the student who learns C cbol as his first language is almost certain to mi sunder stand concepts which are central to higher leve l languaqes today and to computer sc ience more genera l l y .
Fortran , o n the other hand , contains a mixture of syntactic r ichn e s s and poorness which makes it a very use fu l teaching tool . Let Me give you an exampl e . A lmost everyone wi l l agree that block structure is a vital concept in programm ing languages and that Fortran ' s lack of a block structure is one o f its most ser ious drawbacks in relation to languages l ike A lgo l and PL/I, But is it drawback in teaching beqinning a students? What i s the lesson , related to block structure , which the beqinning student should l earn? The answer , I submit , it that the vital concept for beqinning students is the value o f the subproqrar, concept and not the way it i s imp lemented in the lanquage, Inde ed , what needs empha s i s in thi s context i s that in computer programM ing , a s in a l l intel l ectual activity , i t i s vital to break biq problems into smaller ones , each o f which can be treated separate l y .
P rom this po int o f view i t may be that Fortran is a superior teaching tool to block structured lanquaqes, For the physical separation of main programs from subproITraJY\s in Fortran which may be infur iating to the purist and which is for the experien ced counterproduct ive programmer , may wel l be a conceptual aio to the beginning progr amme r .
I t i s , I think , worth noting here also that computer scientists have been s low to learn a pedagogic l e sson long known by others, This is that , if the concepts we are trying to teach in computer sc ience have depth and subtl ety - and what computer sc ient ist would admit the contrary? then it is not to be expected that beqinn inq students will fu ll y crrasp thes e concepts, An analogy to mathemati cs , which will be fam i l iar to most of you , i s that students rarely
perceive the full depth o f the concept of a derivative when they are fi rst introduced to the calculus . Rather they tend to learn about derivatives in a rather mechan ical way at first , later in more depth in advanced calculus and not ful ly unti l a cour se , often at the graduate level , in real analys i s ,
Surely b lock structure i s a s imi lar type of concept in computer sc ienc e . The beginn ing student can be told it is very important but how can he"E'e expected to � that importance unti l he has had suosEantial additional experience with and exposure to computer s cience? (Of cours e , these remarks are not appropriate for the exceptional student . But for such a student the language being taught fi rst is irrelevant for other reason s ; he will quickly surmount the barr iers placed in his way by even Fortran ! )
Other imperf ections in Fortran lend themselves pedaaogically to showing the student that there must be a better way . One such i s the conditional structure o f Fortran, The arithmetic IF statement can be ignored ent irely or introduced only to historical perspect ive . gain some Indeed , we may hope that Fortran constructs l ike the arithmetic IF will , in time , w ither away , a point I shall return to later . But the lesson one would 0like students to learn , even i f only superf icial l y , i s the value o f ne sted conditionals and the if-then - e l s e type o f structure, The unw ieldiness of implementing thi s structure with logical IF s can easi ly lead the instructor to i llustrate how valuable a direct i f-then e l s e structure would be, Of course , in thi s case Fortran is inferior to languages with an i f-then-else fac i l ity but it can hardly be c laimed that this is at a l l sign i f i cant in a f irst course . But aren ' t there some lacks or fai lures in Fortran which p lace it at a s er ious disadvantage in comparison with other -languages? How about data types and data structures?
Surely thi s is a distinct weak point of Fortran in comparison with , say , PL/ I . The l imitations o f arrays and the lack o f any real character o r string data type can hardly be twisted i nto advantages no matter how hard I might try , The important thing here is to admit the disadvantage but not to overemphasize i t . How many instructors in a fi rst course wish to assign programm�pro j ects involving l ists or other data structures than arrays or wish to use nonnurneric data types at a level which cannot be
The future of higher level languages ( in teaching )
7
accommodated in Fortran? Very few , I And I note that the l ack of submit , Fortran is these structures in no inhibition to introducing signifi cant them at appropriate times in lectures , Of course , the importance of structurinq data properly is as important a concept as in prograrnrninq technique the subroutine concept , But it , too , has a depth and subtl ety that cannot be more than introduced in a first cour s e ,
in-core compi lers has been a great boon A to student and instructor alike , corol lary advantage is the expertise in Fortran , in contrast to other languages, which exists at most computing centers, most to beg inning It is valuab l e students , when they run into trouble , to have good sources of advice, The lack of such sources can be a serious drawback to the use of a language l ike Snobol in a first course ,
I could qo on to discuss other aspects of the Fortran syntax , such as the lack of recursion or tasking , which are genera l l y considered inferior to one or more of the languages in Figure 3 but I am sure that by this time you have qrasped Some my point of view, def iciencies in Fortran may actual l y result i n advantaqes in a teaching context ; no def i c iencies · are so serious that they wi l l markedl y af fect the ahi l ity of the beq inninq student to qrasp concepts in computer sc ienc e , Some wi l l arque that Fortran does not encourage qood proqramming habits as the language used in a first course should, But I wou ld respond that , whatever Fortran ' s def iciencies in this respect , the inculcation of aood programminq habits is far more dependent on the instructor than the lanquaqe qiven only that , as I have argued is the case for Fortran , the language is not impossibly bad in this respect ,
6 , A BETTER F UTURE?
This last point leads m e t o a sma l l digression, I t would b e wrong to claim that a qeneral purpose procedure-oriented lanquaqe like Fortran or the others in F iqure 3 is the onl y kind of hiqher leve l lanauaqe that should be used in a first course in computer scienc e , For first arts courses oriented towards and has humanities students there been succ ess with usinq Snobol as the teachinq vehi c l e , There are some disadvantages to this approach but let me make it c lear that I believe this is certainly a viable approach ,
Before leaving the topic of Fortran and teaching , however , there is one more but issue , peripheral nonetheless important , which should be discussed , And this is the qual ity of the implementation of a language , There can be no doubt that this is of great importance to both instructors and students , It accounts in part for the popularity of APL and , with the exception of APL , it is an arqurnent in favor of Fortran relative to the other languages in Figure 3 at almost all insta l l ations , The ava i labi l ity of fast , we l l -desiqned
Unfortunate l y , of course , this last argument is both self-serving to Fortran and circular because , as it encourages use Fortran , it encourages the of manufacturers and the software industry in general to produce more and better Fortran software , often at the expense of deve lopments in other languages , This is just one of many instances of the inertia in the Fortran system, Unless and until the production of good compi ler software becomes more routine than it is today , this situation i s , however , going to persist ,
I have no i llusi ons that any of the foregoing will convince anyone of the glories of Fortran , Indeed , as I hope I have made cl ear , I do not bel ieve Fortran is glorious myse lf , mere l y that it is adequate , I w i l l have succeeded if I have made you bel ieve to some degree in that adequacy and , if so , I think you wi l l , grudgingly perhaps , have to accept much of my thesis in the remainder of this paper, For , if Fortran is adequate now , then its current and presumed future scientifi c dominance in app l i cations suggest very strongly that , instead of f ighting Fortran , it should be supported and improved,
Basical ly my thesis is tha� Fortran should be looked at as an extensible ianguaqe with standard Fortran IV its· · · core , At the first National C omputer · Conference in New York in June , 1 9 7 3 Professor Saul Rosen of Purdue University noted than an opportunity to extend Fortran to contain A lgol - l ike features was missed in 1 9 5 8 because it was not suffic iently understood how rapidly Fortran was catching on , A lthough harder to grasp now , the opportun ity sti l l exists, Some purists wi ll say that the core is so rotten that it is unextensible or that , at best , any extension would be an unwie ldy kludge , I don ' t bel ieve it, As the core contains rotten parts , these can be excised , not in the sense of removing them from the language - upward compatib i l ity must be maintained but
OPENING SESSION
8
rather of re leqating ther, to a hopefu l l y forgotten past, Such " rotten" constructs would , like the co111Mun ist state , " wither away " fror, clisuse althouqh in fact they would sti l l be avai labl e to octogenarian proqrar,r,er s and for recompilation of such prograr,s , One antedi luvian construct is surely the ar ithMetic IF and no doubt you have other favorites of your own. Of course , havinq rel egated such constructs to syntact ical S iber ia , it r,ight be asked whether there would be enouqh left in the core to be recogni zably Fortran , I think so i some of the particular l y irksome featur es of Fortran r,ay tend to hide the fact that r,ost of its syntax is quite viable , But even if you think there would be rather littl e left after the debr is is cl eared away , the ir,portant practical and psycho logical point is that a language which seer,s to grow fror, Fortran w i l l autor,at'IcaTly overcome r,any o f the barriers faced by other languages , After a l l , who can doubt that , if PL/I had come out as oriqinally planned as Fortran VI , everyone would be usinq it today?
Sor,e of r,y exar,p les in the previous section probab ly indicate the kinds of extensions to Fortran I would favor but it may be useful to qive a short l ist here. 1,
Block structure
The lack of compound statements in Fortran is particularly infur iating in connection with the logical IF stater,ent even to those people not experienced in the use of languages l ike Algol and PL/I, But it is , I think , clear that there is no intrinsic barrier to including not only compound statements but a rather qeneral block structure feature in Fortran , Indeed , this ide a , l ike a l l the others which follow, i s not original and most have been actually impler,ented , Block structure wa s bui lt into Fortran V for the Atlas computer sor,e years aqo [ 4 ] , Of course , one wants not j ust block structure but the abi l ity to define procedures { i , e , subprograms) with in the r,a in proqram and its subb locks , a provision which is now ava i lable in proto-fashion main Fortran in the through programs ar ithMetic this But statement function , feature , too , is not a very difficult extension to Fortran ,
What about the current separate if structure block subprogram structure is il'lplemented in Fortran?
Like arithMetic IFs this , too , could be expected to wither away in time in terms of actual use although it might wel l continue to be used for pedagogic purposes, 2 , Conditional statement facil ities
The if-then-else facility seems so basic to good language design and so useful in practice that it is clearly a prime area for consideration of Fortran extensions, Equally it is, I think , clear that such an extension to the logical IF in Fortran should be reasonab ly straightforward , 3,
Data tipes � structures
4,
Miscel laneous fail ings of Fortran
That data type most clearly needed in Fortran is character or string data, This is , indeed , under the by consideration Fortran subcommittee if the Amer ican National Standards Institute in its current restudy of the Fortran Standard [ 1 ] , The data structure problem - lists , structures (in the Cobol-PL/I sense) is also solvable in a re lative ly straightforward sense the in syntactic definition context , A more serious prob lem is that of dynamic storage al location in general but this · would , of course , have to be provided in the block structure context.
contains many annoying Fortran which had id iosyncrasies their qenesis not in bad language design as such but in the restr ictions which hardware forced or seemed to force on the designers of Fortran. Obvious exampl es are the restr ictions on subscript expressions , mixed mode expressions and DO-loop parameters , Most of these problems have been recognized by the ANSI Fortran subcommittee and w i l l probab ly be fixed in the new Fortran standard , {Indeed , many of these failings do not exist in actual Fortran implementations. )
I could go on, But I think my point Most of the things that most is cl ear , people think are wrong with Fortran not only can be f ixed but actual l y have been in some implementations , Moreover , the new Fortran standard , when it does appear , will incorporate some of these il'lprovements a lthough it w i l l not go nearl y as far as the above impl ies is desirab l e , In add ition , of course ,
9
The future of higher level languages (in teaching)
others wi ll continue to add features to Fortran outside the standard. One particularly interesting ex ample of thi s i s some modifi cations intended to make Fortran a better vehicle for structured proqramminq [ 6 ] .
I must be careful about seeming to be too g l ib about the ease with which Fortran can be extended to remove its maj or defi ciencies. There are many knotty problems to be solved and side effects to be con s i dered before such extension s can be made succe s s ful ly. But I doubt any of you would arque about the feas ibi l i ty of doinq thi s.
But , if it ' s feasible , why hasn ' t it been done before thi s , at l east more than widely with occas ional implementations? I think the an swer is that , among those people at major univer sities and e l s ewhere who could have fostered improvements in Fortr an , it has become fa shionable to den igrate Fortran and most unproductive in a tradition al academic sen s e to support and work on Fortran. And , of cour s e , at those myriad col lege s where Fortran is the only l anguage known and used , there i s l ittle capabi l ity of effectinq changes. As an aside I should note that the problem with so many of the first courses taught at such col leqe s is not that Fortran is used in them but that too often the in structors know no other language and have no breadth of view in computer science. This i s , I bel ieve , why one hears sometimes that students who have been tauqht Fortran first cannot be taught other languages and language concepts as eas i ly as students who have been taught another language first. There is truth in this not so much because of Fortran ' s inferiority as from the fact that instructors who teach non Fortran lanquag es in a first course are , on the averag e , much better teachers of computer s c i ence than those who teach Fortran i n such a cour se.
I am , there fore , urg ing that thos e of you here and e l s ewhere who real ly wish to improve compute r usage and programmi ng techn ique s in higher leve l languages should stop searching for a revolution to brand X but rather s hould look for improvements within the system. The e ffectivene s s and influence of too many people has been l e s s than it should have been because they have spent too much time backing hor s e s which are non starters. I am not , I should empha s ize , arguing aga inst deve lopment of other h igher leve l
languages particul arly as thes e deve lopments are the product o f re s earch i nto l anguages and language des ign. Computer sc ience would be immeasurably poorer had A lgol 60 or APL or Algo l 6 8 not been devel oped. But sooner o r l ater the value of rese ar ch must be measured by its impact in applications. I would argue that the impact of general purpose h igher level language research over the past decade or more has been less than it should have been because too many peop l e have been unwi l l i ng t o tran s l ate the fruits of such re search into practical imp lementations and extensions of that most l anguage sc ientific which programmers use and will continue to use. 7. CONCLU SION
Thos e who cannot remember the past are condemned to repeat it, said Santayana. The phenomenon of the development of better l anguages than Fortran but ones which will not be widely used w i l l continue unt i l it i s gener ally acc epted that there wi l l be no more revolutions in the us age of general purpose higher l eve l languages. The inertia , economic and psychologi ca l , of the Fortran system ( and the Cobol system too , of cour s e) i s too great to be overcome by the bludgeon technique s which have been tried in the past. By joining the system rather than fighting it, evolution to a better world may b e achi eved ; otherwi s e w e may expect more o f same and perhaps even a widening gul f between academic researchers i n computer languages and the users of such l anguages. It is just not true , I bel ieve , that " the choi ce of a language for teaching ba s ed on its wide spread acceptance and avai lab i l ity • • • • forms the s afest rec ipe for stagnation in a sub j ect of such profound pedagogi c al i nfluence " [ 9 ] ; it would be true only if there is a re fusal to join in efforts to make that language change as needed to reflect the state of the art and contemporary knowledge. Extending Fortran to include the better features of other languages is no panacea , It will not automatical ly lead to better first courses in computer s c ience , But the real prob lem is at those institutions where , as noted above , Fortran is the only l anguage known or us ed, At such places the resistance to new languages is very s trong. Including new features in Fortran will not a s sure their use by teachers or programmers. But it will make much more probab le not only the use of thes e features in first
10
OPENING SESSION
courses but the expl ication of deeper mean inq in later courses.
their
I suspect that those who f i nd the ideas expressed here abhorrent do so more on esthetic than on techn ical grounds. There are, I think, few phi losoph ical or scientific po ints of d i f ference between us . I too wish to see more students of computer science learning, and more users of computers using, better programming techniques in languages which f acilitate these techn iques . Our d i f f erences are on the best path to achieve these ends. My path is surely torturous, muddy and diff icul t . But other paths, whi l e straighter and cleaner, are, I fear, mirages . REFERENCES 1•
2. 3. 4.
s. 6. 7.
a. 9.
Amer ican Nat ional Standards Committee X3J 3 Unof ficial Dr aft of New Fortran S tandard, F ebruai=y'"72', 19,,-;-
Humble The E.W., Di j kstra, Commun ications of the P rogrammer, �, Volume 1 0, pp . 859-966 ( 1TT2 ) .F l esch, R . , Wh Johnny Can ' t Read and What You Can �o About---rt;" 7iarper';' TIT5' 5 -Y-:- - - -- -
Schofield, c . F . , A Manual of the Atlas Fortran V Language, University ort'ondon (1969T.
McC r acken, D . D . , Is There A Fortran in Your Future?, Datamation, Volume 19, pp. 2 3 6 - 2 3 7 (May, 1973) . Miller, E . F . , Extensions to For tran S upport Structured Programming to (abstract ) , ACM S I GPLAN Not ices, Vol � 8, No . 6 (Jun "e';' 1973) .
Dinner address, A, J . , P er lis, Science Conference, Computer Columbus, Ohio, F eb , 2 1, 19 7 3 .
Rosin, R . F . , Fortran and the New Culture, ACM S IGC SE Bul l etin, Vol . 3, No . 1 (March-Apr il, l971) ,
Wirth, N . , The Programming Language PASC AL, Acta I nformatica, Vol . 1, pp . 3 5- 6 3 ( 1'9'7TT.
A. Giinther ct al. (eds. ) , /11tematio11al Computing Symposium / 9 73 @ North-Holland Pub!. Co., J Y 74.
Invited paper
DESCRIPTID� OF PROCESSES Peter O e u s s e n
F a ku l tat fur In forma t i k der U n i ve r s i t a t K a r l s ru h e , D e u t s c h l a n d
Pro c e s s e s are regarded a s p a t h s i n a s t a t e s p a c e t h a t are i n t he d i s crete c a s e effe cted by a corres pon d i n g s e r i e s of a c t i o n s . From a fixed l ev e l of a b s t r a c t i o n t h e a c t i o n s are cons idered i n d i v i s i b l e u n d e r w h i c h a s s umpt io n s e ri a l , s im u l t a n eo u s , and ge n e r a l comb i n a t i o n s of proces s e s are d i s c u s s ed , Act i on s and comb i n a t i o n s are c ompared w i t h primit i ve s of programmi ng l an g u a ge s w h i c h l e a d s t o a graph i c a l me a n s for c h e c ki n g the harmo n i o u s coopera t i o n of cyc l i c proces s e s , F o rword on p r o c e s s e s i n general T h e concept of pro c e s s enj o y s s u c h a w id e app l i c a t i o n t h a t i t i s wort hwh i l e t o have a l o o k o n t h i s con ce p t a s i d e from it s u s e i n t he comput a t i o n f i e l d . T h ere a r e e . g . i n d u s t r i a l proces s e s , t h ermodynamic proces s e s , c o n t r o l proc e s s e s , and comp u t i n g processes t h a t i s , pro c e s s e s perfo rmed
The Web s t e r d e fi n i t io n of proces s , name l y , a s e r i e s of a c t i o n s o r operat i o n s l ea d i n g t o s o m e r e s u l t , d o e s not q u i t e f i t t h e e xamp l e s above . What are the act i o n s e . g . in an i n d u s t r i a l chemical proces s , t h a t , b y its i n t e n t i o n , i s g o i n g on d a y by d a y , w e e k b y w e e k and a l l i t s r e l evant v a l ues are kept (by a c o n t r o l s y s t em ) a s c o n s t a nt a s pos s ib l e , D r , being more genera l , w h at are t h e ac t i o n s i n a cont i n u o u s proces s ? C l e a rl y , t h e d e f i n i t i o n a p p l i es t o a l l k i n d s of d i s c r e t e proce s s e s , but we s h a l l try t o have a mo re mat h e ma t i c a l n o t i o n of proce s s t h a t h o l d s for bot h c o n t i n u o u s a n d d i s crete proce s s es . A p ro c e s s i s some t h i n g t h a t evolves in t ime and w h at evo l ve s is commo n l y t ermed the state of the proces s . But what i s regarded a s a state d ep e n d s o n t h e p o i n t o f view . From an ab stract p o i n t of v i ew , a momentary s t a t e of a f u n ct i o n a l u n i t i s an en t i t y , t h a t t o ge t h er w i t h t h e i n p u t u n i qu e l y det ermines t he b e h a v i o u r of t he u n i t i n t h e fut ure and i t can be s hown t ha t a n y d ev i c e t hat o b e y s t h e l aw of c a u s a l i t y " h a s " s t a t e s , t h at i s , i t can be d e s cri bed comp l e t e l y b y s t a t e s ( De u s s e n [ 9 ] ) . From a more p r a gmat i c s t a n d p o i n t t h e (mome n t a r y ) v a l u e s of t h e r e l e v a n t quant i t i e s are comb i n ed i n t o o n e ( moment ary ) s t at e . W h i c h q u an t i t i e s are c o n s i dered r e l eva nt d ep e n d s o n t he l evel of i n t er e s t , o n the l e v e l of a b s t r a c t i o n . I n a n i n d u s t r i a l chemic a l p r o c e s s t h e c o ns umer i s s o l e l y i n t er e s t ed in t h e o u t p u t rate of t h e produced s t u ff , w he re a s t he c o n t ro l l i n g e n g i n eer m u s t b e c o ncerned a l s o w i t h vari o u s t e mp e ra t u r e s and p r e s s ures , t h e ma na ger t o t h e contrary l o o k s for t h e mon et a r y ' va lues ' . I n p h e n omeno l o g i c a l t hermo d y n a mi c s , g a s e s are c h a ract erized by t empera t u re , pres s u r e , and vo l ume , and t h e s e t hree q u a n t i t ie s c o n s t i t u t e a s t at e ; i n s t a t i s t i c a l t h e rmodynamics a ( micro - ) st a t e i s d e f i n e d by t h e l o c a t i o n and the impu l s e of e a c h mo l e c u l e , t hat i s , any s u c h s t a t e i s a po i nt i n a s p a c e w i t h rough l y 1 0 2 4 d imen s i o n s . The ob serva t i on that ma n y micro s t at e s belong t o t h e s ame ma cro - st a t e charact erized by t h e above p h enomen o l o g i c a l q ua n t i t i e s l ed t o t he fru i t fu l marr ia g e o f o n a comp ut e r .
t hermodynamics w i t h s t a t i s t i c a l mechan i c s . B oth examp l e s - and t here are man y more - s how t h at a b s t ra c t i o n a s wel l a s r e f i n ement of i n s p e c t i o n are w i d e l y u s e d t o c o p e w i t h t he u nd er s t a n d i n g of comp l e x proce s s e s . So far we c a n s a y t h a t a pro c e s s i s a f u n c t i on T ➔ S ,
w here S i s t h e s e t of s t a t e s and T is a s u b s e t of t h e r eal a x i s regarded a s t ime a x i s , t h e fun c t io n p expres s i n g t h e evo l u t i o n o f t he pro c e s s . O t h erwi s e s p e a ki n g , a p r o c e s s i s a p a t h i n a s t a t e s p a c e w h i c h i s paramet erized b y t ime . As we s a i d , a n y s t a t e s c S c o l l e c t s a l 1 v a l u e s of t h e r e l evant quant i t i e s of t h e pro c e s s at o n e i n s t a n c e o f t ime . Hen c e , i f w e t a k e a s e t N of names for the q u a 7 t i t i e s , a s t a t e s e S is a n a s si gnment of v a l u e s v e V t o t h e name s : p
s : N
➔
St a t ed o t h erw i s e , we h av e S c V
N
V
t h e i n c l u s i o n b e i n g o f t e n proper ( fo r e xamp l e , t emperat ure , v o l ume , and pres s ure o f a g a s are not i nd ep e n d ent , t h e y are c o n n e c t ed by a we l l known s t a t e equati o n ) . The s e t T repre s e n t i n g t ime may be a ( c l o sed ) i n t erva l i f t h e pro c e s s is c o n t i n uo u s , b u t i t may a l s o b e a d i s cret e o r even f i n i t e s u b s et of t h e r eal a x i s u n d e r t he s a me order ing a s t ha t of the real number s ; t hi s ca s e , c l ea r l y , p e r t a i n s t o d i s c r e t e or f i n i t e proce s s e s l i k e t h o s e performed o n a compu t e r .
A more d e l i c a t e d i s cu s s i o n c o n c er n s t he f u n c t i o n p . T h e fun ct i on s t a t e s t h e t ime d e p e n d ency of t h e s t a t e s o f a proces s , i t d o e s n o t d e s c r i b e ( or e x p l ai n ) t h e d ep e n d ency i n a smu c h a s p i t s e l f d o e s not n ec e s s a r i l y g i v e any i nforma t i o n o n t h e l aw s or ru l e s w h i c h p o b ey s . In t h e c a s e of c o n t r o l s y s t em s , p i s a s o l u t i o n of a d i fferent i a l e q u a t i o n , i n o t h e r s it m i ght be t h e s o l u t i o n of a f u n c t i o n a l e q u a t i o n , a n d if p i s a compu t a t i o n a l p r o c e s s p i s d e f i n ed b y t h e e x e c u t ed program. T h e d i fferent i al equation or the program , r e s p e c t i ve l y , d e s cri be t h e a c t u a l pro c e s s far bet t e r , s i nc e t h e former i s i n some s e n s e t h e d irect ima ge of t he c o n t r o l s y stem and the l a t t e r - if it i s we l l s t ructured - d i re c t l y e x p l a i n s t o a n y d e t a i l t h e a i m wit h w h i c h t h e proc e s s i s p e rf o rmed . T h u s we s h o u l d carefu l l y d i st in gu i s h between a pro c es s - t hat i s p erformed h i e et n u n c - and i t s d e s c r i p t i on , w h i c h i n g e n e r a l d e s c r i b e s m o r e t h a n o n e
I2
°
THEORY OF COMPUTATi ON
pro c e s s t hat may or may not be performed a n d , t h u s , s t a n d s f o r a c l a s s of pro ces s e s . A r a t h e r general d i s c u s s i on o n d e s c r i p t i o n s of pro c e s s e s i s t o b e fo und i n Kalman [ 1 9 ] , Reu s c h [ 2 2 ] . Yet a n o t h e r , even more d e l i c a t e q u e s t i o n i s t h a t for t he e q ua l i t y of proces s e s . Regard t he s i t u a tion
w h e r e , i s b i j e ct i ve , o rd e r - p r e s erv i n g , a n d p = q, , w h i c h means t h a t t h e c o u r s e of s t a t e s for b o t h p and q i s t he s ame . Specifica l l y , if , i s a t ra n s l a t ion t h e n t he above d i agram is t h e prec i s e s t a t ement of what i s meant b y s a y i n g t he " s ame " pro c e s s i s started a t d i fferent t i me s . Forma l l y , p a n d q are not t he s ame funct i o n s , whence forma l l y , t he respect ive pro c e s s e s are d i fferent . But t h e re is yet a n i n forma l argume n t for not e q u a t i n g t h e s e two pro c e s s e s : their p e rformance needs resources a n d t h u s t he r e s o u rce management mu s t t re a t b o t h p r o c e s s e s a s d i fferent en t i t i e s ( even if , w e r e t h e i de n t i t y , b u t w e won ' t d e e p e n t h i s s u b t l e s it u a t i o n ) . T h u s t h e re i s o n l y one proces s , i f any , a n d n o p r o c e s s i s e q u a l t o i t . D e s p i t e o f t h i s , we may form c l a s s e s of proce s s e s b y many mean s . For e x amp l e , t h e two proces s e s in t h e d i agram we s ha l l c a l l equ iv a l e n t , w h i c h e n a b l e s u s t o . l o o k for c o n ven i e n t repre s entat ive s by c h o o s ing a p r o p e r t ime set T a s wou l d be { 1 , 2 , . . . , t } if T is f i n i t e w i t h t e l emen t s . O t h e r c l a s s es origi n at e from a b s t ra c t i o n s . L e t
b e a funct i on i n t o a n o t h e r s t a t e s e t , t h en t h i s funct i o n may d i s regard cert a i n q u a n t i t i e s ( a i s a p roj ect i o n ) or i t m a y put t ogether s t a t e s of S w h o s e mut u a l d i ffer e n c e i s of no c o n c ern in s ome c o n t e xt . T h e comp o s it i o n a : S ➔ S'
a P T -> S -> S '
r e su l t s in a , s o t o s a y , c o a r s e r proce s s . A next step w o u l d be t o change t he t ime - s et T by l e t t i n g c o l l a p s e c o n t iguous equ a l s t at e s , w h i c h i s ex pres s ed by t h e c o mmu t i n g d iagram T
p
c t� s T '�
where c ( st a n d s for c ompres s i o n ) i s an order p r e s e rving s u rj ect ive funct i o n . Not i c e , t ha t b o t h s t e p s a l low u s t o i n t erpret t h e ( co n t i n u ou s ) p h y s i c a l swi t c h i n g proc e s s i n a com puter a s a d i s c re t e comp u t a t i o n a l proces s . Now , c l e a rl y , w e may p u t proce s s e s p and p ' i n t o t he same c l a s s i f t hey r e s u l t in e q u i v a l e n t p ro c e s s e s t hrough b o t h s t e p s . A l l k i n d s of a b s t ract ion o r , if o n e w i s h e s , of c l a s s forma t ion d e l i bera t e l y loose i nformat i o n , b u t n eg l ec t i n g i nforma t i o n i s an import a n t men t a l
t o o l f o r an e a s i e r underst a n d i n g of comp l e x pro. c e s s e s , i t " s hi e l d s from t h e o u t s i d e world a l evel of i n t er i or i n d e t e rm i n a c y " ( Di j kstra [ 1 2 ] ) .
D i s c r e t e pro c e s s e s We s h a l l res t rict o u r d is c u s s i o n t o d i screte pr o c e s s e s , i . e . proce s s e s w h o s e t ime s e t T and s et of v a l u e s V are d i s cret e . D i s cret e , th i s rat h er vague concept , in t he e s s e n c e here mea n s fin it e . T h i s a ss u m p t i o n o n o n e s id e s im p l i f i e s t h e d i s c u s s io n a n d o n t h e o t h e r r e p r e s e n t s n o r e s t r i c t i o n : any comp u t a t i o n a l pro c e s s i s f i n i s hed after f i n i t e m a n y s t e p s a n d t h e un iverse of v a l u e s i t d e a l s w i t h i s a l s o f i n i t e d u e t o t h e bou nded c a p a c i t y o f t h e compu t e r . Aga i n , V i s t h e ( fi n it e ) s e t o f va l u e s , s imp le as we l l as s t ru ct ured o n e s , and N i s the ( fi n i t � s et of names . F u r t h ermore ,
is not e x c l u d ed , w h i c h mirrors t h e man i p u l a t a b i l i t y o f names i n a compu t a t i o n proces s . T h e s t a t e s e t S m a y n ow be regarded a s t h e s e t o f a l l p o s s i b l e c o n tent s o f t h o s e l o c a t i o n s t ha t a r e n amed b y e l ements o f N . The set T is a finit e s u b s e t of JR , a n d a s such it is l i n e a r l y ordered . For s e ve r a l r e a so n s , o n e b e i n g o u r i n t u i t ive u nder s t and ing of a f i n i t e s u b s e t of ' t ime ' , it i s w i s e not t o forget a b o u t t h e n a t ura l emb e d d i n g of T i n JR : regard i n g a pro c e s s p : T ➔ S o n e i s always t empted t o ask what i s hap p e n i n g between two c o n s e c u t i ve p o i n t s t , t ' £ T . In d o i n g s o o n e mixes u p d i fferent levels of a b s trac ti o n , t h e one of t h e pr oces s p a n d o t h e r s t hat l i e d e eper . N evert h e l es s , s omet imes i t i s u s e f u l t o l o o k o n e s t e p d o w n stairs . In Hor n i n g [ 1 7 ] t he c o n c e p t of an a c t i o n w a s i n t ro d u c ed . Forma l l y , i t i s a part i a l f u n c t i o n : N --r- V
( a E ( V+ 1 ) N )
t h a t p a i r s some n a me s u n i q u e l y w i t h v a l u e s . Any s u c h a c t i o n n ow changes a s t a t e s to a n o t h e r s t at e s a accord i n g t o t h e d e f i n i t i o n a
n 4 dom n E dom
a
(n E NJ
Hence , s a agrees w i t h s in a l l names t hat a r e n o t affected by t h e a c t i o n a , wherea s , according t o a , i t s rema i n i n g name s p o s s e s s p o s s i b l y new values . T h e c o rre s p o n d e n c e s f--> s a i s a mapping from S i n t o S a n d it h a s been a p p l ied to forma l i z e p ro p e r t i e s o f s t orage ( Be k i c [ 2 ] ) , T he t e rm a c t i o n i n d i c a t e s t h a t t he part i a l f u n c t i o n a s ho u l d r e p r e s e n t t he a c t of c h a n g i n g o n e s t a t e i n t o i t s s u c c e s sor when w e regard a proc e s s . S i n c e t o a n y p a i r s , s ' E S t h ere i s a t l e a s t o n e a wit h t he property s ' = sa , we may represent a p r o c e s s p : s 1 , s 2 , . . . , s n equiva l en t ly b y a s e q u e n c e of a c t i o n s t oget h e r wit h t h e i n i a 1 , a2 , , , . , a n - 1 t ia l s t a t e s 1 of t h e proces s . At l ea st now s omeone might o b j ect t ha t our con cept of a pro c e s s i s o n ly o f a s equ en t i a l n a t u re - an d a
13
Description of processes
ind eed i t is . The c o u n t e r- q u e st ion wou l d be : i s t here a n y non - se q u e n t i a l pr□c e s s 7 Sequent i a l it y i s t he property t hat a c t i o n s are t a k e n one aft e r t h e o t h e r o r s imu l t a n eo u s l y . If we regard a c t i o n s as being indivi si b l e no o t her p o s s i b i l i t y e x i st s , and we do s o by i n s p ec t i n g our proce s s t hrou g h t he t ime - gr i d T whence i t i s inadmi ssa b l e t o s p e a k o f t h e dura t i o n of an a c t io n . I f , t o t h e c o n t rary , t he a c t i o n s are regarded d i v i s i b l e , t he n t hey are t hemselves se q u e n c e s of a c t i o n s and , c l ea r l y , c o n c u rrency may o c c u r ; but t h e n we h ave l eft our l e vel o f i n s p e c t i o n and s t epped d o w n t o a l evel w i t h a h i g her re s o l u t i o n . H e n c e , I w o u l d answe r : no , i f t h e l e vel of a b st ra c t i o n i s r e t a i n ed .
We s h o u l d bear in mind t hat any of t h e a ct i on s a i repre s ent s t he net effect w he n s t a t e s i c h an g e s t o S i + 1 in t h e c o u r s e of t h e proce s s . T h u s if dam a i = { n 1 , nz } and a i ( n 1 J = v 1 , a i ( n z ) = vz , we rega rd a i as t h e s im u l t a n e o u s change of t h e c o n t e n t s of n 1 a n d n z regard l es s of h o w t h i s c h a n g e is a c h i eved by more elementary proce s s e s . To e a ch pair s , s ' of c o n s e c u t i v e s t a t e s of a pro c e s s p t h e re i s an a c t ion a , but t h i s a c t i o n i s genera l l y n o t d e f i n e d u n i q u e l y n e it her b y s nor b y s ' n o r b y bot h ( o n e can e a s i l y c o n s t ruct mea n i ngful examp l e s for pro ces ses , where t he same state a t d ifferent t i mes is s u bj e c t e d t o d ifferent c hanges ) . T o any body who l oo k s for a deeper a l ge b r a i c s t ruct ure o f p ro c e s s e s t h i s f a c t i s u n fo r t u n a t e . C l earl y , it c o u l d b e remedi ed t rivia l l y b y adj o i n i n g t he t ime t o e a c h s t at e , b u t t h i s a n d o t h e r reme d i e s have t h e d i sadvantage t o re st ric t t h e po s s i b i l i t i e s for a b stract i n g proce s s e s .
T h e most impo rtant c o n s t r u c t i o n we can carry out o n p r o c e s s e s i s t o comb i n e t hem t o new o n e s . Com b i n i n g p r o c e s s e s is e s s e nt ia l l y b a s ed o n t h e com b i n a t i o n of t he i r a c t ion s . O n t h e s e t (V+1 ] N o f a c t i o n s whi c h , b y definit ion , are p a r t i a l funct i o n s a part i a l o p e r a t i o n u c a l l e d u n i o n , is defined as fo l lows : if
then
: =r
a j dom a " dam S = S I dom a " dam S , ( a u S J (n l
(n)
S(nl
n Ee dom a n
dam S .
T ha t means t ha t a u 6 i s o n l y defined when a a n d 6 c o i n c i d e in t he common p a r t o f t h e i r respective doma i n s , a n d t hen a LI S i s t he continuation of both a and 6; o t h e rwi s e , a u 6 is not d e f i n ed and t he a c t i o n s are said t o be i n c o n fl i c t . E,
In order to comb i n e two a c t i o n s a g a i n t h e fact h a s t o b e s t re s se d t h a t we regard a c t i o n s a s b e i n g i n d i vi s i b l e : a l l o u r p r o c e s s e s a r e i n s p e c t ed from a fixed l evel of a b s t ra c t i o n in w h i c h t he s t a t e s are o b se rva b l e at d i screte point s t e T of t ime . What h a ppens i n between two c o n s e c u t i ve i n s t a n c e s of t ime is not concerned wit h t ha t leve l . T h u s t he pro p e r t y of a c t i o n s t o be i nd i v i s i b l e i s direc t l y c o u p l e d wi t h o n e l evel of a b s t r a c t i o n a n d i t ma y c e a s e to h o l d when t h i s l e v e l i s c h a n ged . Due t o t he i r i n d ivi s i b i l i t y , two a c t i o n s a , 6 a re e i t h e r o ccurring one a f t e r t he o t h e r , or s imu l t a n e o u s l y . Simu l t a n e i t y c l e a r l y l e a d s t o confl i c t s
if b o t h act i ons a r e i n c o n f l i c t a n d t h e simu l t a n e o u s a c t ion i s n o t w e l l defi ned i n t h a t c a s e . T h i s be hav i o u r i s e x p r e s s ed by forming t he u n ion a u B of b o t h actions a s d e f i n e d above .
As for t he combinat ion of pro c e s s e s c o n s id e r n ow two pro c e s s e s ( wh o s e respect ive s e t s of names s h o u l d be equ a l ) t o g e t her wit h t he i r a c t i on s :
a 1 , az , . . . , a n - 1 s 1 , sz , . . , , S n r 1 , rz , , . . , rm 6 1 , S z , · · · , 6m - 1 When t he y a r e st arted a t t h e s ame t ime t h e n o n l y o n e i n i t i a l s t a t e i s p o s s i b l e , hence we a s s ume s1 = r1 , Accord i n g to t h e forego i n g c o n s idera t i o n s , any of the t h r e e actions a 1 , 6 1 , a 1 u 6z could t a ke p l ace first and produce a n ew s t a t e . But now t h i n g s get d i f f i c u l t : if a 1 were first , t h e n ext a c t i o n c o u l d b e a n y of a 2 , 6 1 , a 2 LI s 1 , o r if S 1 were f i r st any of a 1 , Sz , a 1 u S z , or , l a st l y , if a 1 u 6 1 were first then any of a 2 , 6 2 , a 2 u B 2 is t h e next a c t ion and so fort h . I n Hor n i n g [ 1 7 ] a s i d e from t hi s s o - c a l l ed general comb i n a t ion ( ca l l ed s imu l t a n e o u s action with cer t a i n t y in Gi l be r t [ 1 4 ] ) two other t yp e s are c o n sid ered t h a t res u l t from t h e general comb i n a t i o n by a l lowing s i m u l t a n e i t y o n l y : s y n c h r o n o u s comb i n a ti o n , or b y comp l e t e l y e x c l u d i n g simu l t a ne i t y : serial comb in a t i o n [ no n s im u l t an e o u s a c t i o n in G i l bert [ 1 4 ] J . A l l t he s e t y p e s a r e bet t er e x p l a i n e d grap h i ca l l y r a t h e r t han b y forma l defin i t i o n s s i n c e t h e l a t t e r wou l d need a h i g h n o t a t i o n a l effort . F o r s i m p l i c i t y let us fix n = 3, m = 2 for p and q r e s p e c t i v e l y . T h e t ree p: q:
.· o
represen t s t h e general combi n a t i o n a s we j u st e x p la i n ed b y word s a l i t t l e before . If t he gener al combiha t i o n effect s conf l i c t i n g s imu l ta n e o u s ac t i ons (t he r e s p ec t ive part of ] it i s n o t defi n ed . T h e d o t t e d s u b t r e e r e f l e c t s t he synchro n o u s com b i n a t i o n of bot h pro c e s s e s in which a s many a c t i o n s a s p o s s i b l e a r e perfo rmed s imu l t a neou s l y if t here i s no c o n f l ic t , a n d the subtree d rawn b y l i n e s repres e n t s s e r i a l combinat i o n . T hu s t he comb i n a t ion of p ro c e s s e s d o e s not y i e l d a proc e s s but a w ho l e c l a s s of p o s s i b l e proces s e s : a n y p a t h from t h e root of t he t re e t o one of i t s l eaves repr e s e n t s a pro c e s s t h a t c ompr i s e s in c o r r e c t o r d e r a l l t he a c t i o n s of t he c o n s t i t u en t p r o c e s s e s of t h e combin a t i o n . Which o n e of t he s e pr o ces s es a c t u a l l y i s s e l e c t ed c a n n o t be d i s c u s s e s here , i t ma y d e p e n d f o r examp l e o n s c h ed u l i n g strat e gi e s , o n t he a v a i l a b i l i t y o f resourc e s , o r e v e n o n u n p r ed i ct a b l e i n f l u e n c e s . T hu s , a n impor tant q u e st ion is whether a l l p o s s i b l e proc e s s e s of a combinat i o n l ead t o t h e same r e s u l t , or
14
THEORY O F COMPUTATION
w h e t h e r t he c o n s t i t u e n t pro c e s s e s cooperate harmo n i ou s l y ,
A f o u rt h t ype o f comb i n a t i o n , t ermed ' s im u l t a n e o u s act ion w i t h u ncerta i nt y ' i s s u gg e s t ed in G i l bert [ 1 4 ) . To motivate i t we mu st s t ep down from o u r f i xed l evel of a b st ra c t i o n and c o n s ider a c t i o n s d i v i s i b l e . If we perform two a c t i o n s a , B s i mu l t a n eo u s l y s t a r t i n g from a s t a t e s w h e r e f o r B ( n l ( a , B are i n c o n f l i c t ) , some n E N a ( n l t h e n a c c o rd i ng t o u n known t i me c o n d i t i o n s eit her a o r B wi l l win t he race a n d fo r t he next s t a t e s ' we o b t a i n s ' ( n l = B ( n ) or s ' ( n ) = a ( n ) r e s p e c t ive l y . T h i s gives u s t he id e a for t he fo l l ow i n g d e f i n i t i o n of a new combinat i o n of act i on s :
t
Y E { a +B } : i ff dom y = dam a u dom B and fo r a l l n & dom y : y ( n ) = a ( n ) or y ( n l = B ( n l
T h u s { a + B } i s a set t ha t co n s i s t s of a l l a c t i o n s y t hat c o i n c i d e wit h a a n d B where t hey a r e not i n c o n f l i c t a n d t hat have either of t he v a l u e s of a or B where t hey are i n c o n f l ict . C l e a rl y , i f a a n d B are not conf l i c t i n g t he n { a+ B } = { a u B l . Ot herw i s e { a+ B ) i s a s e t of p o s s i b l y o c c u rr i n g a c t i o n s . T h e comb i n a t i o n of pro c e s s e s n ow i s obt a i n e d q u i t e a n a l o go u s t o t h e e a r l i e r comb i na t i on s : i n s t ead of a u B we have t o take i n to c o n s i d e r a t i o n a l l y e {a+B} , D e s c r i p t i o n of proce s s e s C o n s i d e r t h e fo l l ow i n g proces s e s : n
N:
i
f1
fz
h
s 1 00 7 3.14 43 9 1 5 7 9 3.14 43 s z 43 5 7 s3 9 5 9 5 7 4 9 5 3 s5 s 5 3 6 5 3 5 2 7 5 3 2 s 8 2 5 4 s g 2 2 5 4 1 s 10 3 2 5 4 s 1 11 3 2 5 4 2 5 12 3 2 5 5 2 s 3 1 3 5 5 3 2 5 14 5 5 5 2 3 5 15 5 5 3 5 3 s 16 Nobody , I b e t , wo u l d even c o n j e ct ure t hat t h i s pro c e s s o r i g i n a t ed by e x e c u t i n g t h e fo l lowing p i ece of program b e gin
f 1 : = f2 : = 1 , for i : = 3 �t ep 1 unt i l n d o - b e g i n h : = f z , f : = f +f -;-f : = h e n d 1 1 2 2
�d ( n l ,
end
w h i c h serve s f o r computing s u c c es s i v e l y t he Fibo nacci series u p t o t h e n - t h e l emen t . The s i t u a t i o n w e r e n o t b e t t e r if w e h a d l i s t ed t h e c o rres p o n d i n g a c t i on s . But w hat l o o k s l i ke a crit i c i s m of t h e c o n c e p t o f p r o c e s s i s in f a c t a w r o n g way t o a s k
q u e s t i o n s : t h e t a s k of a p h y s i ci s t i s t o f i n d d es c r i p t i o n s f o r p r o c e s s e s he i s f a c e d w i t h in order t o u n d e r s t a n d t he m , w h er eas the i nfo rma t i o n s c i e n t i s t h a s t o l o o k f o r u n d e r s t a n d i n g t h e pro c e s s e s he d e s cr i b e s .
Pro c e s s e s c a n be d e s c r i b ed by many means a nd i n ma n y way s . Any proce s s , t ri v i a l l y , i s i t s own d e s c r i p t i o n as wel l as t h a t of each proc e s s e q u i v a l en t t o it . T h e s t a t e t ra n s i t i o n s of a who l e c l a s s of pro c e s s e s m a y be repres e n t ed in a con d e n s e d form by PETR I - n e t s ( e . g . P e t r i [ 2 1 ) , De n n i s [ 8 ) , Commoner [ 6 ) , S h a p i ro [ 2 3 ] ) or b y o n e o f i t s gener a l iz a t i o n s ( Genrich [ 1 3 ) ) . ( No t i c e t ha t a l l o u r t r e e s i n t h e for e g o i n g s e c t i o n f o r repre s en t i n g t h e v a r i o u s comb i n a t i o n s of proce s s e s c o u l d b e d u a l l y redraw n a s PETRI -net s ) . The s er i e s of a c t i o n s of a proc e s s may a l s o s erve a s its d e s c r i p t i o n and from t h i s fact the mo s t commo n l y u s e d method for d e s c r i b i n g pro c e s s e s i s derived : p r ogrammi n g . L e t u s , t herefor e , t r y t o pair a c t i o n s w i t h t he p r i m i t i v e s o f a pro grammi n g l an guage . v E V , T hen F i r s t l y , l e t d am a { n } , and a ( n l we obtain the pair a(nl
=
v : a ._ n : = v
The a s s ignation n : = k cribes a w h o l e c l a s s of an a c t i o n a ( n l = s ( k l we denote this c l a s s of v ia l l y :
( o r read ( n l l
( k & N ) , however , d e s a c t i o n s i n t h a t i t evokes for every s t a t e s E S . If a c t i o n s by a�, t hen t r i
a � o-o n : = k
and a� can be i n t erpre t ed a s a f u n c t i o n from S into S o b e y i n g ( a� ( S )
) (X )
= {
s(kl s (xl
xtn
(x
6
N)
( s e e a l so K a n d z i a [ 2 0 ] l . B o t h correspondences can be gener a l ized obvio u s l y for f o rm u l a s o c c u rri n g o n t he right h a nd s i d e o f t h e a s s i gn a t i on s .
Now l e t a affect more t h a n o n e name , s ay d o m a = { n , m} . At first g l a n c e t h e r e i s no count erpart t o s u c h a c t i o n s i n programmi n g l a n g u a ge s , t h ere i s n o prim i t i v e c o n s t r u c t t ha t expr e s s e s t h e ' s i mu l t a neit y ' meant by a ( n l = v a n d a ( m l = u . Since a s hows o n l y t h e net effect of a c ha n g e of a s t a t e t o i t s s u c c e s sor a n d n o t t h e way h o w i t i s a c h i eved we may o n t he p rogramm i n g l anguage side j o in a s e quence of s t a t emen t s t ha t h a s t he a c t i o n a a s net effect : a ( n ) =v , a ( m ) = u
or
a o-o 'n : = v , m : = LLJ
- fiii : = u ; n : = :!J
Equ a l l y , t h e s eq u e n c e s n : = k ; m : = 1 or m : = l ; n : = k ( k , l e N l e v o ke an a c t i o n a ( n l = s ( k l , a ( m l = s ( l l for every s t a t e s c S , a n d a g a i n t he y d e s c r i b e a w h o l e c l a s s of a c t i o n s w h i c h w e s h a l l d e n ote by a�� , w h e n c e a�� •-., rn : = k ; m : = l.J or o-o 1m : = l ; n : = !s.J
Description of processes
For j o i n e d s t a teme n t s w e int roduced a n ew t yp e of brac ket s , " r " and "...J " , t hat s ho u l d expr e s s t h e i n di v i s i b i l ity o f t h e act i o n s evoked by t he m . T h erefore s u c h brackets m u s t n o t b e n e s t e d , no j ump i s a l l owed into a j o i n ed st at ement , and , c l earl y , t he s t ru c t u r e of t h e s e a n g l e brackets must a lways b e comp at i b l e w it h t h e bracket struc t u r e given by begin and end, that i s , e . g . b e i s d i s a l lowed . g i n s 1 ; '5 2 end ; S
The l ast correspondenc e , c l e a rl y , i s correct o n l y w h e n t h e n ames n , m , l , k are p a i rw i s e d i fferent . O t h erwi s e , we obt a i ned for e xamp l e ..1.J
a�� ~'be g i n � h ; h : = n ; n : = m ; m : = h e n� .
Next we s ha l l con s i der c o l l a t er a l s t a t eme n t s ( Di j k s t ra [ 1 1 ] . Wijn gaarden [ 2 5 ] ) . They a r e of t h e general form parbegin p1 b e g i n s1 ; s ; ; p 2 : b e g i n S� ; S� ; parend
end ; end ;
What act u a l l y i s meant by t hi s c o n st ruct is e xac t l y t h e general comb i n at i o n ( o r s e r i a l comb i n a t i o n i n t h e c a s e o f mu l t ipro grammi ng ) o f t h e p ro c e s s e s d e s cr i b e d b y p 1 , p2 , . . . . T h e c o l l at e r a l s t a t emen t d e s c r i b e s a c l a s s of p ro c e s s e s each of w h i c h s t a r t s from t h e s ame i n i t i a l s t at e . T h u s we are fo r c ed to c h ec k , whether e a c h of t h e s e p ro c e s s e s l ea d s e i t h e r t o t h e s ame f i n a l s t a t e ( w h ic h fact could be viewed a s a kind o f i n d ependency of pat h ) o r not , i n w h i c h c a s e t h e co l l a t eral s t a t ement does n o t make s e n s e .
Wit h t he too l s d e v e l opped so far we may d es c r i be proc e s s e s by comp l e t e l y d e - looped , d e - n e s t e d , a n d unwound pro grams , t hat i n e s s e nce a r e n o t h i n g e l s e b u t a s pe c i a l w a y f o r d e s cr i b i n g t h e course o f a c t io n s w h i c h s u c ce s s i v e l y t r a n s form t h e s t a t e s o f t he proce s s . P ro grammi n g were a u s e l e s s j ob i f pro gramm i n g l a n gu a g e s did not provide powerfu l t o o l s b o t h f o r d e s c r i b i n g monotonou s l y r e p e a t i n g s e q u e n c e s of ac tions i n a n abrid ged man n e r and for d e s c r i b i n g s t a t e d e p e n d en t s e l e c t i on o f d i fferent sequences o f a c t i on s , for e xamp l e , t h e wel l known c o n s tructs repeat ifsthen i f B t hen
o r the more e l ementary j ump o r c o n d i t i o n a l j ump . When we tran s l at e t he s e statements into a c t io n s we must fix a l ev e l of a b s t rac t i o n w h i c h again wi ll be i n d i cated b y a n g u l a r bracket s , e . g .
'if B t hen S 1 ; s 2 e l s e S 3 ; S n f i ,_1 i f B t hen lS 1 ; S � e l s e fs 3 ; S nj fi i f B t he n 'S ; f's e l s e 1S ; fs f i . � JJ � 2l In t h e f i r s t c a s e t h e i f - s t at ement corresponds t o o n e ( i n d i v i s i b l e ) act ion w h i c h i s s t a t e d ependent , i n t h e s econd and t h i rd c a s e , howeve r , a c t i o n s or s e q u e n c e s of a c t i on s , r e s p e ct i v e l y , are s e l ect ed a c c o rd i n g t o the boo l ea n v a l u e o f the condition B t hat a l so depends upon t h e momentary s t at e . A s i -
15
m i l ar c o n s ideration a pp l i e s for t h e repeat - s t a t e ment too . In a l l t h e s e c a s e s t h e t e st for t h e cond i t i o n B i s a s sumed to be i n d i v i s i b l e and i f , to the c o n t rary , t h e eva l u a t i o n o f t he boo lean va l u e of B c a n not be v i ewed a s i nd i v i s i b l e , t hen it must be i n d i c a t ed by an appropr i ate s equence o f statement s . Comi n g b a c k t o t he f i r s t primit ive c o n s t ru c t i n pro gramm i n g l a n gu a ge s , t he a s s i g n a t i o n , a s im i l a r c o n s ideration h o l d s concern i n g i t s i n d i v i s i b i l it y . Henc e , for o n e o r t h e o t h e r reason w e c o u l d b e forced t o c l imb down t o t h e l ev e l o f t he i n struc t io n s of a comput er , i . e . to stateme n t s of t h e form Register : = a a Register R e g i s t er . - R e g i s t e r + a D t h e n goto e l s ew h e re if R e g i s t e r
and so o n . At some l ev e l , however , i n d i v i s i b i l i t y of act i o n s mu s t be guaranteed a priori s ince o t h er wise a mea n i n gf u l comb i n a t i o n of pro c e s s e s were not pos s i b l e .
An app l ic a t i o n I n a comp l ete ly sequen t i a l program t h e quest i o n f o r t h e i n d ivi s i b i l ity o f act i o n s d e s cribed b y it s s t a t ements i s of rather l i t t l e conce rn : a c c o r d i n g t o i t s very a i m , a l l t h e a c t i o n s t h e p r o g r a m d e s c r i b e s are performed effe c t i v e l y o n e aft er t h e o t h e r . T hu s t he i n d i ca t i o n of i n d iv i s i b i l i t y by angul ar b r a c k e t s w o u l d be merely a further mean s for struct u r i n g programs t h at cou l d be expre s s ed as we l l by other l a nguage fac i l i t i e s a l ready e x i sting.
T h e s ituati on c h a n g e s comp l e t e l y if w e c o n s i der combi n a t i o n s of proc e s s e s i n t ha t d i v i s i b i l i t y or i n d i v i s i b i l i t y deci des whet her t h e comb i n a t i o n w o r k s or not . C o n s i d e r two p ro c e s s e s p1 and p 2 . If t he i r r e s p e c t i v e s e q u e n c e s of a c t i o n s r e f e r to d i s j o int s u b s e t s of names , t h e i r combina t i o n , s er i a l or g e n e ra l , b e a r s no p rob l ems ( d i sj o i n t combinat i o n in Horning [ 1 7 ] ) , b ut bot h p ro c e s s e s are not a b l e t o exchange any data . Now let both pro c e s s e s have s hared names v i a w h i c h t h ey exc h a n g e d a t a or t hat provi d e d a t a co mmo n t o b o t h pro c e s se s . A s sume f u r t h e r t h at pre parat i o n and r e c e p t i o n of , or acce s s to t he s e data t a ke s t he acti ons a 1 , . . . , a n i n p 1 and s 1 • . • , , S m in p 2 , t hen , obvio u s l y , i t must b e e n s ured t hat eit her proce s s w hen it has e n t e red t h e s eq u e n c e a 1 . . . a n or S 1 , , , S m comp l et e s t h e r e s p e ct i ve s e q u e n c e b e fore t h e o t h e r p roce s s s t a r t s t o u s e t h e s hared names . St ated o t herwi s e , it must b e guarant e e d by s ome s y n c hro n i z i n g mean s t hat the s eq u e n c e s a 1 . . . a n a n d S 1 . . . S m , t h e crit i c a l s e c t i on s , a r e treated a s b e i n g i n d i vi s i b l e a ct i o n s and t he n com b i ned s e r i a l l y (mutual e xc l u s io n ) , Depen d i n g on the sync hro n i z i n g mechan i sm other u nwanted s it u a t i o n s m a y ori gina t e : mut ual b l oc ki n g , ' aft e r - yo u aft er-yo u ' s it u ation , n - 1 pro c e s s e s a r e hindered becau s e t he n - t h pro c e s s decided t o fall a s l ee p , a n d i f pro c e s s e s are p e r i o d i ca l , i n d i v i d u a l b l o c k i n g ( se e e . g . Dij k s t ra [ 1 0 , 1 1 ] J . Let u s i n spect a s an examp l e t h e s econd s o l u t i o n
16
THEORY OF COMPUTATION
to t hi s p ro b le m given in D i j kstra [ 1 1 ] ; ( s ee a l s o G i l b ert [ 1 4 ] ) :
b e g i n var c 1 , c2 : = 1 ; parbegin p 1 : begin
N:
Act i o n s : I 1 I2 c1 c2
L 1 : 2 : li f c2 = 0 t h e n g o t o L 1 f� ; c 2 r n : 3 3 : 'c: 1 : = q p 1 _ 1 : 'cr i t i c a l s e c t i o n ; c 1 : = !....J ; 0 O : fre s t o f c yc l e ; go t o L�
0
end ;
p 2 : b eg i n
L2 : 2 : 'i f c 1 = 0 t h e n got o L2 f � f cHO: 3 : lc2 : = � ;
1 : fc ri ti c a l s e c t i o n ; c 2 : "..2.J ; 0 : !rest of c yc l e ; goto L� end pa rend
1
t
0 1
2
t
t
t
� 2 3 1 1 ---------,, 3 3 1 1 -----';> 1 3 0 1 - 0 3 1 1 -r+-Z t1 o
t
3 1� 0
t
�
t
0 1t-r-
t
� 2 0 1 1�30 1 1 --- 1 0 0 1 -------;>- 0 0 1 1 +-
t
t
p 1 in pro g r e s s
1z
i n p:o g r e s s
Since t he e n c i r c l e d s t a t e ( 1 , 1 , 0 , 0 ) i s reachab l e from t h e i n it i a l stat e , t h e s o l u t i o n d o e s n o t en sure mu t u a l e xc l u s i o n , b o t h proc e s s e s may enter their crit i c a l s ec t i o n at t h e same t i me . Further mo r e , if eit her proces s i s stopped o u t s i d e its c r i t i c a l s ec t i o n the o t h e r can yet proceed ( par t i a l o perabi l it y ) .
t
t
@
t
0 1 0 1 ...-
-------'> 1 00 1 ___,,. 0 0 1 1 -+-
t
I
Now , mutual e x c l u s i o n of t h e c r i t i c a l s e c t i o n i s guaranteed a s we l l a s partial operab i l it y i s n o t d i sturbed . T hi s h o l d s for t h e s e r i a l combinat i on ( mu l t iprogramm i n g ) but not for t h e general comb i n a t i o n : i f b o t h t e s t - a n d - set opera t i o n s wou l d b e p erformed s imu l t a n e o u s l y w e a g a i n reached t h e state ( 1 , 1 , 0 , 0 ) . As s t r i k i n g a s t h e men t i o n ed fact i s , it is not n ew : t h e P - a n d V -o perat i o n Dij kstra i n t rod uced a r e rather c o mp l ex but i nd i v i s i b l e o p e rat i o n s :
t
IL : i f sema = O t hen goto L e l s e s ema : = sema --- 1 f:U
P ( s eroA ) :
N = { I 1 , I2 , c 1 , c2 } is t he s et of names . I 1 and I 2 a r e u se d a s i n s t ru c t i on c o u n t e r s for t h e p r o c e s s e s p 1 a n d p2 r e s p e c t ive l y , t h e i r v a l u e s p o i n t t o t h e stat eme n t t h at d es cr i b e s t h e next a c t i o n t o b e p er fo rmed . W e i nt ro d uc e d t h em f o r reasons of c l ar i t y and i n o r d e r to hand l e t h e g o t o - statements ( s e e B u r s t a l l [ 5 ] l . It i s t a c i t l y i mp l i e d t h a t t h e a c t io n s w i t h t h e l a b e l 2 are the n u l l -act i o n ( i . e . dom a = 0 ) i f t he c o n d i t i o n i s t rue . T h e pro c e s s d e s cr i b e d by t he above program is a comb i na t i o n of t h e p r o c e s s e s d e s cr i b ed by t he stat emen t s p1 and p2 , t h ei r i n i t i a l s t a t e b e i n g ( 2 , 2 , 1 , 1 ) . T h e s er i a l combin a t i o n n o w i s expres sed by t he fo l l owin g stat e - d i agram in which horizontal arrow s i n d i c a t e the progress o f p 1 and vert i c a l arrows t hat o f p 2 . Due t o t h e p e r i o d i ci t y , t h e l e ft s id e i s t o b e i d e n t i fied w i t h t h e r ight s i d e and t h e l o w e r s i d e w i t h t h e upper . T h u s , a n y p r o cess d e s cribed b y o u r pro gram i s � c l o s ed p a t h t hrough t he d i a gram l i ke a L i s saj o u s - figure .
r t r _1__ � 32 1 1--.,, 1 20 1 ------,, 0 2 1 1-+-
+2 1 1 0 1
3 0
1---- --....,.m,------,,,r--,t
� 20 1 1 - - - -
1
2
ments 2 and 3 i n t o o n e j o i n ed stat ement d e s c r i b i n g a n i n d i v i s i b l e a c t io n . T hen the d i agram wo u l d b e :
t
T h e s t r i k i n g fact is t hat t h e s o l ut i on w o u l d b e s a f e i f we h a d ava i l a b l e a n i nd iv i s i b l e t e s t - and - set operatio n , t hat i s , if we c o u l d j oi n t h e s t a t e -
V ( sema ) : lsema : = s ema+.2.J
a n d o n e of t h e i r advantages i s to h i d e t he ' bu s y wait i n g ' of proce s s e s in t hat i t i s bani shed to a l e v e l be low t he c o n s i d ered l ev e l of i n t erest .
C o n c l u d i n g remarks The examp l e i n the l a st s e c t i o n leads t o the im p r e s s ion t hat this met hod could be fea s i b l e for c h e c k i n g t h e correc t n e s s of pro c e s s d e s c r i p t i on s . But l et u s take a l o o k at i t s d i sadvan tage s . ' S i n c e t h e correct n es s , as we have s ee n , m a y depend on t h e choice o f t h e i n d iv i s i b l e action� on ap p l y i n g t hi s method o n e w i l l have h i s d o u b t s whet her t he adequate level of ab straction has been chosen . If t he compo nent p ro c e s s e s are more c omp l ex and if their number i n cr e a s e s t he correspon d i n g graph w i l l exp l o d e . C l e ar l y , to a certain d e gree it cou l d be hand l e d by a computer ( se e G i l bert [ 1 4 ] ) but t h e r e w i l l b e yet a natural bou n d . General proofs would b e very t e d i o u s and , what i s wors e , u n r e l at ed t o t he structure o f t h e proces s .
T h e c h e c k i n g met hod c o u l d b e very we l l a p p l ied to a l l known t yp e s of combinat i o n s o f processes and t h eir s y n c h r o n i z a t i o n mec hani sms ( see e . g . Dij kstra [ 1 1 , 1 2 ] , Den n i s [ 7 ] , Bri n c h Han s e n [ 3 , 4 ] , Van t i l borgh [ 24 ] ) b u t i t i s d o ubtfu l whether w e c o u l d g e t any f u r t h e r i n s i g ht i n t o t h e i r s t ructure b y c h e c k i n g t h em i n t hat way . A l l t h e d if f i c u l t i e s i n comb i n i n g p ro c e s s e s a r i s e from s h a r e d name s . F a l s e i nt erac t i o n o n shared names may cau se t i me dependent f a i l ur e s t hat , due to t he i r irreproduc i b i l it y , in large syst ems can no more b e d i st i n g u i s he d from sporadic hardware f a i lures ( Br i n c h Hansen [ 4 ] ) , O n e s h o u l d t here f or e c o n f i n e himse l f t o u s e d e s c r i b i n g or program ming fac i l it i e s t hat , a l t ho u g h r e s t r i ct ive , are c o n c ept u a l l y c l ea r a n d a l low to a c erta i n extent to det ect programmi n g m i st a k e s o n a syntact i c ba s i s . Conceptua l l y , we c o u l d avoid s hared names as
Description of processes
pro p o s e d i n Br i n c h Hansen [ 4 ] , Dij kstra [ 1 2 ] . If we comb i n e a l l i n t era c t i o n s of n pro c e s s e s into a ( n +1 ) - s t process c a l l ed ' s ec re t ary ' or ' monit o r ' t h at is c a l led u pon when i n t e r a c t i o n i s needed , t hen any of t he s e n+1 p r o c e s s e s had i t s ' own ' names . O bvi o u s l y , t h e d i f f i c u l t y is d e l egated n ow t o t h e ' s e c ret ary ' or ' mo n i t o r ' , but by i t s very n a t u re i t r e s t r i c t s and at the s ame time regu l at e s t he a c c e s s t o t he s hared names .
A rigorous t reatment of b a s i c c o n c e p t s a s proces s , a c t i on s , t he i r i n d i vi s i b i l i t y , a n d t h e l i ke - po s s i b l y by a more e xt ended mathema t i c a l apparatus can h e l p to c l arify t he s e c o n c e p t s and t o stand a r d i z e their u s a ge , i n s ome c a s e s it may even pro vide a rea s o n a b l e too l for a n a l y z i n g pro grams a s t h e examp l e s have s hown . Pro c e s s s t ru ct u re , however , i s ma i n l y p ro b l em o r i e nt e d a n d i s reflected by t h e d es c r i b i ng pro grams . Thus t h e tools for structuring pro ce s s e s and fo r s t a n d a rd i z i ng t he a c c e s s t o s hared n ames mu s t be given by programm in g l a n gu a ges . L it e rat ure
[ 1 ] J . L . Ba e r A Survey o f s o m e T heoret i c a l A s p e c t s o f M ul t iproces s i ng ACM C omp . Surveys Vol . 5 , No . 1 ( 1 97 3 ) [ 2 ] H . B e k i c / K . Wa l k F orma l i z a t i o n o f Storage Propert i e s in Sympo s i um on Sema n t i c s of A l go r it hmic Languages , L e c t u re Note s , Springer 1 9 7 1 [ 3 ] P . B r i n c h Han s e n A Comp a r i s o n o f two Synchro n i z i n g Concept s Acta I n fo rma t i c a Vo l . 1 , No . 1 ( 1 9 7 2 ) [ 4 ] P . Bri n c h Hansen An Approach to M u l t ipro gramming ( 1 9 7 3 ) , to appear in ACM Comp . Surveys [ 5 ] R . M. B u r s t a l l F o rma l Description o f Program St r u c t u r e s a n d S ema n t i c s i n F i r s t O r d e r L o gi c i n M a c h i n e Int e l l igence 5 , New Y o r k 1 97 0 [ 6 ] F . Commoner/A . W . Ho l t / S . Even/A . P n u e l i M a r k e d Directed Gra p h s J . o f Comp . a n d S y s t em S c i e n c e s , V o l . 5 ( 1 971 ) , p . 5 1 1 [ 7 ] J . B . D e n n i s / E . C . Van Horn Pro gramm i n g se·man t i c s for M u l t i progr ammed Compu t a t i o n s CACM V o l . 8 , No . 9 ( 1 9 6 6 ) [ 8 ] J . B . Dennis C o n c u rrency i n Advanced Course of Software E n g i n e ering Lecture Not e s , Springer 1 9 7 3 [ 9 ] P . Deu s sen K a u s a l e Operatoren t o a p p e a r a s Interner B e r i c ht der F a k u l t at fUr Info rmat i k d e r Un iversitat Kar l sruhe [ 1 0 ] E. W . D ij kstra S o l u t i o n o f a Pro b l em in C o n c u rrent Program ming Control CACM Vo l . 8 , No . 9 ( 1 9 6 5 ) ( 1 1 ] E . W . Dij k st ra Coo perat ing S e q u e n t i a l Pro c e s s e s i n Programming Language s ( F . Genuys ed . ) , Academic Press 1 9 6 8
17
[ 1 2 ] E . W . Dij kstra H i erarc h i c a l Ordering of Sequent i a l Pro c e s s e s A c t a Info rma t i c a 1 ( 1 9 7 1 ) [ 1 3] H . J . Genrich E i n f a c h e n i c h t s equ ent i e l l e P r o z e s s e Ges e l l sc h . f . Ma t hema t i k u . Datenverar b e i t u n g , Ber icht Nr . 3 7 ( 1 97 1 ) ( 1 4 ] P h . G i l bert / W . J . C ha n d l e r Interference between Commu n i ca t i n g Pro c e s s e s CACM Vol . 1 5 , No . 6 ( 1 97 2 ) [ 1 5 ] A . N . Habermann Synchro n i z a t i o n of C ommu n i cating Pro c e s s e s C A C M V o l . 1 5 , No . 3 ( 1 97 3 ) [ 1 6 ] C . A . R . Hoare T owards a T heory o f Para l l e l Programm i n g i n O p e r a t i n g Systems T e c hn i q ue s , C . A . R . Hoar e , R . H . Perrot t , e d . , Academic P r e s s 1 97 3 ( 1 7 ] J . J . Horning / B . Rand e l l Pro c e s s Structuring ACM Comp . Surveys V o l . 5 , No . 5 ( 1 9 7 3 ) [ 1 8 ] A . J amme l F o rma l e Behand l u n g d e s Verkl emmu ngsprobl ems beim Me hrprogramm b e t r i e b D i s sert a t i o n T . U . MU n c h e n ( 1 9 7 2 ) [ 1 9 ] R . E . K a l ma n /P . L . F a l b /M . A . Arb ib T o p i c s in Mathema t i c a l System T heory McGraw-Hi l l 1 9 6 9 ( 2 0 ] P . Kandzia / H . Langma a c k I nforma t i k : Programmi eren T e u bner Studi e n b U c h e r I n forma t i k ( 1 9 7 3 ) [ 2 1 ] C . A . Petri G r u n d s at z l i c h e s z u r B e s c h r e i b u n g d i s kreter Prozes se i n 3 . Col l o qu ium U ber Automatent heo ri e , B i r khaus er 1 9 6 7 [ 2 2 ] B . Reu sc h Z u r R ea l i s i eru n g von Automaten U b e r A l gebren Ges e l l s c h . f . Mathema t i k u . Oatenverarbeit u n g Bericht Nr . 3 8 ( 1 97 1 ) [ 2 3 ] R . M . Shapiro / H . Saint A New App roach t o O pt imizat i on o f Sequencing Decisions i n A n n u a l R e v i ew i n A utomat i c Programm in g , V o l . 6 , Part 5 ( 1 97 0 ) [ 2 4 ] H . Vant i l borgh / A . v . Lamsweerde On an E xt e n s i o n of O i j k s t r a s Semaphore Primit ives I n f . Pro c . Let t e r s Vol . 1 , No . 5 ( 1 97 2 ) [ 2 5 ] A . van Wij n gaarden ( ed . ) R ep ort o n t h e A l g o r i t hm i c Language A L GO L 6 8 Num . Ma t h . 1 4 , 7 8 - 2 1 8 ( 1 9 6 9 ) ( 2 6 ] N . Wirt h T h e Programm i n g Language P a s c a l A c t a Informatica 1 ( 1 9 7 1 J
A. Giimher et al. (eds.), flllematio110/ Computing Symposium /973 © North-Ilo/land Pub/. Co., /974.
GENERAL CONTEXT - FREE PARSING IN T IME N . 2
Michel Sne l l ing
MBLE Re search Laboratory, Brus se l s , Bel g ium . (Now at the Unive rsi ty of L i l l e , France)
This paper present s a par s e r , which acce p t s any context-free grammar in BNF no t a t ion and works in a t ime propor t ional to n
2
in wor s t cases . I t s general strategy is of a predictive type , like Earley's algori thm
but a d i f ferent organizat ion and use of informations already ob t a ined perm i t s a better treatment o f
recurs ivi t ies and amb i gu i t ie s . I
. INTRODUCTION
Among the nume rous general context-free parsers that have been describe d , Earley ' s a l gori thm
seems to be the more e f f i c ient for time and
space (Earley [ 1 ] , [ 2 ] ) . But , in wors t case s , i t 3 s t i l l works in a time propo rt ionnel t o n , if n is the l ength of the input s tring . This paper
presents a par ser , which accep ts any context
ved co rrec t in s ec t ion 4 . Sec t ion 5 is devo ted to theor ical resul t s
t ime n
2
i n general , t ime
n for LR(k) granunars without us ing a " lookahe ad " in s tates . Sec tion 6 gives s everal example s . . DEFINITIONS AND NOTAT IONS
. 1 . Context-free grammars . 2
A context-free grammar i s a quadrupl e G = ( V , T , P , R) 2
free grammar in BNF no tat ion and works in t ime
where V is a finite s e t s o f symbo l s , the vocabu
d i f ferent organizat ion and use of informa t ions
a dis t inguihed nonterminal cal led the roo t o f
n
2
in wo rs t case . Its general s t rategy i s o f a
p red ict ive type , l ike Earley ' s a l gori thm , but a a l ready ob t a ined permi t s a b e t ter treatment of
recur s iv i t i e s and amb igui t ie s , in part icular for granunars wi th unbounded d irect amb i guity for
which Earley ' s parsers runs in t ime n . 3
New de f in i t ions for " s tate" and especially
" s tate set" are used . New types o f s tate s e t s
are int roduced : cons truc ted s tep b y s tep a s par s ing progre s s e s , they ob ta in a l l informa t ions
related to the re cogni tion of a r ight recurs ive
der ivat ion and are such tha t the ir proce s s ing by d i f fe r ent comp l eter canno t generate twice
the same s tate excep t for a t mos t one o f them.
The o ther fea tures of the algori thm are the way
in which s ta t e s e t s are cons truc ted ann ordered ,
and the recurs ive act ion of comp l e te r s proces s ing
s tate s e t s and cutting out redundant informat ions .
Al though logical ly comp l e t e , this paper i s e a s i e r
to r e a d i f one i s fami l iar wi th Earle y ' s pai:ers orat: least with the informal exp l anat ion they present .
In s ect ion
b a s ic terminalogy i s introduced .
Sec t ion 3 describe the a l go r i thm , which i s pro2
l ary ; TcV is the set of terminal symbol s ,
N=V-T i s the s e t of nonterminal symbo l s , R e N i s the grammar and P is a f in i t e s e t o f produc t i on
rul es wr i t ten
D
p
-+ C
p I
cP p
J ,;p(d
w i th D e N and c e V for I ,;j ,;p p If a and 8 are s t r ings in v • then a�B expres ses 3
that there e x i s t y ,6 , 11 e v • and AE:N such that
a =y Ao , 8=y116 and A -+11 is a produ c t ion in P . The symbo l � deno tes the tran s i t ive closure o f '=? .
A s entential form is a s tring
a E: v•such tha t
R � a . A s entence is a senten t i a l form a e, T * .
The language L ( G) defined b y a grammar G i s the s e t of i t s s entences .
/\ deno tes the empty s tring, E = {AE:N , A � /\} .
The input s tr ing w i l l be writ ten x • • • X . Let r- 1 n be a new terminal ( r .\,T) and D a new nonterminal O (D f N) : the r ule D -+R is added t o P and O O x . . . X is trans formed into x . • . X 1- ( the mod i 1 n 1 n f ied input sen tence f o r the mod i f ied grammar) . 2. 2.
States
For the descrip t ion o f the d i f ferent s teps of the
20
THEORY OF COMPUTATION
parse the a l gorthim bui l t s s tates . A s tate is a triple
where p , j and f are integers
p ( O"p"d) is the number of a grammar rule j
(O� j "p) indicates a p o s i t ion in the rule ' s right-hand side
f ( O" f En) indicates a pos i t ion in the · input s t r ing .
Whenever i t i s not necess ary to d i s t inguish s ta tes
with the same values for p and
sha l l also use another type of state
, we
j
w i th the same meaning for p and j and where F= { f . , i= l , 2 , . . . , k l O( f . "n } is a set of pos i t ions in the input s t ring . l
2 . 3 . State S e t s
l
Al though w e could also cons ider tha t < p , j , F > i s a s t ate se t , we sha l l d e f ine as s tate sets ;
S the s e t of al l s tates used by the al go ri thm,
S , O.:: iEn+ I an ordered sub s e t of S ( S= U S i ) , i O� i.:sn+ l If F= { f , . . . , f } , S S U . . . U S 1 fk F f k I =
'v o E: N , s�= { < p , j , f > E: s . l c p l l p s !l {
E: s l. t cp & T } ,
j+l
j+ l
=
=
D }, p
S� {
E: S . l j p } , these sets being
ordered by decreas ing f , (and simi l arly for s : , X T SF , S F ) ' p S the set of a l l states that a comp l e ter F cal led by a s tate < p , p , F > w i l l have to process 0 recursively : let s ( F , p) . U s . P and l l& F 1 l
=
l
=
=
S (F ' , p ' )) _ s 2 (F , p ) S 1 ( F , p) u{ 2 (
& S (F , p ) 1 De f ined l i k e thi s s ( F , p ) i s no t a s tate s e t but 2 a s e t of s t ate sets : there fore one or more of
U
=
its e l ement s can contain the same s ta te s . S� wi l l
b e cons tr octed s tep 1:1/ step in the algori dun from s ( F , p ) 2 b y cutt ing out a l l unneces s a ry s tates a s soon as it f inds them . This will be comp l e ted in 3 . 1 . 5 . 3 . ALGORITHM
3 . 1 . The recogn i zer
3. I . I . Ini t i a l i s a t ion : s tar t with the s tate in s , a l l nontermina l s unmark ed and O i O.
3 . I . 2 . : E : to every s tate < p , j , F > in S =
one of the fol lowing operat i ons :
i
apply
If c j
E: N then PREDICTOR ; if c j
+I
i s an unmarked j+ I nonterminal then for any r such tha t D C r p add < r , O , i> to S . and mar k the nonterminal . l +I +l X. add If C j E: T then SCANNER : i f C j 1+ ) p p p , j + I , F to S . i+ I If j p then COMPLETER : for a l l s ta t e s
has been al ready ad
ded to S ( there is an amb igui ty) : i f it is i by the s ame comp l e ter call then the s tate
to S . i
When there i s no more s tate to proces s in S ' i unmark a l l nonterminal s , add one to i and i f u, n + l re turn t o E .
< O , 2 , O> } then n+ l { x • . • X E: L ( G) . If there exi s t i , O" i ,:;n+ l such 1 n tha t S 0 then x . . . X i\:,. L ( G) . i 1 n if the grammar con 3 . 1 . 4 . Case of empty rules 3 . 1 . 3 . Termina t ion : if S
=
=
tains emp ty rules , then i f a s tate
such
that C j k, E i s added to S ' then the s tate i mus t be added to S . a t the same t ime . +
(The s e t E can b e cons tructed once f o r a l l when
the grammar is given) .
3 . 1 . 5 . Remarks
I ) We can now comp l e t e the definit ion of
s: ;
it
i s the s e t (which can some t ime s contain twice o r
more the same e l ement) of a l l s ta t e s in t h e e l e ments o f s ( F , p ) l e s s those tha t are d e l e t e d i n 2 cases and 2 of the comp l eter .
2) Case 2 of the comp l e t e r permi t s to d e l e te from -p S a l l the s ta t e s whi c h , when comple ted , could F c reate more than once the same s tate .
21
General context-free parsing in time n 2
3 ) Case I o f the comp l et er treats r ight recurs i
v i t i e s : in that case each t ime the l a s t s t a te
the comp l e ter operat ion does no t take much more
t ime : it is a recurs ive function organized as a
in the recu r s iv i t y ( the one w i th the higher f )
case ins truc t ion ,
responding s tates can be deleted from S� , which
4 . 1 . Lemma I
i s comp le te d , a l l t h e o thers a r e automa t ically
comp l e te d too , They are no t useful l and the cor
keeps only the "wayout s " o f the recur s iv ity .
ensure that the s ta t e s in a i r igh t recurs ivity are proces sed in order , from 4) Order ing of S the l a s t one ,
4 . PROOF OF CORRECTNESS
If t: S
i
then \/ f e F
�' fH and c1 . . , (.._i ~ =,, xf+ 1 . . . x'l,. . p p .
4 . 2 , Lemma 2 : If E S . and (..-
.
'l,
_i + l p
_i +x,. . . , (..- =J> p
3 . 2 . The ana lyser
Xi +l ' ' ' Xg (j+x�p, g�n) then the state wi l l be added to S if it is not an e lement of a right recU:t>sivi ty . 4 . 3 . Theorem I : R �X . . . X if and only if 1 n s + l = { < 0, 2, 0> } . n
which cons truct the tree in the same t ime . Earley
delet ions does not mod i f i ed the s ta t e s created
mus t say that in case of very ambiguous grammars ,
in c a s e I ,
t e suff i s ant in pract ice , so much more a s some
I t is natural to take for un i t of t ime an ope ra
5) Bouckaert e t al , [4] , [5] s tud i e s the more
e f f i cient way to use the context in this type
of a lgori thm. The method g iven can be appl ie d s traighforward here .
To transform the recognizer of l a s t paragraph ,
into a p a r s e r , one j u s t needs to add a p rocedure
[1] give s a s imp l e way to ob tain thi s , It can be
e a s i ly adap ted to this a lgori thm , However we
we get only a " factor ize d tree" from which a l l
the d if ferent trees can b e ob tained . This i s qui
grammars can give an inf inite number of deriva t ions , even for emp ty s t r in§S , 3 . 3 . Imp l ementation
A detailed description of the impl ementat ion
would be ted ious , so we sha l l give only a ske tch
The proo f s are very s imp l e and s imilar to the
ones of Bouckaert et a l . [4] . However we mus t
also use the rather obvious p roperty that the
they only prevent s the crea t ion of more than on
ce the same s tate in case 2 and of use l e s s s ta t e s 5 , RECOGNITION T IME
t ion which is independant of the grammar and of
the s tring to parse . Thi s cho ice is imp lementa
t ion dependant : we sha l l no t discuss the problem
here . As our implement a t ion is bas ically s imilar to Ear l ey ' s , his d i s cuss ion hol d s unchanged and
o f i t . Based mainly upon l i s t s , it is s imilar to
we can take as "ba s i c s tep" the generat ion of a
I ) the s e t s S� ( O�p�d) ,
( for examp l e , in a comp l eter call the number of s teps is the number of e l ements of -p S ). F The fol lowing no tat ions w i l l be used :
the one given in Earley [1] , but with a few dif
ferences :
· s:i
and S�
are organized
in d i f ferent l i s t s ( in s tead of one l i s t for S ) . i 2 ) the pointer i c reated by the predictor proce s sing i
i
i s in fac t a pointer towards the l is t i I n tha t way w e ge t very s imply the s t ruc ture
e S
s:.
of the l i s t S� w i th a l is t of the se p o inters for the d i f fe rent e lement s of F .
3 ) t o delete a s t a te we j us t remove one e lement from a l i s t ,
4) the case of empty rules i s s imp l i f ied by the use of E .
5 ) a l though i t s d efini t ion i s more comp l ica ted ,
s tate , i . e . the act ion of adding a s tate to S or
a t temp t ing to add one which is not nece s s ary m = max p , O�p�d
C is a con s tant independant of the length of the s tring
,vi means propo r t ional ly
to i , tha t i s to say
a quant i ty which can grow with i .
5 . 1 . Theorem 2 : the time required to recognize
any sentence of length n as the member of the language generated by any given C-F gramnar is bounded by Cn2 •
THEORY OF COMPUTATION
Proof Le t us prove tha t the number o f s tates ge2
nera ted by the a lgor i thm is bounded by Cn
There are n s t a te s e t s , l e s s if the senten
ce does not belong to the language .
In each s tate set the predictor generate s
at mos t d s t a te s , one for e ach rul e , s ince , a t
s tep i , t h e pred ic tor a d d s s tates of t h e form
and only once for each non-termina l .
In each s tate set the scanner generates a t
mos t d m s tates s ince , a t s tep i , i t processes on j+I l y the s ta tes o f S and , i f C =X + ' j u s t mod ii i I p fi es j , wi thout taking care of F . In the se two case s , the presence o f emp ty
rul es can involve the generation of at mos t dm
other s t a te s .
In each s tate s e t there are at mo s t d com
p l e t e r main c a l l s : by the s tates < p , j , F :,, crea ted a t s tep i- 1 by the scanner and for which
j =p . Two cases mus t be cons idered
I) F= { f ' . . . , f } with kl ,vi ( as for UBDA 2 ) I kl the comp l e ter mus t proc e s s a l l s tates in p p sf , • • . , s f kl 2 ) k l i s not 'V i ( fo r example I as for UBDA I ) b u t
a t l e a s t one o f the s tates
w i t h
F ' = f ; , . . . , fk } and k 2 ,v i ( S f contains at mo s t dmf s ta t e s ) .
2
In that case the comp l e ter main c a l l can generate kl k 2 s t a te s ,
i
2
i f kl and k 2 are
i . In any
o ther case the number of s ta tes generated i s boun-
ded by dmi and the theorem ho l d s . The prob l em 1s therefore to prove that the number of s tates
rea l ly generated i s in fact ,v i , because ,vi s tate s e t s have a l ready been comp l eted togethe r , o r
tha t t h e number of s u c h c a l l s i s bounded indepen
dantl y of i .
< p , p , F;, e S
i
w i th F= f , . . . , f D
"'
p� .
X
f
1
I
kl
+1 · · ·\
imp l ie s by lennna l
. .x. 1 +I ' kI As the number of rules and non terminal s is bounD ll.�X f p
ded but no t k l , th i s imp l ies a recur s iv i ty in the
der iva t ion of D : there mus t exi s t D E: N such q p * tha t D II' ="7' CL D et and D :;, et D et • In the s ame I q 2 p q 3 q 4 way
, each t ime D
is recogni zed . If this happens more than once , the f i r s t comp l et ion o f S� can generate
i
2
s ta
tes , but the other ones only -vi by cons truct ion
of the comp le t e r ( In the cases of UBDA I and
UBDA 2 where F ge t s one more e l ement at each s tep , the prob l em rema ins the same s ince the s e t F of
s tep i i s the s e t o f s tep i- 1 , whi c h has a l ready
been comp l e ted , p l us one element ) i
The problem i s thus t o show that there c annot
e xi s t ,vi d i f ferent such recur s i v i t i e s of ,vi s te p s in t h e derivat ion of a s tr ing of l ength i (whi c h
c o u l d l ead to ,v i F ' s d i f f e r ing b y � i e l emen t s f o r t h e d i f fe rent s t e p s ) .
As there is a t mos t d non-terminal s we can res-
General context-free parsing in time n 2
trict our selves to one : suppose n :, a D
a ' w i th
a 1:Y". We can suppose a# /\ : in the case o f empty p
p
rule s there should exis t nontermin als der ivab l e as emp ty rules i n a s many d i f ferent ways as we
are be tween ( ) , fol lowed by a 1t if this causes
de l e t i o n , S tates d e l et ed are between [ } f o l lowa:l
by the number of the s tep wher e this occur . We
suppose that < 0 , 1 , 0> cannot be added before s tep
want : it is p o s s ib l e ( for examp l e A➔AA, A➔/\)
n.
There f ore to have 'I.I i d i f ferent recur s ivi t ie s
a l gori thm i s in t ime n
but genera tes a t mos t dm s tates s ince they are
all generated a t the same step with the same f .
t h e s tr ing gener ated by a mus t have a l ength
growing w i th i and there cannot exis t � i steps of recur s iv i ty in a s tring of l ength i . Thi s achieves the proof ,
5 . 2 , Theorem 3 : the time required to recognize
any sentence of length n as the member of the language generated by an LR grammar is bounded by Cn Proof
as in Lewis and Stearns
[3]
we say tha t
G is LR(k) if i t is unamb iguous and if for a l l
w , w , w , w j E: T" , A e, N , 1 2 3 1 !.� w , R !.. R *=) W Aw , A =;, -,, w 1 w 2w 3' and k : w l =k : w3 imply 2 2 I • I • 2 R �w Aw • To generate i s tates we must h ave 1 3 comp l e ted Ni conta ining �i e l ement s during
s�
the recognit ion of a sub s tring of length i , and , among them, there mus t exis t at l e a s t a s tate
< p , j , F> with F={ f , . . , , f l } , k J ,v i , 1 k . Thi s i p l i e s R ;'ii x l . • • x c l . . . C J B and '? f f p p I • c " ' C J ,;> X J ' " \ f or f= f ' " ' f l with 8 f E. V* p k f+ 1 p and this would imply ambiguit ies in the der iva-
s 1 , . , , , S k i are such tha t one only can be matched with an input t ion . The only solu t ion is that
s tr ing, a l l o ther possib i l i t ie s be ing wrong .
Moreover i f G is LR(k) this detec t ion mus t be
p o s s i b l e with only the f i r s t k terminal s genera-
b l e by the 8 � . Therefore the only po s s ib i l ity
i s a r ight recur s ivity but then we are in case 1
o f the comp leter and only the p o s s i b l e "way outs" of the recur s iv i ty are genera ted : a t mos t N i
s t ates for the who l e recur s ivity ( otherwi s e the
grammar would be amb iguous ) , This achieves the proo f .
6 , EXAMPLES
We sha l l use a representat ion s imilar to Earley ' s
[2]
fo r
s ta te s . States generated but no t added
23
6 . 1 . Grammar RR :
A ➔ aA ; A ➔ a .
I t is an examp l e of grammar for which Earley ' s
wi thout l ookahead , For
2
our a l go r i thm it is in t ime n because only one -p s tate remains in S , the o ther ones b e ing d e l e ted F at each s te p by case I of the comp l e t e r . As it is
very s imp le we sha l l not detail it he re . 6.2.
A ➔ aAa ; A ➔ a .
I t i s an examp l e o f nonamb iguous grammar for
which our a l gorithm , j us t l ike Earley ' s needs
time and space n . In this case we have 8 =a f which is no t bounded . For this case both a lgor i2
f
thms are s im i l ar , so we sha l l not detail it . 6 . 3 . Grammar UBDA I
A ➔ AA , A ➔ a ,
In this examp l e cases
mi t t ime n
so SI
S2 S3
S4
2
ins tead of n
R ➔ .A A ➔ . AA A ➔ .a A ➔ a, [A ➔ A.A A ➔ . AA A ➔ ,a A ➔ a, [A ➔ A.A A ➔ AA . (A ➔ A . A A ➔ ,AA A ➔ .a A ➔ a, A ➔ A.A A ➔ AA . (A ➔ A . A (A ➔ AA , (A ➔ A . A ' A ➔ .AA A ➔ .a A ➔ a, A ➔ A.A A ➔ AA . (A ➔ A . A (A ➔ AA . A.A (A A.A (A . AA A A ➔ .a
.... ..
and 2 occur both to per 3
0 0 0 0) I
0
as for Earley ' s .
3
I 1 (0)] 4 0 I) 2 2
( I ) (0) 1 ,0
2 2
0) 0) I)
3 3
(2) ( I ) (0) 2, I ,O 2) I , 0)
3 3
I) O)
4 4
and so on • . . 2 Rem case 2 i s a lways su f f i sant t o get time n as i t resul t s from proof of theorem 2 .
24
6 . 4 . Grammar UBDA2 :
A + AAa ; A + a
THEORY OF COMPUTATION
In this case only case 2 permi ts delet ions .
so
SI
S2
S3
S4
SS
S6
:
R A A A [A A A A A A A A A A A A (A A A A A A A (A (A A A A A A A (A (A (A A A A A A A (A (A (A (A
+ + + + + + + + -+ -+ -+ -+
...
+ -> + -> + -+ + + + + + +
... ...
+
...
... ... ...+ ... ... ... ... ... ... ... ... ... ... ...
and so on
.A . AAa .a a. A . Aa .AAa .a a. A . Aa AA . a .AAa .a a• A . Aa AA . a AAa . A . Aa • AAa .a a. A . Aa AA . a AAa . A . Aa AA . a . AAa .a a. A . Aa AA . a AAa . A . Aa AA . a A . Aa .AAa •a a. A . Aa AA . a AAa . A . Aa AA . a A . Aa AA . a
...
0 0 0 0
6 I I I I 0 2 2 2 2 (0) I 0 0) 3 3 3 3 (I)
o]
2,0
I I) 0) 4 4 4 4 (2) (0) 3, I 2,0
2) I) 0) 5 5 5 5 (3) ( I ) 4 (2) (0) 3, I 3) 2 , 0) I) O)
7 . CONCLUSION
On the prac t ical side the parser described in
this paper is not very effic ient when compared
to spec ial ized ones . But it has the advantage of
proce ss ing any context-free grammars without
transformat ion , wh ich is very intere s t ing in ap
p l i ca t ions l ike syntac t ic macro-processors . If
we use the context to reduce the number of gene
rated s tates , and a garbage co llector for useless
s tates we obtain very good t ime and space perfor
mances which is of cruc ial impo rtance in these app l icat ions , espec ially for the space .
On the theoret ical s ide it seems very difficul t
to obtain a time n parser , but one could try to
enlarge the c lass of grammars processed in t ime
and space n , or at least to give a good defini t ion of these classes •
BIBLIOGRAPHY
[ 1 } J . EARLEY . An efficient Context-Free Par sing
Algorithm.The s i s , dep t . of Compu ter Sc ienc e , Carnegie-Mel lon
Univ . ( 1 968) .
[2} J . EARLEY . An effic ient Context-Free Pars ing Algorithm. C .A . C . H . _!l, 2, pp . 94 1 02 ( 1 970) .
[3] P . M . LEWIS II , R . E . STEARN S . Syntax d irec ted transduc tion . J .A . C . M • .!2_, 3 ,
pp . 4 65-488 ( 1 968) .
[4] M. BOUCKAERT , A . PIROTTE , M . SNELLING . More effic ient general context-free
top-down parsers . M. B . L . E . Research
Lab . Brussels (Be lgium) Report Rl 73 ( 1 97 1 ) .
[s] M. BOUCKAERT , A . PIROTTE , M. SNELLING .
Effic ient pars ing algori thms for
general context-free grammars . To appear in Information Sciences .
A. Giinther et al. (eds.), International Computing Symposium 1 9 73 © North-Holland Pub/. Co., 1974.
RECURSIVE FUNCTIONS NOT DEPENDENT ON THE COMPUTATIONAL RULES Giorgio De Michelis
Gruppo di Elet tronica e Cibernetica Universita di Milano , Italy
I t is well known that the computation of a recursively defined function depends on the computa tional rule one has made us e of. That is once the arguments hav e been appro priat e ly choosen the function may not give value if computed with leftmost-innermo st rule , whereby a defined value is obt ained if the function is comput ed with the leftmost-outermost rul e , or Kleene • s rule, or Vuillemin I s normal rule . On the basis of some Cadiou-Manna ' s ideas , a Function Calculus is introduced, where it is shown that funct ions ' independence from computational rules is undecidable . Furthermore a class of functions is introduced, namely the St eady Funct ions , who se definition is complet e ly synt actical and it is proved that function steadiness is a sufficient condition fo r function independence from comput ational rules . 1 . FDRWARD
Computation of recurs ively defined funct ions depends on the computational rule one makes us e of, as it is known from literature ( Mor ris [ 1 J ) • How to charact erize such funct ions is thus the key-point in order to us e them in a cor rect and deterministic way ; this problem has been faced with s everal approaches. On the one hand , it has b e en proved that i a) a recurs ively defined function is identi fied by the least fixed point of the func tional which defines it , beyond the speci fic rules us ed by the computation, (Mor ris [ 1] and S cott [2] ) ; b ) some computational rules don' t give values where the least fixed point is defined ( Cadiou [ 3] ) . On the other hand, Vuillemin [ 4] has defined a new computational rule , the "normal rule", which both computes exactly the least fixed point , and is optimal with respect to compu tational comple.:x:ity. In the present paper we are suggesting a radi cally different approach I we characteri ze syntactically tho s e recursively defined func tions which are independent from computatio nal rules , as a cont inuation of De Michelis [5] . Therefore , first we define a functional cal culus ( § 2) and then we prove t hat function independence from computational rules is un decidable in genera le cas e ( € 4 ) • In addition, we characterize the computat ional
rules with respect to the calculus bas ic func t ions and on the basis of their partial or to tal nature ( € 3) . Finally , we define a class of functions , called st eady functions , and we prove the independence of their computation from the computational rules ( 9 4 ) . Such a class is sufficient ly wide as to inclu de the functions most common in literature ; it is easy to s e e that t hose functions which do not belong to the above class are in some way unnatural, in the s ens e that t hey contain dummy variables , that is variables , which do not play any role in computation ( § 5 )
2. A FUNCTIO:tlAL CALCULUS : SYNTAX
We introduce now a Funct ional Calculus , with a formalism by means of which we will lat er express properties of recursiv ely defined functions . Def. 1 : Aluhabet . Let the alphab et A of our Calculus b e defined in the fo llowing way :
A = V v C v B v F v { ( , )J 1] \I { where V = s et of individual variables C = s et of individual const ants ( one of the elem ents of C is necessarly the ''undefined" const ant w ) . F = s et of functional variables , each one with its n- arity B = s et of functional cons t ants each one with its n-arity ( one of the elements of B is necessarly cond, 4- arious ) {c,) 1 1] = s et of auxiliary simbols for t erms construc t ion