A specification language for agents observable behaviour

7
A Specification Language for Agents Observable Behaviour Mirko Viroli Andrea Omicini Abstract—One of the main issues in the engineering of multi-agent systems is to give a precise semantics to agent communicative acts, by specifying how agent interactions with the environment affect and are affected by the agent inner status – namely, by the decisions it takes and by its perception of the world. In this paper, we tackle this prob- lem by modelling agents as observable sources, that is, as proactive and autonomous abstractions manifesting an ob- servable status and dynamics, and allowing external enti- ties to perceive and alter it. Based on this idea, an ab- stract language for specifying agents observable behaviour is presented, providing the designer with a tool for pre- cisely characterising the relationship between agents inter- nal aspects and agents collaborative aspects. We claim that this language can be the basis for a successful engineering methodology for agent-based systems where the concept of observation is taken as a foundational issue. Index Terms—Agent Communication Languages, Agent Architectures, Formal Specification Languages, Agent- Oriented Software Engineering I. Introduction Modelling agents behaviour is a difficult challenge for software engineers, especially as far as both agent deliber- ation and agent collaborative aspects are concerned. On the one hand, agents are too complex abstractions to be modelled as white-box entities whose behaviour is fully known and represented, since agent inner machinery often hides cumbersome activities such as planning and infer- ence. Also, unknowability comes in when applying agents as abstractions to tackle legacy systems, that is, wrapping those components that, independently from their complex- ity, are no longer completely known, but still provide reli- able services. On the other hand, modelling agents as pure black-box entities, known only in terms of the set of actions they are able to perform on the environment, is often a too se- vere constraint, which badly supports a true engineering methodology. While this modelling technique is quite tra- ditional in the field of concurrency theory, being the basis of the observational equivalence approach of process alge- bras [1], it seems somehow inadequate to agent-based sys- tems. In fact, autonomy makes agent interactions loosely coupled with agent inner activity, so that simply observing an agent interaction histories often provides very limited information on the actual status of the agent – its percep- tion of the world, its goals, its intentions, and so on. For instance, an agent receiving a message provides very few information about its actual effect on the agent behaviour, for the agent can simply decide to ignore it. This work has been partially supported by MIUR, and by Nokia Research Center, Burlington, MA, USA. M. Viroli and A. Omicini are with DEIS, Universit`a degli Studi di Bologna, via Rasi e Spinelli 176, 47023 Cesena (FC), Italy – email: {mviroli,aomicini}@deis.unibo.it As a result, the most reasonable way to tackle the prob- lem of agent modelling seems to rely on an intermediate ap- proach, namely a grey-box approach [2], where most agent inner details are abstracted away, and only the aspects re- lated to the agent observable behaviour are explicitly repre- sented. In particular, this is somehow equivalent to provid- ing an abstract architecture for agents, and describing the semantics of agent interactions by focussing on how agent dynamics results in sending and receiving communicative acts. The most notable example of this approach is the se- mantics proposed by the Foundation for Intelligent Phys- ical Agents organisation (FIPA) to its Agent Communi- cation Language (ACL) [3]. In this proposal, any agent’s communicative act is formally described in terms of feasi- ble preconditions (FP) that must hold in the act’s sender, and rational effects (RE) that the sender may suppose to occur on the receiver – even though these effects are not actually mandatory for the receiver, because of its need to preserve autonomy. In particular, the specification of FPs and REs is given in terms of the Semantic Language (SL) [4], a multi-modal logic language with operators for Beliefs (B), Desires (D), Intentions (I), and Uncertain Beliefs (U) based on the BDI framework [5]. As discussed in detail in [6], providing this formal semantics for communicative acts is conceptually equivalent to implicitly assuming an abstract architecture for agents taking as primary concepts the notion of agent perception of the world (beliefs and un- certain beliefs), agent goals (desires), and agent plans for achieving that goals (intentions). However, as pointed out in a number of papers [6], [7], [8], such an approach is of- ten too specifically based on the concept of agent mental state, so that it is not widely useful to support a general description of agent communicative acts. In fact, agents are often applied as wrappers for legacy systems, physical resources, knowledge sources, or as sim- ple active software components participating in well-known interaction protocols. There, agents are not suitable for a BDI implementation, so that a specification based on the concept of an agent mental state is rather useless. More- over, that specification also provides a too complex mod- elling tool for allowing basic engineering support, such as proving conformance of an implementation with respect to a specification [9]. In general, exploiting the grey-box approach introduces a serious challenge, calling for abstract architectures that are loosely coupled with the actual agent implementation, and that capture at the desired level of abstraction the aspects of interest of the agent observable part. So, based on our work in [6], [10], we provide an abstract architecture for agents built on the idea of modelling agents taking the

Transcript of A specification language for agents observable behaviour

A Specification Language for Agents ObservableBehaviour

Mirko Viroli Andrea Omicini

Abstract—One of the main issues in the engineering ofmulti-agent systems is to give a precise semantics to agentcommunicative acts, by specifying how agent interactionswith the environment affect and are affected by the agentinner status – namely, by the decisions it takes and by itsperception of the world. In this paper, we tackle this prob-lem by modelling agents as observable sources, that is, asproactive and autonomous abstractions manifesting an ob-servable status and dynamics, and allowing external enti-ties to perceive and alter it. Based on this idea, an ab-stract language for specifying agents observable behaviouris presented, providing the designer with a tool for pre-cisely characterising the relationship between agents inter-nal aspects and agents collaborative aspects. We claim thatthis language can be the basis for a successful engineeringmethodology for agent-based systems where the concept ofobservation is taken as a foundational issue.

Index Terms—Agent Communication Languages, AgentArchitectures, Formal Specification Languages, Agent-Oriented Software Engineering

I. Introduction

Modelling agents behaviour is a difficult challenge forsoftware engineers, especially as far as both agent deliber-ation and agent collaborative aspects are concerned. Onthe one hand, agents are too complex abstractions to bemodelled as white-box entities whose behaviour is fullyknown and represented, since agent inner machinery oftenhides cumbersome activities such as planning and infer-ence. Also, unknowability comes in when applying agentsas abstractions to tackle legacy systems, that is, wrappingthose components that, independently from their complex-ity, are no longer completely known, but still provide reli-able services.

On the other hand, modelling agents as pure black-boxentities, known only in terms of the set of actions theyare able to perform on the environment, is often a too se-vere constraint, which badly supports a true engineeringmethodology. While this modelling technique is quite tra-ditional in the field of concurrency theory, being the basisof the observational equivalence approach of process alge-bras [1], it seems somehow inadequate to agent-based sys-tems. In fact, autonomy makes agent interactions looselycoupled with agent inner activity, so that simply observingan agent interaction histories often provides very limitedinformation on the actual status of the agent – its percep-tion of the world, its goals, its intentions, and so on. Forinstance, an agent receiving a message provides very fewinformation about its actual effect on the agent behaviour,for the agent can simply decide to ignore it.

This work has been partially supported by MIUR, and by NokiaResearch Center, Burlington, MA, USA.

M. Viroli and A. Omicini are with DEIS, Universita degli Studi diBologna, via Rasi e Spinelli 176, 47023 Cesena (FC), Italy – email:{mviroli,aomicini}@deis.unibo.it

As a result, the most reasonable way to tackle the prob-lem of agent modelling seems to rely on an intermediate ap-proach, namely a grey-box approach [2], where most agentinner details are abstracted away, and only the aspects re-lated to the agent observable behaviour are explicitly repre-sented. In particular, this is somehow equivalent to provid-ing an abstract architecture for agents, and describing thesemantics of agent interactions by focussing on how agentdynamics results in sending and receiving communicativeacts.

The most notable example of this approach is the se-mantics proposed by the Foundation for Intelligent Phys-ical Agents organisation (FIPA) to its Agent Communi-cation Language (ACL) [3]. In this proposal, any agent’scommunicative act is formally described in terms of feasi-ble preconditions (FP) that must hold in the act’s sender,and rational effects (RE) that the sender may suppose tooccur on the receiver – even though these effects are notactually mandatory for the receiver, because of its need topreserve autonomy. In particular, the specification of FPsand REs is given in terms of the Semantic Language (SL)[4], a multi-modal logic language with operators for Beliefs(B), Desires (D), Intentions (I), and Uncertain Beliefs (U)based on the BDI framework [5]. As discussed in detailin [6], providing this formal semantics for communicativeacts is conceptually equivalent to implicitly assuming anabstract architecture for agents taking as primary conceptsthe notion of agent perception of the world (beliefs and un-certain beliefs), agent goals (desires), and agent plans forachieving that goals (intentions). However, as pointed outin a number of papers [6], [7], [8], such an approach is of-ten too specifically based on the concept of agent mentalstate, so that it is not widely useful to support a generaldescription of agent communicative acts.

In fact, agents are often applied as wrappers for legacysystems, physical resources, knowledge sources, or as sim-ple active software components participating in well-knowninteraction protocols. There, agents are not suitable for aBDI implementation, so that a specification based on theconcept of an agent mental state is rather useless. More-over, that specification also provides a too complex mod-elling tool for allowing basic engineering support, such asproving conformance of an implementation with respect toa specification [9].

In general, exploiting the grey-box approach introducesa serious challenge, calling for abstract architectures thatare loosely coupled with the actual agent implementation,and that capture at the desired level of abstraction theaspects of interest of the agent observable part. So, basedon our work in [6], [10], we provide an abstract architecturefor agents built on the idea of modelling agents taking the

concept of observation as a foundation.In our methodology, agents are modelled as observ-

able sources, that is, as software components storing someknowledge and providing services for manifesting its dy-namics to the environment, and for allowing the environ-ment to affect it. This framework has been shown to suit-ably support the modelling of important aspects of agents[10], such as reactiveness, proactiveness, social attitude,and autonomy [11], and to allow for encoding typical agentinteraction schemata [12]. In general, this model seemsto provide a good level of abstraction in describing therelationships between agent internal behaviour and agentcollaborative behaviour, that is, between an agent’s innerbehaviour and its interaction with the environment.

As a further step towards building a full engineeringmethodology for agent-based systems – including specifica-tion, design, implementation, and validation – in this paperwe provide a language for specifying an agent observablebehaviour in terms of the observable source model. Thislanguage defines signature, structure, and dynamics of theobservable source abstract architecture, borrowing somefeatures from logic languages, and providing a declarative,high-level specification. Then, we provide a semantics forthis specification in terms of transition systems, by char-acterising agents as abstractions evolving through the in-teractions with the environment – namely, by providingoutput messages either as response to an input message,or due to the occurrence of internal events modelling proac-tivity.

The remainder of this paper is as follows. Section IIdescribes in an informal way our abstract architecture foragents. Section III introduces syntax and semantics of thespecification language, and Section IV discusses a simpleapplication example. Finally, Section V provides conclud-ing remarks.

II. Modelling Agents as Observable Sources

The reference agent model for our approach is that ofan observable source [12], [6], [10]. This is based on anontology for the observation issue in computer systems de-veloped in [13], where a formal framework is developedthat describes how software components – coming fromthe wide are of computer systems – allow observation oftheir status and its dynamics by the environment. Thiswork inspired a modelling technique based on the conceptof observation, where software components are thought ofas (observable) sources cooperating with observers and co-ordinators. Observers are interested in perceiving manifes-tations of the source status and its dynamics, representedby the output messages it sends. Coordinators conditionthe source observable behaviour so as to set up interactionwith observers, by sending input messages to the source.Interpreting agents as sources according to this ontologymeans to see agents in terms of the abstract architectureshown in Figure 1.

An agent is conceptually divided in two parts: the agentobservable core and the agent internal machinery. On theone hand, the agent observable core is the part of the agent

Cnd

Mnf

Cagent

internal

machinery

Spn

observers

coordinators

P

agent observable core

P C

CuPuEng

Fig. 1. Agent abstract architecture

that is explicitly represented by the model, specifying howconditionings (Cnd) are handled and how manifestations(Mnf) are produced – that is, specifying the agent inter-active behaviour. On the other hand, the agent internalmachinery is the part of the agent that is abstracted away– typically involving complex aspects such as agent delib-eration, planning, and inference. This division is generallynecessary in order to deal with both the need of abstractingaway from complex details while focusing on the interac-tive behaviour – which is a general practice for harnessingcomplexity [14], [15] –, and the need for representing causesand effects of agent interactions in terms of its internal sta-tus.

Our model goes on to the details of the observable corepart dynamics, and to its relationship with both the envi-ronment and the agent internal machinery. The observablecore is made of the agent place (P), representing the agentpart (or abstract view) of the status affecting and affectedby the environment, and the agent configuration (C), stor-ing information on the interactions the agent is in chargeof handling. Agent dynamics is either reactive, when theagent receives a conditioning, or proactive, when a sponta-neous move (Spn) occurs within its place. While the for-mer takes into account the effect of the environment on theagent, the latter is meant to represent how the agent inter-nal machinery can affect the observable behaviour. Noticethat our framework enjoys an interesting property: agentinternal machinery is abstracted away, but is anyway takeninto account as far as it can affect the agent observable be-haviour – namely, by means of the notion of spontaneousmove.

Either conditionings and spontaneous moves are pro-cessed by the agent core engine (Eng), generally producinga change on the core state, in terms of a place update (PU)and a configuration update (CU), and some manifestationsto be produced and sent out to observers. So, from thepoint of view the of the agent interactions with the environ-ment, this model both represents (i) the agent reactivelyreplying to an input message (a conditioning) by send-ing output messages (manifestations) and by updating itsstate (place and configuration), and (ii) the agent proac-tively sending output messages and updating its state as aconsequence of an internal event (a spontaneous move).

III. The Specification Language

In this section, we provide syntax and semantics of aspecification language for agents observable behaviour. Inshort, the language is an abstract tool for formally describ-ing the dynamics of an agent core and of the manifestationsit produces as an effect of the conditionings it receives andthe spontaneous moves occurring in it. Thus, semanticsis given by providing a mapping between the specificationand a labelled transition system representing the agent asan interactive software abstraction.

A. Syntax

The language borrows some aspects from the notation oflogic languages such as Prolog. Let φ range over the finiteset F of (logic) functions, each with a given arity, ν overthe finite set V of variables, and τ over the set T of termsbuilt with functions and variables as:

τ ::= ν | φ(τ1, . . . , τn)

Let σ range over the finite set of predicate symbols, and ψover the set of predicates (atomic formulae), built applyingpredicate symbols to terms:

ψ ::= σ(τ1, . . . , τn)

The complete abstract syntax of our specification languageis shown in Figure 2.

The specification of an agent observable core is asso-ciated to a name represented by term τN – which maye.g. identify the role of the agent within the Multi-AgentSystem (MAS) – and is mainly made by three parts: asignature, a structure, and a description of its dynamics.

The first part of the specification, the agent signature,defines the set of admissible conditionings, spontaneousmoves, and manifestations for the agent. Both condi-tioning, spontaneous moves, and manifestations are rep-resented in form of elements κ, that is, as collections ofterms. Any element κ = τ:-ψ1

w, . . . , ψnw represents the set

of terms matching τ and whose variables satisfy conditionsψ1w, . . . , ψ

nw. Applying a conditions production is always

optional.The second part of the specification is the agent struc-

ture, defining the shape of place and configuration, as wellas the ways they can evolve. In particular, κP representsa generic place with initial state τ inP ; and similarly, κCrepresents the generic configuration with initial state τ inC .The dynamics of both place and configuration – that is,the place and configuration updates along with their effecton place and configuration state – is described by a setof transition rules transition∗, each specifying a label τlab,an old state τf , a new state τt, and a list of conditions tobe satisfied, expressed by predicates ψ1

w, . . . , ψnw. In the

case of place specification, each transition rule means thatif the conditions associated to all predicates ψiw are satis-fied, then the place update τlab makes the place τf moveto τt. Configuration specification is handled similarly. No-tice that we suppose conditionings to be particular cases of

spec ::= agent τN {import constraintssignature structure dynamics

}

import ::= import predicates {σ1/i1, . . . , σn/in}from libname

constraints ::= global conditions {ψ1, . . . , ψn}

signature ::= signature {conditionings {κ1

CND ; . . . ;κnCND ; }spontaneous moves {κ1

SPN ; . . . ;κnSPN ; }manifestations {κ1

MNF ; . . . ;κnMNF ; }}

structure ::= structure {place {

state {κP } initially [τ inP ]updates { transition∗}}configuration {

state {κC} initially [τ inC ]updates { transition∗}

} }

dynamics ::= dynamics {reactiveness { firing rule∗ }proctiveness { firing rule∗ }}

transition ::= τlab : FROM [τf] TO [τt] conditions;

firing rule ::= τtrig in [τ0P ],[τ

0C]: fires

<PU [τPU ],CU [τCU ],MNF [τMNF]>conditions;

conditions ::= [:- ψ1w, . . . , ψ

nw]

κ ::= τ conditions

Fig. 2. Syntax of the Specification Language

configuration updates, and spontaneous moves to be par-ticular cases of place updates.

Finally, agent dynamics defines how conditionings andspontaneous moves are processed, in terms of how they af-fect place and configuration, and what manifestations theyproduce – that is, the behaviour of the core engine part.In particular, firing rules in the reactiveness part describethe effect of conditionings, while those in the proactivenesspart describe the effects of spontaneous moves. Each firingrule specifies the effect of a triggering event τtrig (either aconditioning or spontaneous move, respectively) on a corein place τ0

P and configuration τ0C : if optional conditions

ψiw are satisfied, then place update τPU and configurationupdate τCU are applied, and manifestation τMNF is sentout – conceptually representing either one ore more outputmessages.

A library file can also be specified (import) to importthe predicate symbols used throughout the specification– namely, used to define the predicates ψ appearing asconditions. Also, we suppose that the semantics of thesesymbols is defined by the library file, in terms of the logictheory used to check for the succeeding predicates. Forinstance, a library file can be a Prolog database definingthe semantics of the imported predicate symbols. A libraryfile is generally useful to support low-level functionalities,such as the management of lists, multisets, functions, and

so on.Global conditions can be also defined (constraints) that

are used to specify conditions to be satisfied throughoutthe whole specification, typically constraining the set ofterms that can be substituted to a given variable, in anytransition rule, firing rule, or κ definition. Their semanticsis simply given by supposing that a pre-processor actuallyadds global constraints to predicate lists in any conditionsproduction.

B. Labelled Transition Systems

Labelled transition systems are a very simple, yet pow-erful framework to denote the operational semantics of in-teractive systems. As surveyed e.g. in [16], they allowfor expressing a wide set of different equivalence and pre-order semantics over interactive software systems. Thesemathematical tools, for instance, allows for deciding sub-stitutability of two software components, and for checkingconformance of a component implementation with respectto an abstract specification of its behaviour.

Since labelled transition systems generally provide foran high expressive and abstract framework for specifyinginteractions of software components, in this paper we de-fine the semantics of our specification language in term of amapping on a labelled transition system. Formally speak-ing, a (labelled) transition system [16] is a triple 〈S,→, A〉,where S is said to be the set of states, A is the set of ac-tions, and →⊆ S × A× S is a transition relation, writings

a−→ s′ when 〈s, a, s′〉 ∈→.The common interpretation of this mathematical struc-

ture is as a specification of the interactions between a soft-ware component and its environment. While S is the set ofprocess states, or rather of the states of the software com-ponent of interest, A is the set of actions the process is ableto perform on the environment, e.g. representing eitherreceiving or sending messages. Correspondingly, symbols

a−→ s′ means that the process in state s may move to states′ by performing action a. Notice that this framework isintrinsically non-deterministic: (i) when both s

a−→ s′ ands

b−→ s′ hold, either actions a or b can be performed fromstate s, (ii) when s

a−→ s′ and sa−→ s′′ hold, by performing

a from state s the system may move either to s′ or to s′′.In order to define the content of a transition relation so

as to define the semantics of the transition system, it isusual practice to specify one or more rules of the kind

condition

σα−→ σ′

where σ and σ′ are formulae denoting elements in S, α is aformula denoting an action in A, and condition is a pred-icate on the free variables of σ, σ′, and α. The intendedsemantics of these rules is that s a−→ s′ holds if and only ifthere is one variable substitution to be applied to one ruleso that (i) its condition is satisfied and (ii) its formulae σ,σ′, and α are bounded respectively to s, s′, and a. Whenno condition has to be specified, only the downside part of

the rule is written, meaning that any substitution of thefree variables can be applied.

C. Semantics

Given a setX we generally let meta-variable x range overX, and x⊥ over the set X⊥ = X ∪{⊥X}, where ⊥X (or ⊥for short) is typically considered an exception value overX. Given a variable-to-term substitution θ ∈ Θ = V 7→T , its application to a term τ or predicate ψ – causingsubstitution of their variables – is denoted by symbols τθand ψθ. In order to provide semantics to a specification, wetake as reference the symbols used in Figure 2: for instance,we generally denote by symbol κP the definition of place.Then, when it is useful to denote a term or predicate intoith transition or firing rule in a production, this is taggedby symbols P B i (for place update transitions), C B i(for configuration update transitions), π B i (for proactivefiring rules), and ρB i (for reactive firing rules) – e.g., termφlab denoting the label into ith transition of place updatespecification is written φPBilab .

In order to define the semantics of our language, we sup-pose that the (imported) logic theory that gives semanticsto predicate symbols is always able to decide about suc-ceeding predicates in finite time. Under this assumption,we denote by |= ψ the fact that checking predicate ψ suc-ceeds.

First of all, we associate to any element κ of the specifica-tion the set |κ| of matching terms satisfying its conditions,defined as:

|τ :- ψ1w, . . . , ψ

nw| = {τθ : ∀k, θ |= ψkwθ}

By this notion, we define P = |κP | as the set of places,C = |κC | as the set of configurations, Spn =

⋃j |κ

jSPN | as

the set of spontaneous moves, Cnd =⋃j |κ

jCND | as the set

of conditionings, and Mnf =⋃j |κ

jMNF | as the set of man-

ifestations. Place updates PU and configuration updatesCU are defined as the sets of terms matching labels τlaband satisfying predicates ψw in transition rules for placeand configuration, respectively. Formally:

PU = {φPBilab θ : ∀k, θ, i |= ψk,PBiw θ}CU = {φCBilab θ : ∀k, θ, i |= ψk,CBiw θ}

Transitions for place updates and configurations updatesare given a semantics in terms of transition systems〈P,−→P,PU 〉 and 〈C,−→C,CU 〉, that is, they de-fine the content of relations −→P⊆ P × PU × P and−→C⊆ C × CU × C. For instance, notations p

pu−→P p′

means that place may move from p to p′ when placeupdate pu occurs. In particular, relation −→P is formallydefined by the two rules:

∀k |= ψk,PBiw θ

τPBif θτPBilab θ−−−−→P τ

PBit θ

τnull−−→P τ

where null is a special constant (a 0-ary logic function)automatically defining trivial transitions moving a term

to itself. Analogously, for configuration updates we have:

∀k |= ψk,CBiw θ

τCBif θτCBilab θ−−−−→C τCBit θ

τnull−−→C τ

As already mentioned, we also suppose by constructionthat Spn ⊆ PU and Cnd ⊆ CU , so that transitionsfor place and configuration also give a semantics tospontaneous moves and conditionings. In order to avoidunnecessary specification, we also assume that placeupdates and configuration updates default to the trivialsemantics when their effect is not specified in the agentstructure, that is:

@θ, i : τPBilab θ = pu

ppu−→P p

@θ, i : τCBilab θ = cu

ccu−→C c

In a mostly similar way, firing rules are given a semanticsin terms of definitions:

CBρ ⊆ (Cnd× P × C)× (PU⊥ × CU⊥ ×Mnf ⊥)CBπ ⊆ (Spn× P × C)× (PU⊥ × CU⊥ ×Mnf ⊥)

and by means of rules:1

∀k |= ψk,πBiw θ

〈τπBitrig θ, τ0,πBiP θ, τ0,πBi

C θ, τπBiPU θ, τπBiCU θ, τπBiMNFθ〉 ∈ CBπ

∀k |= ψk,ρBiw θ

〈τρBitrigθ, τ0,ρBiP θ, τ0,ρBi

C θ, τρBiPU θ, τρBiCU θ, τρBiMNFθ〉 ∈ CBρ

where special term null occurring as either place up-date, configuration update, or manifestation is giveninterpretation ⊥. Analogously to the case of place andconfiguration updates, we suppose that spontaneousmoves and conditionings default to the trivial evaluationas follows:

@θ, i : τπBitrig θ = spn

〈spn, p, c,⊥,⊥,⊥〉 ∈ CBπ@θ, i : τρBitrigθ = cnd

〈cnd, p, c,⊥,⊥,⊥〉 ∈ CBρ

Now, the semantics of the whole specification language isdefined by an association between an agent specificationand a transition system:

〈P × C,−→Obs, (Cnd×Mnf ⊥) ∪ (Spn×Mnf ⊥)〉

The state of an agent at any time is modelled as a couple〈p, c〉 with p current place (state) and c current configu-ration (state). Actions are of two kinds: reactive actions〈cnd,mnf ⊥〉 denoted by symbol cndBmnf ⊥, and proactiveaction 〈spn,mnf ⊥〉 denoted by spn �mnf ⊥. Notation

〈p, c〉 cndBmnf⊥−−−−−−−→Obs 〈p′, c′〉1 In particular, there we straightforwardly extended the definition

“by rules” of transition systems to the specification of relations ingeneral, with obvious semantics.

means that the agent with place p and configuration c re-ceives conditioning cnd, moves to place p′ and configura-tion c′, and sends manifestation mnf ⊥ (or nothing if thisis ⊥). In the same way, notation

〈p, c〉 spn�mnf⊥−−−−−−−→Obs 〈p′, c′〉

means that the agent with place p and configuration c per-forms spontaneous move spn, moves to place p′ and config-uration c′, and sends manifestations mnf ⊥. In particular,relation −→Obs is defined by rules:

p0spn−−→P p

〈spn, p′, c0, pu⊥, cu⊥,mnf ⊥〉 ∈ CBπp′

pu⊥−−→P p c0cu⊥−−→C c

〈p0, c0〉spn�mnf⊥−−−−−−−→Obs 〈p, c〉

c0cnd−−→C c′

〈cnd, p, c′, pu⊥, cu⊥,mnf ⊥〉 ∈ CBρc′

cu⊥−−→C c p0pu⊥−−→P p

〈p0, c0〉cndBmnf⊥−−−−−−−→Obs 〈p, c〉

In the former case, a spontaneous move spn occurs in theagent which updates the place from p0 to p′ and which isintercepted by the core engine, producing (i) a place up-date cu⊥ moving place from c0 to c, (ii) a configurationupdate pu⊥ moving configuration from c′ to c, and mani-festation mnf ⊥ to be sent out. Analogously, the latter rulehandles the case of a conditioning.

The specification in Figure 2 also defines the initial statefor the agent 〈τ inP , τ inC 〉 ∈ P×C, which has to be consideredas initial state of the transition system −→Obs.

D. Specification of an agent observable behaviour

We summarise here the logic steps that an user shouldfollow so as to provide an useful specification of the observ-able behaviour of an agent of interest. Not surprisingly,we will find many similarities with common concepts ofobject-oriented languages, so that the definition of an agentabstract architecture can somehow be thought of as an ex-tension to the notion of an abstract class of object-orientedlanguages.

The specification of an agent, as shown in Figure 2,should actually define the observable behaviour of a classτN of agents, each adhering to the same kind of observablebehaviour. Following the traditional terminology, a spec-ification can be easily associated to the notion of agentrole.

First of all, the predicates defining the low-level func-tionalities used in the specification should be importedfrom a library file. Importing an external logic theory al-lows us to separate two important concerns: the aspectsrelated to the interactive behaviour of the agent, and themanagement of data values (and their types). While theformer issue is the one our model is meant to focus on,the latter can be abstracted away by the idea of definingpredicate symbols semantics outside the specification.

agent believer {import predicates {

inF/1, inV/1, inA/1, isfun/1, funupd/4, funval/3,ismset/1, msetadd/3} from lib.pl

constraints {inF(F), inA(A), inV(V), isfun(Fn), isfun(Fn1),ismset(Ms), ismset(Ms1)}signature{

conditionings { ask(F,A); askwhen(F,A); prop(F,V); }spontaneous moves { newK(F,V); eval;}manifestations { send(A,V); sendMany(Ms,V); }}structure{

place{state {p(Fn,P);} initial [p(null,null)]updates {

newK(F,V): FROM [p(Fn,P)] TO [p(Fn1,P)]:-funupd(Fn,F,V,Fn1);

add(F,V): FROM [p(Fn,null)] TO [p(Fn,pr(F,V))];eval: FROM [p(Fn,P)] TO [p(Fn,null)];

} }

configuration{state {c(Fn)} initial [c(null)]updates {

askwhen(F,A): FROM [c(Fn)] TO [c(Fn1)]:-funval(Fn,F,Ms),msetadd(Ms,A,Ms2),funupd(Fn,F,Ms,Fn1);

remall(F): FROM [c(Fn)] TO [c(Fn1)]:-funupd(Fn,F,null,Fn1)

} } }dynamics{

reactiveness{ask(F,A) in [p(Fn,P)],[c(Fn1)]: fires

<PU [null],CU [null],MNF [send(A,V)]>:-funval(Fn,F,V);

prop(F,V) in [p(Fn,P)],[c(Fn1)]: fires<PU [add(F,V)],CU [null],MNF [null]>;

}proactiveness{

newK(F,V) in [p(Fn,P)],[c(Fn1)]: fires<PU [null],CU [remall(F)],MNF [sendMany(Ms,V)]>:-

funval(Fn1,F,Ms);} } }

Fig. 3. Specification for agent believer

Then, the global variables along with their global con-straints have to be specified. The definition of global con-straints provides a list of predicates that should be satisfiedthroughout the specification, so as to constrain the usage ofthe set of variables they are built over. These variables canbe considered as global variables of the specification, withthe global constraints defining how they can be actuallyexploited. So, by the constraints construct the specifica-tion defines the global variables along with their intendedtype.

The next step is the definition of the agent signature,providing the terms that define conditionings, spontaneousmoves, and manifestations. They basically describe theboundary of the agent observable core, with conditioningsand spontaneous moves interpreted as input actions, andmanifestations as output actions. Agent signature can beconsidered as a high-level syntactic description of the agentbehaviour, with no meaning associated to inputs and out-puts, similarly e.g. to the declaration of an interface inobject oriented languages.

Consequently, the agent structure has to be defined thatspecify details of the structure and dynamics of the ob-servable core. This defines the shape of place and con-figuration, their initial state, and how they can evolve byplace updates and configuration updates. Since sponta-neous moves are subsets of place updates and conditioningsare subsets of configuration updates, agent structure alsogives a semantics to the conceptual inputs of the observablecore, in terms of how they act on place and configuration.Agent structure represents an high level description of theparts of the agent state and its dynamics that are relevantto the aim of defining the agent observable behaviour, ab-stracting away from all those aspects that do not directlyaffect the agent interaction, accordingly to the grey-boxmodelling approach.

Finally, the agent dynamics part is to be defined thatseparately describes the agent reactive behaviour and the

agent proactive behaviour. In particular, it describes theeffect of the reactive inputs (conditionings) and proactiveinputs (spontaneous moves) in terms of how they changethe agent state, and how they lead to outputs (manifesta-tions). Given the definition of the agent structure, involv-ing the lowest-level details of the specification, the dynam-ics part concisely represent the agent interactive behaviour.

IV. Example

In order to provide some flavour and more details onthe specification language presented in this paper, here wegive an application example based on a simple yet paradig-matic agent behaviour. We consider an agent storing someknowledge – e.g., representing its perception of the world itinhabits – and allowing other agents to query it so as to beinformed when some of its part updates, and to proposenew information. In particular, we provide examples ofmodelling agent reactivity (as replying to queries), agentproactivity (as informing the environment when an inter-nal event occurs), and agent autonomy (as proposals forchanges possibly not taken into account). Other featuresand interaction patterns typically occurring in agent-basedsystems are analised in [12], where their encoding into theobservable source model are provided and discussed. Inour model, knowledge is represented as a partial functionfrom facts to values, external entities query for or proposethe value associated to a given fact. The specification ofthis agent, or rather of this role, which we call believer, isshown in Figure 3.

Imported predicates basically define abstract data typesand some simple operations on them, including the typesfor agents, values, facts, lists, and multisets. Theirstraightforward implementation – which could be easilyprovided e.g. in Prolog – is avoided here for brevity; theirinformal meaning is as follows. Constants represent eitheragents (A), values (V), or facts (F); correspondingly, predi-cates isA/1, isV/1, and isF/1 check for a term belonging to

one of these sets. Terms can also represent multisets (e.g.,implemented as lists), with ismset/1 checking whether aterm is a multiset, and with msetadd(M,E,N) being truewhen multiset N is obtained by adding element E to mul-tiset M. Functions are also handled, with isfun/1 checkingfor a term belonging to the set of functions (e.g., imple-mented as lists of couples 〈x, f(x)〉). funupd(F,D,R,F2) istrue when F2 is obtained by function F adding associa-tion D 7→ R, and funval(F,D,R) is true when R is the valueassociated by function F to D.

Constraints assign types to some global variables,namely A being an agent, F a fact, V a list, Fn and Fn1lists, Ms and Ms1 multisets.

The agent signature describes (reactive and proactive)inputs, and outputs of the agent. Conditioning ask(F,A)models an external entity A querying for current value as-sociated to fact F, askwhen(F,A) models A willing to be in-formed when value associated to F changes, and prop(F,V)a proposal for associating value V to fact F. Spontaneousmoves are of the kind (i) newK(F,V), representing the agentchanging its knowledge of fact F to value V, and (ii) eval,modelling the agent evaluating a proposal for knowledgechange. Manifestations are either responses send(A,V) toask conditionings, or a multiset of them sendMany(Ms,V)sending value V to all agents in multiset Ms.

The agent structure provides the abstract description ofthe observable core and its dynamics. Places contain boththe knowledge function, and information on a proposedchange pr(F,V) that still has to be evaluated, configurationis a function from facts to multisets of agents interested intheir changes. Other place updates include add(F,V), in-serting a proposal of knowledge change pr(F,V) in the place,while configuration update remall(F) removes all registra-tions for changes on the value associated to fact F.

The agent dynamics describes the interactive behaviourof the agent. Conditioning ask is reactively processed, im-mediately causing the reply to be manifested to the re-questor. Conditioning prop changes the observable status(source place) of the agent, waiting to be actually con-sidered by spontaneous move eval. Then, spontaneousmove newK models a change on knowledge, possibly caus-ing manifestations to be sent to interested observers.

Notice that in this kind of modelling, agent’s internalaspects such as evaluation of proposals and deliberation ofknowledge changes are completely abstracted away – whichwould typically have involved the most complex formalisa-tions – but their effect are anyway taken into account andmodelled as spontaneous moves. In this way, all the possi-ble observable behaviours of the agent can be indeed rep-resented by the model, in spite of the simple specificationprovided.

V. Conclusions

In agent-based systems, agents are typically proactiveand autonomous abstractions, with their own local control,perception of the world, and ability to decide what actionsto perform. On the other hand, agents often have also arole in a society, that is, they represent peculiar problem-

solvers in groups carrying on social tasks. Typically, thissocial attitude is exploited by means of interaction proto-cols that the agent realises with other agents in the MAS.

The specification language introduced in this paper hasthe goal to provide the designer with a tool for reason-ing about how agent internal aspects concerning its au-tonomy and proactivennes influence and are influenced bythose agent aspects devoted at managing the interactionswith the environment. This issue is of great concern, andrequires an engineering methodology where these aspectsare specified in detail and exploited for specifying, design-ing, implementing, and validating the behaviour of MAS.We believe that the observation framework exploited inthis paper can be a suitable support for developing thismethodology, which will be subject of our future researchefforts.

References

[1] Jan A. Bergstra, Alban Ponse, and Scott A. Smolka, Eds., Hand-book of Process Algebra, North-Holland, Amsterdam, London,New York, Oxford, Paris, Shannon and Tokyo, 2001.

[2] Mirko Viroli and Andrea Omicini, “Tuple-based models in theobservation framework,” in Coordination Languages and Mod-els. 2002, vol. 2315 of LNCS, pp. 364–379, Springer-Verlag, 8–11Apr. 2002, York, UK.

[3] FIPA, “FIPA communicative act library specification,”http://www.fipa.org, 2000, Doc. XC00037H.

[4] M.D. Sadek, “Attidues mentales et interaction rationellle: Versune theorie formelle de la communication,” These de DoctoratInformatique, Universite de Rennes I, France, 1991., 1991.

[5] A.S. Rao and M.P. Georgeff, “BDI agents: From theory topractice,” in First International Conference on Multi-AgentSystems (ICMAS’95), San Francisco (CA), 1995, pp. 312–319.

[6] Mirko Viroli and Andrea Omicini, “Towards an alternative se-mantics for FIPA ACL,” in 16th European Meeting on Cyber-netics and Systems Research (EMCRS 2002), Vienna, Austria,3–5 Apr. 2002.

[7] Munindar P. Singh, “Agent communication languages: Rethink-ing the principles,” IEEE Computer, vol. 31, no. 12, pp. 40–47,1998.

[8] Jeremy Pitt and Ebrahim Mamdani, “A protocol-based seman-tics for an agent communication language,” in 16th Intl. JointConf. on Artificial Intelligence (IJCAI ’99), Thomas Dean, Ed.,Stockholm, Sweden, 1999, pp. 486–491, Morgan Kaufmann.

[9] Michael Wooldridge, “Verifiable semantics for agent communi-cation languages,” in 3rd Intl. Conf. on Multi Agent Systems(ICMAS ’98), Yves Demazeau, Ed., Paris, France, 4–7 July1998, IEEE Press.

[10] Mirko Viroli and Andrea Omicini, “Modelling agents as observ-able sources,” Journal of Universal Computer Science, vol. 8,2002.

[11] Michael Woolridge, Reasoning about Rational Agents, The MITPress, Cambridge, Massachusetts, and London, England, 2000.

[12] Mirko Viroli and Andrea Omicini, “Specifying agents’ observ-able behaviour,” in 1st International Joint Conference on Au-tonomous Agents and Multi-Agent Systems (AAMAS 2002),Bologna, Italy, 15–19 July 2002, ACM.

[13] Mirko Viroli, Gianluca Moro, and Andrea Omicini, “On ob-servation as a coordination pattern: An ontology and a formalframework,” in 16th ACM Symposium on Applied Computing(SAC 2001), Las Vegas (NV), 11–14 Mar. 2001, pp. 166–175.

[14] Robin Milner, Communication and Concurrency, Prentice Hall,Campus 400, Marylands Avenue, Hemel Hempstead, Hertford-shire, HP2 7EZ, UK, 1989.

[15] Peter Wegner, “Why interaction is more powerful than comput-ing,” Communications of the ACM, vol. 40, no. 5, pp. 80–91,May 1997.

[16] R.J. van Glabbeek, “The linear time – branching time spectrumI. The semantics of concrete, sequential processes,” In Bergstraet al. [1], chapter 1, pp. 3–100.