NAILS-readnow.txt November 2008 Version 1.0 Copyright © 2008 Adrienne Gaye Thompson CONTENTS 1. ABOUT NAILS 2. RUNNING NAILS 3. BUGS AND OTHER BEASTIES 4. LIST OF FILES 5. ACKNOWLEDGEMENTS 6. CONTACT INFORMATION 7. LICENSE CONDITIONS 1. ABOUT NAILS NAILS is a recursive acronym meaning "NAILS for Artificial Intelligence Lisp Solving". To "nail" is to "focus intently" or to "fix one's attention". I taught myself Lisp mainly with the textbook "LISP' third edition by Berthold Paul Klaus Horn and Patrick Henry Winston, which requires a certain intensity of focus. NAILS consists of my solutions to the exercises in LISP. There are no exercises requiring coded solutions for chapters 1, 8, 10, 15, 16 and 26 of LISP. Because the subject of closures is such an important one, I have included the file "15closures.lsp" which consists of solutions to exercises from Keith Downing's course IT-215 from his program in Artificial Intelligence and Artificial Life at the Norwegian University of Science and Technology. The final 14 chapters of LISP captured my attention, transporting my imagination to the realm of cyber intelligence - that conflation of computer science, mathematics, electrical engineering, and art from which Star Trek's Data and others of his ilk are distilled. This conjuring of things Sci-Fi was, undoubtedly, a component of the force that kept my eyes nailed to the text, driving me through the book; for as I later discovered LISP is best prescribed for the classroom and is not for the faint of heart, but for those intent on adventure. 2. RUNNING NAILS NAILS should not be run with a hammer! A more analytical approach is required. NAILS is Lisp source code compatible with any Common Lisp interpreter/compiler. I developed NAILS mainly with GNU Common Lisp (GCL) run as an inferior Lisp under EMACS on GNU/Linux, substituting CLISP for GCL where this was necessary for ANSI compliance. Some programs call procedures defined in LISP, or require the value of data forms. These definitions would have to be loaded before running the code. The authors of LISP have provided software for use with chapters 18 - 32 of the text. You are free to download this software from the Artificial Intelligence repository in the School of Computer Science, Carnegie Mellon University 3. BUGS AND OTHER BEASTIES As I worked through LISP I gave no thought to publishing my solutions - an idea that occurred to me only some weeks ago. Accordingly, the files in NAILS have not been particularly formatted for presentation. I rushed through the book due to the demands of my ongoing Law Project that consumes much of the time I would ordinarily devote to engineering research. As a result there are bugs in places, and where I resorted to solutions from the book itself (usually following sleepless nights caused by troubling matters from the Law Project) I have excluded these. I have completed all exercises in LISP with the exception of four in chapter 19 "Examples Involving Search" and 13 in chapter 32 "Converting Notations, Manipulating Matrices, and Finding Roots". I shall be adding the seven mathematical projects in the final two chapters when I do get round to my long overdue review of mathematics for computer vision. I hope you have as much fun with the solutions as I did, that you will laugh (with me) at my gaffes as you trace my learning curve, and that you will nail down uses - not yet imagined - for the code. 4. LIST OF FILES Each filename begins with a number corresponding to a chapter in LISP. +---------------------------+-------------------------------------+ | FILES | CHAPTER IN LISP | +---------------------------+-------------------------------------+ +---------------------------+-------------------------------------+ | 2primitives.lsp | Basic Lisp Primitives | +---------------------------+-------------------------------------+ | 3procedures.lsp | Procedure Definition & Binding | +---------------------------+-------------------------------------+ | 4conditionals.lsp | Predicates & Conditionals | +---------------------------+-------------------------------------+ | 5recursion.lsp | Procedure Abstraction & Recursion | +---------------------------+-------------------------------------+ | 6mapping.lsp | Data Abstraction & Mapping | +---------------------------+-------------------------------------+ | 7iteration.lsp | Iteration on Numbers & Lists | +---------------------------+-------------------------------------+ | 9print-read.lsp | Printing & Reading | +---------------------------+-------------------------------------+ | 11props-arrays.lsp | Properties & Arrays | +---------------------------+-------------------------------------+ | 12macros.lsp | Macros & Backquote | +---------------------------+-------------------------------------+ | 13structures.lsp | Structures | +---------------------------+-------------------------------------+ | 14classes.lsp | Classes & Generic Functions | +---------------------------+-------------------------------------+ | 15closures.lsp | Lexical Variables Generators & | | | Encapsulation | +---------------------------+-------------------------------------+ | 17list-surgery.lsp | List Storage Surgery & Reclamation | +---------------------------+-------------------------------------+ | 18lisp-in-lisp.lsp | Lisp in Lisp | +---------------------------+-------------------------------------+ | 19search-ex.lsp | Examples Involving Search | +---------------------------+-------------------------------------+ | 20simulation.lsp | Examples Involving Simulation | +---------------------------+-------------------------------------+ | 21blocks-world.lsp | The Blocks World with Classes & | | | Methods | +---------------------------+-------------------------------------+ | 22goals-qa.lsp | Answering Questions about Goals | +---------------------------+-------------------------------------+ | 23constraints.lsp | Constraint Propagation | +---------------------------+-------------------------------------+ | 24patterns.lsp | Symbolic Pattern Matching | +---------------------------+-------------------------------------+ | 25streams.lsp | Streams & Delayed Evaluation | +---------------------------+-------------------------------------+ | 27expert-back.lsp | Backward Chaining & PROLOG | +---------------------------+-------------------------------------+ | 28trees-interp.lsp | Interpreting Transition Trees | +---------------------------+-------------------------------------+ | 30databases.lsp | Procedure-Writing Programs & | | | Database Interfaces | +---------------------------+-------------------------------------+ | 31images.lsp | Finding Patterns in Images | +---------------------------+-------------------------------------+ | 32math.lsp | Converting Notations Manipulating | | | Matrices & Finding Roots | +---------------------------+-------------------------------------+ | | | +---------------------------+-------------------------------------+ 5. ACKNOWLEDGMENTS Without my parents, Violet and Manley Thompson, and Eliezer Regnier, I would not have been able to focus my attention on writing computer programs, the issue at the heart of the Law Project to which I needed to turn my attention. My dog Cruiser, a spunky Corgi-Shih-Tzoodle, faithfully kept me company during marathon sessions at the computer. Gareth Webb introduced me to Linux, whose proper name (as I've since advised him) is GNU/Linux. Keith Downing updated his website at NTNU so I could have access to all the exercises from his course IT-215, and Bill Clementson fed me with humour. Thanks to RMS for EMACS, the GNU operating system - and the mantra of freedom. 6. CONTACT INFORMATION Adrienne Gaye Thompson Code Art Now http://codeartnow.com EMAIL: agt@codeartnow.com 7. LICENSE CONDITIONS This file is part of NAILS. NAILS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License (the GPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. NAILS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GPL for more details. NAILS includes the file NAILS-license.txt, which contains a copy of the GPL. You may view the GPL online at . Adrienne Gaye Thompson ========================== ==========================