Example: air traffic controller

Structure and Interpretation of Computer Programs, 2nd ed.

Structure andInterpretationof Computer ProgramsHarold Abelson andGerald Jay Sussmanwith Julie Sussman foreword by Alan J. PerlisUnofficial Texinfo Format edition 1996 by e Massachuse s Institute of TechnologyStructure and Interpretation of Computer Programs, second editionHarold Abelson and Gerald Jay Sussmanwith Julie Sussman, foreword by Alan J. Perlis is work is licensed under a Creative CommonsA ribution-ShareAlike International License( . ). Based on a work e PressCambridge, Massachuse sLondon, EnglandMcGraw-Hill Book CompanyNew York, St. Louis, San Francisco,Montreal, TorontoUnofficial Texinfo (February 2, 2016),based (January 10, 2007).ContentsUnofficial Texinfo FormatixDedicationxiiForewordxiiiPreface to the Second EditionxixPreface to the First EditionxxiA nowledgmentsxxv1 Building Abstractions with e Elements of Programming.. Expressions.

computation and Lisp for artificial intelligence. ese two areas con- ... more years have elapsed until the appearance of this second edition. We are pleased that our work has been widely adopted and incorpo- ... Our design of this introductory computer-science subject reflects two major concerns. First, we want to establish the idea that a com-

Tags:

  Design, Edition, Interpretation, Computation, And interpretation of

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Structure and Interpretation of Computer Programs, 2nd ed.

1 Structure andInterpretationof Computer ProgramsHarold Abelson andGerald Jay Sussmanwith Julie Sussman foreword by Alan J. PerlisUnofficial Texinfo Format edition 1996 by e Massachuse s Institute of TechnologyStructure and Interpretation of Computer Programs, second editionHarold Abelson and Gerald Jay Sussmanwith Julie Sussman, foreword by Alan J. Perlis is work is licensed under a Creative CommonsA ribution-ShareAlike International License( . ). Based on a work e PressCambridge, Massachuse sLondon, EnglandMcGraw-Hill Book CompanyNew York, St. Louis, San Francisco,Montreal, TorontoUnofficial Texinfo (February 2, 2016),based (January 10, 2007).ContentsUnofficial Texinfo FormatixDedicationxiiForewordxiiiPreface to the Second EditionxixPreface to the First EditionxxiA nowledgmentsxxv1 Building Abstractions with e Elements of Programming.. Expressions.

2 Naming and the Environment.. Evaluating Combinations.. Compound Procedures.. e Substitution Model for Procedure Conditional Expressions and Predicates.. Example: Square Roots by Newton s Method.. Procedures as Black-Box Abstractions.. Procedures and the Processes ey Generate.. Linear Recursion and Iteration.. Tree Recursion.. Orders of Growth.. Exponentiation.. Greatest Common Divisors.. Example: Testing for Primality.. Formulating Abstractionswith Higher-Order Procedures.. Procedures as Arguments.. Constructing Procedures Usinglambda.. Procedures as General Methods.. Procedures as Returned Values..972 Building Abstractions with Introduction to Data Abstraction.. Example: Arithmetic Operationsfor Rational Numbers.. Abstraction Barriers.. What Is Meant by Data?.. Extended Exercise: Interval Arithmetic.

3 Hierarchical Data and the Closure Property.. Representing Sequences.. Hierarchical Structures.. Sequences as Conventional Interfaces.. Example: A Picture Language.. Symbolic Data.. otation.. Example: Symbolic Differentiation.. Example: Representing Sets.. Example: Huffman Encoding Trees.. Multiple Representations for Abstract Data.. Representations for Complex Numbers.. Tagged data.. Data-Directed Programming and Additivity.. Systems with Generic Operations.. Generic Arithmetic Operations.. Combining Data of Different Types.. Example: Symbolic Algebra..2743 Modularity, Objects, and Assignment and Local State.. Local State Variables.. e Benefits of Introducing Assignment.. e Costs of Introducing Assignment.. e Environment Model of Evaluation.. e Rules for Evaluation.. Applying Simple Procedures.

4 Frames as the Repository of Local State.. Internal Definitions.. Modeling with Mutable Data.. Mutable List Structure .. Representing eues.. Representing Tables.. A Simulator for Digital Circuits.. Propagation of Constraints.. Concurrency: Time Is of the Essence.. e Nature of Time in Concurrent Systems.. Mechanisms for Controlling Concurrency.. Streams.. Streams Are Delayed Lists.. Infinite Streams.. Exploiting the Stream Paradigm.. Streams and Delayed Evaluation.. Modularity of Functional Programsand Modularity of Objects..4794 Metalinguistic e Metacircular Evaluator.. e Core of the Evaluator.. Representing Expressions.. Evaluator Data Structures.. Running the Evaluator as a Program.. Data as Programs.. Internal Definitions.. Separating Syntactic Analysis from Variations on a Scheme Lazy Evaluation.

5 Normal Order and Applicative Order.. An Interpreter with Lazy Evaluation.. Streams as Lazy Lists.. Variations on a Scheme Nondeterministic Amb and Search.. Examples of Nondeterministic Programs.. Implementing theambEvaluator.. Logic Programming.. Deductive Information Retrieval.. How the ery System Works.. Is Logic Programming Mathematical Logic?.. Implementing the ery System.. e Driver Loop and Instantiation.. e Evaluator.. Finding Assertionsby Pa ern Matching.. Rules and Unification.. Maintaining the Data Base.. Stream Operations.. ery Syntax Procedures.. Frames and Bindings..6595 Computing with Register Ma Designing Register Machines.. A Language for Describing Register Abstraction in Machine design .. Subroutines.. Using a Stack to Implement Recursion.. Instruction Summary.

6 A Register-Machine Simulator.. e Machine Model.. e Assembler.. Generating Execution Proceduresfor Instructions.. Monitoring Machine Performance.. Storage Allocation and Garbage Collection.. Memory as Vectors.. Maintaining the Illusion of Infinite Memory.. e Explicit-Control Evaluator.. e Core of the Explicit-Control Evaluator.. Sequence Evaluation and Tail Recursion.. Conditionals, Assignments, and Definitions.. Running the Evaluator.. Compilation.. Structure of the Compiler.. Compiling Expressions.. Compiling Combinations.. Combining Instruction Sequences.. An Example of Compiled Code.. Lexical Addressing.. Interfacing Compiled Code to the Evaluator..823 References834 List of Exercises844 List of Figures846 Index848 Colophon855viiiUnofficial Texinfo Format is is the second edition book, from Unofficial Texinfo are probably reading it in an Info hypertext browser, such as theInfo mode of Emacs.

7 You might alternatively be reading it TEX-forma edon your screen or printer, though that would be silly. And, if printed,expensive. e freely-distributed official -and- format was first con-verted personally to Unofficial Texinfo Format ( ) version 1 by LythaAyth during a long Emacs lovefest weekend in April, 2001. e is easier to search than the format. It is also muchmore accessible to people running on modest computers, such as do-nated 386-based PCs. A 386 can, in theory, run Linux, Emacs, and aScheme interpreter simultaneously, but most 386s probably can t alsorun both Netscape and the necessary X Window System without prema-turely introducing budding young underfunded hackers to the conceptofthrashing. can also fit uncompressed on a floppy diske e,which may come in handy for installing on PCs that do not haveInternet or access. e Texinfo conversion has been a straight transliteration, to theextent possible.

8 Like the TEX-to- conversion, this was not withoutsome introduction of breakage. In the case of Unofficial Texinfo Format,ixfigures have suffered an amateurish resurrection of the lost art of .Also, it s quite possible that some errors of ambiguity were introducedduring the conversion of some of the copious superscripts ( ) and sub-scripts ( _ ). Diviningwhichhas been le as an exercise to the at least we don t put our brave astronauts at risk by encoding thegreater-than-or-equalsymbol as<u>> </u>.If you correct errors or improve the art,then update the@set utfversion to reflect yourdelta. For example, if you started with Lytha s version1, and your nameis Bob, then you could name your successive , , Also updateutfversiondate. If you want to distribute yourversion on the Web, then embedding the string somewherein the file or Web page will make it easier for people to find with Websearch is believed that the Unofficial Texinfo Format is in keeping withthe spirit of the graciously freely-distributed version.

9 But younever know when someone s armada of lawyers might need somethingto do, and get their shorts all in a knot over some benign li le thing,so think twice before you use your full name or distribute Info, ,PostScript, or formats that might embed your account or , Lytha AythAddendum:See also the video lectures by Abelson and Sussman:at or .Second Addendum:Above is the original introduction to the from2001. Ten years later, has been transformed: mathematical symbolsand formulas are properly typeset, and figures drawn in vector graph-ics. e original text formulas and art figures are still there inxthe Texinfo source, but will display only when compiled to Info the dawn of e-book readers and tablets, reading a on screen isofficially not silly anymore. Enjoy! , May, 2011xiDedicationT , in respect and admiration, to the spirit thatlives in the Computer . I think that it s extraordinarily important that we in com-puter science keep fun in computing.

10 When it started out,it was an awful lot of fun. Of course, the paying customersgot sha ed every now and then, and a er a while we beganto take their complaints seriously. We began to feel as if wereally were responsible for the successful, error-free perfectuse of these machines. I don t think we are. I think we reresponsible for stretching them, se ing them off in new di-rections, and keeping fun in the house. I hope the field ofcomputer science never loses its sense of fun. Above all, Ihope we don t become missionaries. Don t feel as if you reBible salesmen. e world has too many of those you know about computing other people will t feel as if the key to successful computing is only inyour hands. What s in your hands, I think and hope, is in-telligence: the ability to see the machine as more than whenyou were first led up to it, that you can make it more. Alan J.