Ai Principles Planning[1]

download Ai Principles Planning[1]

of 18

Transcript of Ai Principles Planning[1]

  • 8/8/2019 Ai Principles Planning[1]

    1/18

    AI Principles, Lecture on Planning

    Planning

    Jeremy Wyatt

  • 8/8/2019 Ai Principles Planning[1]

    2/18

    AI Principles, Lecture on Planning

    Plan

    Situation calculus

    The frame problem

    The STRIPS representation for planning

    State space planning:

    Forward chaining search (progression planning)

    Backward chaining search (regression planning)

    Reading: Russell and Norvig pp.375-387

  • 8/8/2019 Ai Principles Planning[1]

    3/18

    AI Principles, Lecture on Planning

    Situation Calculus

    The situation calculus is a general system for allowing you

    to reason automatically about the effects of actions, and to

    search for plans that achieve goals.

    However, it has some flaws that took a long time to iron

    out

    The situation calculus is composed of

    Situations: S0 is the initial situation Result(a,S0) is the situation that

    results from applying action a in situation S0

    Fluents: functions and predicates that may be true of some situation

    e.g. Holding(G1,S0) says that the agent is not holding G1 in

    situation S0

  • 8/8/2019 Ai Principles Planning[1]

    4/18

    AI Principles, Lecture on Planning

    Situation Calculus

    Actions are described in the situation calculus using two kinds ofaxioms:

    Possibility Axioms: say when you can apply an action Effect Axioms: that say what happens when you apply them

    The essential problem with situation calculus however, is that

    EffectA

    xioms only say what changes, not what stays the same, butreasoning in the situation calculus requires the explicit representation of allthe things that dont change. These are handled by Frame Axioms, andhence this is called the Representational Frame Problem.

    Reasoning about all the effects and non-effects of a sequence of actions isthus very inefficient. This is known as the Inferential Frame Problem.

    Eventually solutions to both the Frame Problems were found. But in themeantime researchers began to look for representations to support moreefficient planning.

  • 8/8/2019 Ai Principles Planning[1]

    5/18

    AI Principles, Lecture on Planning

    The STRIPS representation

    The Grandad of planning representations

    Avoids the difficulties of more general representations (e.g.situation calculus) for reasoning about action effects andchange

    Devised for, and used in the Shakey project

    The key contribution ofthe representation of action effects isto assume that anything that isnt said to change as theresult of an action, doesnt change

    It is this assumption (sometimes called the STRIPSassumption) that avoids the representational frame problem

  • 8/8/2019 Ai Principles Planning[1]

    6/18

    AI Principles, Lecture on Planning

    STRIPS operators

    All effects are modelled, anything that isnt

    in the effects list stays the same

    The effect P^Q adds P to the worlddescription and removes Q

    Variables in the operator(e.g. x) must bebound (unified) with entities in thedescription of the world to apply theoperator, so Move(C,A,B) requires{b/C,x/A,y/B}, i.e. b is substituted by C etc.

    BA

    C

    BA

    C

    Action(Move(b,x,y))-

    Preconditions: On(b,x) ^ Clear(b) ^ Clear(y)

    Effects: On(b,y) ^ Clear(x) ^ On(b,x) ^ Clear(y)

  • 8/8/2019 Ai Principles Planning[1]

    7/18

    AI Principles, Lecture on Planning

    STRIPS operators

    STRIPS doesnt allow us to use full first orderlogic

    So we have to create a Clear(b) predicate,rather than use to indicate thatthere is no block x on block b

    Also we actions like Move(C,A,A) createinconsistent effects

    And we may need additional special operatorse.g. Move_to_table(b,x,Table) whenever theeffects are slightly different

    BA

    C

    BA

    C

    Action(Move(b,x,y))-

    Preconditions: On(b,x) ^ Clear(b) ^ Clear(y)

    Effects: On(b,y) ^ Clear(x) ^ On(b,x) ^ Clear(y)

    ),( bxOnx

  • 8/8/2019 Ai Principles Planning[1]

    8/18

    AI Principles, Lecture on Planning

    The STRIPS state and goal descriptions

    In the state description anything that isnt stated is assumed to be false(Closed World Assumption)

    So only +ve literals are allowed in the state description

    Only ground literals are allowed in the goals. So not

    On(Next_Alpha(x),C) or On(x,C)

    The goal description specifies a set of states

    BA

    C

    On(A,Table) On(B,Table)

    On(C,A) Clear(C)Clear(B)

    B

    A

    C

    On(A,B)

    On(B,C)

    State Goal

  • 8/8/2019 Ai Principles Planning[1]

    9/18

    AI Principles, Lecture on Planning

    Application of an action

    Apply Move(C,A,B)

    BA

    C

    On(A,Table) On(B,Table)

    On(C,A) Clear(C)Clear(B)

    BA

    State State

    Action(Move(b,x,y))-

    Preconditions: On(b,x) ^ Clear(b) ^ Clear(y)

    Effects: On(b,y) ^ Clear(x) ^ On(b,x) ^ Clear(y)

    On(A,Table) On(B,Table)

    On(C,A) Clear(C)Clear(B)

    Action(Move(C,x,y))-

    Preconditions: On(C,x) ^ Clear(C) ^ Clear(y)

    Effects: On(C,y) ^ Clear(x) ^ On(C,x) ^ Clear(y)

    Action(Move(C,A,y))-

    Preconditions: On(C,A) ^ Clear(C) ^ Clear(y)

    Effects: On(C,y) ^ Clear(A) ^ On(C,A) ^ Clear(y)

    Action(Move(C,A,B))-

    Preconditions: On(C,A) ^ Clear(C) ^ Clear(B)

    Effects: On(C,B) ^ Clear(A) ^ On(C,A) ^ Clear(B)

    On(A,Table) On(B,Table)

    On(C,A) Clear(C)Clear(B)

    Action(Move(C,A,B))-

    Preconditions: On(C,A) ^ Clear(C) ^ Clear(B)

    Effects: On(C,B) ^ Clear(A) ^ On(C,A) ^ Clear(B)

    On(A,Table) On(B,Table)

    Clear(C)

    On(A,Table) On(B,Table)

    On(C,B) Clear(C)Clear(A)

    C

  • 8/8/2019 Ai Principles Planning[1]

    10/18

    AI Principles, Lecture on Planning

    Forward Chaining Search

    On(A,Table)

    On(B,Table)On(C,A)

    Clear(C) Clear(B)

    On(A,Table)

    On(B,Table)

    On(C,Table)

    Clear(A)

    Clear(C) Clear(B)

    On(A,Table)

    On(B,Table)

    On(C,B)

    Clear(C) Clear(A)

    Move(C,A,

    Table)

    Move(C,A,B)

  • 8/8/2019 Ai Principles Planning[1]

    11/18

    AI Principles, Lecture on Planning

    Forward Chaining Search

    Because of the restrictions on STRIPS representation there

    can only be a finite number of states

    You need a graph search algorithm (e.g. A*)

    You need a decent heuristic to control search behaviour

    Forward search is inefficient in the number of irrelevant

    actions there are.

    BA

    C

    F ED

  • 8/8/2019 Ai Principles Planning[1]

    12/18

    AI Principles, Lecture on Planning

    Backward Chaining Search

    On(B,C) On(A,B)

    Move(A,x,B)

    Action(Move(b,x,y))-

    Preconditions: On(b,x) ^ Clear(b) ^ Clear(y)

    Effects: On(b,y) ^ Clear(x) ^ On(b,x) ^ Clear(y)

    {x/Table}

    Initial State: On(A,Table)

    On(B,Table) On(C,A)

    Clear(C) Clear(B)

    C

    BA

    A

    C

    B

  • 8/8/2019 Ai Principles Planning[1]

    13/18

    AI Principles, Lecture on Planning

    Backward Chaining Search

    On(B,C) On(A,B)

    On(A,Table)

    Clear(A)

    Clear(B)

    On(B,C)Move(A,x,B)

    Action(Move(b,x,y))-

    Preconditions: On(b,x) ^ Clear(b) ^ Clear(y)

    Effects: On(b,y) ^ Clear(x) ^ On(b,x) ^ Clear(y)

    {x/Table}

    Initial State: On(A,Table)

    On(B,Table) On(C,A)

    Clear(C) Clear(B)

    C

    BA

    B

    AC

    A

    C

    B

  • 8/8/2019 Ai Principles Planning[1]

    14/18

    AI Principles, Lecture on Planning

    Backward Chaining Search

    On(B,C) On(A,B)

    On(A,Table)

    Clear(A)

    Clear(B)

    On(B,C)Move(A,x,B)

    Action(Move(b,x,y))-

    Preconditions: On(b,x) ^ Clear(b) ^ Clear(y)

    Effects: On(b,y) ^ Clear(x) ^ On(b,x) ^ Clear(y)

    {x/Table}

    Initial State: On(A,Table)

    On(B,Table) On(C,A)

    Clear(C) Clear(B)

    C

    BA

    Move(b,A,x)

    On(A,Table)

    Clear(B)

    On(B,A)

    Clear(C)

    B

    AC

    A

    C

    B

    {x/C, b/B}

    B

    AC

  • 8/8/2019 Ai Principles Planning[1]

    15/18

    AI Principles, Lecture on Planning

    Backward Chaining Search

    On(B,C) On(A,B)

    On(A,Table)

    Clear(A)

    Clear(B)

    On(B,C)Move(A,x,B)

    Action(Move(b,x,y))-

    Preconditions: On(b,x) ^ Clear(b) ^ Clear(y)

    Effects: On(b,y) ^ Clear(x) ^ On(b,x) ^ Clear(y)

    {x/Table}

    Move(B,x,C)

    Initial State: On(A,Table)

    On(B,Table) On(C,A)

    Clear(C) Clear(B)

    C

    BA

    Move(b,A,x)

    On(A,Table)

    Clear(B)

    On(B,A)

    Clear(C)

    {x/Table}

    B

    AC

    A

    C

    B

    {x/C, b/B}

    B

    AC

    BAC

    On(A,Table)

    On(B,Table)

    Clear(B)

    Clear(C)

    Clear(A)

  • 8/8/2019 Ai Principles Planning[1]

    16/18

    AI Principles, Lecture on Planning

    Backward Chaining Search

    An operator is chosen that achieves one of the unachievedparts of the goal state

    Variables in the action are bound to entities in the world

    When an operator is applied

    Its positive effects are deleted to create the predecessor

    Each precondition is added to the list of sub-goals

    A sub-goal that is not true in the initial state is then chosen

    to be achieved

  • 8/8/2019 Ai Principles Planning[1]

    17/18

    AI Principles, Lecture on Planning

    Linear vs non-linear planning

    In early planners it was assumed that sub-goals could be solved completely

    independently

    And the plans produced for these sub-goals could then be sequenced

    This approach is called Linear Planning (Sacerdoti, 1975), but it is incomplete

    (not guaranteed to find solutions when they exist) because it doesnt interleave

    the solutions.

    Non-interleaved planners cant solve some problems (e.g. the Sussman

    Anomaly)

    Non-linear planners attempt to solve this problem

    BA

    C

    C

    BA

  • 8/8/2019 Ai Principles Planning[1]

    18/18

    AI Principles, Lecture on Planning

    Conclusion

    Planning is an important area ofAI. State of the art planners are nowbeyond human level performance.

    Specialist representations of action effects have been used to overcomeissues of representational and inferential inefficiency

    The STRIPS representation has been influential, succeeded by ADL andthe overarching framework of PDDL

    State space planning still requires search, either forward or backwardchaining

    This is the ancient history of planning, later on came partial order

    planning (1975-1995), satisfiability planners (1992 on), graph planning(1995 on), and then the resurgence of state space planning (1996 on),and also planning under uncertainty (decision theoretic planning) (1997on).