3APL: A Goal-Oriented Multi-Agent Programming Language

Σχετικά έγγραφα
Overview. Transition Semantics. Configurations and the transition relation. Executions and computation

Phys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)

The Simply Typed Lambda Calculus

Lecture 2. Soundness and completeness of propositional logic

Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit

Sequent Calculi for the Modal µ-calculus over S5. Luca Alberucci, University of Berne. Logic Colloquium Berne, July 4th 2008

2 Composition. Invertible Mappings

The challenges of non-stable predicates

Dynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016

Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3

Concrete Mathematics Exercises from 30 September 2016

LTL to Buchi. Overview. Buchi Model Checking LTL Translating LTL into Buchi. Ralf Huuck. Buchi Automata. Example

Section 8.3 Trigonometric Equations

Partial Differential Equations in Biology The boundary element method. March 26, 2013

3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β

Απόκριση σε Μοναδιαία Ωστική Δύναμη (Unit Impulse) Απόκριση σε Δυνάμεις Αυθαίρετα Μεταβαλλόμενες με το Χρόνο. Απόστολος Σ.

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 24/3/2007

Homework 3 Solutions

Example Sheet 3 Solutions

Derivation of Optical-Bloch Equations

Other Test Constructions: Likelihood Ratio & Bayes Tests

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 19/5/2007

Solutions to Exercise Sheet 5

Econ 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1

Χρειάζεται να φέρω μαζί μου τα πρωτότυπα έγγραφα ή τα αντίγραφα; Asking if you need to provide the original documents or copies Ποια είναι τα κριτήρια

CYTA Cloud Server Set Up Instructions

Πανεπιστήμιο Δυτικής Μακεδονίας. Τμήμα Μηχανικών Πληροφορικής & Τηλεπικοινωνιών. Τεχνητή Νοημοσύνη. Ενότητα 2: Αναζήτηση (Search)

Fractional Colorings and Zykov Products of graphs

ST5224: Advanced Statistical Theory II

TMA4115 Matematikk 3

Every set of first-order formulas is equivalent to an independent set

From the finite to the transfinite: Λµ-terms and streams

Homomorphism in Intuitionistic Fuzzy Automata

CRASH COURSE IN PRECALCULUS

C.S. 430 Assignment 6, Sample Solutions

Εικονική Αναπαράσταση Νοηµατικής Γλώσσας στο ιαδίκτυο

ΓΡΑΜΜΙΚΟΣ & ΔΙΚΤΥΑΚΟΣ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ

Areas and Lengths in Polar Coordinates

HOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:

EE512: Error Control Coding

Section 9.2 Polar Equations and Graphs

Homework 8 Model Solution Section

Jesse Maassen and Mark Lundstrom Purdue University November 25, 2013

Matrices and Determinants

derivation of the Laplacian from rectangular to spherical coordinates

ΚΥΠΡΙΑΚΗ ΕΤΑΙΡΕΙΑ ΠΛΗΡΟΦΟΡΙΚΗΣ CYPRUS COMPUTER SOCIETY ΠΑΓΚΥΠΡΙΟΣ ΜΑΘΗΤΙΚΟΣ ΔΙΑΓΩΝΙΣΜΟΣ ΠΛΗΡΟΦΟΡΙΚΗΣ 6/5/2006

Εγκατάσταση λογισμικού και αναβάθμιση συσκευής Device software installation and software upgrade

(C) 2010 Pearson Education, Inc. All rights reserved.

Statistical Inference I Locally most powerful tests

Instruction Execution Times

Chap. 6 Pushdown Automata

4.6 Autoregressive Moving Average Model ARMA(1,1)

( )( ) ( ) ( )( ) ( )( ) β = Chapter 5 Exercise Problems EX α So 49 β 199 EX EX EX5.4 EX5.5. (a)

Solution Series 9. i=1 x i and i=1 x i.

Areas and Lengths in Polar Coordinates

ω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω

These derivations are not part of the official forthcoming version of Vasilaky and Leonard

Test Data Management in Practice

Trigonometric Formula Sheet

CHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS

Estimation for ARMA Processes with Stable Noise. Matt Calder & Richard A. Davis Colorado State University

b. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!

g-selberg integrals MV Conjecture An A 2 Selberg integral Summary Long Live the King Ole Warnaar Department of Mathematics Long Live the King

DERIVATION OF MILES EQUATION FOR AN APPLIED FORCE Revision C

ΠΕΔΙΟ_ΑΓΟΡΑ: Stakeholder Analysis Questionnaire

Numerical Analysis FMN011

forms This gives Remark 1. How to remember the above formulas: Substituting these into the equation we obtain with

Formal Semantics. 1 Type Logic

ΕΙΣΑΓΩΓΗ ΣΤΗ ΣΤΑΤΙΣΤΙΚΗ ΑΝΑΛΥΣΗ

Geodesic Equations for the Wormhole Metric

ΠΟΛΥΤΕΧΝΕΙΟ ΚΡΗΤΗΣ ΣΧΟΛΗ ΜΗΧΑΝΙΚΩΝ ΠΕΡΙΒΑΛΛΟΝΤΟΣ

Parametrized Surfaces

PARTIAL NOTES for 6.1 Trigonometric Identities

SOLUTIONS TO MATH38181 EXTREME VALUES AND FINANCIAL RISK EXAM

Models for Probabilistic Programs with an Adversary

A Lambda Model Characterizing Computational Behaviours of Terms

The λ-calculus. Lecturer: John Wickerson. Phil Wadler

Στεγαστική δήλωση: Σχετικά με τις στεγαστικές υπηρεσίες που λαμβάνετε (Residential statement: About the residential services you get)

SOLUTIONS TO MATH38181 EXTREME VALUES AND FINANCIAL RISK EXAM

Οδηγίες Αγοράς Ηλεκτρονικού Βιβλίου Instructions for Buying an ebook

SCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions

Abstract Storage Devices

D Alembert s Solution to the Wave Equation

Finitary proof systems for Kozen s µ

Section 7.6 Double and Half Angle Formulas

10.7 Performance of Second-Order System (Unit Step Response)

SOAP API. Table of Contents

Keystroke-Level Model

Chapter 6: Systems of Linear Differential. be continuous functions on the interval

Δημιουργία Λογαριασμού Διαχείρισης Business Telephony Create a Management Account for Business Telephony

Figure A.2: MPC and MPCP Age Profiles (estimating ρ, ρ = 2, φ = 0.03)..

Second Order RLC Filters

k A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +

ΤΕΧΝΙΚΕΣ ΑΥΞΗΣΗΣ ΤΗΣ ΑΠΟΔΟΣΗΣ ΤΩΝ ΥΠΟΛΟΓΙΣΤΩΝ I

Uniform Convergence of Fourier Series Michael Taylor

Verification. Lecture 12. Martin Zimmermann

Module 5. February 14, h 0min

Tridiagonal matrices. Gérard MEURANT. October, 2008

Durbin-Levinson recursive method

Π Ο Λ Ι Τ Ι Κ Α Κ Α Ι Σ Τ Ρ Α Τ Ι Ω Τ Ι Κ Α Γ Ε Γ Ο Ν Ο Τ Α

Transcript:

3APL: A Goal-Oriented Multi-Agent Programming Language

Programming Language for Cognitive Agents Data Structures to represent agent state 3APL Mental State Beliefs : General and specific Information about environment Goals : Objectives that agent want to reach Capabilities : Actions that agent can perform Plans : Procedures to achieve objectives Reasoning rules : Reason about goals and plans Planning goal rules: how to achieve goals Plan revision rules: how to modify plans

Programming Language for Cognitive Agents Programming Instructions to manipulate Data Structures 3APL Programming Constructs to process mental states Select Goals Plan Goals Select Plans Execute Plans Select Rules Apply Rules Agent Interpreter or Agent Deliberation Cycle is a loop consisting of such instructions. The loop determines the behavior of the agent.

3APL Architecture Belief Base Goal Planning Rule Base Goal Base Deliberation Process Plan Base Action Base Plan Revision Rule Base

3APL Deliberation Cycle Start Applying Goal Planning Rules Find PGrules matching goals Rules found? yes Select PGrules matching beliefs Rule selected? yes Apply PGrule no no Sleep until a message arrives no yes Find PRrules matching plans Rules found? yes Select PRrules matching beliefs Applying Plan Revision Rules Rule selected? yes Apply PRrule Rules applied or plans executed? Select plan no Plan selected? Executing Plans yes Execute plan no no

Part I Syntax and Examples

Syntax: belief base BB and goal base GB languages L is the set of first-order literals ψ L + ground (positive literals) ψ 1,..., ψ m L ground (ground literals) φ L + φ 1,..., φ n L BB: GB: ψ x1,...,x n (φ 1... φ n φ) BB ψ 1... ψ m GB x1,...,x n (ϕ) denotes the universal closure of the formula ϕ for every variable x 1,..., x n occurring in ϕ.

Belief Base: An Example c a fl b BB Prolog on(a, fl) on(b, fl) on(a,fl). on(b,fl). on(c, a) clear(b) on(c,a). clear(b). clear(c) clear(fl) clear(c). clear(fl). x, y : on(x, y) y = fl clear(y) clear(y) :- Not on(x,y), Not same(y,fl).

Syntax: Query Language belief query B: if φ 1,..., φ n L +, then B(φ 1... φ n ), B(φ 1... φ n ) Disjunction, Disjunction, if δ, δ Disjunction, then δ δ Disjunction, if δ Disjunction, then δ L B, if β, β L B, then β β L B goal query G: if φ 1,..., φ n L +, then G(φ 1... φ n ) L G, L G, if κ,κ L G, then κ κ L G.

Belief Query: An Example BB: on(a, b) on(b, fl) on(c, fl) x, y : on(x, y) y = fl clear(y) BELIEFBASE: on(a,b). on(b,fl). on(c,fl). clear(y) :- Not on(x,y), Not same(y,fl). B(clear(b)) B(on(a, fl) on(b, fl)) clear(b) on(a,fl) and on(b,fl)

Goal Query: An Example GB: on(a, b) on(b, c), on(d, b) GOALBASE: on(a,b) and on(b,c), on(d,b) G(on(a, b)) on(b, c)) G(on(a, b)) G(on(d, b)) on(a,b) and on(b,c) on(a,b), on(d,b)

Syntax: Actions Mental actions: L ma = { β, α(t 1,..., t n ), (β 1,..., β n ) β L B, β 1,..., β n L, α MentActName, t 1,..., t n Terms} CAPABILITIES: { on(block,from) and clear(to) } Move(Block,From,To) {not on(block,from), on(block,to), clear(from), not clear(to) }

Syntax: Actions External actions: L ea = {Ext(t 1,..., t n ) Ext ExtActName, t 1,..., t n Terms} Java(blockworld,move to(x,y),result) Communication actions: L ca = {Send(r, p, φ) r Aname, p P, φ L + } Send(a,inform,computer(500)) Actions = L ma L ea L ca

Communication Actions: An Example Agent a BELIEFBASE: at time t GOALBASE: Send(b,inform,computer(500)) Agent a BELIEFBASE: sent(b,inform,computer(500)) at time t+1 GOALBASE: Agent b BELIEFBASE: received(a,inform,computer(500)) at time t+1 GOALBASE:

Syntax: Plans empty plan: basic action: test: abstract plan: composite plans: E Plans, Actions Plans, if β L B, then β? Plans, if ρ is a plan name, t 1,..., t n Terms, then ρ(t 1,..., t n ) Plans, if π 1, π 2 Plans and β L B, then π 1 ; π 2, if β then π 1 else π 2 fi, while β do π 1 od Plans PLANBASE: {on(c, A)?; Move(C, A, Fl); Move(A, Fl, B)} {if on(c, A) then Move(C, A, Fl); Move(A, Fl, B) else Move(A, Fl, B)}

Syntax: Planning Goal Rules If β L B, κ L G, and π Plans, then planning goal rules have the following form: κ β π PlanningRules G(on(x, z)) B(on(x, y)) Move(x, y, z) PG-RULES: pos(0,0) <- true { While NOT pos(0,y) Do {GoLeft()}; While NOT pos(x,0) Do {GoUp()} }

Syntax: Plan Revision Rules If β L B and π h, π b Plans, then rules to reason with plans have the following form: π h β π b PlanRevisionRules Move(x, y, z) B(clear(z)) on(u, z)?; Move(u, z, Fl); Move(x, y, z) PR-RULES: GoLeft();X <- pos(0,y) {X} While NOT pos(0,0) Do {GoLeft();GoUp} <- true { While NOT pos(0,0) Do {GoUp;GoLeft()} }

Part II Formal Semantics

Semantics : Agent Configuration Agent Configuration: ι,σ, γ, Π,θ,ξ ι Agents σ L (grounded and consistent) γ {φ i... φ j φ i, φ j,... Atomic} (grounded) such that φ γ : φ = & σ = φ Π Plans θ { [x i /t i ] x i Var, t i Terms, x i Free(t i ) i = j x i = x j } ξ {q(t 1,..., t n ) q R ξ, t 1,..., t n Terms} where R ξ is a set of relations specifying the environment ξ

Semantics : Transition System Transitions between System Configuration ι,σ, γ, Π,θ,ξ ι,σ, γ, Π,θ,ξ Transitions are derived by Transition Rules ι,σ 1, γ 1, Π 1,θ 1,ξ 1 ι,σ 1, γ 1, Π 1,θ 1,ξ 1 ι,σ, γ, Π,θ,ξ ι,σ, γ, Π,θ,ξ Condition ι,σ, γ, Π,θ,ξ ι,σ, γ, Π,θ,ξ

Semantics: Beliefs and Goals (B and G) ι,σ, γ, Π,θ,ξ = ι,σ, γ, Π,θ,ξ = τ Bφ σ = φτ where Var f (φ) dom(τ) ι,σ, γ, Π,θ,ξ = Bφ τ : ι,σ, γ, Π,θ,ξ = τ Bφ ι,σ, γ, Π,θ,ξ = τ δ δ ι,σ, γ, Π,θ,ξ = τ δ or ι,σ, γ, Π,θ,ξ = τ δ ι,σ, γ, Π,θ,ξ = τ β β ι,σ, γ, Π,θ,ξ = τ β and ι,σ, γ, Π,θ,ξ = τ β ι,σ, γ, Π,θ,ξ = Gφ γ = φτ and σ = φτ where Var f (φ) dom(τ) ι,σ, γ, Π,θ,ξ = κ κ ι,σ, γ, Π,θ,ξ = κ and ι,σ, γ, Π,θ,ξ = κ

Example ι, {on(a, b), on(c, fl)}, γ, Π,θ,ξ = B on(a, b) {on(a, b), on(c, fl)} = on(a, b) ι, {on(b, fl)}, {on(a, b) on(b, c), on(c, fl)}, Π,θ,ξ = G on(a, b) {on(a, b) on(b, c)} = on(a, b) and {on(b, fl)} = on(a, b)

Semantics: Mental Actions (α) ι,σ, γ, {(α,κ)},θ,ξ = τ β & T (αθτ,σ) = σ ι,σ, γ, {(α,κ)},θ,ξ ι,σ, γ, {(E,κ)},θ,ξ where γ = γ\{φ γ σ = φ}

Semantics: Mental Actions (α) where ι,σ, γ, {(α,κ)},θ,ξ = τ β ι,σ, γ, {(α,κ)},θ,ξ ι,σ, γ, {(E,κ)},θ,ξ T (αθτ,σ) = σ & γ = γ\{φ γ σ = φ} Example: Assume update function T to be specified by: {pos(x, Y)} Left() {NOT pos(x, Y), pos(x 1, Y)} Then, ι, {pos(2, 3)}, γ, {(Left(),κ)},θ,ξ

Semantics: Mental Actions (α) where ι,σ, γ, {(α,κ)},θ,ξ = τ β ι,σ, γ, {(α,κ)},θ,ξ ι,σ, γ, {(E,κ)},θ,ξ T (αθτ,σ) = σ & γ = γ\{φ γ σ = φ} Example: Assume update function T to be specified by: {pos(x, Y)} Left() {NOT pos(x, Y), pos(x 1, Y)} Then, ι, {pos(2, 3)}, γ, {(Left(),κ)},θ,ξ ι, {pos(1, 3)}, γ, {(E,κ)},θ,ξ

Semantics: Communication Actions (Send) The transition rule for the Send action: ϕ =< s, r, p, ψ > & σ = {sent(r, p, ψ)} ι,σ, γ, {(Send(r, p, ψ),κ)},θ,ξ The transition rule for receiving messages: ϕ =< s, r, p, ψ > & ι = r ϕ! ι,σ σ, γ, {(E,κ)},θ,ξ ι,σ, γ, Π,θ,ξ ϕτ? ι,σ {received(sτ, pτ, ψτ)}, γ, Π,θ,ξ The transition rule for synchronization: A i,ξ ψτ? A i,ξ, A j,ξ ϕ! A j,ξ, ψτ = ϕ {A 1,..., A i,..., A j,..., A n },ξ {A 1,..., A i,..., A j,..., A n},ξ

Semantics: Test Plans (β?) Example: σ = βθτ ι,σ, γ, {(β?,κ)},θ,ξ ι,σ, γ, {(E,κ)},θτ,ξ ι, {pos(1, 2)}, γ, {(pos(x, Y )?,κ)},{[x /1]},ξ

Semantics: Test Plans (β?) Example: σ = βθτ ι,σ, γ, {(β?,κ)},θ,ξ ι,σ, γ, {(E,κ)},θτ,ξ ι, {pos(1, 2)}, γ, {(pos(x, Y )?,κ)},{[x /1]},ξ ι, {pos(1, 2)}, γ, {(E,κ)},{[X /1], [Y /2]},ξ

Semantics: Planning Goal Rule Let the rule κ β π be a variant of a goal rule Example: ι,σ, γ, Π,θ,ξ = τ1 κ & ι,σ, γ, Π,θ,ξ = τ2 βτ 1 ι,σ, γ, Π,θ,ξ ι,σ, γ, Π {(πτ 1 τ 2,κτ 1 )},θ,ξ goto(r) pos(r ) AND door(r, R) Go(R) ι, {pos(r1), door(r1, r2)}, {goto(r2)}, Π,θ,ξ

Semantics: Planning Goal Rule Let the rule κ β π be a variant of a goal rule Example: ι,σ, γ, Π,θ,ξ = τ1 κ & ι,σ, γ, Π,θ,ξ = τ2 βτ 1 ι,σ, γ, Π,θ,ξ ι,σ, γ, Π {(πτ 1 τ 2,κτ 1 )},θ,ξ goto(r) pos(r ) AND door(r, R) Go(R) ι, {pos(r1), door(r1, r2)}, {goto(r2)}, Π,θ,ξ ι, {pos(r1), door(r1, r2)}, {goto(r2)}, Π {(Go(r2), goto(r2))},θ,ξ

Example of a 3APL Program Execution PROGRAM "agent name" CAPABILITIES: { p } α 1 { p } { q } α 2 { q } { q } α 3 { q } BELIEFBASE: p q GOALBASE: g 1, g 2 PLANBASE: α 1 ;α 2 PG-RULEBASE: g 1 p q α 1 ;α 2 g 2 p α 3 PR-RULEBASE: α 2 q α 3 ;α 2

Example of a 3APL Program Execution Actions Beliefs Goals Plans PG-Rules PR-Rules {p}α 1 { p} p q g 1, g 2 α 1 ;α 2 g 1 p q α 1 ;α 2 α 2 q α 3 ;α 2 {q}α 2 { q} g 2 p α 3 { q}α 3 {q} p q p, q p, q p, q p, q p, q α 1 ;α 2 α 2 ɛ α 3 ɛ α 1 ;α 2... g 1, g 2 g 1, g 2 g 1, g 2 g 1, g 2 g 1, g 2 g 1, g 2 p q p, q p, q p, q p, q α 1 ;α 2 α 2 α 2,α 3 α 3 ɛ g 1, g 2 g 1, g 2 g 1, g 2 g 1, g 2 g 1, g 2