Russell and Norvig, Chapter 11: Planning 11.1 A Simple Planning Agent [Fig11.1, p338] - compare to problem-solving agent [Fig3.1] and KB Agent [Fig6.1] - we want to build Ideal-Planner 11.2 From Problem-Solving to Planning - difficulties in problem-solving (i.e., search) - actions are black-box, state-next state procedures - do not describe what they can achieve - no subgoaling - states are complete - cannot function with partial information - plans considered only as unbroken sequences - no partial plans or subplans - most conjunctive goals are independent - no ability to work on intermediate goals directly - e.g., to get the gold, I should do this next 11.3 Planning in Situation Calculus - initial state - at(agent,[1,1],s0) and not hasgold(agent,s0) and alive(agent,s0) - goal state - exists(S) hasgold(agent,S) and at(agent,[1,1],s0) and alive(agent,S) - operators - successor-state axioms - hasgold(agent,result(A,S)) <=> [(A = grab) and at(agent,[X,Y],S) and gold(X,Y)] V [(A != release) and hasgold(agent,S)] - result'(L,S): state resulting from applying the sequence of actions in L starting at state S - can use this to do planning, but not very practical (ie, theorem proving) - using a planner - gives more guidance and is therefore more efficient - at the expense of a less-expressive representation - each representation requires a different planner 11.4 Basic Representations for Planning - STRIPS (STanford Research Institute Problem Solver) language - states and goals - states: conjunction of function-free ground literals - goals: conjunction of function-free literals - queries look for sequences of actions to obtain, not just truth - closed-world assumption is the default - actions (operators) - name - precondition: conjunction of positive literals - effect: conjunction of literals - e.g., name: goforward0 precondition: at(X,Y) and orient(0) [and not wall(X+1,Y)] effect: not at(X,Y) and at(X+1,Y) - situation space vs. plan space - searching in situation space - progression: start from initial state (problem solving) - regression: start from goal state - searching in plan space - partial plan: start anywhere - refinement operators: add and/or order steps - least commitment strategy (variables and order) - usually fewer plans than situations - plans: partial order or total order (--linearization-->) - set of plan steps - intially: { S1: start([],InitialState) S2: finish(GoalState,[]) - set of step ordering constraints, Si < Sj - initially: S1 < S2 - set of variable binding constraints, v=x - initially: null - set of causal links (protection intervals) - causes(Si,C,Sj): Si achieves C for Sj - initially: null - e.g., [Fig11.5, p348] 11.5 A Partial-Order Planning Example [Fig11.6 - Fig11.12] - protecting causal links by demotion or promotion [Fig11.10, p353] 11.6 A Partial-Order Planning Algorithm [Fig11.13] - POP - non-deterministic definition via 'choose' construct (Prolog) - select_subgoal not a candidate for backtracking - order in which goals selected only affects efficiency 11.7 Planning with Partially-Instantiated Operators - possible threats: not at(wumpus,X,Y) and at(wumpus,2,2) - (1) resolve now, binding X,Y to something other than 2,2 - (2) resolve now, adding constraint that not(X=Y=2) - (3) resolve later, wait until X,Y bound by other constraints - implementation [Fig11.14, p358] - avoid nested loops in resolve_threats by storing dependencies 11.8 Knowledge Engineering for Planning - blocks world - Shakey's world - wumpus - operators correspond to actions (e.g., goforward, turnleft, ...) 11.9 Summary - closed-world assumption and the wumpus world (incomplete information)? - conditional effects (e.g., shoot)? - the above concerns answered in Chapter 12