100 likes | 241 Views
Problem Solving in Common Lisp. Common Lisp J.E. Spragg May 1997. The Problem Space Model. People seem to handle adequately the notion of physical space. It seems natural to extend our notions of physical space and use it as a topological metaphor for problems and problem solving.
E N D
Problem Solving in Common Lisp Common Lisp J.E. Spragg May 1997
The Problem Space Model • People seem to handle adequately the notion of physical space. • It seems natural to extend our notions of physical space and use it as a topological metaphor for problems and problem solving. • The problem space model of problems and problem solving makes use of the ideas of location, shape, and distance that are so useful in reasoning about physical space.
Problem Space • A problem space is a set of states that represent distinct configurations of the objects and relationships of the domain. • And a set of operators which define how to move between states. • Operators typically have parameters.
Defining a Problem Space • Defining a problem in a given problem space requires two things: • an initial state • a goal • The initial state is a distinguished state that represents the starting point within the space. • The goal is a specification of the subset of the problem space which could serve as a solution to the problem.
Solving Problems • Solving a problem in this model is accomplished by finding a sequence of operators which, when applied to the initial state, allows one to reach a state satisfying the goal criterion. • In the Blocks World example, the solution is a sequence of transformations that represent a legal plan.
Search • It is easy to see why this is an attractive model of problem solving. • To solve a problem, all we have to do is define the problem space and then unleash a general-purpose search engine on it.
Classic Problem Solving Systems • The design of a classic problem solver consists of two parts: • an interface for user-supplied problem spaces, and a • search engine.
Interface • The interface requires the ability to manipulate states and operators. • What kinds of manipulations are needed? • Goal detection: Ascertain whether a given state satisfies the goal criterion. • State identity: Detect when two descriptions of states refer to the same state. • State display: Produce a human readable description of a given state.
The importance of goal detection is obvious. • State identity is important because we make no progress by re exploring already examined states. • Displaying states allows us to observe and debug system behaviour.
Expanding a State • Identify what operators are available. • Determine whether a given operator is applicable to a particular state. • Given a state and an operator applicable to it, ascertain all the ways the operator can be instantiated on that state. • Figure out what new state results from applying an instantiated operator to a state.