Abstract
The issue of program control structures has had a history of heated controversy. To put this issue on a solid footing, this paper reviews numerous theoretical results on control structures and explores their practical implications.
The classic result of Böhm and Jacopini on the theoretical completeness of if-then-else and while-do is discussed. Several recent ideas on control structures are then explored. These include a review of various other control structures, results on time/space limitations, and theorems relating the relative power of control structures under several notions of equivalence.
In conclusion, the impact of theoretical results on the practicing programmer and the importance of one-in, one-out control structures as operational abstractions are discussed. It is argued further that there is insufficient evidence to warrant more than if-then-else, while-do, and their variants.
- 1 Allen, F.E., and Cocke, J. A catalogue of optimizing transformations. In Randall Rustin (Ed.), Compiler Optimization. 5tb Courant Computer Science Symposium, Prentice-Hall, Englewood Cliffs, N.J., 1972, (pp. 1-30).]]Google Scholar
- 2 Ashcroft, E. and Manna, Z. The translation of"GOTO" programs to "WHILE" programs. Rep. No. STAN-CS-71-188, Comput. Sci. Dep., Stanford U., 1971.]] Google ScholarDigital Library
- 3 Bochmann, G. V. Multiple exits from a loop without the GOTO. Comm. ACM 16, 7 (July, 1973) 443-444.]] Google ScholarDigital Library
- 4 Bohm, C., and Jacopini, G. Flow diagrams, Turing machines and languages with only two formation rules. Comm. ACM, 9, 5 (May 1966), 366-371.]] Google ScholarDigital Library
- 5 Bruno, J., and Steiglitz, K. The expression of algorithms by charts. J. ACM, 19, 3 (July 1972), 517-525.]] Google ScholarDigital Library
- 6 Cooper, D.C. Some transformations and standard tbrms of graphs with applications to computer programs. In E. Dale and D. Michie (Eds.), Machine Intelligence 2. American Elsevier, New York, 1968, pp. 21-32.]]Google Scholar
- 7 Dijkstra, E. W. Notes on structured programming. In Structured Programming. W.J. Dahl, E.W. Dijkstra, and C.A.H. Hoare, Academic Press, New York, 1972, pp. 1-82.]] Google Scholar
- 8 Friedman, D., and Shapiro, S. A case for the while-until. SIGPLAN Notices (ACM newsletter) 9, 7 (July 1974), 7-14.]] Google ScholarDigital Library
- 9 Gross, J.L., and Brainerd, W.S. Fundamental Programming Concepts. Harper and Row, New York, 1972.]]Google Scholar
- 10 Henderson, P., and Snowdon, R. An experiment in structured programming. BIT 12 (1972), 38-53.]]Google ScholarCross Ref
- 11 Hoare, C.A.H., and Wirth, N. An axiomatic definition of the programming language PASCAL. Acta blformatica 2 (1973), 335-355.]]Google Scholar
- 12 Kernigham, B.W., and Plauger, P.J. The Elements of Programming Style. McGraw-Hill, New York, 1974.]] Google ScholarDigital Library
- 13 Knuth, D.E. Structured programming with GOTO statements. Computing Surveys, 6 (Dec. 1974) 261-301.]] Google ScholarDigital Library
- 14 Knuth, D.E., and Floyd, R.W. Notes on avoiding GO TO statements. Rep. No. CS-148, Comput. Sci. Dep. Stanford U., 1970.]]Google Scholar
- 15 Kosaraju, R. Analysis of structured programs J. Comput. and Syst. Sci., 9, 3 (Dec. 1974), 232-255. Tech. Rep. No. 72-11, Elect. Eng. Dep., Johns Hopkins U. 1972.]]Google ScholarDigital Library
- 16 Leavenworth, B. M. Programming with(out) me GOTO. Proc. ACM Nat. Conf., 1972, pp. 782-786.]] Google ScholarDigital Library
- 17 Ledgard, H. F. Programming Proverbs. Hayden Publishing Co., Rochelle Park, N.J., 1975.]]Google Scholar
- 18 McKeeman, W.M., Horning, J.J., and Wortman, D.B. A Compiler Generator. Prentice-Hall, Englewood Cliffs, N.J., 1970.]]Google Scholar
- 19 Mills, H.D. Mathematical foundations for structured programming. FSC 72-6012 Federal System Division, IBM Corp., Gaithersburg, Md., 1972.]]Google Scholar
- 20 Neely, P.M. On program control structure. Proc. ACM Nat. Conf. 1973, pp. 119-125.]] Google ScholarDigital Library
- 21 Peterson, W.W., Kasami, T., and Tokura, N. On the capabilities of while, repeat, and exit statements. Comm. ACM, 16, 8 (Aug. 1973), 503-512.]] Google ScholarDigital Library
- 22 Sites, R.L. Proving tbat computer programs terminate cleanly. Rep. No. STAN-CS-74-418, Comput. Sci. Dep., Stanford U., 1974.]]Google Scholar
- 23 Wirth, N. The programming language PASCAL. Revised report, Eidgenoessische Technische Hochschule, Zurich, 1972.]]Google Scholar
- 24 Wirth, N. Program development by stepwise refinement. Comm. ACM, 14, 4 (Apr. 1971), 221-227.]] Google ScholarDigital Library
- 25 Wulf, W.A., Russell, D.B., and Habermann, A.N. BLISS: A language for systems programming. Comm. ACM, 14, 12 (Dec. 1971), 780--790.]] Google ScholarDigital Library
- 26 Zahn, C.T., A conlrol statement for natural top-down structured programming. Sym!b. on Ping. Lang., Paris, 1974.]]Google Scholar
Index Terms
- A genealogy of control structures
Recommendations
Control Computations and the Design of Loop Control Structures
The control computation for a loop in a program is that part of the program concerned with the initialization, incrementation, and testing of the variables that determine the flow of control into, through, and out of the loop. The elements of loop ...
On extending Fortran control structures to facilitate structured programming
A number of preprocessors and other extensions of Fortran have been implemented recently, aimed at adding "disciplined" control structures to the language. In spite of wide variations in the details of these dialects, many common features can be ...
Tree-structured programs
With this note I hope to bridge the gap between the adherents of structured programming and the devotees of the unrestricted goto. I describe a style of programming which combines the advantages of structured programming with nearly all the power of the ...
Comments