330 likes | 348 Views
This presentation focuses on the synthesis of programs with loops for iterative planning, separating plan generation from verification. It also introduces a new approach to plan testing using a constant bound provided by the user. The KPLANNER tool is used to implement this approach.
E N D
Planning with Loops Hector J. LevesqueDept. of Computer ScienceUniversity of Toronto Presented by Lihui Hu
1.Introduction • sequential planning • conditional planning • iterative planning
1.1 Difficulty of Iterative Planning • theorem-proving approach • plans are programs, planning is synthesis of programs with loops. Stephan and Biundo say “Plan generation on this level is an interactive process with non-trivial inferences that in our opinion, which is shared by other authors as well [citations omitted], cannot be carried out in a fully automatic way.”
1.2 Contribution • Separate the generation of plan from the verification • Generate small plans with loops
1.3 An example • Goals: chop down a tree; put away the axe • Actions: chop(pre:tree-up;axe-available ) store(pre:axe-available )
1.3.1 Plans -- Seuquential • No additional information • Suppose we know the tree will go down if it is hit 3 times sequential plan: chop; chop ; chop ; store
1.3.1 Plans – Conditional • the tree will go down if it is hit at most 2 times conditional plan: CASE look OF -down: store -up: chop ; CASE look OF -down: store -up: chop ; store ENDC ENDC
1.3.1 Plans -- Loops • the tree will eventually go down if it is hit repeatedly iterative plan: LOOP CASE look OF -down: EXIT -up: chop ; NEXT ENDC ENDL ; store
1.4 Robot Programs • nil • seq(A; P) A: primitive action; P: robot program • case(A; [if(R1; P1); : : : ; if(Rk; Pk)]) • if P and Q are robot programs, and B is the result of replacing in P some of the occurrences of nil by exit and the rest by next; then loop(B;Q) is a robot program, executed by repeatedly executing the body B until the execution terminates with exit (rather than next), and then going on by executing the continuation Q. • Planning: given a goal, find a robot program that can achieve it.
1.5.1 The Planning Approach • planning parameter (1) its value is not known or even bounded at plan time, and (2) no loops would be required to achieve the goal if its value were known.
1.5.2 The Planning Approach -- Continue • F is a planning parameter • The user will provide a constant N1 (called the generating bound) and we generate a plan (possibly containing some number of loops) that is provably correct under the assumption that F ≤ N1; • The user will provide a second larger constant N2 (called the testing bound) and we test that the plan generated in the first step is also provably correct under the assumption that F ≤ N2:
2.1 The Planner • problem specification • parameter F, N1 and N2 • we generate a plan that is correct for F ≤ N1 • we test the plan to see if it is correct for F ≤ N2 • KPLANNER, is written in Prolog • http://www.cs.toronto.edu/cogrobo
2.2 Testing Plans • A plan P achieves a goal G starting in history H if
2.2 Testing Plans -- Continue • Unwinding a loop LOOP CASE look OF CASE look OF -down: EXIT -down: EXIT -up: chop; -up: chop ; LOOP NEXT CASE look OF ENDC … ENDL ENDL ENDC
2.4 Generating loops • F ≤ 1
3 Planner in Action • prim_fluent(f) • prim_action(a; [r1; : : : ; rn]) • poss(a; c) • init(f; v) • causes(a; r; f; v; c) • settles(a; r; f; v; c) • rejects(a; r; f; v; c) • parm_fluent(f) • init_parm(w; f; v)
3.1 Tree Chopping Example -- Continue • KPLANNER finds tree-chopping plan with loop in .11 seconds.
3.2 Counting Example • We have two accumulators and some unknown integer input k; where k > 0. The primitive actions are: incr_acc(n); increment accumulator n (both start at 0); test_acc(1); sense if the first accumulator has the same value as the input. The goal: To make the second accumulator have the value 2k-1.
3.3 Another Example • Searching an unbounded binary tree for a target node • A plan is found after 0.07 seconds.
4.1 Discussion • As far as we know, no planner based on fully automated theorem-proving can generate the three plans.
4.2 Limitation • KPLANNER does not scale at all well as the search space grows, even for seemingly easy problems. • Consider the problem of getting some good eggs into a bowl .For just one egg:
4.2 Limitation -- Continue • Small but difficult problems
5.1 Towards a Theory • W(k; σ) stands for the proposition that if we start in any initial state where F = k; we perform the action sequence σ; we end up in a goal state.
5.1 Towards a Theory-- Continue • Define of simple problem
5.3 Theory • Theorem 1 Suppose we have a planning problem that is simple with respect to action A; and a robot program P that contains N occurrences of A. If P is a correct plan for all values of F ≤ N + 2, then P is correct for all values of F.
5.3 Theory -- Continue • Suggest a variant of KPlanner • Compute a testing bound • Apply to simple planning problems only
6. Conclusion • new way of generating a plan with loops that is not tied to proving a theorem about its correctness. • The method involves generating a plan that is correct for a given bound, determining if the plan is the unwinding of a plan with loops, and testing if another unwinding of the plan with loops would also be correct for a larger bound. • A theorem showing that this method of planning is correct for a certain class of simple planning problems.