Model Checking as Planning and Service

Similar documents
Transfer Learning Action Models by Measuring the Similarity of Different Domains

Discriminative Learning of Beam-Search Heuristics for Planning

Domain Knowledge in Planning: Representation and Use

BMBF Project ROBUKOM: Robust Communication Networks

An Effective Framework for Fast Expert Mining in Collaboration Networks: A Group-Oriented and Cost-Based Method

Module 12. Machine Learning. Version 2 CSE IIT, Kharagpur

Learning and Transferring Relational Instance-Based Policies

OPTIMIZATINON OF TRAINING SETS FOR HEBBIAN-LEARNING- BASED CLASSIFIERS

ISFA2008U_120 A SCHEDULING REINFORCEMENT LEARNING ALGORITHM

Software Maintenance

Seminar - Organic Computing

Given a directed graph G =(N A), where N is a set of m nodes and A. destination node, implying a direction for ow to follow. Arcs have limitations

Artificial Neural Networks written examination

FF+FPG: Guiding a Policy-Gradient Planner

Multimedia Application Effective Support of Education

On-Line Data Analytics

The Strong Minimalist Thesis and Bounded Optimality

Version Space. Term 2012/2013 LSI - FIB. Javier Béjar cbea (LSI - FIB) Version Space Term 2012/ / 18

Axiom 2013 Team Description Paper

Radius STEM Readiness TM

Designing a Computer to Play Nim: A Mini-Capstone Project in Digital Design I

TABLE OF CONTENTS TABLE OF CONTENTS COVER PAGE HALAMAN PENGESAHAN PERNYATAAN NASKAH SOAL TUGAS AKHIR ACKNOWLEDGEMENT FOREWORD

arxiv: v1 [cs.se] 20 Mar 2014

Syntax Parsing 1. Grammars and parsing 2. Top-down and bottom-up parsing 3. Chart parsers 4. Bottom-up chart parsing 5. The Earley Algorithm

A Comparison of Annealing Techniques for Academic Course Scheduling

Evolution of Collective Commitment during Teamwork

A R "! I,,, !~ii ii! A ow ' r.-ii ' i ' JA' V5, 9. MiN, ;

Team Formation for Generalized Tasks in Expertise Social Networks

PH.D. IN COMPUTER SCIENCE PROGRAM (POST M.S.)

Implementing a tool to Support KAOS-Beta Process Model Using EPF

Improving Fairness in Memory Scheduling

AGS THE GREAT REVIEW GAME FOR PRE-ALGEBRA (CD) CORRELATED TO CALIFORNIA CONTENT STANDARDS

CS Machine Learning

QuickStroke: An Incremental On-line Chinese Handwriting Recognition System

Learning to Schedule Straight-Line Code

Navigating the PhD Options in CMS

Testing A Moving Target: How Do We Test Machine Learning Systems? Peter Varhol Technology Strategy Research, USA

GACE Computer Science Assessment Test at a Glance

CSC200: Lecture 4. Allan Borodin

Measures of the Location of the Data

Developing a TT-MCTAG for German with an RCG-based Parser

CS 101 Computer Science I Fall Instructor Muller. Syllabus

Extending Place Value with Whole Numbers to 1,000,000

Planning in Intelligent Systems: Model-based Approach to Autonomous Behavior

Learning Methods for Fuzzy Systems

Lecture 10: Reinforcement Learning

Numeracy Medium term plan: Summer Term Level 2C/2B Year 2 Level 2A/3C

arxiv: v1 [math.at] 10 Jan 2016

Specification of the Verity Learning Companion and Self-Assessment Tool

Ricochet Robots - A Case Study for Human Complex Problem Solving

Probabilistic Model Checking of DTMC Models of User Activity Patterns

EECS 571 PRINCIPLES OF REAL-TIME COMPUTING Fall 10. Instructor: Kang G. Shin, 4605 CSE, ;

Proof Theory for Syntacticians

CS 1103 Computer Science I Honors. Fall Instructor Muller. Syllabus

Planning with External Events

THE DEPARTMENT OF DEFENSE HIGH LEVEL ARCHITECTURE. Richard M. Fujimoto

Reinforcement Learning by Comparing Immediate Reward

As a high-quality international conference in the field

Timeline. Recommendations

Informatics 2A: Language Complexity and the. Inf2A: Chomsky Hierarchy

The Good Judgment Project: A large scale test of different methods of combining expert predictions

Laboratorio di Intelligenza Artificiale e Robotica

INPE São José dos Campos

An Introduction to Simio for Beginners

A Version Space Approach to Learning Context-free Grammars

Page 1 of 11. Curriculum Map: Grade 4 Math Course: Math 4 Sub-topic: General. Grade(s): None specified

On the Combined Behavior of Autonomous Resource Management Agents

Designing A Computer Opponent for Wargames: Integrating Planning, Knowledge Acquisition and Learning in WARGLES

CS 3516: Computer Networks

Laboratorio di Intelligenza Artificiale e Robotica

This scope and sequence assumes 160 days for instruction, divided among 15 units.

Exploration. CS : Deep Reinforcement Learning Sergey Levine

(Sub)Gradient Descent

Generating Test Cases From Use Cases

Computer Science 141: Computing Hardware Course Information Fall 2012

Lecture 1: Machine Learning Basics

have to be modeled) or isolated words. Output of the system is a grapheme-tophoneme conversion system which takes as its input the spelling of words,

FONDAMENTI DI INFORMATICA

Dublin City Schools Mathematics Graded Course of Study GRADE 4

Introduction to HPSG. Introduction. Historical Overview. The HPSG architecture. Signature. Linguistic Objects. Descriptions.

Abstractions and the Brain

Action Models and their Induction

M55205-Mastering Microsoft Project 2016

Chapter 2. Intelligent Agents. Outline. Agents and environments. Rationality. PEAS (Performance measure, Environment, Actuators, Sensors)

THE PENNSYLVANIA STATE UNIVERSITY SCHREYER HONORS COLLEGE DEPARTMENT OF MATHEMATICS ASSESSING THE EFFECTIVENESS OF MULTIPLE CHOICE MATH TESTS

University of Groningen. Systemen, planning, netwerken Bosman, Aart

Spring 2016 Stony Brook University Instructor: Dr. Paul Fodor

Learning goal-oriented strategies in problem solving

Language properties and Grammar of Parallel and Series Parallel Languages

Specification and Evaluation of Machine Translation Toy Systems - Criteria for laboratory assignments

Causal Link Semantics for Narrative Planning Using Numeric Fluents

Digital Fabrication and Aunt Sarah: Enabling Quadratic Explorations via Technology. Michael L. Connell University of Houston - Downtown

PROJECT DESCRIPTION SLAM

Continual Curiosity-Driven Skill Acquisition from High-Dimensional Video Inputs for Humanoid Robots

Math DefragGED: Calculator Tips and Tricks

Lecture 1.1: What is a group?

Reducing Features to Improve Bug Prediction

Major Milestones, Team Activities, and Individual Deliverables

Emotional Variation in Speech-Based Natural Language Generation

Welcome to the session on ACCUPLACER Policy Development. This session will touch upon common policy decisions an institution may encounter during the

Transcription:

Model Checking as Planning and Service B.Comp. Dissertation Li Yi Department of Computer Science School of Computing National University of Singapore April 19, 2011 Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 1 / 45

Outline 1 Introduction Two Problems Motivation 2 Planning via Model Checking Experiments From PDDL to CSP# 3 PAT as Planning Service Case Study: Transport4You Demonstration Route Planning Model Design 4 Future Work Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 2 / 45

Outline 1 Introduction Two Problems Motivation 2 Planning via Model Checking Experiments From PDDL to CSP# 3 PAT as Planning Service Case Study: Transport4You Demonstration Route Planning Model Design 4 Future Work Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 3 / 45

Two Problems Model Checking Given a system model M, an initial state s 0, and a formula ϕ which specifies the property, Model Checking can be viewed as M, s 0 = ϕ. Planning Classical Planning is defined as a three-tuple (S 0, G, A) where S 0 represents the initial state, G represents the set of goal states and A represents a finite set of deterministic actions. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 4 / 45

Two Problems Model Checking Given a system model M, an initial state s 0, and a formula ϕ which specifies the property, Model Checking can be viewed as M, s 0 = ϕ. Planning Classical Planning is defined as a three-tuple (S 0, G, A) where S 0 represents the initial state, G represents the set of goal states and A represents a finite set of deterministic actions. Intuition: construct a safety property G ϕ that requires the formula ϕ never to hold, such that the model checker is able to search for a counterexample that leads to a state where ϕ holds. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 4 / 45

Motivation Research shows the performance of model checkers are comparable to that of the state-of-the-art planners. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 5 / 45

Motivation Research shows the performance of model checkers are comparable to that of the state-of-the-art planners. Domain specific control knowledge can be exploited to improve the performance of model checkers on planning problems. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 5 / 45

Motivation Research shows the performance of model checkers are comparable to that of the state-of-the-art planners. Domain specific control knowledge can be exploited to improve the performance of model checkers on planning problems. Model checkers are good at handling large state spaces, which possibly implies better performance on real world problems compared with planners. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 5 / 45

Motivation Research shows the performance of model checkers are comparable to that of the state-of-the-art planners. Domain specific control knowledge can be exploited to improve the performance of model checkers on planning problems. Model checkers are good at handling large state spaces, which possibly implies better performance on real world problems compared with planners. Model checking can be used as underlying planning service for upper layer applications. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 5 / 45

Outline 1 Introduction Two Problems Motivation 2 Planning via Model Checking Experiments From PDDL to CSP# 3 PAT as Planning Service Case Study: Transport4You Demonstration Route Planning Model Design 4 Future Work Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 6 / 45

Tools PAT CSP# is an expressive model description language combining high-level compositional operators with program-like codes. Self-defined C# Libraries provide unlimited potentials on modelling complex data operations and data types. Flexible and modularized framework allows users to build customized model checking modules for specific domains. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 7 / 45

Tools PAT CSP# is an expressive model description language combining high-level compositional operators with program-like codes. Self-defined C# Libraries provide unlimited potentials on modelling complex data operations and data types. Flexible and modularized framework allows users to build customized model checking modules for specific domains. NuSMV NuSMV is an extension of the symbolic model checker SMV. Models are described as transition relations between current and next state pairs: next(identifier):=expression. Specifications can be expressed in both CTL and LTL. Array indices in NuSMV must be statically evaluated to integer constants. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 7 / 45

Tools cont d Spin Spin models are described in a modelling language called Promela that loosely follows CSP and hence models in CSP# can be converted with minimal efforts. The counterexamples produced by Spin are not guaranteed to be in the minimum size. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 8 / 45

Tools cont d Spin Spin models are described in a modelling language called Promela that loosely follows CSP and hence models in CSP# can be converted with minimal efforts. The counterexamples produced by Spin are not guaranteed to be in the minimum size. SatPlan SatPlan is an award winning planner for optimal deterministic planning created by Prof. Henry Kautz, Dr. Jörg Hoffmann and Shane Neph. SatPlan encodes the planning problem into a SAT formulation with length k and check the satisfiability using a SAT solver. The optimality of plan is restricted to the solution length or make-span. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 8 / 45

Tools cont d Metric-FF Metric-FF is a domain independent planning system developed by Dr. Jörg Hoffmann. Numerical plan metrics and optimization criteria are allowed. Two parameters h and g can be customized to assign priorities to either speed or quality. Standard weighted A* search is used to speed up searching, thus the optimality is not guaranteed. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 9 / 45

The bridge crossing problem The bridge has been damaged and can only carry two soldiers at a time. The soldiers only have a single torch which is needed when crossing the bridge. The time needed for each soldier are 5, 10, 20, 25 minutes respectively. The goal is to find a solution to get all the soldiers to cross the bridge to safety in 60 minutes or less. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 10 / 45

The bridge crossing problem cont d The bridge crossing problem is a plan existence problem with a constraint on the total time. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 11 / 45

The bridge crossing problem cont d The bridge crossing problem is a plan existence problem with a constraint on the total time. We extend the original problem to versions with up to 9 soldiers: Soldier 1 2 3 4 5 6 7 8 9 Time Cost 5 10 20 25 30 45 60 80 100 Table: Time cost of each soldier Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 11 / 45

Experimental Results # Time* Metric-FF PAT NuSMV Spin WITH DFS INVAR CTL LTL 4 60 0.00 0.05 0.04 0.0 0.1 0.1 0.02 5 90 0.00 0.19 0.04 0.1 0.9 0.4 0.02 6 130 0.03 1.12 0.22 0.2 14.4 2.5 0.06 7 175 0.16 6.18 0.25 0.5 330.8 71.3 0.11 8 235 0.94 33.19 10.26 m m m 10.50 9 300 5.30 145.51 16.40 m m m 19.50 Table: Experimental results for the bridge crossing problem Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 12 / 45

Experimental Results cont d Figure: Execution time comparison of PAT, Spin and Metric-FF on the bridge crossing problem Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 13 / 45

The sliding game problem The sliding game problem is the largest puzzle of its type that can be completely solved. The game is simple, and yet obeys a combinatorially large problem space of 9!/2 states. The N N extension of the problem is NP-hard. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 14 / 45

The sliding game problem cont d (a) Hard1 (b) Hard2 (c) Most1 (d) Most2 (e) Rand1 (f) Rand2 Figure: Initial configurations of the sliding game problem instances Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 15 / 45

Experimental Results Problem L* H SatPlan PAT NuSMV Spin BFS INVAR CTL LTL suboptimal Hard1 31 21 444.42 9.60 45.2 > 600 > 600 2.25 Hard2 31 21 438.34 10.05 41.6 > 600 > 600 2.06 Most1 30 20 152.76 9.84 42.8 > 600 > 600 1.99 Most2 30 20 152.24 10.01 42.0 > 600 > 600 2.47 Rand1 24 12 33.70 7.00 30.0 > 600 > 600 2.63 Rand2 20 16 2.89 3.54 16.8 505.6 > 600 2.13 Table: Experimental results for the sliding game problem Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 16 / 45

Experimental Results cont d Figure: Execution time comparison of PAT, NuSMV and SatPlan on the sliding game problem, shown on a logarithm scale Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 17 / 45

Comparison of Tools Tools Numerical bridge crossing sliding game Metrics Existence Optimality Optimality PAT NuSMV Spin SatPlan Metric-FF The counterexamples provided by Spin are not guaranteed the shortest. The plans found by Metric-FF are not guaranteed optimal. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 18 / 45

From PDDL to CSP# Assumptions The PDDL domain descriptions are written in the subset of PDDL 2.1 that includes STRIPS-like operators with literals having typed arguments and numerical plan metrics. The naming and structures of the original PDDL model should be preserved. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 19 / 45

From PDDL to CSP# Assumptions The PDDL domain descriptions are written in the subset of PDDL 2.1 that includes STRIPS-like operators with literals having typed arguments and numerical plan metrics. The naming and structures of the original PDDL model should be preserved. The translation process from PDDL to CSP# can be divided into 5 steps: 1 Typing 2 Predicates 3 Initial State 4 Actions 5 Goal Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 19 / 45

Typing PDDL Domain File: (:types place locatable - object soldier torch - locatable) Problem File: (:objects soldier0 soldier1 soldier2 soldier3 - soldier torch - locatable north south - place) Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 20 / 45

Typing PDDL Domain File: (:types place locatable - object soldier torch - locatable) Problem File: (:objects soldier0 soldier1 soldier2 soldier3 - soldier torch - locatable north south - place) CSP# enum {north,south}; enum {soldier0,soldier1,soldier2,soldier3,torch}; Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 20 / 45

Predicates PDDL (:predicates (at?x - locatable?y - place)) Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 21 / 45

Predicates PDDL (:predicates (at?x - locatable?y - place)) CSP# C# Library: 1 void setpredicate(predicatename, x, y, value); 2 bool trypredicate(predicatename, x, y); 3 int snapshot(); CSP# File: #import "Predicate"; var<predicate> pre = new Predicate(); enum {At}; Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 21 / 45

Initial State PDDL (:init (at soldier0 south) (at soldier1 south) (at soldier2 south) (at soldier3 south) (at torch south) (= (time soldier0) 5) (= (time soldier1) 10) (= (time soldier2) 20) (= (time soldier3) 25) (= (time-cost) 0)) Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 22 / 45

Initial State PDDL (:init (at soldier0 south) (at soldier1 south) (at soldier2 south) (at soldier3 south) (at torch south) (= (time soldier0) 5) (= (time soldier1) 10) (= (time soldier2) 20) (= (time soldier3) 25) (= (time-cost) 0)) CSP# var time[n] = {5,10,20,25}; var time_cost = 0; ini() = initial{pre.setpredicate(at,soldier0,south,true); pre.setpredicate(at,soldier1,south,true); pre.setpredicate(at,soldier2,south,true); pre.setpredicate(at,soldier3,south,true); pre.setpredicate(at,torch,south,true)} -> Skip; Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 22 / 45

Actions PDDL (:action StoN :parameters (?x - soldier?y - soldier) :precondition (and (at?x south) (at?y south) (at torch south)) :effect (and (not (at?x south)) (not (at?y south)) (not (at torch south)) (at?x north) (at?y north) (at torch north) (when (>= (time?x) (time?y)) (increase (time-cost) (time?x))) (when (< (time?x) (time?y)) (increase (time-cost) (time?y))))) Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 23 / 45

Actions cont d CSP# StoN(x,y) = [x!=y && pre.trypredicate(at,x,south) && pre.trypredicate(at,y,south) && pre.trypredicate(at,torch,south)] s.x.y{pre.setpredicate(at,x,north,true); pre.setpredicate(at,x,south,false); pre.setpredicate(at,y,north,true); pre.setpredicate(at,y,south,false); pre.setpredicate(at,torch,north,true); pre.setpredicate(at,torch,south,false); if(time[x]>time[y]) {time_cost=time_cost+time[x];} else {time_cost=time_cost+time[y];} } -> Trans(); Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 24 / 45

Actions cont d CSP# Trans() = tau{snap = pre.snapshot()} -> ([] z:{0..3}@([] y:{0..3}@ston(z,y))) []([] x:{0..3}@ntos(x)); Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 25 / 45

Goal PDDL (:goal (and (at soldier0 north) (at soldier1 north) (at soldier2 north) (at soldier3 north))) (:metric minimize (time-cost))) Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 26 / 45

Goal PDDL (:goal (and (at soldier0 north) (at soldier1 north) (at soldier2 north) (at soldier3 north))) (:metric minimize (time-cost))) CSP# #define goal (pre.trypredicate(at,soldier0,north) && pre.trypredicate(at,soldier1,north) && pre.trypredicate(at,soldier2,north) && pre.trypredicate(at,soldier3,north)); #assert Plan reaches goal with min(time_cost); Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 26 / 45

Outline 1 Introduction Two Problems Motivation 2 Planning via Model Checking Experiments From PDDL to CSP# 3 PAT as Planning Service Case Study: Transport4You Demonstration Route Planning Model Design 4 Future Work Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 27 / 45

Case Study: Transport4You Transport4You is a project submission for the 33 rd International Conference on Software Engineering (ICSE) - Student Contest on Software Engineering (SCORE). Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 28 / 45

Case Study: Transport4You Transport4You is a project submission for the 33 rd International Conference on Software Engineering (ICSE) - Student Contest on Software Engineering (SCORE). It is a specifically designed municipal transportation management solution which is able to simplify the fare collection process and provide customized services to each subscriber. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 28 / 45

Case Study: Transport4You Transport4You is a project submission for the 33 rd International Conference on Software Engineering (ICSE) - Student Contest on Software Engineering (SCORE). It is a specifically designed municipal transportation management solution which is able to simplify the fare collection process and provide customized services to each subscriber. The project is selected as one of the finalists (5 out of 94 submissions) which are going to be presented for the final round of the competition at ICSE 2011 in Hawaii. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 28 / 45

Route Planning Module Figure: Simulator architecture diagram Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 29 / 45

Why Using PAT? The searching algorithms of PAT is highly efficient and ready to be used. It also saves the time of implementing a different planning algorithm for every new problem. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 30 / 45

Why Using PAT? The searching algorithms of PAT is highly efficient and ready to be used. It also saves the time of implementing a different planning algorithm for every new problem. CSP# is a highly expressive language for modelling various kind of systems. PAT is ready to solve all kinds of planning problems. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 30 / 45

Why Using PAT? The searching algorithms of PAT is highly efficient and ready to be used. It also saves the time of implementing a different planning algorithm for every new problem. CSP# is a highly expressive language for modelling various kind of systems. PAT is ready to solve all kinds of planning problems. PAT is constructed in a modularized fashion. Modules for specific purposes can be built to give better support for the domains that are considered. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 30 / 45

Route Planning Demonstration Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 31 / 45

Definition A Route Planning task is defined by a 5-tuple (S,B,t,c,L) with the following components: Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 32 / 45

Definition A Route Planning task is defined by a 5-tuple (S,B,t,c,L) with the following components: S is a finite, non-empty set of bus stops. Terminal stops include start terminal s start S, and end terminal s end S, where s start s end =. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 32 / 45

Definition A Route Planning task is defined by a 5-tuple (S,B,t,c,L) with the following components: S is a finite, non-empty set of bus stops. Terminal stops include start terminal s start S, and end terminal s end S, where s start s end =. B is a finite set of bus lines, and for every bus line b i B, b i : S S is a partial function. b i (s) is the next stop taking bus i from stop s. s s start b B, s dom(b) b 1 (s) = α. s s end b B, s dom(b) b(s) = β. b B, b 1 (α) = α b(β) = β. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 32 / 45

Definition A Route Planning task is defined by a 5-tuple (S,B,t,c,L) with the following components: S is a finite, non-empty set of bus stops. Terminal stops include start terminal s start S, and end terminal s end S, where s start s end =. B is a finite set of bus lines, and for every bus line b i B, b i : S S is a partial function. b i (s) is the next stop taking bus i from stop s. s s start b B, s dom(b) b 1 (s) = α. s s end b B, s dom(b) b(s) = β. b B, b 1 (α) = α b(β) = β. t : S B S is a function where B S B. t(s) is the set of available bus lines at stop s, i.e., B S = {b i B s dom(b i )}. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 32 / 45

Definition A Route Planning task is defined by a 5-tuple (S,B,t,c,L) with the following components: S is a finite, non-empty set of bus stops. Terminal stops include start terminal s start S, and end terminal s end S, where s start s end =. B is a finite set of bus lines, and for every bus line b i B, b i : S S is a partial function. b i (s) is the next stop taking bus i from stop s. s s start b B, s dom(b) b 1 (s) = α. s s end b B, s dom(b) b(s) = β. b B, b 1 (α) = α b(β) = β. t : S B S is a function where B S B. t(s) is the set of available bus lines at stop s, i.e., B S = {b i B s dom(b i )}. c : S S is a partial function. c(s) is the stop one can get to by crossing the road at stop s. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 32 / 45

Definition A Route Planning task is defined by a 5-tuple (S,B,t,c,L) with the following components: S is a finite, non-empty set of bus stops. Terminal stops include start terminal s start S, and end terminal s end S, where s start s end =. B is a finite set of bus lines, and for every bus line b i B, b i : S S is a partial function. b i (s) is the next stop taking bus i from stop s. s s start b B, s dom(b) b 1 (s) = α. s s end b B, s dom(b) b(s) = β. b B, b 1 (α) = α b(β) = β. t : S B S is a function where B S B. t(s) is the set of available bus lines at stop s, i.e., B S = {b i B s dom(b i )}. c : S S is a partial function. c(s) is the stop one can get to by crossing the road at stop s. L is a unary predicate on S. L(s) is true when the current location of user is at stop s. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 32 / 45

Definition cont d Given initial location s 0 and destination s g, a Route Planning domain maps a Route Planning task to a classical planning problem with close-world assumption as follows: States: Each state is represented as a literal s S, where L(s) holds. Initial State: s 0 Goal States: s g Actions: 1. (TakeBus(b i, s), PRECOND: b i t(s), EFFECT: L(s) L(b i (s))) 2. (Cross(s), PRECOND: s dom(c), EFFECT: L(s) L(c(s))) Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 33 / 45

Basic Model Environment Variables enum{terminala, Stop5, Stop7, Stop9... Stop26, Stop11, Stop35, Stop34}; var sline1 = [TerminalA, Stop5, Stop7, Stop9, Stop58, Stop31, Stop33, Stop53, Stop57, TerminalC]; var<busline> Line1 = new BusLine(sLine1,1); var sline2 = [TerminalC, Stop56, Stop52, Stop32, Stop30, Stop59, Stop10, Stop8, Stop6, TerminalA]; var<busline> Line2 = new BusLine(sLine2,2);... var sline14 = [TerminalC, Stop34, Stop32, Stop30, Stop16, TerminalB]; var<busline> Line14 = new BusLine(sLine14,14); Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 34 / 45

Basic Model cont d Initial State var currentstop = Stop5; var B0 = [-2]; var<busline> currentbus = new BusLine(B0,-1); Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 35 / 45

Basic Model cont d Initial State var currentstop = Stop5; var B0 = [-2]; var<busline> currentbus = new BusLine(B0,-1); Transition Functions takebus()=case{ currentstop==terminala:busline1[]busline3[]busline5[]busline7 currentstop==stop5:busline1[]busline5 currentstop==stop7:busline1[]busline5... currentstop==stop11:busline12 currentstop==stop35:busline13 currentstop==stop34:busline14 }; Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 35 / 45

Basic Model cont d Transition Functions BusLine1= TakeBus.1{currentStop=Line1.NextStop(currentStop); currentbus=line1;} ->plan;... BusLine14= TakeBus.14{currentStop=Line14.NextStop(currentStop); currentbus=line14;} ->plan; crossroad()=case{ currentstop==stop5: crosscurrentstop=stop6 ->plan currentstop==stop7: crosscurrentstop=stop8 ->plan... currentstop==stop35: crosscurrentstop=stop34 ->plan currentstop==stop34: crosscurrentstop=stop35 ->plan }; Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 36 / 45

Basic Model cont d Transition Functions plan=takebus()[]crossroad(); Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 37 / 45

Basic Model cont d Transition Functions plan=takebus()[]crossroad(); Goal States #define goal currentstop==stop53; Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 37 / 45

Cost Function Approach Modified Transition Functions takebus()=tau{cost = cost + 10}->case{... crossroad()=tau{cost = cost + 2}->case{... BusLine1=tau{if (!currentbus.isequal(linex )){cost = cost + 5}} ->TakeBus.1... Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 38 / 45

Cost Function Approach Modified Transition Functions takebus()=tau{cost = cost + 10}->case{... crossroad()=tau{cost = cost + 2}->case{... BusLine1=tau{if (!currentbus.isequal(linex )){cost = cost + 5}} ->TakeBus.1... New assertion: #assert plan reaches goal with min(cost); cost = 10 takebus + 5 crossroad + 2 buschange Original problem can be solved by a simple breadth-first search. To find the goal state with minimum cost, the whole state space has to be searched? Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 38 / 45

Cost Function Approach cont d Algorithm 1 newbfsverification() initialize queue: working; current InitialStep; τ ; repeat value EvaluateExpression(current); if current.implycondition() then if value < τ then τ value; end if end if if value > τ then continue; end if for all step current.makeonemove() do working.enque(step); end for until working.count() 0 Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 39 / 45

Search Space Pruning Figure: An example bus line configuration Figure: A solution produced by the basic model Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 40 / 45

Search Space Pruning cont d Given the current bus line is b k, an action TakeBus(b i, s j ) is not redundant if one of the followings holds: 1 b i = b k 2 b i t(s j ) b k t(s j ) b i (s j ) b k (s j ) m N 1, b i (s j ) m b k (s j ) m 3 1 and 2 do not hold and b i (s j ) b k (s j ) b 1 i (s j ) b 1 k (s j) Figure: Special pattern of two overlapping bus lines Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 41 / 45

Search Space Pruning cont d (a) Same Previous Stop (b) Same Next Stop Figure: Redundant bus changes Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 42 / 45

Performance Comparison State Transition Time Memory Cost Cost Length Length Basic 1029.46 1070.93 0.0448 11119.91 58.23 1254 5.51 0 Cost 1125.31 1169.82 0.0483 11281.58 56.02 0 5.59 247 Prune 158.48 185.77 0.0179 9197.95 56.79 379 5.51 0 Table: Comparison results of three route planning models Values are average among the 3660 (61 60) test cases. The length of the shortest solution was get by solving the shortest path problem using Dijkstra algorithm. The search space pruning model performs the best in terms of execution time and memory space. The cost function model guarantees the lowest total cost. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 43 / 45

Future Work Extend the comparisons to a larger range of model checking as well as planning tools to get a more general view of the subject. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 44 / 45

Future Work Extend the comparisons to a larger range of model checking as well as planning tools to get a more general view of the subject. By fine tuning the way of modelling or exploiting domain specific knowledge, some models can be further optimized. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 44 / 45

Future Work Extend the comparisons to a larger range of model checking as well as planning tools to get a more general view of the subject. By fine tuning the way of modelling or exploiting domain specific knowledge, some models can be further optimized. An automated translator for the translation from PDDL to CSP# can be implemented. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 44 / 45

Future Work Extend the comparisons to a larger range of model checking as well as planning tools to get a more general view of the subject. By fine tuning the way of modelling or exploiting domain specific knowledge, some models can be further optimized. An automated translator for the translation from PDDL to CSP# can be implemented. The applications of PAT as planning service should be extended to a larger range on real problems in various fields. Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 44 / 45

The End Li Yi (National University of Singapore) B.Comp. Dissertation April 19, 2011 45 / 45