AI – Week 3 An Introduction to AI Planning Lee McCluskey, room 3/10

Slides:



Advertisements
Similar presentations
Uninformed Search in Prolog
Advertisements

Language for planning problems
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
CLASSICAL PLANNING What is planning ?  Planning is an AI approach to control  It is deliberation about actions  Key ideas  We have a model of the.
PROBLEM SOLVING AND SEARCH
PLANNING Ivan Bratko Acknowledgement: Some of these slides were adapted from D. Nau’s course on planning.
October 1, 2012Introduction to Artificial Intelligence Lecture 8: Search in State Spaces II 1 A General Backtracking Algorithm Let us say that we can formulate.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
AI – Week 5 Implementing your own AI Planner in Prolog – part II : HEURISTICS Lee McCluskey, room 2/09
AI – Week 11 AI and Games (3) Lee McCluskey, room 2/09
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
AI – Week AI Planning – Plan Generation Algorithms: GraphPlan Lee McCluskey, room 2/09
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
Using Search in Problem Solving
Artificial Intelligence Chapter 11: Planning
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
The Semantic Web Week 18: Web Agents that can reason … Module Website: Practical this week:
Knowledge and Systems Research Group, University of Huddersfield B vs OCL: Comparing Specification Languages for Planning Domains Diane Kitchin, Lee McCluskey,
Introduction to Artificial Intelligence Blind Search Ruth Bergman Fall 2004.
Constraint Satisfaction Problems
AI – Week 5 An Introduction to AI Planning Lee McCluskey, room 2/07
Week 4: Introduction to AI Planning Lee McCluskey, room 2/07
AI – Week 8 AI + 2 Player Games Lee McCluskey, room 3/10
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Using Search in Problem Solving
Automated Planning and HTNs Planning – A brief intro Planning – A brief intro Classical Planning – The STRIPS Language Classical Planning – The STRIPS.
Solving problems by searching
AI – Week 10 AI and Games (2) Lee McCluskey, room 3/10
CSE (c) S. Tanimoto, 2007 Search 1: State Spaces 1 State-Space Search Outline: Demonstration with T* State spaces, operators, moves A Puzzle: The.
Problem-solving agents
Classical Planning Chapter 10.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Busby, Dodge, Fleming, and Negrusa. Backtracking Algorithm Is used to solve problems for which a sequence of objects is to be selected from a set such.
Week 6: PDDL, itSIMPLE and running “state of the art” planners Lee McCluskey, room 3/10
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
CHA2555 Week2: Knowledge Representation, Logic and Planning Lee McCluskey First term:
Planning (Chapter 10)
Introduction To PROLOG World view of imperative languages. World view of relational languages. A PROLOG program. Running a PROLOG program. A PROLOG.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
1 Solving problems by searching 171, Class 2 Chapter 3.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
CSCI 4310 Lecture 2: Search. Search Techniques Search is Fundamental to Many AI Techniques.
AI – Week 5 More on HEURISTICS and domain modelling Lee McCluskey, room 2/09
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
George F Luger ARTIFICIAL INTELLIGENCE 5th edition Structures and Strategies for Complex Problem Solving Structures and Strategies For Space State Search.
Search in State Spaces Problem solving as search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way.
Planning I: Total Order Planners Sections
Natural Language Processing AI Revision Lee McCluskey, room 2/07
Solving problems by searching A I C h a p t e r 3.
February 11, 2016Introduction to Artificial Intelligence Lecture 6: Search in State Spaces II 1 State-Space Graphs There are various methods for searching.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
Artificial Intelligence Solving problems by searching.
Lecture 3: Uninformed Search
Artificial Intelligence Problem solving by searching CSC 361
Class #17 – Thursday, October 27
Chapter 10: Algorithm Design Techniques
Graphplan/ SATPlan Chapter
Class #19 – Monday, November 3
Depth-First Searches Introduction to AI.
CSE (c) S. Tanimoto, 2001 Search-Introduction
Haskell Tips You can turn any function that takes two inputs into an infix operator: mod 7 3 is the same as 7 `mod` 3 takeWhile returns all initial.
CSE (c) S. Tanimoto, 2002 State-Space Search
Graphplan/ SATPlan Chapter
Graphplan/ SATPlan Chapter
CSE (c) S. Tanimoto, 2004 State-Space Search
[* based in part on slides by Jim Blythe and Dan Weld]
Presentation transcript:

AI – Week 3 An Introduction to AI Planning Lee McCluskey, room 3/10

Artform Research Group Overview How do we make automated planning programs? - we will consider several planning algorithms How do we model planning application knowledge? - we will study several ways of encoding planning domains

Artform Research Group PLANS Are what planners generate. They are orders of instantiated operator schemas. They should be: CORRECT - preconditions are satisfied COMPLETE - achieve the final goal OPTIMAL - n shorter plan exists

Artform Research Group Simple Planning Worlds A simple planning problem can be formulated by: - An INITIAL STATE - A GOAL - A set of OPERATOR schema Later we will see other formulations.,.

Artform Research Group Languages for writing Domain Models… Literal Based: The “Planner Domain Definition Language” (PDDL) is the most commonly used language to communicate Planning Domain Models and associated Tash Descriptions Object-Centred: At Huddersfield we have pioneered the use of “object based” languages – the simple rocket world domain model is object centred.

Artform Research Group The Modelling of States A STATE represents a situation or snapshot of an application. This is sometimes called a WORLD STATE STATES of a planning world are most simply defined (as in PDDL) as conjunctions of ground literals (like a relational database for each state) An alternative way of encoding states is using an “ object centred representation”, where dynamic OBJECTS have their own state also (sometimes called ‘sub-state’). A world state therefore consists of a conjunction of the states of each object.

Artform Research Group The Modelling of Actions This is CENTRAL to planning. In a literal based domain model, actions are modelled as PRE and POST conditions in the form of PRECONDITION SET ADD SET DELETE SET In an object-centred domain model, we use a more structured form: PREVAIL CONDITION NECESSARY OBJECT TRANSITIONS CONDITIONAL OBJECT TRANSITIONS

Artform Research Group The Relationship: from O-C to Literal-based (assume no conditional transitions) PRECONDITION SET = PREVAIL + LHS of NECESSARY OBJECT TRANSITIONS ADD SET = RHS of NECESSARY OBJECT TRANSITIONS DELETE SET = LHS of NECESSARY OBJECT TRANSITIONS So can define things in terms of a literal-based representation, and they will also apply to an OC one.

Artform Research Group Operator Schema – rocket world op(move(R,A,B), % prevail [condition(A,[can_fly(A,B)])], % necessary [ trans(R,[position(R,A), fuel_full(R)], [position(R,B), fuel_empty(R)] ) ], % conditional [ ]).

Artform Research Group Operators - An Operator Schema O has Precons(O), Deletes(O) and Adds(O) - An instance/instantiation of an Operator Schema (aka a ground operator) is one which has all its parameters replaced by constants. A ground operator O can be applied to a state S IF Precons(O) are satisfied in S If operator O is applied/executed to state S then new state O(S) = S minus Deletes(O) plus Adds(O)

Artform Research Group Automated Planning How can algorithms solve planning problems? - Easiest answer: 1. Apply ‘applicable’ OPERATORS to INITIAL STATE to create new states, then repeat this process from new states (use breadth, depth or heuristic search). 2. Stop when a state S is reached in which S satisfies the GOAL condition BUT this leads to an exponential explosion of states!

Artform Research Group Solution to Plan Generation Problems A “goal achievement” plan generation problem is given by an Initial state, a Goal and a set of Operator Schema. A linear SOLUTION to a plan generation problem is a sequence of ground operators that are COMPLETE and CORRECT: Complete: The preconditions of the first operator are satisfied by the Initial state, and the preconditions of each subsequent operator in the sequence are satisfied by the corresponding intermediate states Correct: The Goal is satisfied in the final state

Artform Research Group FORWARD, STATE SPACE SEARCH INITIAL STATE Main source of inefficiency in search algorithms is the branching factor EXHAUSTIVE SEARCH IS VERY INEFFICIENT!!!

Artform Research Group Planning Algorithm: breadth-first forward search through state-space 1. Store the first node (initial state + empty solution) Repeat 2. pick and “retract” a node(State, PartialSoln, heuristic value) 3. pick an operator and parameter instantiation - 'O' - that can be applied to State 4. apply O to State to get State' 5. assert(node(State', Add(O, PartialSoln), heuristic value) 6. if possible, backtrack to 3. and make a different choice. until a node has been asserted that contains a solution

Artform Research Group Building your own forward searching planner INITIAL NODE Each node contains several pieces of information: - a state - sequence of operators that lead to the state - heuristic value

Artform Research Group Initialisation – assert the first node % asserts the root node in the search.. start(Goal, Initial_State) :- % this records the run-time clock statistics(runtime,[_,Time]), % initialise node count to 0 retractall(count(_)), assert(count(0)), assert_and_record_node( node(Initial_State,[ ])), plan(Goal).

Artform Research Group Pick a node to EXPAND % Retracts the first node in the prolog program and expands it.. % a node is of the form node(Advanced_state, Op_sequence) plan(Goal) :- retract(node(Advanced_state, Op_sequence)), length(Op_sequence,Len), tell(user),write(Len), process_node(Goal, Advanced_state, Op_sequence), % then keep searching.. plan(Goal). % SEARCH FINISHES: if no nodes left - end - close trace file plan(_) :- tell(trace), told.

Artform Research Group But wait.. have we found a complete plan? process_node(Goal, Advanced_state, Op_sequence):- achieved(Goal, Advanced_state), ETC.. Collect stats and tidy up retractall(node(_,_)),!. % if no success, generate more nodes process_node(Goal, Advanced_state, Op_sequence):- generate_new_nodes(Advanced_state, Op_sequence),!.

Artform Research Group Heart of the Algorithm – generate new nodes generate_new_nodes(Advanced_state, Op_sequence) :- op(Op_name, Prev, Nec, Cond), achieved(Prev,Advanced_state), lhs_achieved(Nec,Advanced_state), % apply(Op_name, Advanced_state, New_Advanced_state), append(Op_sequence, [Op_name], New_Op_sequence), assert_and_record_node(node(New_Advanced_state, New_Op_sequence)), fail. % after all operators are tried, this procedure should succeed - generate_new_nodes(_,_).

Artform Research Group Are object states achieved in a state? NB no cuts to allow for backtracking lhs_achieved([],_). lhs_achieved([trans(O,E,_)|Tail],State) :- member(state(O,S),State), is_a_subset(E,S), lhs_achieved(Tail,State). achieved([],_). achieved([condition(O,E)|Tail], State) :- member(state(O,S),State), is_a_subset(E,S), achieved(Tail,State).

Artform Research Group Summary Creating forward search AI Planners in Prolog is fairly easy The main part is the generation of ALL new nodes possible from an existing node The sample AI Planners can be augmented with heuristics (next week)