ebook img

MIT Artificial Intelligence Laboratory PDF

386 Pages·2012·47.03 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview MIT Artificial Intelligence Laboratory

.. Ij C- . . I -T .4I 0 .I ... I i I I I. .. f - F,oll""', chnical Report 735 I ----- 0 i I 6w ( 10 4; 9L00% N-.(cid:1) 4I I ki 11 f A(cid:1) k PI )-L Mk a MIT Artificial Intelligence Laboratory ,- - pi ----- --- -- , DRAFT: 31 JULY 1983 i Table of Contents 1. Building Abstractions with Procedures 7 1.1. The Elements of Programming 9 1. 1 1. Expressions 10 1.1.2. Naming and the Environment 12 1.1.3. Evaluating Combinations 13 1.1 4. Compound procedures 16 1.1 5. The Substitution Model for Procedure Evaluation 18 1.1.6. Conditional Expressions and Predicates 20 1.1.7. Example: Square Roots by Newton's Method 23 1. 1.8. Procedures as Black-Box Abstractions 26 1.2. Procedures and the Processes they Generate 30 1.2.1. Linear Recursion and Iteration 31 1.2.2. Tree Recursion 35 1,2.3. Orders of Growth 39 1.2.4. Exponentiation 40 1.2.5. Greatest Common Divisors 42 1.2.6. Example: Testing for Primality 44 1.3. Formulating Abstractions with Higher Order Procedures 48 1.3.1. Procedures as Parameters 49 1.3.2. Constructing Procedures using LAMBDA 52 1.3.3. Procedures as General Methods 56 1.3.4. Procedures as Returned Values 61 2. Building Abstractions with Data 65 2.1. Introduction to Data Abstraction 68 2.1.1. Example: Arithmetic Operators for Rational Numbers 68 2,1.2. Abstraction Barriers 72 2.1.3. What is Data'.) 74 2.1.4. Example: Interval Arithmetic 76 2.2. Hierarchical Data 79 2.2.1. Representing Sequences 80 2.2.2. Representing Trees 85 2.2.3. Symbolic Expressions; The Need for QUOTE 88 2.2.4. Example: Symbolic Differentiation 91 2.2.5. Example: Representing Sets 95 2.2.6. Example: Huffman Encoding Trees 102 2.3. Multiple Representations for Abstract Data 109 2.3. 1. R presentations for Complex Numbers 2.3.2. Manifest Types 114 2.3.3. Data-directed Programming 118 2.4. Systems with Generic Operators 122 . H DRAFT: 31 JULY 1983 Table of Contents 2.4.1. Generic Arithmetic Operators 123 2.4.2. Combining Operands of Different Types 126 2.4.3. Example: Symbolic Algebra 131 3. Modularity, Objects, and State 143 3.1. Assignment and Local State 144 3.1.1. Local State Variables 144 3.1.2. The Costs of Introducing Assignment 149 3.1.3. The Benefits of Introducing Assignment 153 3.2. The Environment Model of Evaluation 156 3.2.1. The Rules for Evaluation 157 3.2.2. Evaluating Simple Procedures 160 3.2.3. Frames as the Repository of Local State 162 3.2.4. Internal Definitions 167' 3.3. Modeling with Mutable Data 170 3.3.1. Mutable List Structure 170 3.3.2. Representing Queues 178 3.3.3. Representing Tables 182 3.3-4 A Simulator for Digital Circuits 186 3.3.5. Propagation of Constraints 196 3.4. Stream Processing 205 3.4.1. Streams as Standard Interfaces 205 3.4.2. Higher Order Procedures for Streams 209 - 3.4-3. Streams and Delayed Evaluation 218 3.4.4. Infinitely Long Streams 223 3.4.5. Streams as Signals 229 3.4.6. Using Streams to Model Local State 234 4. Meta-Linguistic Abstraction 239 4.1. The Meta-circular Evaluator 241 4.1.1. The core of the evaluator: EVAL and APPLY 243 4.1-2. Representing Expressions 246 4.1-3. Representing environments 250 4.1.4. Running the Evaluator as a Lisp Program 252 4.1.5. EVAL: Treating Expressions as Programs 254 4.2. Variations on a Scheme 257 4.2.1. Alternative Binding Disciplines .257 4.2.2. Example: Delayed evaluation 261 4.3. Logic Programming 263 4.3.1. Deductive Information Retrieval 266 4.3.2. How the Query System Works 272 4.3.3. The Query Evaluator 278 4.3-4. Is Logic Programming Mathematical Logic? 280 4.4 Implementing the Query System 284 (cid:1)ql! --1-- --- i DRAFT: 31 JULY 1983 .1.. III 4.4.1. Driver Loop and Syntax Processing 284 4.4.2. The Evaluator 285 4.4.3. Pattern Matching and Finding Assertions 287 4.4.4. Rules and Unification 289 4.4.5. Maintaining the Data Base 291 4.4.6. Utility Procedures 294 5. Register Machine' Model of Control 299 5.1. Computing with register machines 300 5. 1. 1. Register transfer machine language 302 5.1.2. Compound submachines 30.4 6.1.3. Sharing in machines 305 5.1.4. Using a stack to implement recursion 308 5.1.5. Problem section: A register machine smulator 313 5.2. The explicit control evaluator 318 5.2.1. Problem section: Performance Analysis of the Evaluator 329 5.3. Storage allocation and garbage collection 332 5.3. 1. Memory as vectors 332 5.3.2. Supporting the illusion of infinite memory 333 5.4. Compilation 338 5.4. 1. Our system 339 5.4.2. Representations 349 5.4.3. An example of compilation 352 5.4.4. Problem section: Compiled Code 355 5.4.5. Problem section: Compiled Lexical Lookup 357 5.5. Summary 358 Appendix 1. Using Environments to Create Packages 359 References 361 Index 365 -- l- I - awl m"0114.0 ...... , . I iv DRAFT: 31 JULY 1983 woll I ,, (cid:1) I - I ..1..1. . ... ........l.l ---.(cid:1) - I I (cid:1) --- ----- -i I - ., DRAFT: 31 JULY 1983 v List of Exercises Chapter 1: Building Abstractions with Procedures Exercise 1- 22 Exercise 12 23 Exercise 13 23 Exercise 14 23 Exercise 1- 25 Exercise 16 26 Exercise 1-7 26 Exercise 1-8 34 Exercise 19 34 Exercise 1-1 39 Exercise - 40 Exercise 1- 242 Exercise 113 42 Exercise 1-14 42 Exercise 1-15 42 Exercise 116 44 Exercise 117 47 Exercise 1-18 47 Exercise 119 47 Exercise 120 47 Exercise 121 47 Exercise 122 48 Exercise 1-23 48 Exercise 124 51 Exercise 125 51 Exercise 126 51 Exercise 127 62 Exercise 128 55 Exercise 1-29 56 Exercise 130 61 Exercise 31 61 Exercise 132 61 Exercise 133 63 Exercise 134 64 Exercise -35 64 Exercise 136 64 Chapter 2 Building Abstractions with Data Exercise 21 72 Exercise 22 73 Exercise 23 75 Exercise 24 76 Exercise 25 76 Exercise 26 77 Exercise 27 Exercise 28 77 Exercise 29 77 Exercise 210,77 4(cid:1) -(cid:1) M -- -I I I - -- ---. VI DRAFT31 JULY 1983 List of Exercises Exercise 211 78 Exercise 212 78 Exercise 213 78 Exercise 214 79 Exercise 215 79 Exercise 216 83 Exercise 217 83 Exercise 218 83 Exercise 21 83 Exercise 220 84 Exercise 221 84 Exercise 222 5 Exercise 223 87 Exercise 224 87 Exercise 225 87 Exercise 226 90 Exercise 227 91 Exercise 228 91 Exercise 229 95 Exercise 230 95 Exercise 231 97 Exercise 232 97 Exercise 233 98 Exercise 234 99 Exercise 235 101 Exercise 236 102 Exercise 237 107 Exercise 238 108 Exercise 239 108 Exercise 240 108 Exercise 241 108 Exercise 242 109 Exercise 243 120 Exercise 244 121 Exercise 245 122 Exercise 246 122 Exercise 247 124 Exercise 248 125 Exercise 249 126 Exercise 250 130 Exercise 251 130 Exercise 262 130 Exercise 253 131 Exercise 254 131 Exercise 255 131 Exercise 256 131 Exercise 257 136 Exercise 258 136 Exercise 259 136 Exercise 260 136 Exercise 261 137 Exercise 262 138 Exercise 263 138 Exercise 264 139 P. DRAFT: 31 JULY 1983 vii Exercise 265 139 Exercise 266 140 Exercise 267 140 Exercise 268 141 Chapter 3 Modularity, Objects, and State Exercise 31 148 Exercise 32 149 Exercise 33 149 Exercise 34 149 Exercise 35 152 Exercise 36 153 Exercise 37 165 Exercise 38 161 Exercise 39 166 Exercise 310 169 Exercise 311 173 Exercise 312 174 Exercise 313 174 Exercise 314 176 Exercise 315 177 Exercise 316 177 Exercise 317 178 Exercise 318 182 Exercise 319 182 Exercise 320 182 Exercise 321 185 Exercise 322 185 Exercise 323 185 Exercise 324 186 Exercise 325 190 Exercise 326 190 Exercise 327 190 Exercise 328 194 Exercise 329 203 Exercise 330 203 Exercise 331 203 Exercise 332 2T.4 Exercise 333 204 Exercise 34 216 Exercise 335 216 Exercise 336 216 Exercise 337 217 Exercise 338 217 Exercise 339 222 Exercise 340 222, Exercise 341 226 Exercise 342 227 Exercise 343 227 Exercise 344 227 Exercise 345 228 Exercise 346 228 Exercise 347 228 -1- -I-- Vill DRAFT: 31 JULY 1983 List Of Exercises Exercise 348 230 Exercise 349 230 Exercise 350 231 Exercise 351 231 Exercise 352 232 Exercise 353 233 Exercise 354 233 Exercise 355 233. Exercise 356 233 Exercise 357 235 Exercise 358 236 Chapter 4 Meta-Linguistic Abstraction Exercise 41 244 Exercise 42 249 Exercise 43 249 Exercise 44 249 Exercise 45 252 Exercise 46 252 Exercise 47 253 Exercise 48 256 Exercise 49 260 Exercise 410 260 Exercise 411 260 Exercise 412 260 Exercise 413 262 Exercise 414 262 Exercise 415 262 Exercise 416 262 Exercise 417 268 Exercise 418 269 Exercise 419 270 Exercise 420 271 Exercise 421 271 Exercise 422 272 Exercise 423 282 Exercise 424 282 Exercise 425 283 Exercise 426 283 Exercise 427 296 Exercise 428 297 Exercise 429 297 Exercise 430 297 Chapter 5: Register Machine Model of Contro Exercise 5-1 312 Exercise 52 313 Exercise 53 313 Exercise 54 318 Exercise -5 318 Exercise 56 318 Exercise 57 330 Exercise 5-8 330 --- --------- -(cid:1);-, --4.- [4,A1'MZI(cid:1) ! (cid:1)' [ DRAFT: 31 JULY 1983 Ir.,-!,-, ix Exercise 59 331 Exercise 10 331 Exercise -1 331 Exercise 6- 12 331 Exercise 513 338 Exercise -14 356 Exercise 15 356 Exercise 5-16 357 Exercise 517 358 Exercise 18 358 I I j ,. 1(cid:1) -1 , i ' I ! 5; 1i i -----

Description:
of the generations of Lisp wizards, starting with John McCarthy, who have simple syntax, the uniform representation of programs as data objects, and the We also recognize our debt to the mathematicians who scouted out this
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.