Presentation is loading. Please wait.

Presentation is loading. Please wait.

Artificial Intelligence University Politehnica of Bucharest 2008-2009 Adina Magda Florea

Similar presentations


Presentation on theme: "Artificial Intelligence University Politehnica of Bucharest 2008-2009 Adina Magda Florea"— Presentation transcript:

1 Artificial Intelligence University Politehnica of Bucharest 2008-2009 Adina Magda Florea http://turing.cs.pub.ro/aifils_08

2 Lecture No. 9 Automatic planning (AP) AP – features Linear planning in STRIPS Nonlinear planning in TWEAK Hierarchical planning Contingency planning 2

3 1. AP - features Common sense reasoning: Frame problem, qualification problem, ramification problem Decomposing problems into sub-problems Planning linear non-linear hierarchical contingency 3

4 AP - features - cont Representing knowledge in planning problems Representing the states during search 4

5 2. Linear planning in STRIPS Plan operators - Action (name + params) - Preconditions (LP) - Additions (LA) - Eliminations (LE) 5

6 2.1 STRIPS representation Plan operators STACK(x,y), UNSTACK(x,y), PICKUP(x), PUTDOWN(x) Predicates: ON(x,y), ONTABLE(x), CLEAR(x), HOLD(x), ARMEMTY Axioms: 6

7 STRIPS representation - cont Plan operators 7 LP: LE:CLEAR(y)HOLD(x) LA:ON(x,y)ARMEMPTY LP: LE: LA: PICKUP(x)LP: LE: LA: PUTDOWN (x)LP: LE: LA:

8 2.2 Plan execution 8

9 2.3 STRIPS - functionning 9 ARMEMPTY Stack 1Stack 2

10 STRIPS - functionning - cont 10 /* for goal ON(C,A) */ /* preconditions of STAC(C,A)*/

11 2.4 Algorithm of STRIPS S – variable – the current description of state; Stack – stack of satisfied goals on the current search path; Goals – list of unsatisfied goal on the current search path Structure Operator with fields: Action, Preconditions, AddList si DeleteList (Operator.Preconditions) 11

12 2.4 Algorithm of STRIPS Algorithm:Linear Planning in STRIPS SatisfyGoals (Goals, S, Stack) 1.for every Goal in Goals do 1.1. NewState  AchieveGoal(Goal, S, Stack) 1.2.if NewState = FAIL then return FAIL 2.if all goals in Goals are satisfied in state NewState then return NewState 3.else return FAIL end. 12

13 Algorithm of STRIPS - cont AchieveGoal (Goal, S, Stack) 1.if Goal is marked as satisfied in state S then return S 2. if Goal belongs to Stack then return FAIL 3.ValidOperators  {O | O can satisfy goal Goal } 4. for every operator O in ValidOperators do 4.1. NewState  ApplyOperator(O, S, Stack  { Goal }) 4.2. if NewState <> FAIL then 4.2.1.Mark goal Goal as satisfied in state NewState 4.2.2. return NewState 5. return FAIL end. 13

14 Algorithm of STRIPS - cont ApplyOperator (Operator, State, Stack) 1. NewState  SatisfyGoals(Operator.Preconditions, State, Stack) 2.if NewState <> FAIL then 2.1.Add Operator.Action to plan 2.2. NewState  NewState – Operator.DeleteList 2.3. return NewState  Operator.AddList 3. then return FAIL end. 14

15 2.5 Sussman's anomaly 15 ARMEMPTY Stack 1Stack 2

16 Sussman's anomaly - cont 16 Stack 1

17 3. Nonlinear planning - TWEAK Constraints posting (temporal, unification/codesignation) Level of plan representation; Level of plan modification to obtain a plan that solves the problem 17

18 3.1 TWEAK representation 18 Actiune Preconditii: Postconditii: Actiune:PICKUP(x) Preconditii: Postconditii: Action Preconditions Postconditions Action Preconditions Postconditions

19 3.2 Plan synthesis 19 Operations for plan modification: (1)adding steps; (2)promotion; (3)simple binding; (4)separation; (5)removing destructivity - insert S3 (existing or new) between S1 and S2 (S1 a threat for S2).

20 Plan synthesis - cont 20 ARMEMPTY ARMEMTY

21 Plan synthesis - cont 21 *ARMEMTY 1. UNSTACK (C,A) 2. PUTDOWN (C) 3. PICKUP (B) 4. STACK (B,C) 5. PICKUP (A) 6. STACK (A,B) } HOLD(A) HOLD(B)

22 3.3 Algorithm in TWEAK Algoritm:Nonlinear planning in TWEAK 1.Initialize Plan  {} 2.Initialize S with the set of formulas defining the goal state 3.while S <> {} do 3.1.Pick a formula F and remove it from S 3.2.if F is not satisfied in the current state then 3.2.1.Choose a plan modifying operation 3.2.2.Apply operation and add its effect to Plan 22

23 Algorithm in TWEAK - cont 3.3.Verify for every step in Plan if the preconditions are satisfied 3.4.for every unsatisfied condition of a step in Plan do Add precondition to S 4.Generate the total order of the elements in Plan based on individual order relations 5.if Plan is a partial plan then 5.1.Instantiate the variables in Plan 5.2.Arbitrarily transform the partial order in Plan in a total order end. 23

24 3.4 A formal model for planning A formula is true in a state S if it unifies with a formula in state S A plan step asserts a formula F in state S if F unifies with a postcondition of the plan step A plan step invalidates a formula F in state S if F unifies with a negated postcondition of the plan step A plan step may be executed only if all its preconditions are true in S After the execution of a plan step in a state S, all asserted formulas are added to S and all invalidated formulas are removed from S 24

25 A formal model for planning - cont Necessary truth criterion A formula P is necessarily true in a state S if and only if the following 2 conditions are met: (1)there is a state T equal to/or necessarily before state S in which P is necessarily asserted (added); (2)for every step C possibly to be executed before S and for every formula Q which can unify with P and is invalidated (made false) by C, there is a step W necessarily between C and S which asserts R, R being a formula for which R and P unifies whenever P and Q unifies. 25

26 A formal model for planning - cont Necessary truth criterion 26

27 27 Plans on different levels of abstraction Abstract plans Abstract operations Scrie lucrare Biblio Org. idei Editeaza continut Gaseste editor Edit. text Edit. figuri Verifica erori ….. 4. Hierarchical planning

28 5. Contingency planning 28 Start Finish On(Tire1) Flat(Tire1) Inflated(Spare) On(Tire1) Inflated(Tire1) Flat(Tire1) Intact(Tire1) Inflate(Tire1) Intact(Tire1)

29 Contingency planning - cont 29 Start Finish On(Tire1) Flat(Tire1) Inflated(Spare) On(Tire1) Inflated(Tire1) Flat(Tire1) Intact(Tire1) Inflate(Tire1) Remove(Tire1) PutOn(Spare) Finish On(Spare) Inflated(Spare) ~Intact(Tire1) Intact(Tire1) Check(Tire1) ~Intact(Tire1) Intact(Tire1)


Download ppt "Artificial Intelligence University Politehnica of Bucharest 2008-2009 Adina Magda Florea"

Similar presentations


Ads by Google