norvig / paip-lisp

Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chapter 4 Typos and other

LintonNaik opened this issue · comments

Hi, I found more typos As I'm sure you can tell by now, I've decided to read the book online. I'll just make the actual typo bold, it should be obvious what the replacement should be. It's very hard to label exact locations so I'm included surrounding text to make it easier to find. At some point I stopped logging the things I was finding, this chapter is a mess.

Below there is a typo from Chapter 4, towards the top of the chapter. It should be "all" instead of "ail". I've actually noted this issue in a few places, please search for "ail" and see what you get.

Although GPS never lived up to these exaggerated claims, it was still an important program for historical reasons. It was the first program to separate its problem solving strategy from its knowledge of particular problems, and it spurred much further research in problem solving. For ail these reasons, it is a fitting object of study.

Also chapter 4, "confusing"

In fact, the conf using nature of IPL was probably an important reason for the grand claims about GPS. If the program was that complicated, it must do something important.

I think I may be seeing a general problem with the markup, maybe that's my browser. You could find most of these by searching for "!!!". In case it isn't a markup issue in my browser, here's an example (one more directly after):

_We follow all five stages in the development of our versions of GPS, with the hope that the reader will understand GPS better and will also come to understand better how to write a program of his or her own. To summarize, the five stages of an AI programming project are:

Describe the problem in vague terms !!!(p) {:.numlist}

Specify the problem in algorithmic terms !!!(p) {:.numlist}

Implement the problem in a programming language !!!(p) {:.numlist}

Test the program on representative examples !!!(p) {:.numlist}

Debug and analyze the resulting program, and repeat the process !!!(p) {:.numlist}_

there are several of these issues:
4.2 Stage 2: Specification
{:#s0015} {:.h1hd}

Similar problem to the one with "confusing":

The function a chieve is given as an argument a single goal. The function succeeds if that goal is already true in the current state (in which case we don't have to do anything) or if we can apply an appropriate operator. This is accomplished by first building the list of appropriate operators and then testing each in turn until one can be applied. achieve calls find-all, which we defined on page 101. In this use, find-all returns a list of operators that match the current goal, according to the predicate appropriate-p.

error in the code below, that should be "tell", ":action", ":action":

_With this operator as a model, we can define other operators corresponding to Newell and Simon's quote on page 109. There will be an operator for installing a battery, telling the repair shop the problem, and telephoning the shop. We can fill in the "and so on" by adding operators for looking up the shop's phone number and for giving the shop money:

(defparameter school-ops
(list
(make-op :action 'drive-son-to-school
:preconds '(son-at-home car-works)
:add-list '(son-at-school)
:del-list '(son-at-home))
(make-op :action 'shop-installs-battery
:preconds '(car-needs-battery shop-knows-problem shop-has-money)
:add-list '(car-works))
(make-op :action 'tel 1-shop-problem
:preconds '(in-communication-with-shop)
:add-list '(shop-knows-problem))
(make-op raction 'telephone-shop
:preconds '(know-phone-number)
:add-list '(in-communication-with-shop))
(make-op .-action 'look-up-number
:preconds '(have-phone-book)
:add-list '(know-phone-number))
(make-op :action 'give-shop-money
:preconds '(have-money)
:add-list '(shop-has-money)
:del-list '(have-money))))_

Similar problems in section 4.9, that should be add-list:

_In our simulated nursery school world there is only one way to find out a phone number: to look it up in the phone book. Suppose we want to add an operator for finding out a phone number by asking someone. Of course, in order to ask someone something, you need to be in communication with him or her. The asking-for-aphone-number operator could be implemented as follows:

(push (make-op :action 'ask-phone-number
:preconds '(in-communication-with-shop)
:add-1 i st '(know-phone-number))
school-ops)_

Welcome Linton!

I think chapter 4 is the first that hasn’t had a full manual cleanup.

I made a list of things to do over on my fork.

Things like ail typos are definitely worth cleaning up.
I’m unsure how those errors got in the docs!
This version isn’t built on OCR from a scan.

The notes like !!! and {:#s0015} were meant as signposts: some quick-and-dirty automation converted this, it might be worth taking a look.

Are you comfortable with the git workflow, of making these corrections and submitting a PR?

Thanks! You won't believe how happy I am to see this book online after all these years.

I'm quite a git noob so I'll need some guidance on that. I'm actually weary of markdown already because even in my posting here my italics didn't work well.

I'm keen to give it a go, I found some very obvious things that need to be fixed and some are not so obvious. How do we go about this?

Nifty! I can give better pointers with a little more information.

  • are you comfortable with the command line, or do you prefer a GUI?
  • what OS are you on? Mac, Windows, Linux, ???
  • do you have a favorite text editor?

I've gotten comfortable with markdown, but if I'm doing formatting I use Macdown, an editor that lets me preview.

GitHub has some decent guides.

Thanks for getting back to me.

I prefer a GUI, I'm on Windows and I'm comfortable with both Emacs and Notepad++.

I'll check out those guides.

I've made a fork and changes. I hope I've done this correctly. Please let me know. There's still some work to be done on the chapter and if you accept my changes, that would mean there would still need to be some work to be done on the code in the .lisp files as well.

Ah, you filed your PR against your own repo, not the main repo. It looks mostly good, but I have feedback / questions that I'll add there.

Is what I did fine? Looking forward to your other questions and comments. From the chapters I've seen, quite a lot of cleaning up needs to be done.

Hmm. I'm most used to leaving comments in pull requests; it looks like I can also leave comments on commits, but that feels hidden. (I did leave comments, and I don't think they made it to you.) In the future, I'd suggest making a branch per chapter, and making a pull request for each branch onto master here.

I think I'll start a PR for your revisions to chapter 4. I'm most used to having back-and-forth conversations that way here.

I'm confused. I've edited a lot of chapter 5 and chapter 6 already but I don't know how to create a branch for a chapter, everything is in my fork. Have I done something wrong?

Sorry for my ineptitude, I think I have the branch per chapter thing figured out, I'll do that in future.

Still gonna bother you a bit, I created a new branch for chapter 4, let me know if you can see it. I replaced the pictures with markdown tables.

Sorry about the delayed response; I’ve been busy lately.

About branches:
Once a PR is made from a branch, adding commits to the branch will show up in the PR. No merges needed.

How I’d pull apart a branch into, say, chapter branches:

  • have the branch pushed to github, or have git log open in a terminal and leave it open for reference
  • git checkout (a hash before additions) - e.g. a04c060 is the current master commit on norvig’s branch.
  • git checkout -b (new branch name) - e.g. LintonNaik/chapter4
  • git cherry-pick (each hash) that you want to bring over. repeat for each hash.

This project takes quite a bit of time. You can pick up a chapter at a time, do the interesting bits, hit whatever low-hanging fruit you'd like. You don't have to finish an entire chapter at a time, but you can do that if it suits you!

I'll try to look over your branches now.

@LintonNaik: Which chapter 4 branch / PR of yours would you rather I go over? The earlier one has comments you haven't responded to yet, though the newer one likely has some additions. It would be easier for me to do the first.

Hi, I would suggest you look at the latest branch, I think that has what is my final chapter 4, I don't think I'll be making any other changes, the latest chapter is the one that the addition of the tables has been made in.

I checked the current version against the list above, and every issue has been addressed, probably in a PR from you.