12
Introduction to AI Introduction to AI & & AI Principles (Semester 1) AI Principles (Semester 1) WEEK 4 – Wednesday WEEK 4 – Wednesday (2008/09) John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK

Introduction to AI & AI Principles (Semester 1) WEEK 4 – Wednesday (2008/09)

Embed Size (px)

DESCRIPTION

Introduction to AI & AI Principles (Semester 1) WEEK 4 – Wednesday (2008/09). John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK. Reminder (HOT) DRINKS Case Study Planning the Delivery of One Drink. - PowerPoint PPT Presentation

Citation preview

Page 1: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Introduction to AI Introduction to AI &&AI Principles (Semester 1)AI Principles (Semester 1)

WEEK 4 – Wednesday WEEK 4 – Wednesday (2008/09)

John BarndenProfessor of Artificial Intelligence

School of Computer ScienceUniversity of Birmingham, UK

Page 2: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Reminder

(HOT) DRINKSCase Study

Planning the Delivery of One Drink

Page 3: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 1 Initial Situation: Mike (M) wants beer; Mike is in the sitting

room (S); you are in the kitchen (K); there is an unopened bottle B of beer in the fridge (F); you are next to F; there is a bottle-opener O on top of F; doors D-KS, D-KH and D-HL[see below] are closed.

Other Facts: F is in K K and S are connected by door D-KS K and the hall (H) are connected by door D-KH H and S are connected by door D-HS.

Goal Situation (for You to achieve): M has B; B is open.

Page 4: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 2 Actions available (at a high level):

agent a opens a bottle b with a bottle-opener o. agent a opens a door d. agent a closes a door d. agent a goes through a room-door e. agent a moves from (being next to) an object x to an object y. agent a picks up an object x with one free hand. agent a picks up an object x with both hands. agent a puts down an object y. agent a gives a held object z to agent p.

NB: In most cases you will act as agent a, but we should be open to other possibilities.

Page 5: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 3

Individual Exercise “One-Drink A” [4 mins]

Write down one sensible sequence of actions that will achieve the Goal from the Initial Situation. Use only actions from my list.

Write down another such sequence.

Individual Exercise “One-Drink B” [3 mins]

How did you work out your first sequence, do you think?

Page 6: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 4 One sensible sequence of actions (or rather, action instances) is

as follows…. and is there anything missing?: I move to F. I open F’s door. I pick up B with one free hand. I pick up O with one free hand. I open B with O. I put down O. I move to D-KS. I open D-KS. I go through D-KS. I move to M. I give B to M.

NB: we instantiated the variables in the action specifications by replacing them by constants.

Page 7: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

New Stuff on

(HOT) DRINKSCase Study

Planning the Delivery of One Drink

Page 8: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 5 What Do You Need to Know about the action

agent a opens a bottle b with a bottle-opener o ??

answer: [Some] Preconditions:

• b is unopened

• a is holding b [roughly upright].

• a is holding o.

[Some] (Non-)Effects:• b is open

• a is still holding b.

• a is still holding o.

Page 9: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 6(corrected)

What Do You Need to Know about the action

agent a goes through a room-door e [joining rooms r1 & r2] ??

Answer: Preconditions:

• e is open• a is next to e.• a is in r1(say).

(Non-)Effects:• a is in r2. [but what about r1?]• a is [still] next to e [though in a different way].• ((e is still open)) [but do you need to know this?]• ((e still joins rooms r1 and r2 !!))

Page 10: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 7

Individual Exercise “One-Drink C” [up to 10 mins]

Write down What You Need to Know for the following actions:

a moves from (being next to) an object x to an object y.

a puts down an object y.

a gives a held object z to person p.

a picks up an object x with both hands.

a picks up an object x with one free hand.

Page 11: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 8 A possible way of working out an action sequence:

How do I achieve the Goal? I could address the following two subgoals separately:

(G1) M has B; (G2) B is open.

How do I achieve, say, G1? Aha, an action that could achieve it is “a gives held object z to person p”, with a instantiated to me, z instantiated to B, and p instantiated to M. But this means I have to achieve two subgoals (and not forget about G2):

(G1.1) I am holding B; (G1.2) I am next to M.

How do I achieve G1.1? Aha , …..

Page 12: Introduction to AI  & AI Principles (Semester 1) WEEK 4 – Wednesday   (2008/09)

Planning the Delivery of One Drink, 9 Such a process is a form of backwards chaining.

Notice some complications:

Trying to achieve more than one subgoal. One issue: what order to address them in?

The fact that several different action instances could achieve a particular subgoal. How do you choose? What order?

In principle, a single action instance could achieve more than one subgoal.

Needing to remember other subgoals when thinking backwards through an action instance (subgoal regression).