norvig / paip-lisp

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errata for chapter 8

gregr opened this issue · comments

I noticed a couple of mistakes in the definition of integrate (page 256) that probably slipped by testing. In the sketch below, I've indicated the mistakes with comments describing corrections:

(cond
  ((free-of exp x) `(* ,exp x))   ;; This should instead unquote x as in `(* ,exp ,x).
  ...
  ((starts-with exp '-)
   (ecase ...
     (1 (integrate (exp-lhs exp) x))  ;; This should instead build a unary minus operation to account for negation, as in `(- ,(integrate (exp-lhs exp) x)).
     ...