Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "CSE P573 Introduction to Artificial Intelligence Class 1 Planning & Search INTRODUCE MYSELF Relative new faculty member, but 20 years in AI research."— Presentation transcript:

1 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

2 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

3 What is Artificial Intelligence?

4 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

5 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

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

7 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?

8 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

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

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

11 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

12 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

13 Blocks World Blackbox Planner Demo

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

15 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

16 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

17 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)

18 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

19 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

20 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

21 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

22 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

23 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!

24 Maze Runner Demo

25 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)

26 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

27 Constraint Propagation Problems (CSP)

28 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

29 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}

30 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}

31 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.

32 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)

33 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)

34 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)

35 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

36 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)

37 In-Class Exercise Form groups of 3 Open a browser on
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


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

Similar presentations


Ads by Google