CSE P573 Introduction to Artificial Intelligence Class 1 Planning & Search INTRODUCE MYSELF Relative new faculty member, but 20 years in AI research.

Slides:



Advertisements
Similar presentations
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Advertisements

State Transition Systems  linear planning  bounded model checking  conditional planning  model checking  state transition description languages: oPDDL.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Heuristic State Space Seach Henry Kautz. Assignment.
State Space Search Algorithms CSE 472 Introduction to Artificial Intelligence Autumn 2003.
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
The Theory of NP-Completeness
Lecture 3 Informed Search CSE 573 Artificial Intelligence I Henry Kautz Fall 2001.
Planning II CSE 473. © Daniel S. Weld 2 Logistics Tournament! PS3 – later today Non programming exercises Programming component: (mini project) SPAM detection.
Knowledge Representation II (Inference in Propositional Logic) CSE 473 Continued…
Logic - Part 2 CSE 573. © Daniel S. Weld 2 Reading Already assigned R&N ch 5, 7, 8, 11 thru 11.2 For next time R&N 9.1, 9.2, 11.4 [optional 11.5]
Planning II CSE 573. © Daniel S. Weld 2 Logistics Reading for Wed Ch 18 thru 18.3 Office Hours No Office Hour Today.
State-Space Searches.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
Advanced Algorithm Design and Analysis (Lecture 14) SW5 fall 2004 Simonas Šaltenis E1-215b
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3 - Search.
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
Introduction to Artificial Intelligence Class 1 Planning & Search Henry Kautz Winter 2007.
Classical Planning Chapter 10 Mausam / Andrey Kolobov (Based on slides of Dan Weld, Marie desJardins)
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
CSE 326: Data Structures Lecture #17 Heuristic Graph Search Henry Kautz Winter Quarter 2002.
Inference in Propositional Logic (and Intro to SAT)
Hard Problems Some problems are hard to solve.
Inference and search for the propositional satisfiability problem
Planning as Satisfiability
HW3: Planning.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
The Propositional Calculus
CSE 473 Artificial Intelligence Oren Etzioni
Introduction Defining the Problem as a State Space Search.
Lecture 7 Constraint Satisfaction Problems
Introduction to Software Verification
Heuristic Search Henry Kautz.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Class #17 – Thursday, October 27
Planning as Satisfiability with Blackbox
Graph-based Planning Slides based on material from: Prof. Maria Fox
Graphplan/ SATPlan Chapter
Problem Solving and Searching
Planning CSE 573 A handful of GENERAL SEARCH TECHNIQUES lie at the heart of practically all work in AI We will encounter the SAME PRINCIPLES again and.
Logic: Top-down proof procedure and Datalog
Informed search algorithms
Class #19 – Monday, November 3
Problem Solving and Searching
Problem Spaces & Search
CSE (c) S. Tanimoto, 2001 Search-Introduction
Problem Spaces & Search
Chap 4: Searching Techniques
CSE (c) S. Tanimoto, 2002 State-Space Search
Graphplan/ SATPlan Chapter
Problem Spaces & Search
State-Space Searches.
Graphplan/ SATPlan Chapter
State-Space Searches.
CS621: Artificial Intelligence
CS 416 Artificial Intelligence
CSE (c) S. Tanimoto, 2004 State-Space Search
Instructor: Aaron Roth
Graph-based Planning Slides based on material from: Prof. Maria Fox
Reading: Chapter 4.5 HW#2 out today, due Oct 5th
State-Space Searches.
GRASP-an efficient SAT solver
Presentation transcript:

CSE P573 Introduction to Artificial Intelligence Class 1 Planning & Search INTRODUCE MYSELF Relative new faculty member, but 20 years in AI research Interests: Efficient ways to represent and reason with commonsense knowledge GO OVER SYLLABUS HAND OUT SEATING CHART Henry Kautz Autumn 2004

Tonight (6:40) What is artificial intelligence? (7:00) Outline of course (7:10) Planning (7:20) State-space search (7:40) Constraint satisfaction (8:00) Exercise: creating & solving planning problems

What is Artificial Intelligence?

Outline of Course Topics Textbook Coursework Information search & planning game playing logic & knowledge representation natural language processing probabilistic reasoning robotics rule learning neural networks reinforcement learning local search & genetic algorithms Textbook Russell & Norvig, Artificial Intelligence, A Modern Approach, 2nd Ed Skim before class; re-read afterward Coursework weekly assignments (80%) take home final (20%) Information http://www.cs.washington.edu/education/courses/csep573/04au/

Planning Input Description of initial state of world Description of goal state(s) Description of available actions Optional: Cost for each action Output Sequence of actions that converts the initial state into a goal state May wish to minimize length or cost of plan

Classical Planning Atomic time Deterministic actions Complete knowledge No numeric reward (just goals) Only planner changes world

Route Planning State = intersection Operators = block between intersections Operator cost = length of block States = cities Start state = starting city Goal state test = is state the destination city? Operators = move to an adjacent city; cost = distance Output: a shortest path from start state to goal state SUPPOSE WE REVERSE START AND GOAL STATES?

Blocks World Control a robot arm that can pick up and stack blocks. Arm can hold exactly one block Blocks can either be on the table, or on top of exactly one other block State = configuration of blocks { (on-table G), (on B G), (clear B), (holding R) } Operator = pick up or put down a block (put-down R) put on table (stack R B) put on another block State = configuration of blocks: ON(A,B), ON(B, TABLE), ON(C, TABLE) Start state = starting configuration Goal state test = does state satisfy some test, e.g. “ON(A,B)”? Operators: MOVE x FROM y TO z or PICKUP(x,y) and PUTDOWN(x,y) Output: Sequence of actions that transform start state into goal. HOW HARD if don’t care about number of actions used? POLYNOMIAL HOW HARD to find smallest number of actions? NP-COMPLETE Suppose we want to search BACKWARDS from GOAL? Simple if goal COMPLETELY specified NEED to have a DIFFERENT notion of STATE if goals are PARTIALLY SPECIFIED

State Space Planning = Finding (shortest) paths in state graph put-down(R) stack(R,B) pick-up(R) pick-up(G) stack(G,R)

STRIPS Representation (define (domain prodigy-bw) (:requirements :strips) (:predicates (on ?x ?y) (on-table ?x) (clear ?x) (arm-empty) (holding ?x))

goal may be a partial description Problem Instance (define (problem bw-sussman) (:domain prodigy-bw) (:objects A B C) (:init (on-table a) (on-table b) (on c a) (clear b) (clear c) (arm-empty)) (:goal (and (on a b) (on b c)))) goal may be a partial description

delete effects – make false Operator Schemas (:action stack :parameters (?obj ?under_obj) :precondition (and (holding ?obj) (clear ?under_obj)) :effect (and (not (holding ?obj)) (not (clear ?under_obj)) (clear ?obj) (arm-empty) (on ?obj ?under_obj))) add effects – make true delete effects – make false

Blocks World Blackbox Planner Demo

Planning Algorithms Direct Space-State Search Depth-First Breadth-First Best-First A* Constraint Satisfaction Davis-Putnam Procedure

A General Search Algorithm Search( Start, Goal_test, Criteria ) Open = { Start }; Closed = { }; repeat if (empty(Open)) return fail; select Node from Open using Criteria; if (Goal_test(Node)) return Node; for each Child of node do if (Child not in Closed) Open = Open U { Child }; Closed = Closed U { Node }; Closed list optional

Criteria = shortest distance from Start Breadth-First Search Search( Start, Goal_test, Criteria ) Open = { Start }; Closed = { }; repeat if (empty(Open)) return fail; select Node from Open using Criteria; if (Goal_test(Node)) return Node; for each Child of node do if (Child not in Closed) Open = Open U { Child }; Closed = Closed U { Node }; Criteria = shortest distance from Start

Depth-First Search Search( Start, Goal_test, Criteria ) Open = { Start }; Closed = { }; repeat if (empty(Open)) return fail; select Node from Open using Criteria; if (Goal_test(Node)) return Node; for each Child of node do if (Child not in Closed) Open = Open U { Child }; Closed = Closed U { Node }; Criteria = most recently visited (implies: greatest distance from Start)

Criteria = shortest estimated (heuristic) distance to goal Best-First Search Search( Start, Goal_test, Criteria ) Open = { Start }; Closed = { }; repeat if (empty(Open)) return fail; select Node from Open using Criteria; if (Goal_test(Node)) return Node; for each Child of node do if (Child not in Closed) Open = Open U { Child }; Closed = Closed U { Node }; Criteria = shortest estimated (heuristic) distance to goal

Best-First with Manhattan Distance ( x+  y) Heuristic 53nd St 52nd St G 51st St S 50th St 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave

Non-Optimality of Best-First 53nd St 52nd St S G 51st St 50th St 10th Ave 9th Ave 8th Ave 7th Ave 6th Ave 5th Ave 4th Ave 3rd Ave 2nd Ave

Properties Depth First Simple implementation (stack) Might not terminate Might find non-optimal solution Breadth First Always terminates if solution exists Finds optimal solutions Visits many nodes Best First Always terminates if heuristic is “reasonable” Visits many fewer nodes May find non-optimal solution

A* Criteria: minimize (distance from start) + (estimated distance to goal) Implementation: priority queue f(n) = g(n) + h(n) f(n) = priority of a node g(n) = true distance from start h(n) = heuristic distance to goal

Optimality of A* Suppose the estimated distance is always less than or equal to the true distance to the goal heuristic is a lower bound heuristic is admissible Then: when the goal is removed from the priority queue, we are guaranteed to have found a shortest path!

Maze Runner Demo

Planning Heuristics General idea: solve an easier “relaxed” problem Blocks World Number of blocks out of place Ignores complication of “trapped” blocks General STRIPS Planning Number of false goal propositions (not admissible) Delete all preconditions from actions; solve easier relaxed problem; use length of solution (admissible)

Tonight (6:40) What is artificial intelligence? (7:00) Outline of course (7:10) Planning (7:20) State-space search (7:40) Constraint satisfaction (8:00) Exercise: creating & solving planning problems

Constraint Propagation Problems (CSP)

Constraint Satisfaction Find assignment(s) to a set of variables that satisfies (makes true) a set of constraints on those variables Example: variables = real numbers constraints = linear equations x + 2y + z = 3 x – y + z = 0 -x - y – 2z = 7 Satisfied by x=10, y=1, z=-9

Constraint Satisfaction Find assignment(s) to a set of variables that satisfies (makes true) a set of constraints on those variables Example: variable = true/false (Boolean) constraints = propositional logic formulas (x  y) (x  z) (y  z) Satisfied by {x=False, y=True, z=True} {x=True, y=False, z=True} {x=True, y=True, z=True}

Constraint Satisfaction Find assignment(s) to a set of variables that satisfies (makes true) a set of constraints on those variables Example: variable = true/false (Boolean) constraints = propositional logic formulas (x  y) (x  z) (y  z) Satisfied by {x=0, y=1, z=1} {x=1, y=0, z=1} {x=1, y=1, z=1}

Special Syntactic Forms General propositional logic ((q r)  s))   (s  t) Conjunction Normal Form (CNF) ( q  r  s )  ( s   t) Binary clauses: 2 literals per clause ( q  r) ( s   t) Unit clauses: 1 literal per clause ( q) (s) Before going into some specific proof systems, let us define some important special syntactic forms of sentences in propositional logic.

Planning as a Logical CSP Choose a maximum time step K Variables for each ground fact for each time step: (on R B 1) (on R B 2) (on R B 3) Variables for each ground action for each time step: (pick-up R 1) (pick-up R 2) (pick-up R 3)

Initial & Goal State Formulas Assert initial state hold at time 1 Variables for each ground fact for each time step: (on R B 1)  (on B G 1)  (on-table G 1)  (hand-empty)  (clear R 1) Assert goals hold at time K (e.g. 5) (on R G 5)

Action Formulas For each time step: If an action occurs, its preconditions hold (pickup R 3)  (on-table R 3) (pickup R 3)  (hand-empty 3) For each time step after the first: If a fact holds, it was either just added by an action or maintained from the previous state (on R G 3)  [ (stack R G 2)  (maintain (on R G) 2) ] The precondition of maintain is that fact: (maintain (on R G) 3)  (on R G 2) (maintain (on-table R) 3)  (on-table R 2)

Mutual Exclusion Formulas Actions and maintains whose preconditions or effects conflict cannot happen at the same time (pickup R 3)  (pickup G 3) (pickup R 3)  (pickup B 3) (pickup R 3)  (maintain (hand-empty) 3) (pickup R 3)  (maintain (on-table R) 3) That’s it! The TRUE action variables in a satisfying solution are a plan! SATPLAN – Winner of 2004 AI Planning System Competition

Solving SAT: Davis-Putnam DPLL( wff ): for each unit clause (P) [resp. ( P)] set P to true [resp. to false] simplify other clauses if empty clause then return false if no clause left then return solution choose a unassigned variable Q if DPLL( wff U {(Q)} ) return solution else return DPLL( wff U {( Q)} ) Backtrack search over partial variable assignments Worst case O(2n)

In-Class Exercise Form groups of 3 Open a browser on http://www.cs.washington.edu/education/courses/csep573 Follow: Lectures & Assignments, Shakey Domain Launch x-windows and ssh Login to attu Launch: xterm& xterm& In one xterm: cd /cse/courses/csep573/04au/planning/blocks blackbox -o domain.pddl –f bw-sussman.pddl (8:30) SHARE representation (8:50) SHARE solutions