problem solving in common lisp common lisp j.e. spragg may 1997
TRANSCRIPT
Problem Solving in Problem Solving in Common LispCommon Lisp
Common Lisp
J.E. Spragg
May 1997
The Problem Space ModelThe 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 SpaceProblem 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 SpaceDefining 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 ProblemsSolving 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.
SearchSearch
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 Classic Problem Solving SystemsSystems
The design of a classic problem solver consists of two parts:» an interface for user-supplied problem
spaces, and a» search engine.
InterfaceInterface
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 StateExpanding 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.