Learning Algol 68 Genie

Total Page:16

File Type:pdf, Size:1020Kb

Learning Algol 68 Genie LEARNING ALGOL 68 GENIE Algol 68 Genie 2.0.0 (September 2010) Edited by Marcel van der Veer Learning Algol 68 Genie copyright c Marcel van der Veer, 2008-2010. Algol 68 Genie copyright c Marcel van der Veer, 2001-2010. Learning Algol 68 Genie is a compilation of separate and independent documents or works, consisting of the following parts: I. Informal introduction to Algol 68, II. Programming with Algol 68 Genie, III. Example a68g programs, IV. Algol 68 Revised Report, V. Appendices Part I, II, III and V are distributed under the conditions of the GNU Free Documenta- tion License: Permission is granted to copy, distribute and / or modify the text under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. See http://www.gnu.org. Part IV is a translation of the Algol 68 Revised Report into LATEX and is therefore subject to IFIP’s condition contained in that Report: Reproduction of the Report, for any purpose, but only of the whole text, is explicitly permitted without formality. Chapter 20, "Specification of partial parametrization proposal", is not a part of the Algol 68 Revised Report, and is distributed with kind permission of the author of this proposal, C.H. Lindsey. IBM is a trademark of IBM corporation. Linux is a trademark registered to Linus Torvalds. Mac OS X is a trademark of Apple Computer. Pentium is a trademark of Intel Corporation. TEX is a trademark of the American Mathematical Society. UNIX is a registered trademark of The Open Group. Wikipedia is a trademark of the Wikimedia Foundation, Inc. Typeset in LATEX. Table of contents Preface xi I Informal introduction to Algol 68 1 1 Preliminaries 3 1.1 AbriefhistoryofAlgol68 ........................... .. 3 1.2 Terminology..................................... 6 1.3 Notationofproduction-rules. ..... 7 2 Basic concepts 11 2.1 Modesandvalues.................................. 11 2.2 Integers ....................................... 12 2.3 Identity-declarations . .... 13 2.4 Reals ......................................... 15 2.5 Formulas....................................... 18 2.6 Elementarymonadic-formulas . ... 19 2.7 Realtointegerconversion . ... 19 2.8 Elementarydyadic-formulas . ... 20 2.9 Realfunctions.................................... 22 2.10 Booleans....................................... 23 2.11 Booleanoperators................................ .. 24 2.12 Charactersandtext ............................... 24 2.13 Characteroperators .............................. .. 25 2.14 Comparisonoperators . .. 25 2.15 Programstructure ................................ 27 2.16 Variables....................................... 28 2.17 Assignation ..................................... 30 2.18 Operatorscombinedwithassignation . .... 32 2.19 Orderofevaluation................................ 32 2.20 Abbreviatedvariable-declarations . ........ 33 2.21 Readingvariables................................ .. 34 2.22 Referencestonames ............................... 35 2.23 The value NIL .................................... 36 iii TABLE OF CONTENTS 2.24 Comments...................................... 36 2.25 Pragmats....................................... 37 3 Control structures 39 3.1 Introduction..................................... 39 3.2 Theconditional-clause . ... 39 3.3 Pseudo-operators ................................. 43 3.4 Identityrelations ................................ .. 44 3.5 Theinteger-case-clause . ... 45 3.6 Theloop-clause ................................... 47 4 Stowed modes 51 4.1 Introduction..................................... 51 4.2 Rows ......................................... 51 4.3 Flexiblenames ................................... 61 4.4 Vectors,matricesandtensors . .... 65 4.5 Torrixextensions ................................. 65 4.6 Anoteonbrackets ................................. 67 4.7 Structuredmodes.................................. 67 4.8 Field-selections ................................. .. 73 4.9 Mode-declarations ................................ 74 4.10 Complexnumbers.................................. 77 4.11 BYTES — a compact [] CHAR ........................... 79 4.12 BITS — a compact [] BOOL ............................ 79 5 Routines 83 5.1 Routines ....................................... 83 5.2 Routinemodes.................................... 86 5.3 Routineswithoutparameters . .. 87 5.4 Routineswithparameters. 88 5.5 Routinesandscope ................................. 91 5.6 Declaringnewoperators............................. 92 5.7 Identificationofoperators . .... 94 5.8 Recursion ...................................... 95 5.9 Recursionanddatastructures . ... 99 5.10 Partialparametrisationandcurrying . ....... 103 6 United modes 105 6.1 United-mode-declarations . 105 6.2 Unitedmodesasarguments. 107 6.3 United-case-clauses.............................. 108 6.4 Well-formedmodes ................................. 110 6.5 Equivalenceofmodes ............................... 113 iv TABLE OF CONTENTS 7 Transput 115 7.1 Transput.......................................115 7.2 Channelsandfiles ................................. 116 7.3 Transputandscope................................. 117 7.4 Readingfiles.....................................118 7.5 Writingtofiles ...................................119 7.6 Stringterminators ................................ 121 7.7 Events ........................................121 7.8 Formattingroutines ............................... 124 7.9 Straightening .................................... 126 7.10 Default-formattransput . 126 7.11 Formattedtransput............................... 128 7.12 Binaryfiles .....................................138 7.13 Using a STRING asafile..............................138 7.14 Othertransputprocedures . 139 8 Algol 68 Genie context-free syntax 141 8.1 Introduction..................................... 141 8.2 Reservedsymbols.................................. 141 8.3 Commonproduction-rules . 144 8.4 Tags..........................................145 8.5 Contexts .......................................146 8.6 Coercions.......................................147 8.7 Particularprogram................................ 151 8.8 Clauses........................................152 8.9 Units.........................................152 8.10 Enclosed-clauses ................................ 153 8.11 Balancing ......................................156 8.12 Parallel processing in a68g ............................157 8.13 Primaries ......................................158 8.14 Secondaries ..................................... 164 8.15 Tertiaries ...................................... 164 8.16 Units.........................................165 8.17 Jumps ........................................167 8.18 Assertionsaspre-orpostconditions . ....... 169 8.19 Declarations..................................... 169 8.20 Declarers.......................................171 8.21 Pragments......................................171 8.22 Refinements..................................... 172 II Programming with Algol 68 Genie 173 9 Installing and using Algol 68 Genie 175 v TABLE OF CONTENTS 9.1 Algol68Genie....................................175 9.2 Algol68Genietransput .............................. 179 9.3 InstallingAlgol68GenieonGNU/Linux . 181 9.4 Synopsis .......................................186 9.5 a68g diagnostics .................................. 188 9.6 Options........................................191 9.7 Themonitor .....................................197 9.8 ThePreprocessor .................................. 201 9.9 Amulti-passschemetoparseAlgol68. 203 9.10 a68g sourcecodechecks .............................. 204 9.11 Limitationsandbugs.............................. 205 10 Standard-prelude and library-prelude 207 10.1 Thestandard-environ . 207 10.2 Thestandard-prelude . 208 10.3 Standardmodes................................... 208 10.4 Environmentenquiries. 210 10.5 Standardoperators............................... 213 10.6 Standardprocedures .............................. 227 10.7 Transput.......................................233 10.8 Thelibrary-prelude. 242 10.9 ALGOL68C transputprocedures . 242 10.10Drawingandplotting............................... 244 10.11Mathematicalfunctions . 249 10.12Linearalgebra.................................. 253 10.13Solutionoflinearalgebraicequations . ......... 257 10.14Fouriertransforms . 260 10.15Laplacetransform ............................... 262 10.16Constants ...................................... 263 10.17Linuxextensions ................................ 271 10.18 Regular expressions in string manipulation. .......... 276 10.19Cursessupport .................................. 279 10.20PostgreSQLsupport ............................... 280 10.21PCMSounds..................................... 289 III Example a68g programs 293 11 Example a68g programs 295 11.1 Lucasnumbers ................................... 295 11.2 Romannumbers................................... 296 11.3 HolidaysrelatedtoEaster. 297 11.4 TheSierpinskitriangle . 298 11.5 Whetstonebenchmark .............................. 299 vi TABLE OF CONTENTS 11.6 Primenumbers ................................... 301 11.7 Hilbertmatrixusingfractions . ..... 305 11.8 Mastermindcodebreaker . 307 11.9 Mandelbrotset ................................... 309 11.10Knighttraversingachessboard . 310 11.11Decisiontree...................................
Recommended publications
  • Layout-Sensitive Generalized Parsing
    Layout-sensitive Generalized Parsing Sebastian Erdweg, Tillmann Rendel, Christian K¨astner,and Klaus Ostermann University of Marburg, Germany Abstract. The theory of context-free languages is well-understood and context-free parsers can be used as off-the-shelf tools in practice. In par- ticular, to use a context-free parser framework, a user does not need to understand its internals but can specify a language declaratively as a grammar. However, many languages in practice are not context-free. One particularly important class of such languages is layout-sensitive languages, in which the structure of code depends on indentation and whitespace. For example, Python, Haskell, F#, and Markdown use in- dentation instead of curly braces to determine the block structure of code. Their parsers (and lexers) are not declaratively specified but hand-tuned to account for layout-sensitivity. To support declarative specifications of layout-sensitive languages, we propose a parsing framework in which a user can annotate layout in a grammar. Annotations take the form of constraints on the relative posi- tioning of tokens in the parsed subtrees. For example, a user can declare that a block consists of statements that all start on the same column. We have integrated layout constraints into SDF and implemented a layout- sensitive generalized parser as an extension of generalized LR parsing. We evaluate the correctness and performance of our parser by parsing 33 290 open-source Haskell files. Layout-sensitive generalized parsing is easy to use, and its performance overhead compared to layout-insensitive parsing is small enough for practical application. 1 Introduction Most computer languages prescribe a textual syntax.
    [Show full text]
  • TI 83/84: Scientific Notation on Your Calculator
    TI 83/84: Scientific Notation on your calculator this is above the comma, next to the square root! choose the proper MODE : Normal or Sci entering numbers: 2.39 x 106 on calculator: 2.39 2nd EE 6 ENTER reading numbers: 2.39E6 on the calculator means for us. • When you're in Normal mode, the calculator will write regular numbers unless they get too big or too small, when it will switch to scientific notation. • In Sci mode, the calculator displays every answer as scientific notation. • In both modes, you can type in numbers in scientific notation or as regular numbers. Humans should never, ever, ever write scientific notation using the calculator’s E notation! Try these problems. Answer in scientific notation, and round decimals to two places. 2.39 x 1016 (5) 2.39 x 109+ 4.7 x 10 10 (4) 4.7 x 10−3 3.01 103 1.07 10 0 2.39 10 5 4.94 10 10 5.09 1018 − 3.76 10−− 1 2.39 10 5 7.93 10 8 Remember to change your MODE back to Normal when you're done. Using the STORE key: Let's say that you want to store a number so that you can use it later, or that you want to store answers for several different variables, and then use them together in one problem. Here's how: Enter the number, then press STO (above the ON key), then press ALPHA and the letter you want. (The letters are in alphabetical order above the other keys.) Then press ENTER.
    [Show full text]
  • A Politico-Social History of Algolt (With a Chronology in the Form of a Log Book)
    A Politico-Social History of Algolt (With a Chronology in the Form of a Log Book) R. w. BEMER Introduction This is an admittedly fragmentary chronicle of events in the develop­ ment of the algorithmic language ALGOL. Nevertheless, it seems perti­ nent, while we await the advent of a technical and conceptual history, to outline the matrix of forces which shaped that history in a political and social sense. Perhaps the author's role is only that of recorder of visible events, rather than the complex interplay of ideas which have made ALGOL the force it is in the computational world. It is true, as Professor Ershov stated in his review of a draft of the present work, that "the reading of this history, rich in curious details, nevertheless does not enable the beginner to understand why ALGOL, with a history that would seem more disappointing than triumphant, changed the face of current programming". I can only state that the time scale and my own lesser competence do not allow the tracing of conceptual development in requisite detail. Books are sure to follow in this area, particularly one by Knuth. A further defect in the present work is the relatively lesser availability of European input to the log, although I could claim better access than many in the U.S.A. This is regrettable in view of the relatively stronger support given to ALGOL in Europe. Perhaps this calmer acceptance had the effect of reducing the number of significant entries for a log such as this. Following a brief view of the pattern of events come the entries of the chronology, or log, numbered for reference in the text.
    [Show full text]
  • Verifiable Semantic Difference Languages
    Verifiable Semantic Difference Languages Thibaut Girka David Mentré Yann Régis-Gianas Mitsubishi Electric R&D Centre Mitsubishi Electric R&D Centre Univ Paris Diderot, Sorbonne Paris Europe Europe Cité, IRIF/PPS, UMR 8243 CNRS, PiR2, Rennes, France Rennes, France INRIA Paris-Rocquencourt Paris, France ABSTRACT 1 INTRODUCTION Program differences are usually represented as textual differences Let x be a strictly positive natural number. Consider the following on source code with no regard to its syntax or its semantics. In two (almost identical) imperative programs: this paper, we introduce semantic-aware difference languages. A difference denotes a relation between program reduction traces. A s = 0 ; 1 s = 0 ; 1 difference language for the toy imperative programming language d = x ; 2 d = x − 1 ; 2 while (d>0) { 3 while (d>0) { 3 Imp is given as an illustration. i f (x%d== 0) 4 i f (x%d== 0) 4 To certify software evolutions, we want to mechanically verify s = s + d ; 5 s = s + d ; 5 − − that a difference correctly relates two given programs. Product pro- d = d 1 ; 6 d = d 1 ; 6 } 7 } 7 grams and correlating programs are effective proof techniques for s = s − x 8 8 relational reasoning. A product program simulates, in the same programming language as the compared programs, a well-chosen The program P1 (on the left) stores in s the sum of the proper interleaving of their executions to highlight a specific relation be- divisors of the integer x. To that end, it iterates over the integers tween their reduction traces. While this approach enables the use from x to 1 using the variable d and accumulates in the variable s of readily-available static analysis tools on the product program, it the values of d that divide x.
    [Show full text]
  • Primitive Number Types
    Primitive number types Values of each of the primitive number types Java has these 4 primitive integral types: byte: A value occupies 1 byte (8 bits). The range of values is -2^7..2^7-1, or -128..127 short: A value occupies 2 bytes (16 bits). The range of values is -2^15..2^15-1 int: A value occupies 4 bytes (32 bits). The range of values is -2^31..2^31-1 long: A value occupies 8 bytes (64 bits). The range of values is -2^63..2^63-1 and two “floating-point” types, whose values are approximations to the real numbers: float: A value occupies 4 bytes (32 bits). double: A value occupies 8 bytes (64 bits). Values of the integral types are maintained in two’s complement notation (see the dictionary entry for two’s complement notation). A discussion of floating-point values is outside the scope of this website, except to say that some bits are used for the mantissa and some for the exponent and that infinity and NaN (not a number) are both floating-point values. We don’t discuss this further. Generally, one uses mainly types int and double. But if you are declaring a large array and you know that the values fit in a byte, you can save ¾ of the space using a byte array instead of an int array, e.g. byte[] b= new byte[1000]; Operations on the primitive integer types Types byte and short have no operations. Instead, operations on their values int and long operations are treated as if the values were of type int.
    [Show full text]
  • Parse Forest Diagnostics with Dr. Ambiguity
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by CWI's Institutional Repository Parse Forest Diagnostics with Dr. Ambiguity H. J. S. Basten and J. J. Vinju Centrum Wiskunde & Informatica (CWI) Science Park 123, 1098 XG Amsterdam, The Netherlands {Jurgen.Vinju,Bas.Basten}@cwi.nl Abstract In this paper we propose and evaluate a method for locating causes of ambiguity in context-free grammars by automatic analysis of parse forests. A parse forest is the set of parse trees of an ambiguous sentence. Deducing causes of ambiguity from observing parse forests is hard for grammar engineers because of (a) the size of the parse forests, (b) the complex shape of parse forests, and (c) the diversity of causes of ambiguity. We first analyze the diversity of ambiguities in grammars for programming lan- guages and the diversity of solutions to these ambiguities. Then we introduce DR.AMBIGUITY: a parse forest diagnostics tools that explains the causes of ambiguity by analyzing differences between parse trees and proposes solutions. We demonstrate its effectiveness using a small experiment with a grammar for Java 5. 1 Introduction This work is motivated by the use of parsers generated from general context-free gram- mars (CFGs). General parsing algorithms such as GLR and derivates [35,9,3,6,17], GLL [34,22], and Earley [16,32] support parser generation for highly non-deterministic context-free grammars. The advantages of constructing parsers using such technology are that grammars may be modular and that real programming languages (often requiring parser non-determinism) can be dealt with efficiently1.
    [Show full text]
  • Overview of the SPEC Benchmarks
    9 Overview of the SPEC Benchmarks Kaivalya M. Dixit IBM Corporation “The reputation of current benchmarketing claims regarding system performance is on par with the promises made by politicians during elections.” Standard Performance Evaluation Corporation (SPEC) was founded in October, 1988, by Apollo, Hewlett-Packard,MIPS Computer Systems and SUN Microsystems in cooperation with E. E. Times. SPEC is a nonprofit consortium of 22 major computer vendors whose common goals are “to provide the industry with a realistic yardstick to measure the performance of advanced computer systems” and to educate consumers about the performance of vendors’ products. SPEC creates, maintains, distributes, and endorses a standardized set of application-oriented programs to be used as benchmarks. 489 490 CHAPTER 9 Overview of the SPEC Benchmarks 9.1 Historical Perspective Traditional benchmarks have failed to characterize the system performance of modern computer systems. Some of those benchmarks measure component-level performance, and some of the measurements are routinely published as system performance. Historically, vendors have characterized the performances of their systems in a variety of confusing metrics. In part, the confusion is due to a lack of credible performance information, agreement, and leadership among competing vendors. Many vendors characterize system performance in millions of instructions per second (MIPS) and millions of floating-point operations per second (MFLOPS). All instructions, however, are not equal. Since CISC machine instructions usually accomplish a lot more than those of RISC machines, comparing the instructions of a CISC machine and a RISC machine is similar to comparing Latin and Greek. 9.1.1 Simple CPU Benchmarks Truth in benchmarking is an oxymoron because vendors use benchmarks for marketing purposes.
    [Show full text]
  • An Introduction to Programming in Simula
    An Introduction to Programming in Simula Rob Pooley This document, including all parts below hyperlinked directly to it, is copyright Rob Pooley ([email protected]). You are free to use it for your own non-commercial purposes, but may not copy it or reproduce all or part of it without including this paragraph. If you wish to use it for gain in any manner, you should contact Rob Pooley for terms appropriate to that use. Teachers in publicly funded schools, universities and colleges are free to use it in their normal teaching. Anyone, including vendors of commercial products, may include links to it in any documentation they distribute, so long as the link is to this page, not any sub-part. This is an .pdf version of the book originally published by Blackwell Scientific Publications. The copyright of that book also belongs to Rob Pooley. REMARK: This document is reassembled from the HTML version found on the web: https://web.archive.org/web/20040919031218/http://www.macs.hw.ac.uk/~rjp/bookhtml/ Oslo 20. March 2018 Øystein Myhre Andersen Table of Contents Chapter 1 - Begin at the beginning Basics Chapter 2 - And end at the end Syntax and semantics of basic elements Chapter 3 - Type cast actors Basic arithmetic and other simple types Chapter 4 - If only Conditional statements Chapter 5 - Would you mind repeating that? Texts and while loops Chapter 6 - Correct Procedures Building blocks Chapter 7 - File FOR future reference Simple input and output using InFile, OutFile and PrintFile Chapter 8 - Item by Item Item oriented reading and writing and for loops Chapter 9 - Classes as Records Chapter 10 - Make me a list Lists 1 - Arrays and simple linked lists Reference comparison Chapter 11 - Like parent like child Sub-classes and complex Boolean expressions Chapter 12 - A Language with Character Character handling, switches and jumps Chapter 13 - Let Us See what We Can See Inspection and Remote Accessing Chapter 14 - Side by Side Coroutines Chapter 15 - File For Immediate Use Direct and Byte Files Chapter 16 - With All My Worldly Goods..
    [Show full text]
  • BASIC Session
    BASIC Session Chairman: Thomas Cheatham Speaker: Thomas E. Kurtz PAPER: BASIC Thomas E. Kurtz Darthmouth College 1. Background 1.1. Dartmouth College Dartmouth College is a small university dating from 1769, and dedicated "for the educa- tion and instruction of Youth of the Indian Tribes in this Land in reading, writing and all parts of learning . and also of English Youth and any others" (Wheelock, 1769). The undergraduate student body (now nearly 4000) outnumbers all graduate students by more than 5 to 1, and majors predominantly in the Social Sciences and the Humanities (over 75%). In 1940 a milestone event, not well remembered until recently (Loveday, 1977), took place at Dartmouth. Dr. George Stibitz of the Bell Telephone Laboratories demonstrated publicly for the first time, at the annual meeting of the American Mathematical Society, the remote use of a computer over a communications line. The computer was a relay cal- culator designed to carry out arithmetic on complex numbers. The terminal was a Model 26 Teletype. Another milestone event occurred in the summer of 1956 when John McCarthy orga- nized at Dartmouth a summer research project on "artificial intelligence" (the first known use of this phrase). The computer scientists attending decided a new language was needed; thus was born LISP. [See the paper by McCarthy, pp. 173-185 in this volume. Ed.] 1.2. Dartmouth Comes to Computing After several brief encounters, Dartmouth's liaison with computing became permanent and continuing in 1956 through the New England Regional Computer Center at MIT, HISTORY OF PROGRAMMING LANGUAGES 515 Copyright © 1981 by the Association for Computing Machinery, Inc.
    [Show full text]
  • Latest Results from the Procedure Calling Test, Ackermann's Function
    Latest results from the procedure calling test, Ackermann’s function B A WICHMANN National Physical Laboratory, Teddington, Middlesex Division of Information Technology and Computing March 1982 Abstract Ackermann’s function has been used to measure the procedure calling over- head in languages which support recursion. Two papers have been written on this which are reproduced1 in this report. Results from further measurements are in- cluded in this report together with comments on the data obtained and codings of the test in Ada and Basic. 1 INTRODUCTION In spite of the two publications on the use of Ackermann’s Function [1, 2] as a mea- sure of the procedure-calling efficiency of programming languages, there is still some interest in the topic. It is an easy test to perform and the large number of results ob- tained means that an implementation can be compared with many other systems. The purpose of this report is to provide a listing of all the results obtained to date and to show their relationship. Few modern languages do not provide recursion and hence the test is appropriate for measuring the overheads of procedure calls in most cases. Ackermann’s function is a small recursive function listed on page 2 of [1] in Al- gol 60. Although of no particular interest in itself, the function does perform other operations common to much systems programming (testing for zero, incrementing and decrementing integers). The function has two parameters M and N, the test being for (3, N) with N in the range 1 to 6. Like all tests, the interpretation of the results is not without difficulty.
    [Show full text]
  • Xilinx Running the Dhrystone 2.1 Benchmark on a Virtex-II Pro
    Product Not Recommended for New Designs Application Note: Virtex-II Pro Device R Running the Dhrystone 2.1 Benchmark on a Virtex-II Pro PowerPC Processor XAPP507 (v1.0) July 11, 2005 Author: Paul Glover Summary This application note describes a working Virtex™-II Pro PowerPC™ system that uses the Dhrystone benchmark and the reference design on which the system runs. The Dhrystone benchmark is commonly used to measure CPU performance. Introduction The Dhrystone benchmark is a general-performance benchmark used to evaluate processor execution time. This benchmark tests the integer performance of a CPU and the optimization capabilities of the compiler used to generate the code. The output from the benchmark is the number of Dhrystones per second (that is, the number of iterations of the main code loop per second). This application note describes a PowerPC design created with Embedded Development Kit (EDK) 7.1 that runs the Dhrystone benchmark, producing 600+ DMIPS (Dhrystone Millions of Instructions Per Second) at 400 MHz. Prerequisites Required Software • Xilinx ISE 7.1i SP1 • Xilinx EDK 7.1i SP1 • WindRiver Diab DCC 5.2.1.0 or later Note: The Diab compiler for the PowerPC processor must be installed and included in the path. • HyperTerminal Required Hardware • Xilinx ML310 Demonstration Platform • Serial Cable • Xilinx Parallel-4 Configuration Cable Dhrystone Developed in 1984 by Reinhold P. Wecker, the Dhrystone benchmark (written in C) was Description originally developed to benchmark computer systems, a short benchmark that was representative of integer programming. The program is CPU-bound, performing no I/O functions or operating system calls.
    [Show full text]
  • ALGOL 60 Programming on the Decsystem 10.Pdf
    La Trobe University DEPARTMENT OF MATHEMATICS ALGOL 60 Programming on the DECSystem 10 David Woodhouse Revised, August 1975 MELBOURNE, AUSTRALIA ALGOL 60 Programming on the DECSystem 10 David Woodhouse Revised, August 1975 CE) David Woodhouse National Library of Australia card number and ISBN. ISBN 0 85816 066 8 INTRODUCTION This text is intended as a complete primer on ALGOL 60 programming. It refers specifically to Version 4 of the DECSystem 10 implementation. However, it avoids idiosyncracies as far as possible, and so should be useful in learning the language on other machines. The few features in the DEC ALGOL manual which are not mentioned here should not be needed until the student is sufficiently advanced to be using this text for reference only. Exercises at the end of each chapter illustrate the concepts introduced therein, and full solutions are given. I should like to thank Mrs. K. Martin and Mrs. M. Wallis for their patient and careful typing. D. Woodhouse, February, 1975. CONTENTS Chapter 1 : High-level languages 1 Chapter 2: Languagt! struct.ure c.f ALGOL 6n 3 Chapter 3: Statemp.nts: the se'1tences {'\f the language 11 Chapter 4: 3tandard functions 19 Chapter 5: Input an~ Outp~t 21 Chapter 6: l>rray~ 31 Chapter 7 : For ane! ~hil~ statements 34 Chapter 8: Blocks anr! ',: ock sc rll,~ turr. 38 Chapter 9: PrOCe(:l1-:-~S 42 Chapter 10: Strin2 vp·jaLlps 60 Chapter 11: Own v~rj;lI'.i..es clOd s~itc.hef, 64 Chapter 12: Running ~nd ,;ebllggi"1g 67 Bibliography 70 Solutions to Exercises 71 Appendix 1 : Backus NOlUlaj F\:q'm 86 Appendix 2 : ALGuL-like languages 88 Appenclix 3.
    [Show full text]