Logic and the Development of Programming Languages, 1930–1975
Total Page:16
File Type:pdf, Size:1020Kb
LOGIC AND THE DEVELOPMENT OF PROGRAMMING LANGUAGES, 1930–1975 Peter Mark Priestley University College London Thesis submitted in fulfillment of requirements for the degree of PhD. May 2008 2 I, Peter Mark Priestley, confirm that the work presented in this thesis is my own. Where information has been derived from other sources, I confirm that this has been indicated in the thesis. Abstract Compared with the history of computing hardware, the history of software is in a relatively unde- veloped state. In particular, the history of programming languages still consists for the most part of technical accounts presenting a rather Whiggish perspective on developments. Given the importance of software in the contemporary world, however, it is important to develop a more sophisticated un- derstanding of the medium in which it is expressed. This thesis considers some aspects of this history with the aim of examining the influence of formal logic on the evolution of notations for expressing computer programs. It is argued that this was not a natural or inevitable application of theory to practice, as is sometimes suggested, but a complex and contingent process with a rich history of its own. Two introductory chapters discuss the work on computability carried out by logicians in the mid-1930s, and the controversial topic of the role of logic in the invention of the computer. The body of the thesis proceeds chronologically, considering machine codes, the introduction of higher level notations, structured programming and software engineering, and the early object-oriented languages. The picture that emerges is that formal logic was deliberately employed by programming lan- guage designers to provide a model for a theoretical understanding of programming languages and the process of program development. This led to a flourishing research programme in the 1960s and 1970s, many of whose results are of lasting significance and value. The thesis concludes by exam- ining the early history of object-oriented languages, arguing that this episode shows the emergence of limits to the applicability of the logical research programme. 3 Contents 1 Introduction 9 1.1 The historiography of programming languages . ........... 12 1.2 Whiggism....................................... 17 1.3 Internalism ..................................... 19 1.4 The insider perspective . ..... 20 1.5 Methodology ..................................... 22 1.6 Theargument ..................................... 25 2 Logic, computability and formal systems 28 2.1 Historical links between logic and computation . ............ 28 2.2 G¨odel’s construction . ..... 30 2.3 Recursivefunctions ... ..... ...... ..... ...... ..... 32 2.4 -definability ..................................... 34 2.5 Direct approaches to defining effective computability . ............... 35 2.6 Turing’s machine table notation . ....... 37 2.7 Universalmachines ............................... 46 2.8 The concept of a formal language . ..... 48 2.9 The relationship between Turing’s work and logic . ............ 52 3 Logic and the invention of the computer 56 3.1 The origins of the stored program computer . ......... 58 3.2 The early development of cybernetics . ........ 65 3.3 Von Neumann’s design for the EDVAC . ..... 68 3.4 Logic and the stored program concept . ....... 72 4 CONTENTS 5 3.5 TuringandtheACE................................. 75 3.6 Giantbrains..................................... 79 3.7 Universalmachines ............................... 81 3.8 General purpose machines . 87 3.9 Conclusions..................................... 88 4 Machine-level programming and logic 91 4.1 Sequencing ...................................... 92 4.2 Transfersofcontrol .............................. 96 4.3 Conditiontesting ................................ 98 4.4 Instruction modification . 100 4.5 Subroutines ..................................... 103 4.6 Machine code and program structures . ....... 106 4.7 Machinecodeandlogic. ..... ...... ..... ...... ..... 108 4.8 Syntax......................................... 110 4.9 Semantics....................................... 113 4.10 Programs as metalinguistic expressions . ........... 116 4.11Conclusions.................................... 118 5 Programming notations as formal languages 119 5.1 Automaticcoding................................. 120 5.2 Virtual machines: the semantics of pseudo-codes . ............ 122 5.3 Formulatranslation ... ..... ...... ..... ...... ..... 126 5.4 Fortran and the definition of expressions . .......... 128 5.5 Universallanguages... ..... ...... ..... ...... ..... 130 5.6 Algolasaformallanguage . 133 5.7 The influence of logic on Algol . 140 5.8 Lisp and recursive function theory . ........ 145 5.9 Conclusion ...................................... 148 6 The Algol research programme 149 6.1 Algol 60 as a concrete paradigm . 150 6.2 Normal science in the Algol paradigm . ....... 152 CONTENTS 6 6.3 The description of programming languages . ......... 153 6.4 Different philosophies of programming language design ............... 160 6.5 Logic and the design of control structures . .......... 163 6.6 Logic and data structures . 167 6.7 Modelling data for information retrieval . ........... 171 6.8 Conclusions..................................... 176 7 The logic of correctness in software engineering 178 7.1 Checking computations . 179 7.2 Debuggingandtesting . ..... ...... ..... ...... ..... 181 7.3 Proof and program development . 183 7.4 Constructivemethods . 186 7.5 Specifications and correctness . ....... 189 7.6 Structured programming . 191 7.7 Proofandtesting ................................. 196 7.8 Conclusions..................................... 202 8 The unification of data and algorithms 204 8.1 Simulationlanguages . 204 8.2 Modellingwithrecords . 206 8.3 Simula67....................................... 208 8.4 Dataabstraction................................. 209 8.5 Smalltalk ....................................... 213 8.6 The relationship between Smalltalk and logic . ........... 217 8.7 Conclusions..................................... 221 9 Conclusions 223 9.1 Theinfluenceoflogic.............................. 223 9.2 Thenatureofinfluence . ..... ...... ..... ...... ..... 227 9.3 Methodological conclusions . 229 9.4 Directions for further work . 232 Bibliography 235 Acknowledgements I would like to acknowledge the practical and financial support provided by the University of West- minster during the work on this thesis, and also the invaluable support and enthusiasm shown throughout by my supervisor, Professor Donald Gillies. 7 Typographical conventions The literature shows little consistency in the way that the names of programming languages are written: variants such as ‘FORTRAN’, ‘FORTRAN’ and ‘Fortran’ are commonly found. In this thesis, the following conventions are adopted: names which are more or less pronouncable are treated as proper names and written as ‘Fortran’, whereas unpronouncable acronyms are written as ‘NPL’. In direct quotation, however, the style adopted by the original source is preserved. The name ‘Mark I’ is used throughout to refer to the machine designed by Howard Aiken and also known as the ‘Automatic Sequence Controlled Calculator’ or ‘ASCC’. A persuasive rationale for this practice has been given by I. Bernard Cohen in his biography of Aiken [Cohen, 1999, p. xix–xx]. 8 Chapter 1 Introduction The roots of modern digital computing lie in the desire to automate certain processes of calculation and collation. In the nineteenth century, Charles Babbage’s Difference Engines were intended to compute various arithmetical tables, such as tables of logarithms [Babbage, 1864], and Herman Hollerith designed a punched-card system to facilitate the processing of the results of the 1890 census in the USA [Austrian, 1982]. This latter work led directly to the creation of a large punched- card industry in the first half of the twentieth century which automated many data processing tasks in industry and commerce [Aspray, 1990a]. Babbage’s work did not result in any comparable application, but in the 1930s a number of in- dependent developments were started by people inspired, like Babbage, by a desire to escape the labour of extended calculation. In 1935, Konrad Zuse had recently graduated as an engineer and, apparently motivated by a desire to automate the long and complex calculations he had had to per- form, “decided to become a computer developer” [Zuse, 1993, p. 34]. He set up what he described as an “inventor’s workshop” in his parents’ apartment in Berlin, and by 1936 had started work on the Z1, the first in a line of machines leading in 1941 to the Z3, a device that has been described as the “first fully operational program-controlled computing machine in the world” [Ceruzzi, 1983, p. 29]. In 1937, Howard Aiken at Harvard University noted the repetitive nature of the computations involved in calculating approximate values of functions or performing numerical integration using infinite series [Aiken, 1937]. He designed a large-scale calculator intended to automate these and similar calculations. Known later as ‘Mark I’, this machine was developed in partnership with IBM and became operational in 1944 [Cohen, 1999]. The construction of automatic computing machines raised the question of how to specify the 9 CHAPTER 1. INTRODUCTION 10 computational process that the machines should carry out. One approach was to build specialized machines that could carry out one particular task, but except in specialized domains such as cryp- tography, this