Download Planning problem in AI and more Exams Artificial Intelligence in PDF only on Docsity!
CS 1571 Intro to AI M. Hauskrecht
CS 1571 Introduction to AI
Lecture 18
Milos Hauskrecht
5329 Sennott Square
Planning: STRIPS and POP planners
Representation of actions, situations, events
Propositional and first order logic assume a static world
- Once something is true it cannot become false
But, the world is dynamic:
- What is true now may not be true tomorrow
- Changes in the world may be triggered by our activities
Problems:
- How to represent the change in the FOL?
- How to represent actions we can use to change the world?
CS 1571 Intro to AI M. Hauskrecht Planning
Planning problem:
- find a sequence of actions that achieves some goal
- an instance of a search problem
- the state description is typically very complex and relies on a
logic-based representation
Methods for modeling and solving a planning problem:
- State space search
- Situation calculus based on FOL
- STRIPS – state space search algorithm
- Partial-order planning algorithms Situation calculus
Provides a framework for representing change, actions and for
reasoning about them
- Situation calculus
- based on the first-order logic
- How does it represent time?
- Uses a situation variable that models new states of the world
- Example: On(x,y,s)
- How does it represent the change due to actions?
- effect and frame axioms
- What inference method it uses?
- Inference rules, Resolution refutation
CS 1571 Intro to AI M. Hauskrecht Blocks world example. Frame axioms.
- Frame axioms.
- Represent things that remain unchanged after an action. On ( u , v , s )∧( u ≠ x )∧( v ≠ y )→ On ( u , v , DO ( MOVE ( x , y , z ), s )) Clear ( u , s )∧( u ≠ z )→ Clear ( u , DO ( MOVE ( x , y , z ), s ))
On relations:
Clear relations:
Planning in situation calculus
Planning problem:
- find a sequence of actions that lead to a goal
Planning in situation calculus is converted to the theorem
proving problem
- Possible inference approaches:
- Inference rule approach
- Conversion to SAT
- Plan (solution) is a byproduct of theorem proving.
- Example: blocks world ∃ s On ( A , B , s )∧ On ( B , C , s )∧ On ( C , Table , s )
Goal state:
CS 1571 Intro to AI M. Hauskrecht Planning in the blocks world. A B C Initial state (s0) A B C s s 1 (^) = DO ( MOVE ( B , Table , C ), s 0 )
Action: MOVE (^ B , Table , C )
On ( B , C , s 1 ) On ( A , Table , s 1 ) On ( C , Table , s 1 ) Clear ( A , s 1 ) Clear ( B , s 1 ) ¬ Clear ( C , s 1 ) Clear ( Table , s 1 ) s 0 = On ( B , Table , s 0 ) On ( A , Table , s 0 ) On ( C , Table , s 0 ) Clear ( A , s 0 ) Clear ( B , s 0 ) Clear ( C , s 0 ) Clear ( Table , s 0 ) ¬ On ( B , Table , s 1 ) Planning in the blocks world. A B C C B A Initial state (s0) (^) s A B C s s 1 (^) = DO ( MOVE ( B , Table , C ), s 0 ) Clear ( A , s 1 ) Clear ( B , s 1 ) ¬ Clear ( C , s 1 ) Clear ( Table , s 1 )
Action: MOVE ( A , Table , B )
On ( B , C , s 2 ) On ( A , B , s 2 ) On ( C , Table , s 2 ) Clear ( A , s 2 ) ¬ Clear ( B , s 2 ) ¬ Clear ( C , s 2 ) Clear ( Table , s 2 ) s (^) 2 = DO ( MOVE ( A , Table , B ), s 1 ) = DO ( MOVE ( A , Table , B ), DO ( MOVE ( B , Table , C ), s 0 )) On ( B , C , s 1 ) On ( A , Table , s 1 ) On ( C , Table , s 1 ) ¬ On ( B , Table , s 1 ) ¬ On ( B , Table , s 2 ) ¬ On ( A , Table , s 2 )
CS 1571 Intro to AI M. Hauskrecht STRIPS planner
Defines a restricted representation language as compared to
the situation calculus
Advantage: leads to more efficient planning algorithms.
- State-space search with structured representations of states,
actions and goals
- Action representation avoids the frame problem
STRIPS planning problem:
- much like a standard search problem STRIPS planner
- States:
- conjunction of literals, e.g. On(A,B), On(B,Table), Clear(A)
- represent facts that are true at a specific point in time
- Actions (operators):
- Action: Move (x,y,z)
- Preconditions: conjunctions of literals with variables
On(x,y), Clear(x), Clear(z)
- Effects. Two lists:
- Add list: On(x,z), Clear(y)
- Delete list: On(x,y), Clear(z)
- Everything else remains untouched (is preserved)
CS 1571 Intro to AI M. Hauskrecht STRIPS planning
Operator: Move (x,y,z)
- Preconditions: On(x,y), Clear(x), Clear(z)
- Add list: On(x,z), Clear(y)
- Delete list: On(x,y), Clear(z) On ( B , C ) On ( A , Table ) On ( C , Table ) Clear ( A ) Clear ( B ) Clear ( C ) Clear ( Table ) On ( B , Table ) On ( A , Table ) On ( C , Table ) Clear ( A ) Clear ( B ) Clear ( Table )
unchanged
delete
add
Move ( B , Table , C ) A B A B C C STRIPS planning
Initial state:
- Conjunction of literals that are true
Goals in STRIPS:
- A goal is a partially specified state
- Is defined by a conjunction of ground literals
- No variables allowed in the description of the goal
Example:
On(A,B) ∧ On(B,C)
CS 1571 Intro to AI M. Hauskrecht Forward search (goal progression)
- Use operators to generate new states to search
- Check new states whether they satisfy the goal
Search tree:
Initial state A B C Move ( B , Table , C ) Move ( A , Table , C ) Move ( A , Table , B ) Move ( A , Table , B ) C B A goal A B C Forward search (goal progression)
- Use operators to generate new states to search
- Check new states whether they satisfy the goal
Search tree:
Initial state A B C Move ( B , Table , C ) Move ( A , Table , C ) Move ( A , Table , B ) Move ( A , Table , B ) C B A goal A B C
Heuristics?
CS 1571 Intro to AI M. Hauskrecht Backward search (goal regression)
Idea: Given a goal G
- Unify the add list of some operator a with a subset of G
- If the delete list of a does not remove elements of G , then the
goal regresses to a new goal G’ that is obtained from G by:
- deleting add list of a
- adding preconditions of a Clear ( A ) On ( B , C ) Clear ( B ) On ( A , Table ) On ( A , B ) On ( C , Table ) precondition (^) add Move ( A , Table , B ) On ( B , C ) On ( C , Table ) Goal (G) New goal (G’) Mapped from G C B A A B C Backward search (goal regression)
- Use operators to generate new goals
- Check whether the initial state satisfies the goal
Search tree:
Initial state A B C Move ( B , Table , C ) Move ( A , Table , B ) C B A goal Move ( A , B , Table ) A B C
CS 1571 Intro to AI M. Hauskrecht Sussman’s anomaly.
- An example from the blocks world in which the divide and
conquer fails due to interacting goals
A B C C B A Initial state Goal On ( B , C ) On ( A , B )
1. Assume we want to satisfy first
But now we cannot satisfy without undoing
Sussman’s anomaly A B C B C A Initial state On ( B , C ) On ( A , B ) On ( A , B )
1. Assume we want to satisfy first
But now we cannot satisfy without undoing
2. Assume we want to satisfy first.
But now we cannot satisfy without undoing
Sussman’s anomaly A B C B C A Initial state On ( B , C ) On ( A , B ) On ( B , C ) A B C Initial state A B C On ( A , B ) On ( B , C ) On ( A , B )