Search new states f i r s t until goal is reached. (tree-search ( l i s
Question:
"Search new states f i r s t until goal is reached."
(tree-search ( l i s t start) goal-p successors #'append))
Let's see how we can search through the binary tree defined previously. First, we define the successor function b i nary- tree. It returns a list of two states, the two numbers that are twice the input state and one more than twice the input state. So the successors of 1 will be 2 and 3, and the successors of 2 will be 4 and 5. The b i na ry - t r e e function generates an infinite tree of which the first 15 nodes are diagrammed in our example.
(defun b i n a r y -tree (x) ( l i s t (* 2 x) (+ 1 (* 2 x))))
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Paradigms Of Artificial Intelligence Programming Case Studies In Common Lisp
ISBN: 9781558601918
1st Edition
Authors: Peter Norvig
Question Posted: