140 likes | 269 Views
Constraint Based Reasoning over Mutex Relations in Graphplan Algorithm. Pavel Surynek Charles University, Prague Czech Republic. Outline of the presentation. Brief introduction to AI planning World states reachability analysis ( Planning graphs and Graphplan ) Graphplan and constraints
E N D
Constraint Based Reasoning over Mutex Relations in Graphplan Algorithm Pavel Surynek Charles University, PragueCzech Republic
Outline of the presentation • Brief introduction to AI planning • World states reachability analysis (Planning graphs and Graphplan) • Graphplan and constraints • Singleton arc-consistency in Graphplan • Revised algorithm for state reachability • Conclusions CSCLP 2006 Pavel Surynek
AI Planning Problem • a set of actions of the form • (name; preconditions; effects) example: action that moves robot from A to B (move-robot-AB; prec={at(robot, A)}; effects={at(robot, B), at(robot,A}) • an initial world state is a set of atoms example:{at(robot_1,A); at(robot_2,C), ...} • a goal is a set of literals example:{at(robot_1,B); at(robot_2,C), ...} CSCLP 2006 Pavel Surynek
Solving of the planning problem • solution = sequence of actions transforming the initial state into a state satisfying the goal example: <move-robot_1-AB, move-robot_2-CB, ...> • forward/backward search algorithms • evolve the initial/goal world state using actions • systematically try alternative actions (backtracking) • real life problem high branching factor • techniques for search space reductions • state reachability analysis using planning graphs Extremely large search space ! CSCLP 2006 Pavel Surynek
s0 a1i a12 a11 States reachable by one step . . . s11 s12 Search tree s1i a21 a2j States reachable by two steps ... ... ... . . . s21 s2j . . . . . . . . . State reachability: planning tree Action applicable to initial state Initial world state Resulting state after application of the action • expand the tree until a goal state satisfying goal is reached Unmanageable size cannot be stored in memory CSCLP 2006 Pavel Surynek
s0 . . . a1i a12 a11 . . . s11 s12 s1i . . . . . . a21 a2j ... s21 s2j . . . . . . . . . State reachability: planning graph • build an approximationof the search tree • lot of information is lost (several sets are represented by their union) Initial proposition layer = set of atoms in the initial state Action layer = a set of actions applicable to previous proposition layer Proposition layer = set of all the positive effects of actions in the previous action layer CSCLP 2006 Pavel Surynek
p01 p02 ... p0l a11 a12 ... a1i p11 p12 ... p1i a21 a22 ... a2j p21 p22 ... p1j . . . State reachability: planning graph • this structure fits into memory • every proposition knows its origin in the previous action layer • every action knows its precondition in the previous proposition layer Preconditions of a given action Initial proposition layer = set of atoms in the initial state Action layer = a set of actions applicable to previous proposition layer Proposition layer = set of all the positive effects of actions in the previous action layer What actions produces a given proposition (atom) CSCLP 2006 Pavel Surynek
State reachability: mutex relations • associate a set of mutexes with each layer • forbids pairs of actions or atoms to be used at the same time (action is not applicable over mutex) • make the planning graph more accurate • two types of mutexes: action and propositional • a pair of actions {a1,a2} is mutex (action mutex)iff • a1 and a2 are dependent = a1 destroyspreconditions or positive effects of a2 or vice versa or • preconditions of a1 and a2 are mutex in the previous layer • a pair of atoms {p1,p2} is mutex (propositional) iff • every pair of actions producing p1 and p2 are mutex in the previous proposition layer CSCLP 2006 Pavel Surynek
Graphplan and constraints • Graphplan algorithm works in two alternating phases • expands(add layers)the planning graph until the last proposition layer satisfies the goal condition • tries to extracta valid plan (backtracking) from the planning graph, if unsuccessful continues with the former phase (planning graph is expanded again) • Planning graph can be modeled using constraints • consistency techniques more accurate approximation of the state reachability CSCLP 2006 Pavel Surynek
State variable representation • instead of saying that something is true or false say: • a certain property takes a certain value example: location(robot)=A • change actions and goals according to the above scheme: example of an action with state variables: (move-robot-AB; prec={location(robot)=A)}; effects={location(robot)=B}) example of a goal with state variables: {location(robot_1)=B; location(robot_2)≠C} CSCLP 2006 Pavel Surynek
Constraint model for plan-graph • construct the modellayer by layer • introduce a variable for every property and its value • the domain contains all the actions that has assignment property=value as its positive effect example:a(location(robot)=B){move-robot-AB, move-robot-CB,...} • forbid every pair of assignments that are mutex • mark them as incompatible within a binary constraint between corresponding variables CSCLP 2006 Pavel Surynek
Variable representing assignment Z=z3 a(X=x1) a11 a(Z=z3) a21 Domain of variable a(Z=z3) a13 a23 a(Y=y2) a12 Assignment a(Y=y2)=a22 & & a(Z=z3)=a13is not allowed a22 Consistency in the model • maintainsingleton arc-consistency in the model • deduces more information than the standard Graphplan more accurate reach. approximation No mutex between any of X=x1; Y=y2 and Z=z3 Consider an action with preconditions X=x1; Y=y2; Z=z3 CSCLP 2006 Pavel Surynek
Revised plan-graph expansion ExpandModel(M,m) {M is the constraint model of size m}1 let Gm=(Vm,Em)2 VmØ, EmØ3 for each action b=(precond(b),effect(b)) do4 let precond(b)=((Fj1=dk1);...;(Fjl=dkl)5c=(a(Fj1,dk1)≠) &...& a(Fjl,dkl)≠)6 if M{c} is singleton arc-consistent then7add a vertex (b,Fj,dk) to Vm for8 every (Fj,dk)effect(b)9 for each pair of vertexes (ai1,Fj1,dkl);(ai2,Fj2,dk2)Vm10 where ai1 and ai2 are dependent do11 add an edge {(ai1,Fj1,dkl);(ai2,Fj2,dk2)} to Em12 extend the model M according to the graph Gm=(Vm,Em)13 perform the mutex propagation in the model ExpandModel(M,m) {M is the constraint model of size m}1 let Gm=(Vm,Em)2 VmØ, EmØ3 for each action b=(precond(b),effect(b)) do4 let precond(b)=((Fj1=dk1);...;(Fjl=dkl)5c=(a(Fj1,dk1)≠) &...& a(Fjl,dkl)≠)6 if M{c} is singleton arc-consistent then7add a vertex (b,Fj,dk) to Vm for8 every (Fj,dk)effect(b)9 for each pair of vertexes (ai1,Fj1,dkl);(ai2,Fj2,dk2)Vm10 where ai1 and ai2 are dependent do11 add an edge {(ai1,Fj1,dkl);(ai2,Fj2,dk2)} to Em12 extend the model M according to the graph Gm=(Vm,Em)13perform the mutex propagation in the model Consistency check is done before an action is included into the planning graph CSCLP 2006 Pavel Surynek
Conclusions and future works • our contribution • revised planning graph expansion • planning graph expressed as a CSP • singleton arc-consitency is maintained within the planning graph CSP model • more accurate reachability approximation • reduces number of plan extraction phases which is the major time consumer • future works • implementation, experimental evaluation and improvements CSCLP 2006 Pavel Surynek