Behavioural State Machines (programming modular agents) Peter Novk - - PowerPoint PPT Presentation

behavioural state machines
SMART_READER_LITE
LIVE PREVIEW

Behavioural State Machines (programming modular agents) Peter Novk - - PowerPoint PPT Presentation

Behavioural State Machines (programming modular agents) Peter Novk Clausthal University of Technology, Germany March 27th, 2008 AITA08/AAAI SS 2008, Stanford University, USA Peter Novk Clausthal University of Technology, Germany March


slide-1
SLIDE 1

Behavioural State Machines

(programming modular agents)

Peter Novák

Clausthal University of Technology, Germany

March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 1/16

slide-2
SLIDE 2

Outline

1

Motivation

2

Behavioural State Machines

3

Jazzbot: case study

4

Summary & outlook

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 2/16

slide-3
SLIDE 3

Motivation

Agent programming

Knowledge intensive/cognitive agents

knowledge - attitudes, mental state, state of environment body - sensors/effectors environment system dynamics - reasoning, behaviours and performing actions Challenges for programming frameworks: theoretical properties - insight into system properties verification, analysis, design practical applicability - support of traditional SW development techniques, modularity, integration with external systems (Belief-Desire-Intention metaphor in mind)

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 3/16

slide-4
SLIDE 4

Motivation

Agent programming

Knowledge intensive/cognitive agents

knowledge - attitudes, mental state, state of environment body - sensors/effectors environment system dynamics - reasoning, behaviours and performing actions Challenges for programming frameworks: theoretical properties - insight into system properties verification, analysis, design practical applicability - support of traditional SW development techniques, modularity, integration with external systems (Belief-Desire-Intention metaphor in mind)

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 3/16

slide-5
SLIDE 5

Motivation

My way to go...

Different programming languages are suitable for different knowledge representation tasks. Focus on encoding agent’s behaviours.

Behavioural State Machines

A programming framework with clear separation between knowledge representation and agent’s behaviours. Desiderata: clear semantics modularity (KR, source code) easy integration with external/legacy systems

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 4/16

slide-6
SLIDE 6

Motivation

My way to go...

Different programming languages are suitable for different knowledge representation tasks. Focus on encoding agent’s behaviours.

Behavioural State Machines

A programming framework with clear separation between knowledge representation and agent’s behaviours. Desiderata: clear semantics modularity (KR, source code) easy integration with external/legacy systems

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 4/16

slide-7
SLIDE 7

Motivation

My way to go...

Different programming languages are suitable for different knowledge representation tasks. Focus on encoding agent’s behaviours.

Behavioural State Machines

A programming framework with clear separation between knowledge representation and agent’s behaviours. Desiderata: clear semantics modularity (KR, source code) easy integration with external/legacy systems

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 4/16

slide-8
SLIDE 8

Behavioural State Machines Theoretical framework

BSM overview

core concept: KR module M = (L, Q, U)

L - a KR language, Q - a set of query operators | =: S × L → {⊤, ⊥}, U - set of update operators ⊕ : S × L → S.

BDI agent system beliefs desires intentions capabilities Environment

interpreter interaction rules

query update events actions

QB UD QI UC

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 5/16

slide-9
SLIDE 9

Behavioural State Machines Theoretical framework

BSM Syntax: Query − → Update

query formulae

| = ϕ is a query (ϕ ∈ Li, and | =∈ Ui of a KR module Mi) φ1 ∧ φ2, φ1 ∨ φ2 and ¬φ1 are queries

mental state transformer (mst)

primitive skip is a mst primitive ⊕ψ is a mst (⊕ ∈ Ui, ψ ∈ Li of a module Mi) conditional φ − → τ is a mst (φ is a query, and τ is a mst) choice τ|τ ′ sequence τ ◦ τ ′

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 6/16

slide-10
SLIDE 10

Behavioural State Machines Theoretical framework

BSM Syntax: Query − → Update

query formulae

| = ϕ is a query (ϕ ∈ Li, and | =∈ Ui of a KR module Mi) φ1 ∧ φ2, φ1 ∨ φ2 and ¬φ1 are queries

mental state transformer (mst)

primitive skip is a mst primitive ⊕ψ is a mst (⊕ ∈ Ui, ψ ∈ Li of a module Mi) conditional φ − → τ is a mst (φ is a query, and τ is a mst) choice τ|τ ′ sequence τ ◦ τ ′

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 6/16

slide-11
SLIDE 11

Behavioural State Machines Computational model

Semantics: A = (M1, . . . , Mn, P)

☛ ✡ ✟ ✠ transition system over states σ = σ1, . . . , σn induced by updates ⊕ψ yields(τ, σ, ν)

⊤ yields(skip,σ,∅) ⊤ yields(⊕ψ,σ,{(⊕,ψ)}) update module [{...}] yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,ν) yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,∅) when query module [{...}] then {...} yields(τ1,σ,ν1), yields(τ2,σ,ν2) yields(τ1|τ2,σ,ν1∪ν2) {...} ; {...} yields(τ1,σ,ν1=∅), ∀ρ∈ν1:yields(τ2,σ ρ,νρ) yields(τ1◦τ2,σ,

  • ∀ρ∈ν1

{ρ}•νρ) {...} , {...} // ν1 = {ρν1

1 , . . . ρν1 n } •

// ν2 = {ρν2

1 , . . . ρν2 m }

yields(τ1,σ,∅), yields(τ2,σ,ν2) yields(τ1◦τ2,σ,ν2) ν1 • ν2 = {ρ1 • ρ2|(ρ1, ρ2) ∈ ν1 × ν2} σ ρ1 • ρ2 (σ ρ1) ρ2

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 7/16

slide-12
SLIDE 12

Behavioural State Machines Computational model

Semantics: A = (M1, . . . , Mn, P)

☛ ✡ ✟ ✠ transition system over states σ = σ1, . . . , σn induced by updates ⊕ψ yields(τ, σ, ν)

⊤ yields(skip,σ,∅) ⊤ yields(⊕ψ,σ,{(⊕,ψ)}) update module [{...}] yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,ν) yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,∅) when query module [{...}] then {...} yields(τ1,σ,ν1), yields(τ2,σ,ν2) yields(τ1|τ2,σ,ν1∪ν2) {...} ; {...} yields(τ1,σ,ν1=∅), ∀ρ∈ν1:yields(τ2,σ ρ,νρ) yields(τ1◦τ2,σ,

  • ∀ρ∈ν1

{ρ}•νρ) {...} , {...} // ν1 = {ρν1

1 , . . . ρν1 n } •

// ν2 = {ρν2

1 , . . . ρν2 m }

yields(τ1,σ,∅), yields(τ2,σ,ν2) yields(τ1◦τ2,σ,ν2) ν1 • ν2 = {ρ1 • ρ2|(ρ1, ρ2) ∈ ν1 × ν2} σ ρ1 • ρ2 (σ ρ1) ρ2

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 7/16

slide-13
SLIDE 13

Behavioural State Machines Computational model

Semantics: A = (M1, . . . , Mn, P)

☛ ✡ ✟ ✠ transition system over states σ = σ1, . . . , σn induced by updates ⊕ψ yields(τ, σ, ν)

⊤ yields(skip,σ,∅) ⊤ yields(⊕ψ,σ,{(⊕,ψ)}) update module [{...}] yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,ν) yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,∅) when query module [{...}] then {...} yields(τ1,σ,ν1), yields(τ2,σ,ν2) yields(τ1|τ2,σ,ν1∪ν2) {...} ; {...} yields(τ1,σ,ν1=∅), ∀ρ∈ν1:yields(τ2,σ ρ,νρ) yields(τ1◦τ2,σ,

  • ∀ρ∈ν1

{ρ}•νρ) {...} , {...} // ν1 = {ρν1

1 , . . . ρν1 n } •

// ν2 = {ρν2

1 , . . . ρν2 m }

yields(τ1,σ,∅), yields(τ2,σ,ν2) yields(τ1◦τ2,σ,ν2) ν1 • ν2 = {ρ1 • ρ2|(ρ1, ρ2) ∈ ν1 × ν2} σ ρ1 • ρ2 (σ ρ1) ρ2

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 7/16

slide-14
SLIDE 14

Behavioural State Machines Computational model

Semantics: A = (M1, . . . , Mn, P)

☛ ✡ ✟ ✠ transition system over states σ = σ1, . . . , σn induced by updates ⊕ψ yields(τ, σ, ν)

⊤ yields(skip,σ,∅) ⊤ yields(⊕ψ,σ,{(⊕,ψ)}) update module [{...}] yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,ν) yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,∅) when query module [{...}] then {...} yields(τ1,σ,ν1), yields(τ2,σ,ν2) yields(τ1|τ2,σ,ν1∪ν2) {...} ; {...} yields(τ1,σ,ν1=∅), ∀ρ∈ν1:yields(τ2,σ ρ,νρ) yields(τ1◦τ2,σ,

  • ∀ρ∈ν1

{ρ}•νρ) {...} , {...} // ν1 = {ρν1

1 , . . . ρν1 n } •

// ν2 = {ρν2

1 , . . . ρν2 m }

yields(τ1,σ,∅), yields(τ2,σ,ν2) yields(τ1◦τ2,σ,ν2) ν1 • ν2 = {ρ1 • ρ2|(ρ1, ρ2) ∈ ν1 × ν2} σ ρ1 • ρ2 (σ ρ1) ρ2

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 7/16

slide-15
SLIDE 15

Behavioural State Machines Computational model

Semantics: A = (M1, . . . , Mn, P)

☛ ✡ ✟ ✠ transition system over states σ = σ1, . . . , σn induced by updates ⊕ψ yields(τ, σ, ν)

⊤ yields(skip,σ,∅) ⊤ yields(⊕ψ,σ,{(⊕,ψ)}) update module [{...}] yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,ν) yields(τ,σ,ν), σ| =φ yields(φ− →τ,σ,∅) when query module [{...}] then {...} yields(τ1,σ,ν1), yields(τ2,σ,ν2) yields(τ1|τ2,σ,ν1∪ν2) {...} ; {...} yields(τ1,σ,ν1=∅), ∀ρ∈ν1:yields(τ2,σ ρ,νρ) yields(τ1◦τ2,σ,

  • ∀ρ∈ν1

{ρ}•νρ) {...} , {...} // ν1 = {ρν1

1 , . . . ρν1 n } •

// ν2 = {ρν2

1 , . . . ρν2 m }

yields(τ1,σ,∅), yields(τ2,σ,ν2) yields(τ1◦τ2,σ,ν2) ν1 • ν2 = {ρ1 • ρ2|(ρ1, ρ2) ∈ ν1 × ν2} σ ρ1 • ρ2 (σ ρ1) ρ2

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 7/16

slide-16
SLIDE 16

Behavioural State Machines Computational model

Semantics cont.

BSM computation step

A BSM A = (M1, . . . , Mn, P) induces a transition σ → σ′ iff the program P yields an update set ν = ∅ in σ, ⊘ψ ∈ ν is an update and σ′ = σ ⊘ψ.

BSM semantics (operational view)

A sequence σ1, . . . , σi, . . ., s.t. σi → σi+1, is a trace of BSM. An agent system (BSM), is characterized by a set of all traces.

BSM semantics (functional view)

yields(τ, σ, ν) a set of enabled updates in states code modularity

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 8/16

slide-17
SLIDE 17

Behavioural State Machines Computational model

Semantics cont.

BSM computation step

A BSM A = (M1, . . . , Mn, P) induces a transition σ → σ′ iff the program P yields an update set ν = ∅ in σ, ⊘ψ ∈ ν is an update and σ′ = σ ⊘ψ.

BSM semantics (operational view)

A sequence σ1, . . . , σi, . . ., s.t. σi → σi+1, is a trace of BSM. An agent system (BSM), is characterized by a set of all traces.

BSM semantics (functional view)

yields(τ, σ, ν) a set of enabled updates in states code modularity

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 8/16

slide-18
SLIDE 18

Behavioural State Machines Computational model

Semantics cont.

BSM computation step

A BSM A = (M1, . . . , Mn, P) induces a transition σ → σ′ iff the program P yields an update set ν = ∅ in σ, ⊘ψ ∈ ν is an update and σ′ = σ ⊘ψ.

BSM semantics (operational view)

A sequence σ1, . . . , σi, . . ., s.t. σi → σi+1, is a trace of BSM. An agent system (BSM), is characterized by a set of all traces.

BSM semantics (functional view)

yields(τ, σ, ν) a set of enabled updates in states code modularity

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 8/16

slide-19
SLIDE 19

Behavioural State Machines Computational model

Abstract interpreter

input: agent program P, initial mental state state σ0 σ = σ0 loop compute ν, s.t. yields(P, σ, ν) if ν = ∅ then non-deterministically choose ρ ∈ ν σ = σ ⊕ ρ end if end loop

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 9/16

slide-20
SLIDE 20

Behavioural State Machines Computational model

Example: office space robot

/∗ Initialization ∗/ declare module beliefs as ASP declare module goals as Prolog declare module body as Java /∗ initializations omitted ∗/ /∗ Default operation ∗/ when sense body [{ (Battery.status() == OK) }] then { /∗ Roam around ∗/ perform body [{ Motors.turn(Rnd.get(), Rnd.get()) }] ; perform body [{ Motors.stepForward() }] } else { /∗ Safe emergency mode − degrade gracefully ∗/ perform body [{ Face.smile(off) }] ; perform body [{ InfraEye.switch(off)}] ; update goals [{ assert(dock) }] } ; /∗ Interruption handling ∗/ when sense body (X) [{ Visual.see(X) }] and query beliefs (X) [{ friend(X), not met(X) }] then { perform body [{ Face.smile(on) }] , perform body [{ Audio.say("Hello!") }] , adopt beliefs (X) [{ met(X) }] } Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 10/16

slide-21
SLIDE 21

Jazzbot: case study

Jazzbot

Bot in a simulated 3D environment. A case study application/proof-of-concept for BSM/Jazzyk. test-bed for various KR technologies in agent setting test-bed for applications of evolving KBs/LP updates in a dynamic, single agent scenario (DLP) challenging, dynamic, unstructured and rich environment

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 11/16

slide-22
SLIDE 22

Jazzbot: case study

Jazzbot overview

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 12/16

slide-23
SLIDE 23

Summary & outlook

Summary, open issues

Behavioural State Machines & Jazzyk

An implemented hybrid programming framework with clear separation between knowledge representation and agent’s behaviours. heterogeneous KR technologies clear semantics source-code modularity: code blocks, macro pre-processor easy integration with external systems/environments Hot topic: methodology How to build such agents? What about BDI? Goal-oriented behaviours?

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 13/16

slide-24
SLIDE 24

Summary & outlook

Summary, open issues

Behavioural State Machines & Jazzyk

An implemented hybrid programming framework with clear separation between knowledge representation and agent’s behaviours. heterogeneous KR technologies clear semantics source-code modularity: code blocks, macro pre-processor easy integration with external systems/environments Hot topic: methodology How to build such agents? What about BDI? Goal-oriented behaviours?

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 13/16

slide-25
SLIDE 25

Summary & outlook

Related work

AgentSpeak(L) family - Jason, 3APL, 2APL, GOAL, etc. rule based syntax

  • perational semantics: transition system

IMPACT - framework for heterogeneous agent systems strong KR modularity differences in semantics, code modularity, scripting

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 14/16

slide-26
SLIDE 26

Summary & outlook

On-going and future work

methodology

higher level programming constructs:

goals commitment strategies modal logics(?)

Jazzbot

towards a public system demonstration goal-oriented behaviours multi-agent setting communication, richer LP updates, agent platform integration

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 15/16

slide-27
SLIDE 27

Summary & outlook

Thank you for your attention.

http://jazzyk.sourceforge.net/

Peter Novák · Clausthal University of Technology, Germany March 27th, 2008 AITA’08/AAAI SS 2008, Stanford University, USA 16/16