artificial intelligence: the main ideas nils j. nilsson olli course sci 102 tuesdays, 11:00 a.m. –...

45
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 [email protected] u 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

Upload: jase-holman

Post on 29-Mar-2015

222 views

Category:

Documents


3 download

TRANSCRIPT

  • Slide 1

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 [email protected] 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 Slide 2 AI in the News ? Slide 3 PART TWO AGENTS THAT PLAN Slide 4 AI Planning MOOC http://www.coursera.org/course/aiplan Slide 5 Adding a Planner to The Model of an Agent Perception Action Selection Memory Planner Slide 6 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 Slide 7 ---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. Slide 8 Those who will not reason, perish in the act. Those who will not act, perish for that reason. W.H. Auden Slide 9 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? Slide 10 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 Slide 11 Maps Can be of Different Scales Slide 12 A Map is an Explicit Graph All the nodes and links are right there in the map Slide 13 There Are Also Implicit Graphs The nodes and links arent known until we begin a search Slide 14 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 Slide 15 Another Example of an Implicit Graph All Possible Boards in Chess, Given the Initial Board and the Legal Moves of Chess Slide 16 Components of an Implicit Graph SiSi SjSj SkSk SlSl A Possible State (Node) Successor States (Nodes) Possible Actions Slide 17 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 Slide 18 Example of Search: Internet Routing An Explicit Graph Slide 19 Finding a Path From Palo Alto to Pittsburgh 1 hop 2 hops 3 hops Path Found! Slide 20 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 Slide 21 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 Slide 22 Node Annotations Slide 23 Breadth-First Search START 1 2 3 8 0 4 7 6 5 slide 2 to left slide 1 up Compare with GOAL Slide 24 Breadth-First Search Explores Outward in All Directions Slide 25 Heuristic Search Attempts to Focus Toward The Goal Slide 26 Heuristics (That Is, Good Guesses) Make the Search Process More Efficient Because They Are Only Guesses, They Arent Guaranteed To Be Accurate Slide 27 Using Heuristic Search (A*) on the 8-Puzzle 1 2 3 8 0 4 7 6 5 The GOAL State The START State Slide 28 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 Slide 29 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 Slide 30 A* (Next) 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node Slide 31 A* (Next) 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node Slide 32 A* (Next) 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node Open Node Slide 33 A* (Next) 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node Open Node Slide 34 A* (Final) GOAL! 1 2 3 8 0 4 7 6 5 value = 6 Open Nodes Best Open Node Open Nodes Slide 35 History of A* Shakey the Robot (around 1968) Shakeys Map Slide 36 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 Slide 37 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 Slide 38 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 Slide 39 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) Slide 40 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 Slide 41 Two Technical Problems 1. The Qualification Problem 2. The Side-Effect Problem Slide 42 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 Slide 43 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 Slide 44 This Style of Planning Was First Proposed in a System Called STRIPS Used by Shakey the Robot to Make Plans (1971) Slide 45 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