Ch 04 GPS
There are several problems with the “base model” General Problem Solver: Clobbered goal: achieving one goal causes another goal to be lost. Leaping before you look: committing to a “strategy” that is impossible to finish (and missing another method). Infinite loop: trying to find a way to achieve a goal causes you to need that same goal, again and again. You should be able to give examples of goals and operations that would give rise to each of these problems with a “naive solver”.
The term “mocking” refers to producing a “fake” function or component to use only during testing. The origin of the term is the same as the word “mock-up”, which is a non-functional product made for testing look or feel, or for demonstrating the appearance. Usually the function being replaced is complex, whereas the “mock” function is simplified or only made to work for certain cases. Simplified example: suppose (sum-first-N #'func 100) applies a given function to the first 100 integers and adds the results.
Read pages 99-101 in the book and write complement and find-all, possibly copying them from the book. (ball) Make a structure ball that holds the kind of ball (a symbol) and the circ-umference of the ball (in inches, a number). Create a softball with a circumference of 12. Modify the circumference to be 13. Write a function that takes in anything (even lists and numbers) and returns true if the item is a ball of circumference greater than 10.
In this problem set we are going to develop a version of the General Purpose Solve that fixes the “not looking after you do not leap” problem. This requires a redesign. achieve-all: Check each goal in turn, trying to achieve it with achieve-one. achieve-one: Given a single goal: 1. find all of the ops that could result in gaining that goal; 2. attempt to satisfy the preconditions of that op 3.