Compiling and Executing PDDL in Picat

Similar documents
Heuristics for Cost-Optimal Classical Planning Based on Linear Programming

AUTOMATED REASONING. Agostino Dovier. Udine, October 2, Università di Udine CLPLAB

Fast Planning by Search in Domain Transition Graph

Heuristics for Planning with SAT and Expressive Action Definitions

CPP: A Constraint Logic Programming Based Planner with Preferences

Chapter 3 Deterministic planning

Chapter 6 Constraint Satisfaction Problems

The 4th (Open) Answer Set Programming Competition

Post s Theorem and Blockchain Languages

Probabilistic Planning. George Konidaris

A Heuristic Search Approach to Planning with Temporally Extended Preferences

Fact-Alternating Mutex Groups for Classical Planning (Extended Abstract)

Chapter 7 Propositional Satisfiability Techniques

Chapter 7 Propositional Satisfiability Techniques

Application: Planning as Satisfiability (SATPlan) (Pre Lecture)

Planning with PDDL3.0 Preferences by Compilation into STRIPS with Action Costs

Grundlagen der Künstlichen Intelligenz

CS360 Homework 12 Solution

CMSC 330: Organization of Programming Languages. Pushdown Automata Parsing

A Novel Transition Based Encoding Scheme for Planning as Satisfiability

Static Program Analysis

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

1 Introduction. 1.1 The Problem Domain. Self-Stablization UC Davis Earl Barr. Lecture 1 Introduction Winter 2007

The State Explosion Problem

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements

Optimal Metric Planning with State Sets in Automata Representation

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Searching in non-deterministic, partially observable and unknown environments

Speculative Parallelism in Cilk++

Try to find a good excuse!

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Compilers. Lexical analysis. Yannis Smaragdakis, U. Athens (original slides by Sam

KLMLean 2.0: a Theorem Prover for KLM Logics of Nonmonotonic Reasoning

Parsing with Context-Free Grammars

EDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach

From Abstract Models to Executable Models for Multi-Agent Path Finding on Real Robots

The PITA System for Logical-Probabilistic Inference

Sanjit A. Seshia EECS, UC Berkeley

Limits of Computation

Probabilistic Model Checking and Strategy Synthesis for Robot Navigation

From Causal Theories to Successor State Axioms and STRIPS-Like Systems

Planning as Satisfiability

Advanced Topics in LP and FP

Fast Strong Planning for FOND Problems with Multi-Root Directed Acyclic Graphs

Activity Planning II: Plan Extraction and Analysis. Assignments

Space-aware data flow analysis

arxiv: v1 [cs.lo] 29 May 2014

ARTIFICIAL NEURAL NETWORK PART I HANIEH BORHANAZAD

AI Planning. goal states B Definition Example Matrices Reachability Algorithm. Transition systems. Succinct TS. initial state

Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies

Binary Decision Diagrams and Symbolic Model Checking

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Strong AI vs. Weak AI Automated Reasoning

Algorithms and Complexity theory

Inference in first-order logic. Production systems.

Watershed Modeling With DEMs

A heuristic algorithm for the Aircraft Landing Problem

Sapienza universita di Roma Dipartimento di Informatica e Sistemistica. User guide WSCE-Lite Web Service Composition Engine v 0.1.

REPRESENTATION AND ANALYSIS OF ELECTRICAL CIRCUITS IN A DEDUCTIVE SYSTEM

Artificial Intelligence Chapter 7: Logical Agents

Parallel PIPS-SBB Multi-level parallelism for 2-stage SMIPS. Lluís-Miquel Munguia, Geoffrey M. Oxberry, Deepak Rajan, Yuji Shinano

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS 662 Sample Midterm

Scalable and Accurate Verification of Data Flow Systems. Cesare Tinelli The University of Iowa

Contingent Planning with Goal Preferences

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

Compiler Design. Spring Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Abstract parsing: static analysis of dynamically generated string output using LR-parsing technology

Automatic Verification of Parameterized Data Structures

Example: Robot Tasks. What is planning? Background: Situation Calculus. Issues in Planning I

Classical Planning Chapter 10. Mausam (Based on slides of Dan Weld, Marie desjardins)

Proceedings of the 18th Czech-Japan Seminar on Data Analysis and Decision Making under Uncertainty

A Generic Framework and Solver for Synthesizing Finite-State Controllers

ICS 233 Computer Architecture & Assembly Language

Complexity Theory Part I

Resolution of Concurrent Planning Problems using Classical Planning

Parameter estimation using simulated annealing for S- system models of biochemical networks. Orland Gonzalez

Long-Short Term Memory and Other Gated RNNs

ECS 120 Lesson 23 The Class P

Article from. ARCH Proceedings

Lin-Kernighan Heuristic. Simulated Annealing

Path Testing and Test Coverage. Chapter 9

THEORY OF COMPILATION

The TLA + proof system

arxiv: v1 [cs.cl] 21 May 2017

Path Testing and Test Coverage. Chapter 9

Fault Collapsing in Digital Circuits Using Fast Fault Dominance and Equivalence Analysis with SSBDDs

Reconciling Situation Calculus and Fluent Calculus

Spring 2015 Program Analysis and Verification. Lecture 4: Axiomatic Semantics I. Roman Manevich Ben-Gurion University

COSE312: Compilers. Lecture 17 Intermediate Representation (2)

Proof Rules for Correctness Triples

Course on Automated Planning: Transformations

Solving Non-deterministic Planning Problems with Pattern Database Heuristics. KI 2009, Paderborn

Enumeration and generation of all constitutional alkane isomers of methane to icosane using recursive generation and a modified Morgan s algorithm

Data Structures in Java

A tableau-based decision procedure for a branching-time interval temporal logic

VLSI Design Verification and Test Simulation CMPE 646. Specification. Design(netlist) True-value Simulator

Alpha-Beta Pruning: Algorithm and Analysis

Parsing VI LR(1) Parsers

Transcription:

Compiling and Executing PDDL in Picat Marco De Bortoli, Roman Bartak, Agostino Dovier, Neng-Fa Zhou Università degli Studi di Udine CILC 2016 Picat CILC 2016 1 / 21

Outline Introduction to classical planning The PDDL Language The Picat Language The compiler Experimental results Conclusions and further work Picat CILC 2016 2 / 21

Classical Planning Classical Planning is the simplest version of automated Planning and Scheduling, a core branch of Artificial Intelligence involved in the realization of a strategy, intended as an accurate sequence of actions, to resolve a specific problem in a world described by state variables. Automated Planning is composed of two main components: the domain the planner The operation of finding this sequence of actions by the planner can be seen as the search for a path in a direct graph, where every node represents a state of the world, and every edge corresponds to an action. act1(x) s1 act1(a) s4 start init s act2(y) s2 act1(b) s5 Picat CILC 2016 3 / 21

The PDDL Language The Planning Domain Definition Language was created in 1998 by Drew McDremott to standardize all the languages used for classical automated planning and to be the official language of the 1998/2000 IPC, the first International Planning Competition Only physics only principles are used for describing a domain, making the PDDL planner totally domain-independent. Picat CILC 2016 4 / 21

The PDDL Language An example Example 1: A more-level Type Hierarchy ( : t y p e s movable l o c o b j e c t t r u c k cargo movable ) ( : p r e d i c a t e s ( at?n movable? l l o c ) ( i n P r e d? c cargo? t t r u c k ) ( g o a l? c cargo? l l o c ) ) ( : a c t i o n move : p a r a m e t e r s (? t t r u c k? l? l 1 l o c ) : p r e c o n d i t i o n ( and ( at? t? l ) ) : e f f e c t ( and ( not ( at? t? l ) ) ( at? t? l 1 ) ) ) Picat CILC 2016 5 / 21

The Picat Language Introduction to Picat Developed in 2012 by Neng-Fa Zhou It aims to collect the main characteristics of various kind of programming language. Based on B-Prolog engine, but far more expressive and scalable. Tabling can be used to store the results of certain function calls in memory, allowing the program to do a quick table lookup instead of repeatedly calculating a value. It guarantees recursive program termination, preventing infinite loops and redundancy Picat CILC 2016 6 / 21

The Picat Language Planning in Picat Picat provides to the user an interesting planner module: it allows the user to write domains that are at the same time more sophisticated and more compact than those we could obtain in PDDL, thanks to the expressiveness of the language we can mix deterministic and non-deterministic rules to model the domain as we want a state can be represented by any possible kind of term provided by Picat tabling to improve the plan creation, without user intervention Picat CILC 2016 7 / 21

Planning in Picat Action and goal check definition f i n a l (+ S t a t e ) => g o a l c o n d i t i o n. Example 2: Final state check Example 3: State transition a c t i o n (+ State, NextState, Action, Cost ), p r e c o n d i t i o n, [ c o n t r o l k n o w l e d g e ]?=> d e s c r i p t i o n o f n e x t s t a t e, a c t i o n c o s t c a l c u l a t i o n, [ h e u r i s t i c a n d d e a d e n d v e r i f i c a t i o n ]. Picat CILC 2016 8 / 21

Planning in Picat Plan finding techniques deep-first searches: best plan unbounded(s,limit,plan,plancost) plan unbounded(s,limit,plan,plancost) resource-bounded searches: plan(s,limit,plan,plancost) iterative deepening with best plan(s,limit,plan,plancost) branch and bound with best plan bb(s,limit,plan,plancost) Picat CILC 2016 9 / 21

Planning in Picat Factored and Structured State Rapresentation Factored State Rapresentation is the only possibile in PDDL, so it is one of the most known in planning. Structured representation goal is to make the State as small as possible by a massive usage of Picat expressiveness, because the smaller the States are the better is due to tabling. Example 4: PDDL Factored State Representation from Nomystery { a t ( c1, l o c 1 ), a t ( c2, l o c 2 ), a t ( t, l o c 3 ), c o n n e c t e d ( l o c 1, l o c 2 ), c o n n e c t e d ( l o c 2, l o c 3 ), t r u c k ( t )} Example 5: Factored State Representation in Picat $ [ a t ( c1, l o c 1 ), a t ( c2, l o c 2 ), a t ( t, l o c 3 ), c o n n e c t e d ( l o c 1, l o c 2 ), c o n n e c t e d ( l o c 2, l o c 3 ), t r u c k ( t ) ] Example 6: Structured State Representation in Picat s ( TruckLoc, TruckLoad, Cargo ) Picat CILC 2016 10 / 21

The Compiler In this section we present the main contribution of the thesis, namely the definition and implementation of a tool for automatic conversion of PDDL files into Picat, developed in Picat. It provides support to many PDDL features, like object typing (not naturally supported by Picat planner), functions (numeric and not), calculated action costs, quantifiers and others, that are not even supported by some PDDL planners. It includes the pi2pddl parser written by Neng-Fa Zhou, only for the problem instances conversion Since the Factored Representation is the only available in PDDL, a state in a Picat translated domain takes the following form: s ( PREDICATE 1, PREDICATE 2,..., PREDICATE N) PDDL objects types are respesented by Picat rigid facts. Picat CILC 2016 11 / 21

The Compiler Discrimination between fluents and rigids predicates by a static analysis; (pd?x1...?xn) is translated as: member(pd,(x1,...,xn)) if the predicate is a fluent. PD1=select(PD0,(X1,...,XN)) if the predicate is a fluent and we have (not(pd?x1...?xn)) in the effect. pd(x1,...,xn) if the predicate is rigid Lists to represent fluents and Picat rigid predicates to represent static predicates and PDDL types. Picat CILC 2016 12 / 21

The Compiler Typing If our domain presents an hierarchy tree with more levels, some actions may not work properly, due to the extra information from PDDL paramaters section missing in Picat: ( p r e d i c a t e ( a t? t movable? l l o c )... ) ( a c t i o n move ( p a r a m e t e r s (? t t r u c k... These ambiguities are resolved by binding?t to a truck with the rigid predicate truck(t ) (only when strictly necessary) object movable location truck cargo Picat CILC 2016 13 / 21

The Compiler Avoid Floundering Negative preconditions in Picat can cause floundering; the compiler tries to resolve this issue: by moving them after the positive ones and if it is not enough by adding type predicates for unbounded variables (like we did..) The second operation is also carried out if after preconditions parsing some variables are still unbounded (this can occour while using forall quantifiers in effect section) as in the following action: (:action workat :parameters (?day - day?airport - airport) :precondition (today?day) :effect (and (not (today?day)) (forall (?plane - plane) (when (at?plane?day?airport) (done?plane))))) Picat CILC 2016 14 / 21

The Compiler A translated action ( : a c t i o n move : p a r a m e t e r s (? t t r u c k? l 1? l 2 l o c ) : p r e c o n d i t i o n ( and ( a t? t? l 1 ) ( c o n n e c t e d? l 1? l 2 ) ) : e f f e c t ( and ( not ( a t? t? l 1 ) ) ( a t? t? l 1 ) ) ) a c t i o n ( s (AT0, CARRIED0, INPRED0 ), NextState, Action, Cost ), t r u c k (T), s e l e c t ( (T, L ), AT0, AT1 ), c o n n e c t e d ( L1, L2 )?=> AT2 = i n s e r t o r d e r e d w o d (AT1, ( T, L2 ) ), N e x t S t a t e = $s (ATP2, CARRIED0, INPRED0 ), A c t i o n = $act move (T, L1, L2 ), Cost =1. Picat CILC 2016 15 / 21

The Compiler Final state checking To know if the final state is reached, all we need is to check if the goal preconditions lists are subsets of the current ones: f i n a l ( s (AT, IN ) ), g o a l (AT GOAL, IN GOAL ), s u b s e t (AT GOAL,AT), s u b s e t ( IN GOAL, IN ) => t r u e. Picat CILC 2016 16 / 21

Experimental results PDDL files, both domain and instances, refer to specifications from official IPC web site, while the Picat equivalents are translated by the compiler. Where available, also the structured ad-hoc versions of Picat will be tested. We will try all kinds of searches available in Picat, reporting bounds and execution times in seconds. The tests are executed on a notebook with a CPU Intel Core I5 4210h at 3.42 Ghz and 8 gigabytes of RAM. The PDDL planner employed in these tests is Metric - FF 2.1, a state-of-the-art PDDL planner declared Top Performer in the Strips Track of the 3rd International Planning Competition. It is implemented in C, and it is based on FF (Fast Forward), a forward chaining heuristic state space planner, awarded for Outstanding Performance at the 2nd International Planning Competition and Top Performer in the Strips Track of the 3rd International Planning Competition. Picat CILC 2016 17 / 21

Experimental results In the charts reported below we summed up the outcomes of all the problems, collecting different results from tested domains. FF and translated Picat results 4 Picat FF time (s) 2 0 nomys1 nomys2 hik1 hik2 maint1 maint2 tet1 tet2 instances Picat CILC 2016 18 / 21

Experimental results They confirms the well-known fact that generally in planning does not exist a perfect planner able to obtain the best results from all the domains and instances, but the performance of each one is very sensitive to the single case. time (s) 0,6 0,4 0,2 Picat FF FF and Structured Picat results 0 nomys1 nomys2 hik1 hik2 tet1 tet2 instances Picat CILC 2016 19 / 21

Conclusions and further work Results as a base for Picat programmers to create more compact and more performing encodings A good starting point for the automation of optimization stages Picat CILC 2016 20 / 21

Thanks for your attention Picat CILC 2016 21 / 21