Languages for goals and plans

Similar documents
Situation Calculus and YAGI

A SITUATION CALCULUS APPROACH TO MODELING AND PROGRAMMING AGENTS

IG-JADE-PKSlib. An Agent Based Framework for Advanced Web Service Composition and Provisioning. Erick Martínez & Yves Lespérance

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs?

Com S 541. Programming Languages I

HTN Planning for Web Service Composition Using SHOP2

Lecture 18: Planning and plan execution, applications

CSCC24 Functional Programming Scheme Part 2

CMSC 330: Organization of Programming Languages. Operational Semantics

Modeling Dynamic Domains with ConGolog

Logic Programming and MDPs for Planning. Alborz Geramifard

Adapting Golog for Composition of Semantic Web Services

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

Programming Languages Third Edition

Chapter 2 & 3: Representations & Reasoning Systems (2.2)

Automata Theory for Reasoning about Actions

Introduction to dependent types in Coq

Static verification of program running time

An Intelligent Assistant for Computer-Aided Design Extended Abstract

Chapter 3 (part 3) Describing Syntax and Semantics

3.7 Denotational Semantics

UniLFS: A Unifying Logical Framework for Service Modeling and Contracting

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

An Incremental Interpreter for High-Level Programs with Sensing

(Refer Slide Time: 1:27)

Incremental Plan Recognition in an Agent Programming Framework

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.

A Small Interpreted Language

Evolving Hierarchical and Recursive Teleo-reactive Programs through Genetic Programming

CITS5501 Software Testing and Quality Assurance Formal methods

Computing intersections in a set of line segments: the Bentley-Ottmann algorithm

ICS 606. Intelligent Autonomous Agents 1

Introduction to Scheme

Lecture 6: Arithmetic and Threshold Circuits

HTN Planning for Web Service Composition Using SHOP2

First-Class Type Classes

Semantics. There is no single widely acceptable notation or formalism for describing semantics Operational Semantics

Functional Programming. Big Picture. Design of Programming Languages

Lecture Notes on Program Equivalence

CSE 307: Principles of Programming Languages

The semantics of a programming language is concerned with the meaning of programs, that is, how programs behave when executed on computers.

CS558 Programming Languages

The DPL (Decisive Plausible Logic) Tool

Scheme: Data. CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Monday, April 3, Glenn G.

Assignment WS 2012/2013

Programming Language Pragmatics

The AGENT0 Manual. Department of Computer Science

A First-Order Logic with First-Class Types

Writing Temporally Predictable Code

Lecture Notes on Real-world SMT

Dining Philosophers with π-calculus

Basic Foundations of Isabelle/HOL

Part (04) Introduction to Programming

Semantics and Pragmatics of NLP Propositional Logic, Predicates and Functions

Concepts of programming languages

A multi-threaded architecture for cognitive robotics. Keith Clark Imperial College London

Chapter 14: Planning with relational actions. c D. Poole, A. Mackworth 2010, W. Menzel 2013 Artificial Intelligence, Lecture 14.

JOURNAL OF OBJECT TECHNOLOGY

Last class. CS Principles of Programming Languages. Introduction. Outline

Formal Systems II: Applications

Linking Natural Language to Action. Advisors: George Pappas and Norm Badler

Lecture #13: Type Inference and Unification. Typing In the Language ML. Type Inference. Doing Type Inference

CSE 146. Asymptotic Analysis Interview Question of the Day Homework 1 & Project 1 Work Session

1 Lexical Considerations

Type Checking. Outline. General properties of type systems. Types in programming languages. Notation for type rules.

Critical Analysis of Computer Science Methodology: Theory


On the Semantics of Deliberation in IndiGolog From Theory to Implementation

The Discrete Event Calculus for Games and Other (Soft) Real Time Systems

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals

Adapting Golog for Composition of Semantic Web Services

CSC 533: Programming Languages. Spring 2015

Outline. General properties of type systems. Types in programming languages. Notation for type rules. Common type rules. Logical rules of inference

An Introduction to Functions

Using LNT Formal Descriptions for Model-Based Diagnosis

CS508-Modern Programming Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan

Complex Epistemic Modalities in the Situation Calculus

Fifth Generation CS 4100 LISP. What do we need? Example LISP Program 11/13/13. Chapter 9: List Processing: LISP. Central Idea: Function Application

Notes on Higher Order Programming in Scheme. by Alexander Stepanov

Introduction to Axiomatic Semantics

Formal specification in Event-B

Overview. Rationale Division of labour between script and C++ Choice of language(s) Interfacing to C++

Principles of Programming Languages

Lecture 11 Lecture 11 Nov 5, 2014

12/30/2013 S. NALINI,AP/CSE

ESL: A Language for Supporting Robust Plan Execution in Embedded Autonomous Agents

A Tutorial on Runtime Verification and Assurance. Ankush Desai EECS 219C

An introduction to Scheme

Structural and Syntactic Pattern Recognition

Lecture #24: Programming Languages and Programs

Evaluation of Predicate Calculus By Arve Meisingset, retired research scientist from Telenor Research Oslo Norway

1.7 Recursion. Department of CSE

Discussion 12 The MCE (solutions)

SOFTWARE ENGINEERING DESIGN I

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory

15-819M: Data, Code, Decisions

Subsets in type theory

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Lecture #23: Conversion and Type Inference

Program Verification. Program Verification 307/434

Transcription:

Languages for goals and plans Overview of the existing plan languages Dmitry Shaparau shaparau@itc.it ITC-IRST Languages for goals and plans p. 1/2

Motivation One of the key components of the planning framework are a language to express planning goals. a language to specify resulting detailed plans. We are going to combine goals with plans: Goal: "REACH g1 THEN RUN plan π THEN REACH g2" Plan:... do action1; if(battery == low) { goal (position == recharging room); }... Languages for goals and plans p. 2/2

Introduction Approaches to high-level planning task programming can roughly be classified into those making use of some form of deliberation and those which do not: Reactive architectures Task Definition Language Reactive Plan Language Logic-based architectures Golog Golog for WS composition ReadyLog Languages for goals and plans p. 3/2

Task Definition Language Computer games industry is a huge application area for AI techniques. To make a virtual environment more realistic the game has to simulate a behavior of game-world objects. SimHuman is tool for creation animated three-dimensional scenes with an arbitrary number of objects, virtual agents and user-controlled avatars. TDL is a high-level procedural language for the definition of the virtual environment objects behavior. Languages for goals and plans p. 4/2

TDL (key concepts) The key concept in TDL is a task A task defines the combination of virtual agent actions (It has a duration and is executed in continuous timeframes) primitive actions, which are a set of commands that an agent can perform in one timeframe. predef ined actions, which are predefined sequence of actions: a 1,a 2,...,a n, where a i is the set of primitive actions performed in the timeframe i. goal oriented actions: a i = f(a i 1,I,G), where I is the set information about the objects, G is the goal, and f is a function that returns the next primitive action set based on the agent s current action and senses. Languages for goals and plans p. 5/2

TDL (task definition) The syntax of task definition is: TASK task_name (type 1,arg 1,..., type n,arg n ) #Variables < v a r i a b l e d e c l a r a t i o n > #Body <block of commands> #end Languages for goals and plans p. 6/2

TDL (commands) Possible task commands are: action task or function call PAR( block b1, block b2 ) : Blocks b1 and b2 are executed in parallel DO( block b ) UNTIL c : Block b is executed until condition c is true IF bool c THEN ( block b1 ) ELSE ( block b2 ) : If condition c is true, block b1 is executed, else block b2 is executed Languages for goals and plans p. 7/2

TDL (example) TASK s i t _ o n _ f r e e _ t a b l e ( ) #Variables e n t i t y Table " ", Chair " " #Body DO ( task walk_around ( ) ) UNTIL exists ( Table, and ( eq ( [ Table ] class, table ), and ( exists ( Chair, and ( eq ( [ Chair ] class, chair ), and ( near ( Chair, Table ), ) ) ) ) ) ) ; task go_and_sit ( Table ) #end Languages for goals and plans p. 8/2

TDL (conclusion) Advantages: It is really simple. Drawbacks: It is strictly oriented to SimHuman tool. There is no possibility to introduce new primitive actions. Goal-oriented actions were introduced, but implementation and usage were not discussed. There is no information about the TDL state in last works of its authors, so probably TDL became forgotten. Languages for goals and plans p. 9/2

Reactive Plan Language Reactive Plan Language (RPL) was developed for high-level robot planning. A RPL plan looks like a Lisp program. The key concept of the RPL is a procedure that can be defined using (DEF INTERP PROC name ( formals ) body ) The execution is based on the task network construction. ( :TAG LL (LOOP (A) ( :TAG SS (B ) ) ) ) In order to access the second step B in the third iteration of the loop we can use a construction (TAGGED SS (SUB ITER 3 LL)) Languages for goals and plans p. 10/2

RPL (task life-cycle) During its life-cycle a task passes through following states: 1. created, when a task is first created 2. enabled, when a task is ready to be executed 3. active, when execution begins 4. finished, failed or evaporated. The status of each task is stored in a fluent, which can be used to trigger events. Languages for goals and plans p. 11/2

RPL (Key concepts) RPL provides possibility to deal with following aspects: failure, a task failure can be managed using FAIL, TRY-ALL and TRY-IN-ORDER constructions. It is similar to the exception handling in high-level programming languages. concurrency, RPL controls the concurrency using a type of semaphore called a valve. Whenever two tasks should no execute simultaneously, we arrange that they compete for a valve. The entity that requests and waits for a valve is called a process (PROCESS name -body-). Valves are created using (CREATE-VALVE name b). It can be requested and released using (VALVE-REQUEST p v) and (VALVE-RELEASE p v). Languages for goals and plans p. 12/2

RPL (Key concepts cont.) policies and priorities. Sometimes, a plan is executed to constrain the execution of another plan that is called a policy. For this reason RPL has a construction (WITH-POLICY s a), where s is a "secondary" plan and a is a "primary" plan. There is another construction (WITH-TASK-BLOCKED T -body-) which prevent running any subtask of the task T until the body is finished. protections and violations. Protected state is a state that has to be kept true during some interval. There is a PROTECTION construct in RPL for protected states management. (PROTECTION [:RIGID :HARD :SOFT] prop f repair), where f is a fluent being protected. Languages for goals and plans p. 13/2

RPL (conclusion) RPL is a very flexible and powerful plan language. RPL is very similar to the programming languages such as Java or C. LISP syntax makes it harder to read and understand. There is a big set of reactive languages which are similar to RPL in spirit and notation. Languages for goals and plans p. 14/2

Golog Golog is a logic programming language. Golog was developed for applications, whose design is based on a sophisticated logic of actions High-level control of robots and mechanical devices. Programming intelligent software agents. Modeling and simulation of discrete event systems. Golog uses the situation calculus for modeling dynamically changing application domains. Languages for goals and plans p. 15/2

Golog (situation calculus) Situation calculus is a first order language with following key concepts: Situation = possible world history, which is a sequence of actions S 0 is used to denote the initial situation in which no actions have yet occurred. The world is conceived as being in a state s; this state can change only when some agent performs some action. Languages for goals and plans p. 16/2

Golog (situation calculus) Binary function symbol do(α, s) denotes the successor situation to s resulting from performing action α Relational fluent is a predicate which takes a situation term as the last argument. For example, is_carring(robot, p, s) means that a robot is carrying package p in situation s. Knowledge fluent K, where K(s,s ) holds if system is in situation s but believes it might be in situation s. Languages for goals and plans p. 17/2

Golog (domain definition) To define application domain we have to define following sets of axioms: Action precondition axioms. Successor state axioms. Unique names axioms for the primitive actions. Accessibility axioms for K. Domain initial state S 0 (including K 0 ). Complex actions and procedures. Languages for goals and plans p. 18/2

Golog (example) i f car_in_driveway then d r i v e else walk endif while ( block ) ontable ( block ) do remove_block endwhile proc remove_block (πx ) [ pickup ( x ) ; putaway ( x ) ] endproc Where π is a nondeterministic operator. Languages for goals and plans p. 19/2

Golog (commands) The full list of Golog constructs is following: a - primitive action δ 1 ;δ 2 - sequence φ? - test δ 1 δ 2 - nondeterministic choice of actions (πx)δ(x) - nondeterministic choice of arguments δ - nondeterministic iteration i f φ then δ 1 else δ 2 endif c o n d i t i o n a l s while φ do δ endwhile loops Languages for goals and plans p. 20/2

Golog (implementation) Golog interprets complex actions and procedures as macros which have to be expand into a situation calculus formula (sometimes second order), so while φ do δ endwhile [[φ?;δ] ; φ?] Languages for goals and plans p. 21/2

Golog (block world) proc maketower ( n ) (πx,m) [ tower ( x,m)? ; i f m n then stack ( x, n m) else unstack ( x,m n ) endif ] endproc ; proc stack ( x, n ) n=0? (πy ) [ put ( y, x ) ; stack ( y, n 1)] endproc ; proc unstack ( x, n )... endproc ; maketower ( 7 ) ; ( x) on ( x,a)? Languages for goals and plans p. 22/2

Golog (execution) In order to execute such kind of program Golog interpreter involves a finding a proof in second-order logic. Languages for goals and plans p. 23/2

Golog (conclustion) Golog is ancestor of the huge family of logic programming languages for dynamically changing application domain. Extensions exist for dealing with continuous change concurrency decision-theoretic planning others... Golog interpreter works in two steps: 1. Transform Golog program into situation calculus formulas 2. Find a proof in second-order logic. Languages for goals and plans p. 24/2

Golog for WS composition WS compostion is considered as a planning and execution task. The new extension of Golog was achieved by introducing new language constructions: Desirable(a, s) is a new fluent in situation calculus which means that action a is desirable in situation s. It is different from precondition of action a P oss(a, s) where action a is physically possible in situation s. This fluent constraints the search space for actions. Legal(a,s) Poss(a,s) Desiable(a,s) Languages for goals and plans p. 25/2

Golog for WS composition WS compostion is considered as a planning and execution task. The new extension of Golog was achieved by introducing new language constructions: Order connective ":". Informally, a 1 : a 2 will perform the sequence of action a 1 ;a 2 whenever Poss(a 2,do(a 1,s)) is true. However, when it is false, the ":" construct dictates that Golog search for a sequence of actions ā that achieves Poss(a 2,do(ā,do(a 1,s))). All actions is distinguished in two groups: usual actions and sensing actions. Only sensing actions can be used to update knowledge data K. Languages for goals and plans p. 26/2

ReadyLog Readylog is an extension of Golog which offers following additional control constructs: solve(p; h) - (offline) dt-planning waitfor(c) - event-interrupt withctrl(c; a1) - condition-bounded execution pconc(a1; a2) - concurrent actions prob(valprob; a1; a2) - probabilistic actions pproj (c; a1) - probabilistic (offline) projection Languages for goals and plans p. 27/2

ReadyLog (example) To illustrate the use of these constructs we give some examples from the soccer domain. To control different phases of the game special signals like beforekickoff are sent from an external computer by the referee. The withctrl statement means that as long as the condition holds the particular procedure is executed: proc mainloop while gamerunning do pconc ( withctrl ( beforekickoff ; p o s i t i o n O n F i e l d ) ; withctrl (gameon ; playsoccer ),... endwhile endproc Languages for goals and plans p. 28/2