0% found this document useful (0 votes)
32 views32 pages

Artificial Intelligence 3451: UNIT: 05 Planning and Reasoning

Planning algorithms allow agents to find a sequence of actions to achieve a goal state from an initial state. The STRIPS language represents states as conjunctions of literals and actions with preconditions and effects. Planners use special algorithms rather than general logical inference due to the huge search space. Partial order planners search a plan space of partial plans rather than total orderings, allowing more flexibility. Heuristics like problem decomposition and relaxed problems help guide the search more efficiently.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views32 pages

Artificial Intelligence 3451: UNIT: 05 Planning and Reasoning

Planning algorithms allow agents to find a sequence of actions to achieve a goal state from an initial state. The STRIPS language represents states as conjunctions of literals and actions with preconditions and effects. Planners use special algorithms rather than general logical inference due to the huge search space. Partial order planners search a plan space of partial plans rather than total orderings, allowing more flexibility. Heuristics like problem decomposition and relaxed problems help guide the search more efficiently.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

Artificial Intelligence 3451

UNIT: 05
Planning and Reasoning
Lecture: 12

Farhad Muhammad Riaz


From Problem Solving to Planning
 Planners can
 Use FOL (for example) for representing states, goals, and
actions
 Break hard problems into manageable subproblems
 Solve some subproblems independently of others
Planning
 Could use standard FOL inference (e.g., resolution) to find
plan
 But this isn’t practical: Huge search space
 Instead, use special-purpose (=efficient) algorithms, each with
its own restricted (= smaller search space) language
STRIPS Representation for Planning

 STRIPS language
 States = conjunctions of function-free ground literals
 Goals = same thing, but can also have variables (assumed to be
existentially quantified)
STRIPS Representation for Actions

 Actions have three components:


 Action description = just the name
 Precondition = conjunction of positive literals that says what
must be true to make the action applicable
 Effect = conjunction of positive or negative literals that says
what changes in the state when the action is applied
 Can be separated into an add list and a delete list
Representations for Plans
 Relative ordering of plan steps
 Total order (linearization): all steps in order
 Partial order: some steps in order
Plan Solutions

 Problems with linearized, totally ordered plans


 Which linearization to choose?
 What if agent can perform some steps in parallel?
 When combining plans (e.g., for subproblems), partial
ordering gives flexibility
 Solution = an executable plan that guarantees
reaching the goal
 Complete plans: all preconditions of all steps are achieved
by prior steps
 Consistent plans: no inconsistencies in ordering
constraints or causal links
Plan Space

 Searching through plan space


 Each node is a partial plan, which represents a set of complete
plans
 Search operators modify plans: add steps, reorder steps, etc.
 Progression (forwards) vs. Regression (backwards)
planning
The Plan Data Structure

 A Plan data structure contains:


 A set of plan steps, Si
 A set of step ordering constraints
 A set of open preconditions
 A set of causal links
 Initial plan: Steps = Start and Finish
 Start’s effects = initial state. No preconditions.
 Finish’s preconditions = goal state. No effects.
Clobbering
Partial-Order Planning

 Start with the minimal partial plan


 Each point in planning adds a step (and causal links) that
achieves some precondition
 Can use standard search algorithms
 The key is the formulation: Nodes aren’t world states, they’re
partial plans
Partial-Order Planning Example

 Start at home
 Goal = return home with milk, bananas, and drill
 Only add steps that achieve an unachieved precondition ->
Reduces search space
 Causal links help prune bad plans quickly, before going
too far down the dead end
Example
Example
Example
Situation Calculus
 Formalization of actions in first-order logic (McCarthy & Hayes, 1969).
Search performed by logical inference.
 Situations are logical terms denoting states of the world.
 Actions and facts are represented as logical terms called fluents.
 puton(A,B): The action of putting block A on block B.
 on(A,B): The proposition that block A is on block B.
 Propositional fluents are asserted to be true in a particular
 state by using the predicate: holds
 holds(on(A,B), s): A is on B in situation s
 Situations resulting from performing an action in another situation are
represented using the function: result
 result(puton(A,B), s): The situation resulting from putting A on B in
situation s.
An example – Blocks world
 Blocks on a table
 Can be stacked, but only one block on top of another
 A robot arm can pick up a block and movie to another
position
 On the table
 On another block
 Arm can pick up only one block at a time
 Cannot pick up a block that has another one on it

19/34 AI Lecture 17
Representation language
 STRIPS (Fikes & Nilsson, 1971)
 One of the first planning systems
 Robotics
 See it in action at
http://www.ai.sri.com/movies/Shakey.ram
 Main contribution is its language description formalism
 Many variants/extensions

20/34 AI Lecture 17
STRIPS
 State is a conjunction of positive ground literals
On(B, Table) Λ Clear (A)
 Goal is a conjunction of positive ground literals
Clear(A) Λ On(A,B) Λ On(B, Table)
 Action schema
 Conjunction of positive literals as preconditions
 Conjunction of positive and negative literals as effects

21/34 AI Lecture 17
More on action schema

 Example: Move (b, x, y)


 Precondition:
Block(b) Λ Clear(b) Λ Clear(y) Λ On(b,x) Λ (b ≠ x) Λ (b ≠ y) Λ (y ≠ x)
 Effect:
¬Clear(y) Λ ¬On(b,x) Λ Clear(x) Λ On(b,y)

Delete list Add list

 An action is applicable in any state that satisfies its


precondition
22/34 AI Lecture 17
STRIPS assumptions
 Closed World assumption
 Unmentioned literals are false (no need to explicitly list out)
 w/an open world assumption unmentioned literals are unknown
 STRIPS assumption
 Every literal not mentioned in the “effect” of an action schema
remains unchanged

23/34 AI Lecture 17
STRIPS expressiveness
 Literals are function free: Move (Block(x), y, z)
 Any action scheme can be propositionalized
Move(b,x,y) and 3 blocks and table can be expressed as 48 purely
propositional actions
 No disjunctive goals: On(B, Table) V On(B, C)
 No conditional effects: On(B, Table) if ¬On(A, Table)
 In original STRIPS, no equality: x ≠ y
 Ramification – esp. in more complex domain

24/34 AI Lecture 17
Forward state-space search (1)
 Progression
 Initial state: initial state of the problem
 Actions:
 Applied to a state if all the preconditions are satisfied
 Succesor state is built by updating KB with add and delete lists
 Goal test: state satisfies the goal of the problem

25/34 AI Lecture 17
Forward search in the Blocks world

26/34 AI Lecture 17
Forward state-space search (2)
 Advantages
 No functions in the declarations of goals 
search state is finite
 Sound
 Complete (if algorithm used to do the search is complete)
 Limitations
 Irrelevant actions  not efficient
 Need heuristic or prunning procedure

27/34 AI Lecture 17
Backward state-space search (1)
 Regression
 Initial state: goal state of the problem
 Actions:
 Choose an action that
 Is relevant; has one of the goal literals in its effect set
 Is consistent; does not negate another literal
 Construct new search state
 Remove all positive effects of A that appear in goal
 Add all preconditions, unless already appears
 Goal test: state is the initial world state

28/34 AI Lecture 17
Backward state-space search (2)
 Possible because of STRIPS-like language
 Goals are listed
 Predecessors are listed for each action/state
 Advantages
 Consider only relevant actions  much smaller branching
factor
 Ways to reduce even more the branching factors
 Limitations
 Still need heuristic to be more efficient

29/34 AI Lecture 17
Heuristics for state-space search (1)
 Valid both for forward and backward searches
 Valid for many planning problems
 Possible approaches
 Divide and conquer
 Derive a relaxed problem
 Combine both

30/34 AI Lecture 17
Heuristics for state-space search (2)
 Divide and conquer
 Subgoal independence assumption
 What if there are negative interactions between the subgoals of the
problems?
 What if there are redundant actions in the subgoals?
 Derive a relaxed problem
 Remove all preconditions from the actions
 Remove all negative effects from the actions
(empty delete list)

31/34 AI Lecture 17
Limitation of state-space search
 Linear planning or Total order planning
 Example
 Initial state: all the blocks are clear and on the table
 Goal: On(A,B) ∧ On(B,C)
 If search achieves On(A,B) first, then needs to undo it in order
to achieve On(B,C)
 Have to go through all the possible permutations of the
subgoals

32/34 AI Lecture 17

You might also like