# ARTIFICIAL INTELLIGENCE: THE MAIN IDEAS Nils J. Nilsson OLLI COURSE SCI 102 Tuesdays, 11:00 a.m. – 12:30 p.m. Winter Quarter, 2013 Higher Education Center,

## Presentation on theme: "ARTIFICIAL INTELLIGENCE: THE MAIN IDEAS Nils J. Nilsson OLLI COURSE SCI 102 Tuesdays, 11:00 a.m. – 12:30 p.m. Winter Quarter, 2013 Higher Education Center,"— Presentation transcript:

ARTIFICIAL INTELLIGENCE: THE MAIN IDEAS Nils J. Nilsson OLLI COURSE SCI 102 Tuesdays, 11:00 a.m. – 12:30 p.m. Winter Quarter, 2013 Higher Education Center, Medford Room 226 nilsson@cs.stanford.edu http://ai.stanford.edu/~nilsson/ Course Web Page: www.sci102.com/ For Information about parking near the HEC, go to: http://www.ci.medford.or.us/page.asp?navid=2117 There are links on that page to parking rules and maps

AI in the News ?

PART TWO AGENTS THAT PLAN

AI Planning MOOC http://www.coursera.org/course/aiplan

Adding a Planner to The Model of an Agent Perception Action Selection Memory Planner

On The Importance of Planning [the ant] knew that a certain arrangement had to be made, but it could not figure how to make it. It was like a man with a tea-cup in one hand and a sandwich in the other, who wants to light a cigarette with a match. But, where the man would invent the idea of putting down the cup and sandwich--- before picking up the cigarette and the match--- T. H. White, The Once and Future King

---this ant would have put down the sandwich and picked up the match, then it would have been down with the match and up with the cigarette, then down with the cigarette and up with the sandwich, then down with the cup and up with the cigarette, until finally it had put down the sandwich and picked up the match. It was inclined to rely on a series of accidents to achieve its object.

Those who will not reason, perish in the act. Those who will not act, perish for that reason. W.H. Auden

What an Agent Needs in Order to Make a Plan 1. What state am I in now? 2. What state do I want to be in? 3.Once I am in a state, and take an action I can take in that state, in which state will I end up?

The States and the Actions that Link Them Comprise a Graph A node in the graph An action link in the graph A map is an example of a graph

Maps Can be of Different Scales

A Map is an Explicit Graph All the nodes and links are right there in the map

There Are Also Implicit Graphs The nodes and links arent known until we begin a search

An Example: The 8-Puzzle 2 3 1 4 5 8 7 6 3 1 4 5 8 7 6 2 2 3 1 4 5 8 7 6 1

Another Example of an Implicit Graph All Possible Boards in Chess, Given the Initial Board and the Legal Moves of Chess

Components of an Implicit Graph SiSi SjSj SkSk SlSl A Possible State (Node) Successor States (Nodes) Possible Actions

Planning Can Be Accomplished by Searching a Graph Whether Explicit or Implicit, we begin at a start node, visit the adjacent nodes, and continue until we reach a node corresponding to our goal

Example of Search: Internet Routing An Explicit Graph

Finding a Path From Palo Alto to Pittsburgh 1 hop 2 hops 3 hops Path Found!

The 8-Puzzle Again 2 3 1 4 5 8 7 6 2 13 4 5 6 7 8 START GOAL Represent states by an array of numbers: Successor states: exchange 0 with an adjacent number in array Goal is this array: 1 2 3 8 0 4 7 6 5 0 2 3 1 4 5 8 7 6

Start and Goal States for The 8-Puzzle 1 2 3 8 0 4 7 6 5 The following sequence of slides was generated from an applet at: www.cs.rmit.edu.au/AI-Search/Product/ The GOAL State The START State

Node Annotations

Breadth-First Search START 1 2 3 8 0 4 7 6 5 slide 2 to left slide 1 up Compare with GOAL

Breadth-First Search Explores Outward in All Directions

Heuristic Search Attempts to Focus Toward The Goal

Heuristics (That Is, Good Guesses) Make the Search Process More Efficient Because They Are Only Guesses, They Arent Guaranteed To Be Accurate

Using Heuristic Search (A*) on the 8-Puzzle 1 2 3 8 0 4 7 6 5 The GOAL State The START State

Evaluating States in A* 1 2 3 8 0 4 7 6 5 number of moves made so far number of tiles out of place (a rough heuristic estimate of number of moves left) value = 6 generate successor states + sequence number

A* 1 2 3 8 0 4 7 6 5 number of moves made so far number of tiles out of place (a rough heuristic estimate of number of moves left) value = 6 + Best Open Node Open Nodes

A* (Next) 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node

A* (Next) 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node

A* (Next) 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node Open Node

A* (Next) 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node Open Node

A* (Final) GOAL! 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node Open Nodes

History of A* Shakey the Robot (around 1968) Shakeys Map

Some Applications of A* (and its descendants) Route Finding in Maps (Google, Bing, MapQuest, …) Electronic Games (NPC Navigation) Language Analysis (Parsing Sentences) Navigation on Mars

Planning When States Are Represented by Lists of Statements Example: Toy Blocks State Description in English and in Computerese: B is on the FloorOn(B,Fl) A is on COn(A,C) C is on the floorOn(C,Fl) B is openOpen(B) A is openOpen(A) The floor is openOpen(Fl) C A B

Describing Effects of Actions Action Description in English and in Computerese: Moving a block, x, from one place, y, to another place, z move(x,y,z) (A schema --- x, y, z are variables) Preconditions: On(x,y), Open(x), Open(z) Delete List: On(x,y), Open(z) Add list: On(x,z), Open(y), Open(Fl) One of three possible actions here: x = A, y = C, z = B (Instantiating the schema --- A, C, and B are constants) C A B

Example Action and its Effects One (of three) possible actions here: move(A,C,B) Preconditions: On(A,C), Open(A), Open(B) Delete List: On(A,C), Open(B) Add list: On(A,B), Open(C), Open(Fl) Open(A) On(C,Fl) On(B,Fl) Open(Fl) On(A,B) Open(C) On(A,C) Open(B) Open(A) On(C,Fl) On(B,Fl) Open(Fl) C A B C A B move(A,C,B)

A Possible Goal State On(A,B), On(B,C),On(C,Fl) C A B What Actions Will Achieve the Goal? C A B

Two Technical Problems 1. The Qualification Problem 2. The Side-Effect Problem

The Qualification Problem move(x,y,z) Preconditions: On(x,y), Open(x), Open(z) Delete List: On(x,y), Open(z) Add list: On(x,z), Open(y), Open(Fl) What about unexpected, anomalous preconditions? C A B

The Side-Effect Problem move(x,y,z) Preconditions: On(x,y), Open(x), Open(z) Delete List: On(x,y), Open(z) Add list: On(x,z), Open(y), Open(Fl) Mention These in Delete and Add Lists C A B

This Style of Planning Was First Proposed in a System Called STRIPS Used by Shakey the Robot to Make Plans (1971)

Applications of STRIPS-Style Planners Scheduling (e.g., for Hubble Space Telescope) Mission Planning (Defense and Space) Assembly Planning Logistics Planning Actions for Non-Player Characters in Electronic Games

Download ppt "ARTIFICIAL INTELLIGENCE: THE MAIN IDEAS Nils J. Nilsson OLLI COURSE SCI 102 Tuesdays, 11:00 a.m. – 12:30 p.m. Winter Quarter, 2013 Higher Education Center,"

Similar presentations