PLANNING

Planning vs. Problem Solving

	requirements of completeness of descriptions of states

	goals are yes or no decision functions -- no meta-
	reasoning about progress

	need more flexibility in real world

Planning approach:

	make representation of states, goals, and actions 
	more accessible

	allow intermediate plans to be unordered sequence of 
	actions (can work by back-chaining, forward-chaining, 
	or mid-chaining)

	decompose goals into subgoals and create subplans 
	to satisfy subgoals

Some starting assumptions:

	states are static unless otherwise specified

	actions will not always need to be ordered

	goals are semi-independent



				GPS (1957)

"It is not my aim to shock you ... But the simplest way I can 
summarize is to say that there are now in the world 
machines that think, that learn and create. Moreover, their 
ability to do these things is going to increase rapidly until -- 
in the visible future -- the range of problems they can 
handle will be coextensive with the range to which the 
human mind has been applied."
				Herb Simon, 1957


Means-ends analysis (Aristotle, ~300 BC)
	what is my current state
	what is my goal state
	how can I get from one to the other

I want to take my son to nursery school. 

	The problem is one of distance. 
		What changes distance? My automobile. 

	My automobile wont work. 
		What is needed to make it work? A new battery.
		What has new batteries? An auto repair shop.

	I want the repair shop to put in a new battery, but they 
	do not know I need one.
		What is the difficulty? One of communication.
		What allows communication? A telephone

	... and so on.



			GPS: A SIMPLE IMPLEMENTATION

(defvar *state* nil "the current state")

(defvar *ops* nil "list of possible actions")

(defstruct op "an operation"
	(action nil) (preconds nil) (add-list nil) (del-list nil))

(defun GPS (*state* goals *ops*)
	"achieve some goal using actions"
	(if (every #'achieve goals) 'solved))

(defun achieve (goal)
	"goal already true or we can find a way to make it true"
	(or	(member goal *state*)
		(some #'apply-op
			(find-all goal *ops* :test #appropriate-p))))

(defun appropriate-p (goal op)
	"an op is appropriate if the goal is in the add list"
	(member goal (op-add-list op)))

(defun apply-op (op)
	"print message stating action and update state"
	(when (every #'achieve (op-preconds op))
		(print (list 'executing (op-action op)))
		(setf *state* (set-difference *state* (op-del-list op)))
		(setf *state* (union *state* (op-add-list op)))
		t))



			PROBLEMS WITH SIMPLE GPS

This is much simpler than the original GPS and has a 
number of problems:

	running around the block problem
	representing state changes

	clobbered sibling goal problem
	assumed independence of goals -- but maybe not true

	leaping before you look problem
	interleaved planning and execution

	recursive subgoal problem
	circular dependencies of prerequisites

	lack of intermediate information problem
	no information about cause of failure to achieve goals



				STRIPS (1970)

Representation
	logic-based
	preconditions, actions, effects
	can have variables, but must decide when applicable

State-space planning
	reason about moving from state to state
	progression planner -- forward-chaining
	regression planner -- back-chaining

Plan-space planning

	reason about partial plans -- add / remove / specialize 
	actions

	least commitment -- do not commit to bindings until 
	necessary

	partial order plans -- do not commit to ordering of 
	actions until required (need for plan executor)