Classical Planning Problems: Representation Languages

Similar documents
The STRIPS Subset of PDDL for the Learning Track of IPC-08

Hierarchical Task Networks

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Planungsbasierte Kommunikationsmodelle

Principles of AI Planning. Principles of AI Planning. 7.1 How to obtain a heuristic. 7.2 Relaxed planning tasks. 7.1 How to obtain a heuristic

Acknowledgements. Outline

Domain-Configurable Planning: Hierarchical Task Networks

Planning. CPS 570 Ron Parr. Some Actual Planning Applications. Used to fulfill mission objectives in Nasa s Deep Space One (Remote Agent)

Shared Variables and Interference

Shared Variables and Interference

Artificial Intelligence

Chapter 3 Complexity of Classical Planning

C++ Data Types. 1 Simple C++ Data Types 2. 3 Numeric Types Integers (whole numbers) Decimal Numbers... 5

Chapter 1 Introduc0on

Dipartimento di Elettronica Informazione e Bioingegneria. Cognitive Robotics. SATplan. Act1. Pre1. Fact. G. Gini Act2

Heuristic Search for Planning

15-819M: Data, Code, Decisions

Hierarchical Task Networks. Planning to perform tasks rather than to achieve goals

Automated Planning. Plan-Space Planning / Partial Order Causal Link Planning

CS103 Spring 2018 Mathematical Vocabulary

Lecture Overview. CSE3309 Artificial Intelligence. The lottery paradox. The Bayesian claim. The lottery paradox. A Bayesian model of rationality

MIDTERM EXAM (Solutions)

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

Lee Pike. June 3, 2005

HOL DEFINING HIGHER ORDER LOGIC LAST TIME ON HOL CONTENT. Slide 3. Slide 1. Slide 4. Slide 2 WHAT IS HIGHER ORDER LOGIC? 2 LAST TIME ON HOL 1

Set 9: Planning Classical Planning Systems. ICS 271 Fall 2013

Introduction to Linear-Time Temporal Logic. CSE 814 Introduction to LTL

Goals: Define the syntax of a simple imperative language Define a semantics using natural deduction 1

The Satisfiability Problem [HMU06,Chp.10b] Satisfiability (SAT) Problem Cook s Theorem: An NP-Complete Problem Restricted SAT: CSAT, k-sat, 3SAT

Intelligent Agents. State-Space Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 14.

Induction and Semantics in Dafny

KI-Programmierung. Planning

Recursively Enumerable Languages, Turing Machines, and Decidability

AXIOMS OF AN IMPERATIVE LANGUAGE PARTIAL CORRECTNESS WEAK AND STRONG CONDITIONS. THE AXIOM FOR nop

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

NDL A Modeling Language for Planning

Introduction to dependent types in Coq

GPS: The general problem solver. developed in 1957 by Alan Newel and Herbert Simon. (H. Simon, 1957)

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

A deterministic action is a partial function from states to states. It is partial because not every action can be carried out in every state

Propositional Logic. Part I

Lecture 1: Conjunctive Queries

Now that we have keys defined for the maps, we can start talking about maps. The first of these are Total Maps. Total Maps are defined as follows:

6. Hoare Logic and Weakest Preconditions

Complete Instantiation of Quantified Formulas in Satisfiability Modulo Theories. ACSys Seminar

Propositional Calculus. Math Foundations of Computer Science

Z Notation. June 21, 2018

In Our Last Exciting Episode

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré

So many Logics, so little time

The DPL (Decisive Plausible Logic) Tool

Final Solution. CS510, Fall 2012, Drexel University Ariel Stolerman

4.1 Review - the DPLL procedure

Hardware versus software

COMP 410 Lecture 1. Kyle Dewey

Artificial Intelligence 2005/06

Planning. Introduction

Resolution (14A) Young W. Lim 6/14/14

Lecture Notes on Ints

CS 2750 Foundations of AI Lecture 17. Planning. Planning

A Solidify Understanding Task

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

6.001 Notes: Section 8.1

Validating Plans with Durative Actions via Integrating Boolean and Numerical Constraints

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Program Verification & Testing; Review of Propositional Logic

Efficient Planning with State Trajectory Constraints

Recursive Definitions

Context-free Grammars

Set 9: Planning Classical Planning Systems. ICS 271 Fall 2014

Logic and Computation

INF Kunstig intelligens. Agents That Plan. Roar Fjellheim. INF5390-AI-06 Agents That Plan 1

Foundations of Artificial Intelligence

System Correctness. EEC 421/521: Software Engineering. System Correctness. The Problem at Hand. A system is correct when it meets its requirements

PROPOSITIONAL LOGIC (2)

CS558 Programming Languages

Introduction to Planning COURSE: CS40002

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Testing, Debugging, and Verification

Cognitive Robotics. Planning: Plan Domain Description Language. Matteo Matteucci

PIC 10A Flow control. Ernest Ryu UCLA Mathematics

Higher-Order Logic. Specification and Verification with Higher-Order Logic

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

An Evolution of Mathematical Tools

Functional Programming. Pure Functional Programming

Lecture 5: Formation Tree and Parsing Algorithm

Integrity Constraints (Chapter 7.3) Overview. Bottom-Up. Top-Down. Integrity Constraint. Disjunctive & Negative Knowledge. Proof by Refutation

Civil Engineering Computation

Current Versions of the TLA + Tools

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

Quiz 1: Functions and Procedures

Foundations of Artificial Intelligence

Modal Logic: Implications for Design of a Language for Distributed Computation p.1/53

Planning: Wrap up CSP Planning Logic: Intro

SOFTWARE ENGINEERING DESIGN I

From the λ-calculus to Functional Programming Drew McDermott Posted

Introduction to Logic Programming

Implementation of Lexical Analysis. Lecture 4

3.7 Denotational Semantics

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman.

Transcription:

jonas.kvarnstrom@liu.se 2017 Classical Planning Problems: Representation Languages

History: 1959 3 The language of Artificial Intelligence was/is logic First-order, second-order, modal, 1959: General Problem Solver (Newell, Shaw, Simon)

History: 1969 4 1969: Planner explicitly built on Theorem Proving (Green)

Basis in Logic 5 Full theorem proving generally proved impractical for planning Different techniques were found Foundations in logical languages remained! Languages use predicates, atoms, literals, formulas We define states, actions, relative to these Allows us to specify an STS at a higher level! Formal representation using a first-order language: "Classical Representation" (from the book) "The simplest representation that is (more or less) reasonable to use for modeling"

Running Example 6 Running example (from the book): Dock Worker Robots Containers shipped in and out of a harbor Cranes move containers between piles and robotic trucks

Objects 1: Intro 8 We are interested in objects in the world Buildings, cards, aircraft, people, trucks, pieces of sheet metal, Must be a finite set! Modeling: Which objects exist and are relevant for the problem?

Objects 2: Dock Worker Robots 9 Dock Worker Robots A crane moves containers between piles and robots A container can be stacked, picked up, loaded onto robots c3 c1 p1 loc1 c2 p2 r1 A robot is an automated truck moving containers between locations loc2 A pile is a stack of containers at the bottom, there is a pallet A location is an area that can be reached by a single crane Can contain several piles, at most one robot. We can skip: Hooks Wheels Rotation angles Drivers not relevant for this problem!

Objects 3: Classical Representation 10 Classical representation: We are constructing a first-order language L Every object is modeled as a constant Add a constant symbol ("object name") for each object: L contains c3 c1 p1 loc1 c2 p2 r1 loc2

Objects 4: For all non-boolean values 11 All non-boolean constant values are modeled in the same way! Colors: red, green, blue

Internal Structure? 13 An STS only assumes there are states What is a state? The STS doesn t care! Its definitions don t depend on what s represents or means Can execute a in s if γ s, a = s We (and planners) need more structure! "state s 23862497124985 " " "

Predicates 14 First-order language: Start with a set of predicates Properties of the world Properties of single objects Relations between objects Relations between >2 objects Non-boolean properties are "relations between constants" Essential: Determine what is relevant for the problem and objective!

Predicates for DWR 15 All predicates for DWR, and their intended meaning: "Fixed/Rigid" (can't change) "Dynamic" (modified by actions)

Predicates, Terms, Atoms, Ground Atoms 16 Terminology: Term: Constant symbol or variable Atom: Predicate symbol applied to the intended number of terms Ground atom: Atom without variables (only constants) Plain first-order logic has no object types! Allows strange atoms:

States 1: Factored, Internally Structured 17 A state defines which ground atoms are true/false in the world We can compute differences between states Structure is essential! We will see later how planners make use of structured states

States 2: First-order Representation 18 Efficient specification / storage of a single state: Specify which facts are true All other facts have to be false what else would they be? A classical state is a set of all ground atoms that are true 2 1 3 Why not store all ground atoms that are false instead?

States 3: State Set 19 "A state is a set of all ground atoms that are true" Set of states in the STS: S = 2 ground atoms (powerset: all sets of ground atoms) Number of states: S = 2 ground atoms =

States 4: Initial State 20 The STS assumes a single initial state s 0 Complete information about the current state of the world Complete relative to the model: We must know everything about those predicates and objects we have specified... State = set of true facts s 0 = attached p1,loc1, in c1,p1, on c1,pallet, on c3,c1, c3 c1 p1 loc1 c2 p2 r1 loc2

States 5: Goal States, Positive Goals 21 One way of efficiently defining a set of goal states: A goal g is a set of ground atoms Example: g In the final state, containers 1 and 3 should be in pile 2, and we don't care about any other facts Then S g = s S g s S g c3 c1 p1 loc1 c2 p2 r1 loc2

States 6: Goal States, Literal Goals 22 To increase expressivity: A goal g is a set of ground literals A literal is an atom or a negated atom: Container 1 should be in pile 2 Container 2 should not be in pile 3 Then S g = s S s satisfies g Positive atoms in g are also in s Negated atoms in g are not in s More expressive than positive goals Still not as expressive as the STS: arbitrary set of states Many classical planners use one of these two alternatives (atoms/lits); some are more expressive c3 c1 p1 loc1 c2 p2 r1 loc2

Abstraction 23 We have abstracted the real world! Motion is really continuous in 3D space Uncountably infinite number of positions for a crane But for the purpose of planning: We model a finite number of interesting positions On a specific robot In a specific pile Held by a specific crane Real World Abstraction Approximation Simplification Formal Model Gives sufficient information for us to solve interesting problems

Actions with Structure 25 If states have internal structure: Makes sense for actions to have internal structure γ s 291823, a 120938 = action move(diska, peg1, peg3) requires a state where on(diska,peg1) γ s 975712397, a 120938 = s 12578942 action move(diska, peg1, peg3) makes on(diska,peg3) true, and

Operators 26 In the classical representation: Don't define actions directly Define a set O of operators Each operator is parameterized, defines many actions Has a precondition precond(o): set of literals that must hold before execution precond(take) = Has effects effects(o): set of literals that will be made to hold after execution effects(take) = c3 c1 p1 loc1 c2 p2 r1 loc2

Actions 27 In the classical representation: Every ground instantiation of an operator is an action a 1 Also has (instantiated) precondition, effects precond(a 1 ) = effects(a 1 ) = A = a a is an instantiation of an operator in O using constants in L c3 c1 p1 loc1 c2 p2 r1 loc2

Untyped Actions and Applicability 28 If every ground instantiation of an operator is an action then so is this: But when will this action be applicable? For these preconditions to be true, something must already have gone wrong!

Untyped Actions and Applicability (2) 29 Standard solution: Separate type predicates Ordinary predicates that happen to represent types: Used as part of preconditions: DWR example was "optimized" somewhat belong(k,l) is only true for crane+location, replaces two type predicates So: is an action Its preconditions can never be satisfied in reachable states! Type predicates are fixed, rigid, never modified such actions can be filtered out before planning even starts

Useful Properties 30 Some useful properties: If a is an operator or action = { atoms that appear positively in a s preconditions } = { atoms that appear negated in a s preconditions } = { atoms that appear positively in a s effects } = { atoms that appear negated in a s effects } Example: Negation disappears!

Applicable (Executable) Actions An action a is applicable in a state s if precond+(a) s and precond (a) s = Example: Action ground preconds are ground atoms 31 Simple representation (sets) simple definitions! c3 c1 p1 loc1 c2 p2 r1 loc2

Result of Performing an Action 32 Applying will add positive effects, delete negative effects If is applicable in, then the new state is c3 c1 p1 loc1 c2 p2 r1 loc2 c3 c1 p1 loc1 c2 p2 r1 loc2

Defining γ 33 From actions to γ: γ s, a = s effects a effects + (a) Positive preconditions missing from state if precond + a s or precond a s otherwise Negated preconditions present in state From the classical representation language, we know how to define Σ = (S, A, γ) and a problem (Σ, s 0, S g )

Modeling: What Is a Precondition? 34 Usual assumption in domain-independent planning: Preconditions should have to do with executability, not suitability Weakest constraints under which the action can be executed These are physical requirements for taking a container! The planner chooses which actions are suitable, using heuristics (etc.) Add explicit suitability preconditions domain-configurable planning Only pick up a container if there is a truck on which the crane can put it Only pick up a container if it needs to be moved according to the goal

Domain-Independent Planning 36 High Level Problem Descr. Objects, Predicates Operators Initial state, Goal Domain-independent Classical Planner Written for generic planning problems Difficult to create (but done once) Improvements all domains benefit Solution (Plan)

Domain vs Instance 37 Makes sense to split the information Domain Description: The world in general Instance Description: Our current problem Predicates Operators Objects Initial state Goal Domain-independent Planner

Domain-Independent Planning 38 To solve problems in other domains: Keep the planning algorithm Write a new high-level description of the problem domain Mars Rover problem instance Satellite problem instance Mars Rover Domain Domainindep. Planner Plan Satellite Domain Domainindep. Planner Plan

Covered in the book Now: Extensible representation language Classical Representation is simple, but not easily extended with complex preconditions, effects, timing, action costs, concurrency, Misc. Separation: Domain / instance Misc. PDDL object types Preconditions Formulas: Disjunctions, Effects Conditional effects, Extensions Timing, action costs, Formal representation language Closer to how we think Provides more structural information, very useful for planning algorithms Objects Fact atoms State Operators Preconditions Effects Set of true atoms This indirectly defines Underlying formal model Concepts as simple as possible: States, actions, transition function Good for analysis, correctness proofs, understanding what planning is States Actions Transition function Goals no structure! defining the result of an action, set of end states

PDDL 41 PDDL: Planning Domain Definition Language Origins: First International Planning Competition, 1998 Most used language today General; many expressivity levels Lowest level of expressivity: Called STRIPS After the planner used by Shakey, STRIPS: Stanford Research Institute Problem Solver One specific predicate-based ("logic-based") syntax/semantics for classical planning domains/instances

PDDL: Domain and Problem Definition PDDL separates domains and problem instances 42 Domain file Named Problem instance file Named Associated with a domain Colon before many keywords, to avoid collisions when new keywords are added

PDDL: Domain and Problem Definition Domains declare their expressivity requirements 43 We will see some other levels as well Warning: Many planners parsers ignore expressivity specifications

PDDL Objects 1: Types 45 In PDDL and most planners: Constants have types, defined in the domain Tell the planner which features you need c3 c1 p1 loc1 c2 p2 r1 loc2

PDDL Objects 2: Type Hierarchies 46 Many planners support type hierarchies Convenient, but often not used in domain examples Predefined topmost supertype : c3 c1 p1 loc1 c2 p2 r1 loc2

PDDL Objects 3: Object Definitions 47 Instance-specific constants are called objects c3 c1 p1 loc1 c2 p2 r1 loc2

PDDL Objects 4: PDDL Constants 48 Some constants should exist in all instances Define once use in all problem instances Can use in the domain definition as well!

Predicates in PDDL 50 In PDDL: Lisp-like syntax for predicates, atoms, Variables are prefixed with?

Modeling: Different predicates per type? 51 Modeling Issues: Single or multiple predicates? 3 predicates with similar meaning Could use type hierarchies instead in most planners

Modeling: Duplicate information 52 Models often provide duplicate information A location is occupied there is some robot at the location Strictly speaking, is redundant Still necessary in many planners No support for quantification: (exists?r (at?r?l)) Have to write (occupied?l) instead Have to provide this information + update it in actions!

States 1: Initial State in PDDL 54 Initial states in PDDL: Set (list) of true atoms Lisp-like notation again:, not c3 c1 p1 loc1 c2 p2 r1 loc2

States 2: Goal States 55 The :strips level supports positive conjunctive goals Example: Containers 1 and 3 should be in pile 2 We don't care about their order, or any other fact Write as a formula (and ), not a set: Other levels support "or", "forall", "exists", c3 c1 p1 loc1 c2 p2 r1 loc2

States 3: Goal States 56 Some planners: Conjunctions of positive / negative literals Example: Containers 1 and 3 should be in pile 2 Container 2 should not be in pile 4 Buggy support in some planners Can be worked around Define outside predicate = inverse of in Make sure actions update this c3 c1 p1 loc1 c2 p2 r1 loc2

Operators in PDDL 58 PDDL: Operators are called actions, for some reason Typed params can only instantiate with the intended objects Again, written as logical conjunctions, instead of sets!

Transformation: PDDL/strips STS 59 Input : Planning domain Object Types: There are UAVs, boxes Defines the set of states in the formal model (STS) Predicates: Every UAV has a, Operators: Definition of,, Input : Problem instance Objects: Current UAVs are { } Initial State: Box locations, Goal: Box at location, Defines transitions between states in the formal model (STS) Defines initial and goal states

Properties of Objects 61 Let's model a "drive" operator for a truck Natural parameters: The truck and the destination Natural precondition: There must exist a path between the current location and the destination Should use the predicate How? In a first-order predicate representation, we can only test whether a truck is at some specific location:

Alternative Representations 62 Three wide classes of logic-based representations (general classes, containing many languages!) Propositional (boolean propositions) athome, atwork PDDL :strips (if you avoid objects) First-order (boolean predicates) at(truck, location) PDDL :strips, State-variable-based (non-boolean functions) loc(truck) = location Read chapter 2 of the book for another perspective on representations

Classical and State-Var Representation 63 Classical planning with classical representation A state defines the values of logical atoms (boolean) May be wasteful: Can represent a container being on many robots, which never happens Can be convenient, space-efficient often used internally! c3 c1 p1 loc1 Alternative: Classical with state-variable representation c2 p2 r1 loc2 A state defines the values of arbitrary state variables Seems more powerful, but is equivalent!

Property Values 1 64 Back to the "drive" operator Natural parameters: The truck and the destination Natural precondition: There must exist a path between the current location and the destination Should use the predicate State variable representation can express the location of the truck: No STS extensions are required!

Property Values 2 65 If the planner only supports boolean predicates: Add a parameter to the operator Constrain that variable in the precondition Can only apply those instances of the operator where is the current location of the truck

Property Values 3 66 Example: Initially: Action: These parameters are "extraneous" in the sense that they do not add choice: We can choose truck and dest (given some constraints); from is uniquely determined by state + other params! Which actions are executable? no, precond false: not (at truck5 work) no, precond false no, precond false precond true, can be applied! With quantification, we could have changed the precondition: No need for a new parameter in this case

Property Values 4 67 What about effects? Same natural parameters: The truck and the destination Natural effects: The truck ends up at the destination: The truck is no longer where it started: How do you find out where the truck was before the action? Using an additional parameter still works: The value of?from is constrained in the precondition before The value is used in the effect state