A Procedure Mechanism for Backtrack Programming*

Total Page:16

File Type:pdf, Size:1020Kb

A Procedure Mechanism for Backtrack Programming* A PROCEDURE MECHANISM FOR BACKTRACK PROGRAMMING* David R. HANSON + Department o£ Computer Science, The University of Arizona Tucson, Arizona 85721 One of the difficulties in using nondeterministic algorithms for the solution of combinatorial problems is that most programming languages do not include features capable of easily repre- senting backtracking processes. This paper describes a procedure mechanism that uses co- routines as a means for the description and realization of nondeterministic algorithms. A solution to the eight queens problem is given to illustrate the application of the procedure mechanism to backtracking problems. I. INTRODUCTION Although backtrack programming has been known for To facilitate comparison with previous work, the several years [1-4], the method has yet to become eight queens problem [13-15] is used as the exam- a common programming technique for the realization ple o£ backtracking throughout this paper. This of nondeterministic algorithms. Floyd [1] alluded is a nontrivial problem whose solution is ideally to the reason for this situation: most program- suited to the backtracking strategy, and has ming languages do not include features that facil- frequently been used as an example that can be itate backtrack programming. He suggested that solved by nondeterministic programming. programming languages ought to possess mechanisms capable of representing nondeterministic algo- 2. THE SL5 PROGRAMMING LANGUAGE rithms. SL5 is an expression-oriented language that is Since the appearance of Floyd's paper, consider- structurally similar to BLISS or Algol 68. SL5 able research has been undertaken to add facili- is a "typeless" language in the same sense that ties of this kind to new or existing languages. SNOBOL4 is -- a variable can have a value of any This work has covered a large part of the spec- datatype at any time during program execution. trum of programming languages, from general de- scriptions with a slant toward Algol-like lan- 2.1 Control Structures and Signaling guages [5,6], to languages for artificial intel- ligence research [7], and even to Fortran [8]. An expression returns a signal, "success" or In all the work cited, features that were added "failure", as well as a value. The combination or proposed for backtracking were cast in a o£ a value and a signal is called the result of framework of recursive functions with additional the expression. SL5 possesses most o£ the "mod- built-in mechanisms or primitives with which to ern" control structures, each of which is an implement backtracking. That is, the basic pro- expression and returns a result. Control cedure mechanism of the proposed languages or structures are driven by signals rather than by language extensions was the traditional recursive boolean values. For an example, in the expression function. i_~f e 1 then e 2 else e 3 This paper presents a general procedure mechanism that includes coroutines as a means for the de- e I is evaluated first. If the resulting signal scription and realization of nondeterministic is success, e 2 is evaluated. Otherwise, e 5 is algorithms. The SL5 programming language [9-12] evaluated. The result of the if-then-else ex- in which this procedure mechanism is implemented pression is the result (value and signal) o£ e 2 is the vehicle used to describe this method and or e 3, whichever is evaluated. its application to backtrack programming. Other typical control structures are: *This work was supported by the National Science while e I do e 2 Foundation under Grant DCR75-01307. until e I do e 2 repeat e +Author's present address: Department of Computer for v from e I to e 2 do e 5 Science, Yale University, New Haven, Connecticut I 06520. 401 The while and for expressions behave in the con- whichreturn V as the value of the procedure and ventlo~-6n~manner. The until expression repeated- signal either success or failure as indicated. ly evaluates e 2 until e I succeeds. The repeat If the procedure is activated by a resume, the expression evaluates e repeatedly until a failure result given in succeed or fail is transmitted signal is returned. Expressions may be grouped and becomes the result of teh-6"~esume expression. together as a single expression using The execution of succeed or fail causes the sus- begin ... end or { ... }. pension of that environment. If the environment is again resumed, execution proceeds from where 2.2 Procedures it left off. The argument v may be omitted, in which case the null string is assumed. In SL5, procedures and their environments (activation records) are separate source-language A label generator illustrates a simple example of data objects. A procedure is "created" by an coroutine usage: expression such as genlab :={procedure (n) gcd := procedure (x, y) repeat while x ~= y do succeed "U' l] lp~Cn, 3, "0"); if x > y then x := x-y else y := y-x; n := n+1 succeed x } end; end; which assigns to gcd a procedure that computes An environment for genlab generates the next the greatest common divisor of its arguments. label of the form Lnnn each time it is resumed. The sequence begins at the integer given by the The invocation of a procedure in the standard argument. (lpad is a built-in procedure that recursive fashion is accomplished using the usual pads n on the left with zeros to form a functional notation f(el,e 2 ..... en) , which S-character string, and [] denotes string concat- invokes the procedure that is the current value enation.) For example, an expression such as of the variable f. gen := create genZab with 10 Procedure activation may be decomposed into sev- eral distinct source-language operations that assigns to gen an environment for genlab that permit SL5 procedures to be used as coroutines. generates a sequence of labels beginning at L010. These operations are the creation of an environ- To obtain the next label, the execution of the ment for the execution of the given procedure, environment is resumed; the bindin~ of the actual arguments to that envi- ronment, and the resumption of the execution of x := resume gen the procedure. Notice that the sequence may be restarted by The create expression takes a single argument of retransmitting the argument, e.g., datatype procedure, creates an environment for its execution, and returns this environment as gen := gen with 10 its value. For example, the expression 2.3 Declarations e := create f SL5 has declarations for identifiers that are assigns to e an environment for the execution of used to determine only the interpretation and f. scope of identifiers that appear in a procedure, not their type. The declaration The with. expression is used to bind the actual arguments to an environment. The expression private x e with (el,e 2, .... e n) declares x to be a private identifier whose value is available only to the procedure in which it is binds the actual arguments, e I through en, to the declared; it cannot be examined or modified by environment e. any other procedure. Private identifiers are used, for example, when a coroutine must "remem- The execution of a procedure is accomplished by ber" information from one resumption to the next. "resuming" it via the resume expression. The Other declarations and the scope of identifiers expression are described in refs. 9 and 12. resume e 3. BACKTRACKINGAND THE EIGHT QUEENS PROBLEM suspends execution of the current procedure and There are many problems for which an analytic activates the procedure for which e is an envi- solution is not known, but for which a solution ronment. can be constructed by trial and error. A classic example is the eight queens problem, sometimes A procedure usually "returns" a result to its referred to as the n-by-n nonattacking queens "resumer". This is accomplished by the expressions problem. The object is to place eight queens on a chess board so that no queen can capture any of succeed v the others. One such solution is shown in fig. I. 402 There are 92 solutions to this problem, although For example, it is easy to place the first five only 12 are unique. queens to form the partial solution (1,3,5,2,4). But the sixth queen cannot be placed. It is necessary to backtrack to the partial solution (1,3,5,2) and try again. This partial solution 8 can be extended to (1,3,5,2,8) but no further. It is necessary to backtrack all the way to the 7 partial solution (1,3,5), which can then be ex- 6 tended to (1,3,5,7,2,4,6). This backtracking process continues until the solution 5 (1,5,8,6,3,7,2,4) is found, which is shown in tOW fig. 1. 4 A more formal description of the backtracking 5 strategy is given in ref. 2. A particularly lucid explanation can be found in ref. 16, which 2 describes a method for estimating the efficiency of backtracking programs. 5.2 Realization of the Nondeterministic I 2 5 4 5 6 7 8 Algorithm column The usual method for programming the solution to the eight queens problem is to use a procedure Fig. 1 - A Solution to the Eight Queens Problem that generates all solutions with the first queen on rows 1 to 8 by calling itself recursively to generate all solutions for the second queen in A brute force approach to this problem is to test rows 1 to 8, etc. The foliowing procedure, simi- all the possible configurations of the queens to lar to the Pascal solution given in ref. 15, find the 92 "safe" ones.
Recommended publications
  • Typology of Programming Languages E Early Languages E
    Typology of programming languages e Early Languages E Typology of programming languages Early Languages 1 / 71 The Tower of Babel Typology of programming languages Early Languages 2 / 71 Table of Contents 1 Fortran 2 ALGOL 3 COBOL 4 The second wave 5 The finale Typology of programming languages Early Languages 3 / 71 IBM Mathematical Formula Translator system Fortran I, 1954-1956, IBM 704, a team led by John Backus. Typology of programming languages Early Languages 4 / 71 IBM 704 (1956) Typology of programming languages Early Languages 5 / 71 IBM Mathematical Formula Translator system The main goal is user satisfaction (economical interest) rather than academic. Compiled language. a single data structure : arrays comments arithmetics expressions DO loops subprograms and functions I/O machine independence Typology of programming languages Early Languages 6 / 71 FORTRAN’s success Because: programmers productivity easy to learn by IBM the audience was mainly scientific simplifications (e.g., I/O) Typology of programming languages Early Languages 7 / 71 FORTRAN I C FIND THE MEAN OF N NUMBERS AND THE NUMBER OF C VALUES GREATER THAN IT DIMENSION A(99) REAL MEAN READ(1,5)N 5 FORMAT(I2) READ(1,10)(A(I),I=1,N) 10 FORMAT(6F10.5) SUM=0.0 DO 15 I=1,N 15 SUM=SUM+A(I) MEAN=SUM/FLOAT(N) NUMBER=0 DO 20 I=1,N IF (A(I) .LE. MEAN) GOTO 20 NUMBER=NUMBER+1 20 CONTINUE WRITE (2,25) MEAN,NUMBER 25 FORMAT(11H MEAN = ,F10.5,5X,21H NUMBER SUP = ,I5) STOP TypologyEND of programming languages Early Languages 8 / 71 Fortran on Cards Typology of programming languages Early Languages 9 / 71 Fortrans Typology of programming languages Early Languages 10 / 71 Table of Contents 1 Fortran 2 ALGOL 3 COBOL 4 The second wave 5 The finale Typology of programming languages Early Languages 11 / 71 ALGOL, Demon Star, Beta Persei, 26 Persei Typology of programming languages Early Languages 12 / 71 ALGOL 58 Originally, IAL, International Algebraic Language.
    [Show full text]
  • Simula Mother Tongue for a Generation of Nordic Programmers
    Simula! Mother Tongue! for a Generation of! Nordic Programmers! Yngve Sundblad HCI, CSC, KTH! ! KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula OctoberYngve 2010Sundblad! Inspired by Ole-Johan Dahl, 1931-2002, and Kristen Nygaard, 1926-2002" “From the cold waters of Norway comes Object-Oriented Programming” " (first line in Bertrand Meyer#s widely used text book Object Oriented Software Construction) ! ! KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula OctoberYngve 2010Sundblad! Simula concepts 1967" •# Class of similar Objects (in Simula declaration of CLASS with data and actions)! •# Objects created as Instances of a Class (in Simula NEW object of class)! •# Data attributes of a class (in Simula type declared as parameters or internal)! •# Method attributes are patterns of action (PROCEDURE)! •# Message passing, calls of methods (in Simula dot-notation)! •# Subclasses that inherit from superclasses! •# Polymorphism with several subclasses to a superclass! •# Co-routines (in Simula Detach – Resume)! •# Encapsulation of data supporting abstractions! ! KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula OctoberYngve 2010Sundblad! Simula example BEGIN! REF(taxi) t;" CLASS taxi(n); INTEGER n;! BEGIN ! INTEGER pax;" PROCEDURE book;" IF pax<n THEN pax:=pax+1;! pax:=n;" END of taxi;! t:-NEW taxi(5);" t.book; t.book;" print(t.pax)" END! Output: 7 ! ! KTH - CSC (School of Computer Science and Communication) Yngve Sundblad – Simula OctoberYngve 2010Sundblad!
    [Show full text]
  • Internet Engineering Jan Nikodem, Ph.D. Software Engineering
    Internet Engineering Jan Nikodem, Ph.D. Software Engineering Theengineering paradigm Software Engineering Lecture 3 The term "software crisis" was coined at the first NATO Software Engineering Conference in 1968 by: Friedrich. L. Bauer Nationality;German, mathematician, theoretical physicist, Technical University of Munich Friedrich L. Bauer 1924 3/24 The term "software crisis" was coined at the first NATO Software Engineering Conference in 1968 by: Peter Naur Nationality;Dutch, astronomer, Regnecentralen, Niels Bohr Institute, Technical University of Denmark, University of Copenhagen. Peter Naur 1928 4/24 Whatshouldbe ourresponse to software crisis which provided with too little quality, too late deliver and over budget? Nationality;Dutch, astronomer, Regnecentralen, Niels Bohr Institute, Technical University of Denmark, University of Copenhagen. Peter Naur 1928 5/24 Software should following an engineering paradigm NATO conference in Garmisch-Partenkirchen, 1968 Peter Naur 1928 6/24 The hope is that the progress in hardware will cure all software ills. The Oberon System User Guide and Programmer's Manual. ACM Press Nationality;Swiss, electrical engineer, computer scientist ETH Zürich, IBM Zürich Research Laboratory, Institute for Media Communications Martin Reiser 7/24 However, a critical observer may notethat software manages to outgrow hardware in size and sluggishness. The Oberon System User Guide and Programmer's Manual. ACM Press Nationality;Swiss, electrical engineer, computer scientist ETH Zürich, IBM Zürich Research Laboratory, Institute for Media Communications Martin Reiser 8/24 Wirth's computing adage Software is getting slower more rapidly than hardware becomes faster. Nationality;Swiss, electronic engineer, computer scientist ETH Zürich, University of California, Berkeley, Stanford University University of Zurich. Xerox PARC.
    [Show full text]
  • Oral History Interview with John Brackett and Doug Ross
    An Interview with JOHN BRACKETT AND DOUG ROSS OH 392 Conducted by Mike Mahoney on 7 May 2004 Needham, Massachusetts Charles Babbage Institute Center for the History of Information Processing University of Minnesota, Minneapolis Copyright, Charles Babbage Institute John Brackett and Doug Ross Interview 7 May 2004 Oral History 392 Abstract Doug Ross and John Brackett focus on the background of SofTech and then its entry into the microcomputer software marketplace. They describe their original contact with the University of California at San Diego (UCSD) and licensing the p-System which had been developed there. They discuss the effort required to bring the program to production status and the difficulties in marketing it to the sets of customers. They talk about the transition from 8 bit to 16 bit machines and how that affected their market opportunities. They conclude with a review of the negotiations with IBM and their failure to get p-System to become a primary operating environment. That, and the high performance of Lotus 1-2-3, brought about the demise of the p- System. [John Brackett requested that the following information from Wikipedia, the free encyclopedia, be provided as an introduction to this oral history interview: “UCSD p-System or UCSD Pascal System was a portable, highly machine independent operating system based upon UCSD Pascal. The University of California, San Diego Institute for Information Systems developed it in 1978 to provide students with a common operating system that could run on any of the then available microcomputers as well as campus DEC PDP-11 minicomputers. UCSD p- System was one of three operating systems (along with PC-DOS and CP/M-86) that IBM offered for its original IBM PC.
    [Show full text]
  • Type Extensions, Wirth 1988
    Type Extensions N. WIRTH lnstitut fijr Informatik, ETH, Zurich Software systems represent a hierarchy of modules. Client modules contain sets of procedures that extend the capabilities of imported modules. This concept of extension is here applied to data types. Extended types are related to their ancestor in terms of a hierarchy. Variables of an extended type are compatible with variables of the ancestor type. This scheme is expressed by three language constructs only: the declaration of extended record types, the type test, and the type guard. The facility of extended types, which closely resembles the class concept, is defined in rigorous and concise terms, and an efficient implementation is presented. Categories and Subject Descriptors: D.3.3 [Programming Languages]: Language Constructs-data types and structures; modules, packuges; D.3.4 [Programming Languages]: Processors-code generation General Terms: Languages Additional Key Words and Phrases: Extensible data type, Modula-2 1. INTRODUCTION Modern software development tools are designed for the construction of exten- sible systems. Extensibility is the cornerstone for system development, for it allows us to build new systems on the basis of existing ones and to avoid starting each new endeavor from scratch. In fact, programming is extending a given system. The traditional facility that mirrors this concept is the module-also called package-which is a collection of data definitions and procedures that can be linked to other modules by an appropriate linker or loader. Modern large systems consist, without exception, of entire hierarchies of such modules. This notion has been adopted successfully by modern programming languages, such as Mesa [4], Modula-2 [8], and Ada [5], with the crucial property that consistency of interfaces be verified upon compilation of the source text instead of by the linking process.
    [Show full text]
  • Reception of Pascal in the History of Sciences
    Reception of Pascal in the history of sciences... Camille Akmut April 27, 2020 Abstract In particular computer science and technologies. With references to the history of philosophy and the social sciences. 1 I - Crown jewel computers, and sciences The computer scientist Niklaus Wirth, creator of the Pascal programming language, has said of the origins of his creation : I named it after the French philosopher and mathematician, who in 1642 designed one of the first gadgets that might truly be called a digital calculator.1 This is how Wirth remembered Pascal, and explained his choice of the philosopher for his namesake language in 1993 as part of a large conference organized by the ACM on the history of programming languages (the second HOPL); as a pioneer in a line from which { it is either implied, or we interpret too strongly { he ultimately descended. Another notable computer scientist, Friedrich Bauer, known for the stack ADT and his participation in the making of ALGOL 602 among others, in his 'Historical notes on computer science' (one of his last books, if not the last) expressed the following judgment on Pascal and Schickard : \We would not do Schickard any justice by exaggerating : his cal- culating machine was no 4-type ["Vier-Species"] machine, like that of Leibniz, but only a 2-type like Pascal's, but with the difference of having come twenty years earlier. Kepler was said to have been most happy with it. And, perhaps its mechanism was superior. But, that would be a detail."3 [trans.] Ergo : the real machine was Leibniz's { as it could (really) do all four operations of arithmetic { and as for the earlier, partial or lesser, ones Schickard's 1Found in History of programming languages, vol.
    [Show full text]
  • 1. with Examples of Different Programming Languages Show How Programming Languages Are Organized Along the Given Rubrics: I
    AGBOOLA ABIOLA CSC302 17/SCI01/007 COMPUTER SCIENCE ASSIGNMENT ​ 1. With examples of different programming languages show how programming languages are organized along the given rubrics: i. Unstructured, structured, modular, object oriented, aspect oriented, activity oriented and event oriented programming requirement. ii. Based on domain requirements. iii. Based on requirements i and ii above. 2. Give brief preview of the evolution of programming languages in a chronological order. 3. Vividly distinguish between modular programming paradigm and object oriented programming paradigm. Answer 1i). UNSTRUCTURED LANGUAGE DEVELOPER DATE Assembly Language 1949 FORTRAN John Backus 1957 COBOL CODASYL, ANSI, ISO 1959 JOSS Cliff Shaw, RAND 1963 BASIC John G. Kemeny, Thomas E. Kurtz 1964 TELCOMP BBN 1965 MUMPS Neil Pappalardo 1966 FOCAL Richard Merrill, DEC 1968 STRUCTURED LANGUAGE DEVELOPER DATE ALGOL 58 Friedrich L. Bauer, and co. 1958 ALGOL 60 Backus, Bauer and co. 1960 ABC CWI 1980 Ada United States Department of Defence 1980 Accent R NIS 1980 Action! Optimized Systems Software 1983 Alef Phil Winterbottom 1992 DASL Sun Micro-systems Laboratories 1999-2003 MODULAR LANGUAGE DEVELOPER DATE ALGOL W Niklaus Wirth, Tony Hoare 1966 APL Larry Breed, Dick Lathwell and co. 1966 ALGOL 68 A. Van Wijngaarden and co. 1968 AMOS BASIC FranÇois Lionet anConstantin Stiropoulos 1990 Alice ML Saarland University 2000 Agda Ulf Norell;Catarina coquand(1.0) 2007 Arc Paul Graham, Robert Morris and co. 2008 Bosque Mark Marron 2019 OBJECT-ORIENTED LANGUAGE DEVELOPER DATE C* Thinking Machine 1987 Actor Charles Duff 1988 Aldor Thomas J. Watson Research Center 1990 Amiga E Wouter van Oortmerssen 1993 Action Script Macromedia 1998 BeanShell JCP 1999 AngelScript Andreas Jönsson 2003 Boo Rodrigo B.
    [Show full text]
  • Pioneers of Computing
    Pioneers of Computing В 1980 IEEE Computer Society учредило Золотую медаль (бронзовую) «Вычислительный Пионер» Пионерами учредителями стали 32 члена IEEE Computer Society, связанных с работами по информатике и вычислительным наукам. 1 Pioneers of Computing 1.Howard H. Aiken (Havard Mark I) 2.John V. Atanasoff 3.Charles Babbage (Analytical Engine) 4.John Backus 5.Gordon Bell (Digital) 6.Vannevar Bush 7.Edsger W. Dijkstra 8.John Presper Eckert 9.Douglas C. Engelbart 10.Andrei P. Ershov (theroretical programming) 11.Tommy Flowers (Colossus engineer) 12.Robert W. Floyd 13.Kurt Gödel 14.William R. Hewlett 15.Herman Hollerith 16.Grace M. Hopper 17.Tom Kilburn (Manchester) 2 Pioneers of Computing 1. Donald E. Knuth (TeX) 2. Sergei A. Lebedev 3. Augusta Ada Lovelace 4. Aleksey A.Lyapunov 5. Benoit Mandelbrot 6. John W. Mauchly 7. David Packard 8. Blaise Pascal 9. P. Georg and Edvard Scheutz (Difference Engine, Sweden) 10. C. E. Shannon (information theory) 11. George R. Stibitz 12. Alan M. Turing (Colossus and code-breaking) 13. John von Neumann 14. Maurice V. Wilkes (EDSAC) 15. J.H. Wilkinson (numerical analysis) 16. Freddie C. Williams 17. Niklaus Wirth 18. Stephen Wolfram (Mathematica) 19. Konrad Zuse 3 Pioneers of Computing - 2 Howard H. Aiken (Havard Mark I) – США Создатель первой ЭВМ – 1943 г. Gene M. Amdahl (IBM360 computer architecture, including pipelining, instruction look-ahead, and cache memory) – США (1964 г.) Идеология майнфреймов – система массовой обработки данных John W. Backus (Fortran) – первый язык высокого уровня – 1956 г. 4 Pioneers of Computing - 3 Robert S. Barton For his outstanding contributions in basing the design of computing systems on the hierarchical nature of programs and their data.
    [Show full text]
  • IBM Highlights, 1985-1989 (PDF, 145KB)
    IBM HIGHLIGHTS, 1985 -1989 Year Page(s) 1985 2 - 7 1986 7 - 13 1987 13 - 18 1988 18 - 24 1989 24 - 30 February 2003 1406HC02 2 1985 Business Performance IBM’s gross income is $50.05 billion, up nine percent from 1984, and its net earnings are $6.55 billion, up 20 percent from the year before. There are 405,535 employees and 798,152 stockholders at year-end. Organization IBM President John F. Akers succeeds John R. Opel as chief executive officer, effective February 1. Mr. Akers also is to head the Corporate Management Board and serve as chairman of its Policy Committee and Business Operations Committee. PC dealer sales, support and operations are transferred from the Entry Systems Division (ESD) to the National Distribution Division, while the marketing function for IBM’s Personal Computer continues to be an ESD responsibility. IBM announces in September a reorganization of its U.S. marketing operations. Under the realignment, to take effect on Jan. 1, 1986, the National Accounts Division, which markets IBM products to the company’s largest customers, and the National Marketing Division, which serves primarily medium-sized and small customer accounts, are reorganized into two geographic marketing divisions: The North-Central Marketing Division and the South-West Marketing Division. The National Distribution Division, which directs IBM’s marketing efforts through Product Centers, value-added remarketers, and authorized dealers, is to merge its distribution channels, personal computer dealer operations and systems supplies field sales forces into a single sales organization. The National Service Division is to realign its field service operations to be symmetrical with the new marketing organizations.
    [Show full text]
  • 50 Years of Pascal Niklaus Wirth the Programming Language Pascal Has Won World-Wide Recognition
    50 Years of Pascal Niklaus Wirth The programming language Pascal has won world-wide recognition. In celebration of its 50th birthday I shall remark briefly today about its origin, spread, and further development. Background In the early 1960's, the languages Fortran (John Backus, IBM) for scientific, and Cobol (Jean Sammet, IBM and DoD) for commercial applications dominated. Programs were written on paper, then punched on cards, and one waited for a day for the results. Programming languages were recognized as essential aids and accelerators of the hard process of programming. In 1960, an international committee published the language Algol 60. It was the first time that a language was defined by concisely formulated constructs and by a precise, formal syntax. Already two years later it was recognized that a few corrections and improvements were needed. Mainly, however, the range of applications should be widened, because Algol 60 was intended for scientific calculations (numerical mathematics) only. Under the auspices of IFIP a Working Group (WG 2.1) was established to tackle this project. The group consisted of about 40 members with almost the same number of opinions and views about what a successor of Algol should look like. There ensued many discussions, and on occasions the debates ended even violently. Early in 1964 I became a member, and soon was requested to prepare a concrete proposal. Two factions had developed in the committee. One of them aimed at a second, after Algol 60, milestone, a language with radically new, untested concepts and pervasive flexibility. The other faction remained more modest and focused on realistic improvements of known concepts.
    [Show full text]
  • *Programing Languages 4Tching Techniques
    DOCUMENT RESUME ED 134 150 IR 004 309 AUTHOR Worland, Peter B. TITLE Teaching Structured Fortran without Structured Extensions. INSTITUTION Gustavus Adolphus Coll., St. Peter, Minn. PUB DATE 76 Wen 25p. EDRS PRICE MF-$0.83 HC-$1.67 Plus Postage. DESCRIPTORS Algorithms; College Pr3grams; *Programing; *Programing Languages 4Tching Techniques IDENTIFIERS *FORTRAN ABSTRACT Six control structures are used in teaching a college Fortran programing course: (1) simple sequences of instruction without any control statement,(2) IF-THEN selection, (3) IF-THEN-ELSE selection,(4) definite loop, (5) indefinite loop, and (6) generalized IF-THEN-ELSE case structure. Outlines, instead of flowcharts, are employed for algorithm development. Comparisons of student performance in structured and standard Fortran classes show no statistical significance, but suggest that the former approach is appropriate. (SC) *********************************************************************** Documents acquired by ERIC include many informal unpublished * materials not available from other sources. ERIC makes every effort * * to obtain the best copy a-vailable. Nevertheless, items of marginal * * reproducibility are often encountered and this affects the quality * * of the microfiche and hatdcopy reproductions ERIC makes available * * via the ERIC Document Reproduction Service (EDRS). EDRS is not * responsible for the quality of the original document. Reproductions * * supplied by EDRS are the best that can be made from the original. * *********************************************************************** -r TEACHING STRUCTURED FORTRAN WITHOUT STRUCTURED EXTENSIONS by PETER B. WORLAND GUSTAVUS ADOLPHUS COLLEGE ST. PETER, MINNESOTA56082 TC -P RIGHTED MA'EFII,. THIS COPY. PEEN c,RANTED BY --Peter B._ WoT;a0. TO ERIC AND OR,T.AT.i:AY;0,4s OPERATING UNDER AGREEMENTL Ft THE NATIONAL IN STITUTE OF EDuCATIOTi FURTHER RERRO- DUCTION OUTSIDE EPIC SYSTEM RE- QUIRES PERMISW.N !RE COPYRIGHT' OWNER U.S.
    [Show full text]
  • Software Engineering
    Software Engineering A historical perspective and a current assessment Niklaus Wirth Zurich, 22.11.2010 Early days 1960: Language and compiler Neliac Overriding property: A mess Extending language, fixing compiler bugs: Black art Missing a scientific basis Therefore a unique subject for scientific research The ESSENCE of SE: Cleaning the mess How can you write “correct” programs, if there is no rigorous specification of your notation? Algol 60 appeared as an excellent starting point It provided structure, defined in a rigorous mathematical sense: Syntax Giving a strong impetus to methods of syntactic analysis EBNF: The Syntax of Syntax • syntax = {rule}. • rule = ident “:=“ expression “.” . • expression = term {“|” term}. • term = factor {factor}. • factor = ident | string | “(“expression”)” | • “[“expression”]” | “{“expression”}”. Semantics Syntax ok, but what about meaning? The dominant idea: Operational semantics Attach a meaning to each syntactic construct Semantic of each construct defined in terms of a short program, specified in a simpler language Garwick, Wirth: Euler Did not solve the problem, simply moved it down to a lower plane Axiomatic definition • R. Floyd (1968) • C.A.R.Hoare (1969) - Assertion • E.W. Dijkstra (1973) - Predicate transformer • Axiomatic defintion of the PL Pascal (1973) • Programming = Constructing correctness proof • The ESSENCE of SE: Not ceaning up, but avoiding the mess (Dijkstra) State of the Art (2010) • Correctness proofs are rarely used. Why? • The proof is more complex than the program • The theory requires a strong ability for formula manipulation. Most prog. lack it. • Programming methodology has improved: - Structures, modularity, type checking, and languages supporting them. - Interactive tools to help locating errors Consequences • Industrial SE has produced a myriad of tools, emerging from early “symbolic debuggers” • Resulting work mode: Try, test, fix.
    [Show full text]