AFormal Emb edding of AgentSp eakL in 3APL

Ko en Hindriks, Frank S. de Bo er, Wieb e van der Ho ek and John-Jules Ch. Meyer

University Utrecht, Department of

P.O. Box 80.089, 3508 TB Utrecht, The Netherlands

fko enh,frankb,wieb e,[email protected]

Abstract

Agent-based computing in Arti cial Intelligence has given rise to a numb er of diverse and

comp eting prop osals for agent programming languages. Agents, in the sense we are using

it, are complex mental entities consisting of b eliefs, goals, and intentions. For several

reasons it has b een dicult to evaluate and compare the di erent prop osals for agent

languages. One of the main reasons, in our opinion, is the lack of a general semantic

framework which provides a suitable basis for language comparison. Our aim is to make

as much use as p ossible of formal metho ds from the area of programming semantics. In

this pap er, we give a formal emb edding of the agent language AgentSp eakL in our own

agent language 3APL. To this end we de ne a notion of simulation based on the formal

op erational semantics of the languages. The main result of the pap er is a pro of that 3APL

can simulate AgentSp eakL. As a consequence, 3APL has at least the same expressive

power as AgentSp eakL. The comparison yields some new insights into the features of the

agent languages. One of the results is that AgentSp eakL can b e substantially simpli ed.

1 Intro duction

Agent-based computing in Arti cial Intelligence has given rise to a numb er of diverse and

comp eting prop osals for agent programming languages. Agents, in the sense we are using

it, are complex mental entities comprising the b eliefs, goals, and intentions of agents. For

several reasons it has b een dicult to evaluate and compare the di erent prop osals for agent

languages.

One of the reasons for this, we think, is the lack of a general semantic framework which

provides a suitable basis for language comparison. Our aim is to makeasmuch use as p ossible

of formal metho ds from more traditional computing science to deal with these issues. In [4]

weintro duced the agent 3APL triple-a-p-l and formally de ned its

semantics. In that pap er, we informally compared our programming language with several

other programming languages for agents prop osed in the literature. The most imp ortant

characteristic of our language is that it is rule-based. This is a characteristic which it shares

with two other well-known agent languages, AgentSp eakL [8] and AGENT-0 [11].

A more detailed comparison of rule-based agent programming languages yields a b etter

understanding of these languages. It yields new insights into the features that are character-

istic of agent languages, and into the agent concept itself. In this pap er, we give a formal

emb edding of AgentSp eakL in 3APL based on the formal op erational semantics of the lan-

guages. An emb edding of a language in another language is a translation of agents of the 1

source language, in our case AgentSp eakL, into agents of the target language, 3APL, and a

pro of that the latter can simulate the former. Since the semantics of AGENT-0 is only given

informally in [11], we cannot construct an emb edding for AGENT-0 agents. However, the

language 3APL, which has a formal semantics, might b e used to de ne the formal semantics

of AGENT-0 or an abstraction of AGENT-0.

The structure of this pap er is as follows. In section 2 we give an informal overview of

3APL and AgentSp eakL. In section 3 we will give an outline of the pro of that 3APL has

at least the same expressivepower as AgentSp eakL, i.e. that 3APL can simulate Agent-

Sp eakL. Weintro duce the notion of translation bisimulation which is the formal concept

that makes our claims precise. In the next two sections we prove that 3APL can simulate

AgentSp eakL. We pro ceed in two steps, and rst de ne a translation from AgentSp eakL

to a language called AgentSp eak1. In the second step, a translation from AgentSp eakL

to a subset of 3APL is de ned. In section 6 we end with some conclusions.

2 Overview of AgentSp eakL and 3APL

The languages AgentSp eakL and 3APL have many similarities. The most imp ortantof

these is that b oth languages are rule-based. In AgentSp eakL the rules emb o dy the know-

how of the agent, and are used for planning. The informal reading of these rules reads: If the

agentwants to achieve goal G and b elieves that situation S is the case, then plan P might

b e the right thing to do. The same typ e of rules for planning are available in 3APL. Toavoid

confusion, we will call these rules plan rules and we will call the b o dy P of such a rule a plan.

Other typ es of rules are conceivable, and are also included in 3APL. These second typ e of

rules are used for other purp oses than planning what to do, for example, for goal revision cf.

[4, 3].

An agent of the programming language AgentSp eakL consists of beliefs, goals, plan rules,

intentions, and events which make up its mental state. An agent also has an asso ciated set

of actions for changing its environment. To b egin with the latter, actions are executed as

a result of executing adopted plans. Adopted plans are called intentions in AgentSp eakL,

and actions are one of the constituents of intentions.

The beliefs represent the situation the agent thinks it is in. In AgentSp eakL twotyp es of

goals are distinguished: achievement goals and test goals. A test goal is a check on the set of

b eliefs of the agent to nd out if something is b elieved to b e the case or not. An achievement

goal is a state of a airs desired by the agent. The means to achieve that state are provided

by plan rules. An attempt to accomplish an achievement goal is initiated by a search in the

plan library for a plan rule that provides the appropriate means to succeed. If such a plan

rule is found, the agent will b egin acting up on the plan as sp eci ed by the rule.

Plans are hierarchically structured, i.e. a plan may include new subgoals for achieving a

higher-level goal. For these subgoals the agent also needs to nd suitable plans. The agent

keeps track of these plans whichwere adopted to achieve its subgoals by creating a stackof

plans which is called an intention. Eachentry of such a stack is a plan for the rst subgoal

in the plan of the next entry on the stack, except for the last entry.

An agent executes the plans which o ccur in its intentions. One of the plans is selected for

execution, and may sp ecify either that the agent should execute an action or that the agent

should accomplish a subgoal. In the case that a an achievement goal is the next thing to

accomplish, a so-called event is triggered to signal that a suitable plan for the subgoal must 2

b e found. Events might also b e triggered on other o ccasions. For example, an event might

b e triggered to record that a change in the b elief base of the agent has o ccurred. However,

the semantics of the latter typeofevents is not formally de ned in AgentSp eakL.

An agent of the programming language 3APL consists of beliefs, goals, and practical rea-

soning rules which make up its mental state and has a set of asso ciated basic actions which

provide for the capabilities of the agent for changing its environment. Basic actions are one of

the constituents of plans as in AgentSp eakL, and are formally de ned as up date op erators

on the b eliefs of the agent. A set of beliefs called a b elief base is used by the agent to represent

the situation the agent thinks he is in.

Goals have more structure than in AgentSp eakL. Goals in 3APL incorp orate achievement

goals as well as the adopted plans to achieve goals of the agent. A goal is comp osed of

achievement goals, to achieve a desired state of a airs, basic actions, tests. These constituents

of goals are comp osed by means of sequential, alternative, and parallel comp osition. Because

3APL goals have more structure than AgentSp eakL goals and are the adopted plans of the

agent, they are more like the intentions of AgentSp eakL. In this pap er, we formally show

that AgentSp eakL intentions corresp ond to goals in 3APL.

Practical reasoning rules serve several purp oses. They provide the means to achieve

subgoals of the agent. This is similar to AgentSp eakL. However, practical reasoning

rules have a more complex structure than the plan rules of AgentSp eakL. A practical rea-

soning rule also provides the means for mo difying complex goals of the agent, instead of just

providing the means for achievement goals. The latter typ e of rules can b e used to express

things like: If the agent has adopted a plan P to achieve a goal G, and b elieves S is the

0

case, then the agent should consider revising plan P and substitute it with a new plan P

0

or goal G .

This concludes our short summary of AgentSp eakL and 3APL. For the details, the reader

is referred to [8] for AgentSp eakL and to [4,3] for 3APL, and the discussion in the rest of this

pap er. The op erational semantics of AgentSp eakL as well as that of 3APL formally sp ecify

the exact meaning of the informal concepts whichwere outlined in the previous paragraphs.

3 Comparing the ExpressivePower of Programming Languages

The main contribution of this pap er consists in a formal pro of that the computational b e-

haviour of AgentSp eakL agents can b e simulated by 3APL agents in a natural way. It

follows from this result that 3APL has at least the same expressivepower as AgentSp eakL.

The pro of of this claim is based on two concepts: that of a computation, and that of

observation. The concept of a computation is de ned by the op erational semantics of a

programming language. The concept of observation is a state-based concept, derived from

that of an agent. Agents are the entities of a programming language which are executed, and

give rise to computations.

An agent is able to simulate another agentifevery legal  nite or in nite computation of

the latter agent is matched by a legal computation of the rst agent. The notion of matching

is derived from the notion of observation. The concept of simulation is used to compare the

expressivepower of AgentSp eakL relative to 3APL. To compare the expressivepower of

AgentSp eakL and 3APL wethus havetodotwo things: i wehave to nd a corresp onding

3APL agent for each AgentSp eakL agent, and ii wehave to show that the computations

of the AgentSp eakL agent are simulated by that of the 3APL agent. 3

The op erational semantics of all agent programming languages other than AgentSp eakL

in this pap er are sp eci ed by means of Plotkin-style transition systems [7]. Wehave tried

to stay as close as p ossible to the original de nition of the semantics of AgentSp eakL as

given in [8]. The semantics of AgentSp eakL is de ned by a slightly di erent and somewhat

weaker formalism. It is quite easy,however, to transform the semantics of AgentSp eakL into

a transition system, as we will show. Both semantic formalisms de ne a transition relation

which formalises the computational b ehaviour of an agent. A transition relation ! is a

relation on agents that de nes the legal computation steps of agents.

De nition 3.1 computation

0

Let ! b e a transition relation on agents. A ! A is called a computation step of agent

A. A nite or in nite sequence of agents A ;A ;::: such that A ! A for all i is called

1 2 i i+1

a computation.

The comparison of two agents we will use in this pap er is based on a comparison of the

set of possible computation steps of the agents. The basic idea is that each computation step

of one of the agents is matched or simulated by a computation step of the other agent, and

vice versa. The comparison based on this idea is called strong bisimulation in the literature

cf. [6, 5]. A bisimulation is a binary relation b etween agents, based on a transition relation

which de nes the legal computation steps of agents.

To b e able to compare computation steps of agents we need to make explicit when com-

putation steps match with each other. In action-based semantics, transitions are lab elled by

actions, and it is easy to state such a condition: two computation steps match if they have

the same action lab els cf. [5]. In case a state-based, unlab elled transition semantics is used,

as is the case for the agent programming languages in this pap er, the matching needs to b e

based on a state-based concept. We use the state-based concept of an observable.For now,

we will assume that a function O : A! , where A is a set of agents and is the set of

observables, has b een given and de nes the notion of observable. The function O allows us

to observe changes in an agent during its execution.

De nition 3.2 strong bisimulation

Let A and B be two sets of agents. A binary relation R AB over agents is a bisimulation

if A; B  2 R implies,

0 0 0 0 0

i Whenever A ! A then, for some B , B ! B , and A ;B  2 R,

0 0 0 0 0

ii Whenever B ! B then, for some A , A ! A , and A ;B  2 R, and

iii O A=O B .

The notion of strong bisimulation is the basic to ol we use for comparing agents. However,

we will maketwochanges to obtain a somewhat more suitable notion for our purp oses. First

of all, the notion of strong bisimulation requires that each computation step of one agentis

matched by a computation step of the other agent. However, we might argue that computation

0 0

steps A ! A such that O A=O A  are not observable, and do not havetobesimulated.

We call such steps internal or stuttering steps. The notion that we obtain by allowing that

internal steps of one agent are matched by zero or more internal steps of the other agentis

called weak bisimulation. 4

De nition 3.3 derivedtransition relation 



Let ! b e a transition relation on agents from A, and ! denote the re exive, transitive

closure of !.

i

 the internal step transition relation ! is obtained by restricting !:

0 0 0

A ! A i A ! A and O A= O A ,

i

0 0

 the derivedtransition relation  is de ned by: A  A i there are agents X; X 2A

 0 0 0  0

such that A ! X , X ! X or X = X , and X ! A .

i i



Note that ! . Given that  is the derived transition relation of !,we can de ne

i

weak bisimulation. The de nition of strong bisimulation 3.2 and that of weak bisimulation

3.4 are very similar. The di erence is that a weak bisimulation allows that an internal step is

simulated by zero or more internal steps and allows that a non-internal step is simulated by

anumber of internal steps and one non-internal step. Note that every strong bisimulation is

aweak bisimulation.

De nition 3.4 weak bisimulation

Let A and B be two sets of agents. A binary relation R AB over agents is a weak

bisimulation if A; B  2 R implies,

0 0 0 0 0

i Whenever A ! A then, for some B , B  B , and A ;B  2 R,

0 0 0 0 0

ii Whenever B ! B then, for some A , A  A , and A ;B  2 R, and

iii O A=O B .

For our purp oses, we make a second change to the de nition of bisimulation to obtain

a sp ecialised variantofweak bisimulation which relates two agents of p ossibly di erent

0

languages. We assume that a metho d for mapping an agent from language L to an agent from

a language L is given. Such a metho d is called a translation function. If a translation function

 de nes a weak bisimulation R, i.e.  = R,we obtain a sp ecial case of weak bisimulation

also called a p-morphism in the literature cf. [10]. A p-morphism is a bisimulation such

that the bisimulation relation is a function. This sp ecialised notion of bisimulation yields

a concept suitable to compare the expressivepower of agent programming languages. In

general, however, the sets of observables of two di erent languages are di erent. Therefore,

0

weintro duce a mapping called a decoder. A deco der maps observables from language L back

0

onto observables of L we are assuming that L simulates L, but not necessarily vice versa.

De nition 3.5 translation bisimulation

Let ! , ! be two transition relations de ned on the sets of agents A and B , resp ectively.

A B

Let  : A! Bb e a total mapping from A to B . Furthermore, O : A! and

A A

O : B! are two functions de ning the observables of agents from the A and B .

B B

Then:  is a translation bisimulation if B =  A implies,

0 0 0 0

 Whenever A ! A , then B  B , where B =  A ,

A B

0 0 0 0 0

 Whenever B ! B , then for some A , A  A such that B =  A , and

B A

 There is a decoder  : ! such that  O B  = O A.

B A B A 5 L A A'

τ δ τ

τ(A) τ(A')

L’

Figure 1: Translation Bisimulation

Figure 1 illustrates the concept of a translation bisimulation as de ned in 3.5. Note

that, although not depicted in the gure, the simulating agentmay execute more than one

step on condition that these steps are internal steps. A translation function  maps an

0

agent A 2Ato an agent  A 2B.For any agent A and a computation step A ! A

A

0

there must b e a corresp onding computation  A   A  which has the same observable

B

e ects. This is de ned formally in the rst and third conditions in the de nition of translation

bisimulation, and assures that the b ehaviour pro duced by an agent from A can b e simulated

by the translated agent  A. The third condition requires a deco der for proving that the

observables pro duced by an agent from A can b e retrieved from the observable b ehaviour

of the corresp onding agent from B . In the other direction, wehavetomake sure that only

the b ehaviour pro duced by the agent from A is generated and no other observable b ehaviour

is pro duced by the agent  A from B . This is formally captured by the second condition

in de nition 3.5. It states that it must b e p ossible to simulate any computation step of

the translated agent from B by the agent from A, with the same observable e ects. Again,

we need the deco der to map the observables corresp onding to the agents from B backonto

observables corresp onding to agents from A. Note that in case the deco der  is the identity

function translation bisimulation just is a p-morphism.

The notion of translation bisimulation sp eci es a numb er of requirements whichmust hold

for a language to have at least the same expressivepower as another language. To compare

0

the expressivepower of two programming languages L and L ,we need to nd a translation

bisimulation relating al l agents in the source language L to some suitable set of agents from the

0

target language L .However, this notion is still not strong enough to de ne expressivepower.

The reason is that any reasonable programming language is Turing-complete, and for this

reason any programming language can simulate another programming language. Therefore,

we will imp ose one more constraint on the translation function  : A translation function

should also preserve the global structure of an agent cf. [2]. Such a constraint seems b oth

intuitive and reasonable.

In general this constraint can b e formalised by the requirement that the translation func-

tion  and the deco der  are compositional:Every op erator op of the source language is

translated into a context C [X ;:::;X ] assuming that n is the arityofop of the target

1 n

language such that a program op A ;:::;A  is translated into C [ A ;:::;A ]. In order

1 n 1 n

to account for the complex structure of an agent that is, its various comp onents comprising

its b eliefs, goals, intentions, etc. we will assume that an agent is a tuple A = hE ;:::;E i,

1 n

where each of the E is a subset of the expressions of a programming language L, i.e. E L.

i i

Moreover we assume that the expressions in L are inductively de ned, and we require that the

translation function  is de ned comp ositionally as de ned ab ove. A mapping from agents 6

hE ;:::;E i from L to agents hF ;:::;F i is induced by  by means of a pre-sp eci ed se-

1 n 1 m

lection criterion which determines for each expression e 2 E a corresp onding target F such

i j

that  e 2 F . In this manner we allow the simulation of the di erent comp onents of an

j

agent.

De nition 3.6 expressibility

Let O : A! and O : B! be two functions from the set of al l agents A from L

A A B B

0

and some suitable set of agents B from L to the corresp onding sets of observables.

0

Then wesay that L has at least the same expressive power as L if there is a mapping  : A!B

and a mapping  : ! which satisfy the following conditions:

B A

E1  and  are comp ositional,

E2  is a translation bisimulation.

0 0

Let L L b e shorthand for L has at least the same expressivepower as L. Then it

0

follows from de nition 3.6 that  is transitive. So, if L has at least the expressivepower

00 0 00

of L, and L has at least the expressivepower of L , then we also have that L has at least

the expressivepower of L. The result follows from the fact that the comp osition of two

comp ositional translation functions again is comp ositional and the fact that comp osing two

translation bisimulations again yields a translation bisimulation.

A slightly stronger notion than that of expressivepower is the notion of eliminabil ityof

a programming op erator. A programming op erator is eliminable from a given programming

language if the op erator can b e expressed by other op erators in the same language. A simple

example from imp erative programming is the eliminabil i ty of the rep eat ::: until op erator

in the presence of the while op erator.

De nition 3.7 eliminability

Let O : A! and O : B! be two functions from the set of al l agents A from L

A A B B

0

and some set of agents B from L to the corresp onding sets of observables.

Then wesay that a programming op erator F in the language L is eliminable if there is a

mapping  : A!B and a mapping  : ! which satisfy the following conditions:

B A

F1  and  are comp ositional,

F2  is a translation bisimulation, and

0 0

F3 L L, in particular F is not a programming op erator of L .

F1 and F2 are equivalenttoE1 and E2 in de nition 3.6. As will b ecome clear later

on, the de nition allows that minor mo di cations are made to the semantics of the subset

of the original language to comp ensate for the lack of the eliminated op erator. This will b e

illustrated in this pap er by the elimination of the notion of event from AgentSp eakL.

3.1 Outline of the Pro of

The pro of of the claim that 3APL has at least the same expressivepower as AgentSp eakL

consists of two steps. These steps corresp ond to the two main conceptual di erences b etween

AgentSp eakL and 3APL. The concepts referred to are, resp ectively, the concept of event

and the concept of intention, which do not haveanobvious counterpart in 3APL. In the 7

rst step section 4, we construct an intermediate language called AgentSp eak1 whichis

a subset of AgentSp eakL that do es not include events. We show that AgentSp eak1 has

at least the same expressivepower as AgentSp eakL. As a consequence, wehave that events

are eliminable in the formal sense of de nition 3.7. This shows that the notion of eventis

redundant in AgentSp eakL.

In the second step of the pro of section 5, we show that AgentSp eakL intentions can

b e transformed into 3APL goals. For this purp ose, we use a subset of 3APL called Agent-

Sp eak2. We show that AgentSp eak2 has at least the same expressivepower as Agent-

Sp eak1. By transitivity, it then follows that 3APL has at least the same expressivepower of

AgentSp eakL, since each of the intermediate programming languages de ned in the trans-

formation steps have at least the same expressivepower as AgentSp eakL.

4 The Eliminabil ityofEvents

In this section we de ne a comp ositional translation function  of AgentSp eakL to a lan-

1

guage without events, called AgentSp eak1, and show that AgentSp eak1 has at least the

same expressivepower as AgentSp eakL. First, the syntax and semantics of the two languages

AgentSp eakL and AgentSp eak1 are de ned. The de nition of the syntax and semantics

of AgentSp eakL is based on the description of AgentSp eakL in [8]. The semantic rules

have b een changed at a numb er of places, however, to correct for some omissions in [8]. The

semantics of AgentSp eak1 is given by means of a Plotkin-style transition system.

4.1 The Syntax of AgentSp eakL

The b eliefs of AgentSp eakL agents are given by a fragment of rst-order logic, namely the

set of literals. A signature for this language provides for the vo cabulary to construct terms

and formulae in the usual way.

De nition 4.1 signature for AgentSpeakL

A signature for AgentSp eakL is a tuple hPred; Func; Cons; Actsi where

 Pred is a set of predicate symbols,

 Func is a set of function symbols,

 Cons is a set of constant symbols,

 Acts is a set of action symbols.

We assume that Pred, Func, Cons, and Acts are disjoint sets.

De nition 4.2 terms

Let Var b e a set of variables. The set of terms T is inductively de ned by:

[Syn-1] Var T,

[Syn-2] Cons T,

[Syn-3] If f 2 Func of arity n and t ;:::;t 2 T, then f t ;:::;t  2 T.

1 n 1 n 8

De nition 4.3 belief atoms, literals

The set of atoms At and literals Lit are de ned by:

[Syn-4] At = fP t ;:::;t  j P 2 Pred of arity n; t ;:::;t 2 Tg,

1 n 1 n

[Syn-5] Lit = At [:At .

A ground atom is also called a base belief. The set of literals are called belief literals.

De nition 4.4 actions

The set of actions A is de ned by:

[Syn-6] If a 2 Acts of arity n and t ;:::;t 2 T, then at ;:::;t  2 A.

1 n 1 n

The actions of an agent are the basic means of the agenttochange its environment. The

set of these actions can b e viewed as sp ecifying the capabilities of the agent.

De nition 4.5 goals

The set of AgentSp eakL goals G is de ned by:

[Syn-7] If  2 At, then ! 2 G,

[Syn-8] If  2 At, then ? 2 G,

A goal ! is called an achievement goal.Anachievement goal ! expresses that the agent

has a goal to achieve a state of a airs where  is the case. A goal ? is called a test goal.A

test goal is a test on the b elief base to check if something is or is not b elieved to b e the case.

De nition 4.6 triggering events

The set of triggering events E is de ned by:

t

[Syn-9] If ! 2 G, then +! 2 E .

t

In [8], four typ es of triggering events are de ned. Besides the triggering event+! in def-

inition 4.6, three other typ es of triggering events, !; +?, and ?, are de ned. Triggering

events are triggered when an addition + or deletion - to the set of goals or b eliefs o ccurs.

The formal semantics in [8], however, do es not makeany reference to the last three triggering

events. Therefore, we do not consider the latter typ e of triggering events in this pap er. The

triggering event+! is generated in case a plan for an achievement goal ! has to b e found.

The triggering event is p osted when the agent tries to execute a plan and encounters a subgoal

!.Itthus signals the need for a plan for !.

De nition 4.7 plan rules

The set of plan rules P is de ned by:

[Syn-10] If e 2 E , b ;:::;b are b elief literals, and h ;:::;h 2 G [ A, then

t 1 m 1 n

e : b ^ :::^ b  h ; :::; h 2 P.

1 n 1 n

De nition 4.8 head, context, body

Let e : b ^ :::^ b  h ; :::; h b e a plan rule.

1 n 1 n 9

 e : b ^ :::^ b is called the head of the plan rule,

1 n

 h ; :::; h is called the body of the plan rule, and

1 n

 b ^ :::^ b is called the context of the plan rule.

1 n

We will also call the b o dy of a plan rule the plan sp eci ed by the rule. Plan rules in

AgentSp eakL sp ecify the means for achieving a goal, and can b e viewed as recip es co ding

the know-how of the agent. The triggering event in the head of the plan rule indicates the

achievement goal for which the b o dy of the plan rule sp eci es the means for accomplishing

it. Recall that a triggering event signals the need to nd a plan for the corresp onding

achievement goal. The context of the plan rule describ es the circumstances whichmust hold

for the plan to b e a suitable option. Empty b o dies are allowed in plan rules. We use the

symbol  to denote an empty body. The reason for intro ducing this feature is that it serves

to simplify the pro of rules of AgentSp eakL.

De nition 4.9 intentions

The set of intentions I is de ned by:

[Syn-11] If p ;:::;p 2 P, then [p z :::zp ] 2 I.

1 z 1 z

Intentions are stacks of plans whichkeep track of the adopted plans to achieve goals of

the agent. A plan in a stack is supp osed to sp ecify the means for a subgoal in a plan at the

next entry in the stack if there is suchanentry. The stackthus keeps a record of all the

plans adopted for all the subgoals encountered so far in the plans on the stack. An intention

is constructed during execution. In case the agent encounters an achievement goal in a plan

in an intention that it is executing, an event is generated. A suitable instance of a plan is

searched for, and in case such a plan is found, it is added to the stack. Therefore, not all

intentions of the form as sp eci ed in Syn-11 are legal, since the de nition allows plans at an

entry in the stack which are unrelated to the next entry in the stack. Suchintentions are not

allowed. Up on completion of the execution of a plan in an intention the plan rule is removed

again. The symbol T is used to denote the intention [+!true : true  ] and is called the true

intention.

De nition 4.10 events

The set of events E is de ned by:

[Syn-12] If e 2 E and i 2 I, then he; ii2 E.

t

Events are pairs of triggering events and intentions. The intention part of an event indi-

cates whichintention gave rise to the triggering event. An event of the form he; T i is called

an external event. All other events are called internal events. As we will see, external events

are never generated by the AgentSp eakL agent itself the true intention T do es not give rise

to triggering events. This may imply that they only have meaning in a multi-agent setting.

De nition 4.11 AgentSpeakL agents

An agent is a tuple hE; B; P; Ii, where

 E E is a set of events, 10

 B At is a set of base beliefs,

 P P is a set of plans, and

 I I is a set of intentions.

AgentSp eakL agents consist of b eliefs, intentions, and plan rules. Agents also keep a

record of the events that are generated. However, not all agents allowed by de nition 4.11

are legal. Some initialisation conditions from which execution is started need to b e imp osed.

The initialisation conditions are the following: i E = ;, and ii all i 2 I are of the form

~

[+!true : true !P t ]. The conditions i and ii do not constrain an agentinany essential

way and are natural to imp ose. Condition i expresses that no events have b een generated

when execution b egins. Condition ii expresses that an agentmay only have adopted a

numb er of simple achievement goals when execution b egins.

The de nition of AgentSp eakL agents wehave given di ers in some resp ects from that

in [8]. One of the more imp ortant di erences is that we do not put basic actions in a

set to keep record of which actions have to b e executed. Instead, we formally de ne the

semantics of actions as up dates on the b elief base. If the agent needs to keep track of actions

which are executed or need to b e executed, it can store this information in the b elief base.

Another di erence is that wehave not included the three selection functions from [8] for

selecting intentions and plans. We think this is an asp ect which should not b e included in

the de nition of the op erational semantics, but is b etter viewed as a feature of an interpreter

implementing the agent language. The selection functions can b e lo oked up on as de ning

part of the control structure for an interpreter for AgentSp eakL cf. [3].

4.2 Semantics of AgentSp eakL

The op erational semantics of AgentSp eakL is given by a pro of system. The pro of system

allows the derivation of computation steps of agents. The pro of system consists of a set

of pro of rules which de ne a derivability relation `. Each rule corresp onds to a sp eci c

typ e of computation step. The derivability relation is de ned on so-called con gurations,

which consist of the dynamically changing parts of the agent during execution, i.e. the set of

generated events, the b eliefs, and the intentions of the agent.

De nition 4.12 BDI con guration

A BDI con guration is a tuple hE; B; Ii, where

 E E is a set of events,

 B At is a base of b eliefs, i.e. a set of base b eliefs,

 I I is a set of intentions.

In the remainder of this section, we assume that an agent hE; B; P; Ii has b een xed.

Furthermore, we assume that a function sp ecifying the up date semantics of the basic actions

T : A  }At ! }At is given.

The rst semantic rule, is a rule for dealing with internal events. An internal eventis

generated to achieve a goal, denoted by the triggering event part of the event. A plan which

sp eci es the means for achieving the goal is added to the intention which triggered the event,

and the event is dropp ed. 11

De nition 4.13 proof rule IntendMeans

~

hf:::;h+!P t; [p z :::zp ]i;:::g; B; Ii

1 z

hf:::g; B; I [f[p z :::z p z p] gi

1 z

where

~

 p = e :  !P t ; g ; :::; g ,

z 2 l

0

 p =+!P ~s:  h ; :::; h 2 P, such that p has no o ccurrences of variables which

1 n

also o ccur in the eventorintention set,

~

 is a most general uni er for +!P t and +!P ~s , and

 B j= 8 , for a substitution such that X isnotavariable which also o ccurs in

the eventorintention set.

The substitution in the plan uni es the triggering event+!P ~s in the head of the plan

~

rule and the triggering event+!P t in the event. Because of the match, plan h ; :::; h is

1 n

~

a plan for achieving achievement goal !P t . The substitution retrieves sp eci c parameters

related to the current situation from the b elief base by a derivation for the context  of the

plan rule. A new intention is constructed by pushing the plan on the intention part of the

event. The comp osition of the two substitutions is used to instantiate variables in this new

intention and thus variables in the plan. The rule IntendMeans deals with internal events.

We do not give a rule for external events. Such a rule is given in [8], but since an agent will

only generate internal events the rule is redundant.

There is one imp ortant di erence b etween the rule IntendMeans as given here and the one

0

given in [8] which concerns the renaming of variables. We use p 2 P to denote that p is a

variant of a rule in P, i.e. a plan rule in whichvariables mayhave b een renamed uniformly.

Such a renaming is necessary to avoid interference b etween variables which o ccur in the plan

rule with variables that o ccur in the intention. This issue is discussed in more detail in [4].

Furthermore, the values retrieved by substitutions should b e applied to the whole intention

and not just to a part of it, as is done in [8]. Otherwise, value-passing would b e of limited

use.

The generation of an internal event is de ned in the next rule. It is the only rule in the

system that creates events cf. remark ab ove. An internal event is generated if during the

execution of a plan from an intention an achievement goal is encountered. Toachieve the

goal a plan has to b e found, and an event recording the achievement goal and the intention

whichgave rise to it is generated.

De nition 4.14 proof rule ExecAch

hE; B; f:::;j;:::gi

~

hE [fh+!P t;jig; B; f:::gi

where

~

 j =[p z :::zp ze :  !P t ; h ; :::; h ].

1 z 1 2 n 12

The execution of an action in an intention means up dating the b elief base according to

the up date semantics of the action, and removing the action from the intention. The b elief

base is up dated according to the semantic function T which sp eci es the up date semantics

of actions.

De nition 4.15 proof rule ExecAct

~

hE; B; f:: :; [p z :::ze :   at; h ; :::; h ];:::gi

1 2 n

0

hE; B ; f:::;[p z :::z e :   h ; :::; h ];:::g; i

1 2 n

such that

0

~

Tat; B= B .

The execution of a test is a check on the b elief base. The test is removed from the

intention when it has b een executed. Suchacheckmay retrieve data from the b elief base,

which is recorded in a substitution . The substitution is applied to the remaining part of

the intention to instantiate variables with their corresp onding parameters.

De nition 4.16 proof rule ExecTest

~

hE; B; f:::;[p z :::z e :  ?P t ; h ; :::; h ];:::gi

1 2 n

hE; B; f:: :; [p z :::ze :   h ; :::; h ] ;:::gi

1 2 n

where

 is a substitution such that for all X in the domain of , X  is not a variable which

also o ccurs in the eventorintention set,

~

 B j= 8P t .

The rule CleanStackEntry to b e de ned b elowwas omitted in [8], as also noted in [1]. The

rule implements the notion of an intention b eing executed in de nition 16 in [8]. It is used for

the removal of a plan that has b een completely executed. The entry o ccupied by this plan is

p opp ed from the intention so that execution may continue with the remainder of the intention

which triggered the completed plan. Besides removing the plan, the achievement goal which

gave rise to the plan at the next entry in the intention must also b e removed completed plan

execution indicates that the goal has b een achieved. An empty body  in a plan rule in an

intention indicates that the plan has b een executed completely.

De nition 4.17 proof rule CleanStackEntry

~

hE; B; f:: :; [p z :::zp z+!P t:   ];:::gi

1 z

0

hE; B; f:: :; [p z :::zp ];:::gi

1

z

where

~

 p = e :  !P t ; h ; :::; h ,

z 2 n

0

= e :   h ; :::; h .  p

2 n

z 13

In case that a plan has b een executed completely but there is no remaining part of the

intention consisting of plans still to b e executed, the intention itself may b e removed from

the intention set. The rule CleanIntSet is used for this purp ose. It was not given in [8], as was

also noted in [1]. However, from a formal p oint of view the rule may b e considered redundant

b ecause it do es not change the observable b ehaviour of an agent.

De nition 4.18 clean rule CleanIntSet

~

hE; B; f:::;[+!P t:   ];:::gi

hE; B; f:: :gi

The set of semantic rules given in this section de nes the op erational semantics of Agent-

Sp eakL. Although wehave based our description of the pro of rules of AgentSp eakL on

[8], wehavemadeanumber of changes to the rules as they are presented in [8]. The rules

we give do not mo dify the language in any essential way [9]. Apart from minor di erences,

the more imp ortant issue of renaming variables has already b een discussed.

4.2.1 Computations and Observables

The pro of system for AgentSp eakL de nes a derivation relation ` on BDI con gurations.

A pro of rule allows to derive from an instantiation of the con guration C in the premise of

0

that rule the con guration C in the conclusion of that same rule. This relation is written as

0

C ` C . A derivation de nes the legal computations of an agent.

De nition 4.19 BDI derivation

A BDI derivation is a nite or in nite sequence of BDI con gurations, i.e. C ;:::;C ;:::,

0 n

where each C is derivable from C according to a pro of rule, i.e. C ` C .

i+1 i i i+1

The language is goal- or intention-driven, i.e. by executing its intentions the agent com-

putes results which are stored in the b elief base of the agent. Thus, the agent can b e viewed

up on as computing a series of up dates on the b eliefs of the agent. This suggests that taking

the b elief base of the agent as the observables of the system is a go o d choice.

De nition 4.20 observables

L L

Let C b e the set of all legal BDI con gurations, and let hE; B; Ii2 C b e such a con gura-

L L L L

tion. The function O : C ! }At is de ned by O hE; B; Ii= B. O yields the observable

of a given con guration.

For our purp ose, this means that if we can show that two agent languages are capable of

pro ducing the same sequences of observable b elief bases and there exists a natural transla-

tion of the agents in one of the languages to agents in the other language, the latter has at

least the same expressivepower as the former.

4.3 The syntax of AgentSp eak1

The de nition of the language AgentSp eak1 is given by the set of syntactic rules Syn-1

to Syn-11. I.e., AgentSp eak1 is a prop er subset of AgentSp eakL equivalent to Agent-

Sp eakL without events. To show that AgentSp eak1 has at least the same expressivepower 14

as AgentSp eakL we rst have to de ne a comp ositional translation function for mapping

AgentSp eakL agents onto AgentSp eak1 agents.

A natural candidate for this function is the function that maps all syntactic expressions of

AgentSp eakL on the same expressions in AgentSp eak1, except for AgentSp eakL events,

which are mapp ed onto AgentSp eak1 intentions. I.e., we de ne the translation function to

b e the identity function, except for events, which need to b e mapp ed on some other notion

since events do not o ccur in AgentSp eak1.

The choice to map events onto intentions is explained as follows. Events are only used

to indicate that a plan to achieve some achievement goal has to b e found. The creation of

events thus forms an intermediate step in the pro cess of creating a new intention by pushing

a suitable plan onto that intention. By incorp orating the stack building into the semantic

rule which generates the event in AgentSp eakL wemay skip this intermediate step and we

can do without events in AgentSp eak1.

De nition 4.21 translation function  

1

The translation function  translating AgentSp eakL into AgentSp eak1 is de ned as the

1

identity, except for events, for which it is de ned by:

  he; j i= j .

1

It is easy to see that  is comp ositional.

1

De nition 4.22 AgentSpeak1 agent

An AgentSpeak1 agent is a tuple hB; P; Ii where

 B At is a set of base b eliefs,

 P P is a set of plans, and

 I I is a set of intentions.

The set of legal AgentSp eak1 agents is a restriction on the set of agents from de nition

4.22. The same restriction on the initial intention set of an AgentSp eakL agent is imp osed

~

on an AgentSp eak1 agent: all i 2 I should b e of the form [+!true : true !P t]. The

condition expresses that an agentmay only have adopted a numb er of simple achievement

goals when execution b egins. By de nition, an AgentSp eakL agent hE; B; P; Ii is mapp ed

onto an AgentSp eak1 agentby  as follows:  hE; B; P; Ii= hB; P; I [  Ei.  is lifted to

1 1 1 1

sets of expressions p oint-wise, i.e.  S = f s j s 2 S g.

1 1

4.4 Semantics of AgentSp eak1

The pro of system used to sp ecify the semantics of AgentSp eakL is replaced by a transition

system giving the semantics for AgentSp eak1. Transition systems are a means to de ne

the op erational semantics of programming languages [7]. Formally, a transition system is

a deductive system which allows to derive the transitions of an agent. A transition system

consists of a set of transition rules which sp ecify the meaning of the programming constructs

in a language. Transition rules transform con gurations. In AgentSp eak1 a con guration

is the same as a mental state, i.e. a pair hB; Ii of b eliefs and intentions. 15

De nition 4.23 AgentSpeak1 con guration

An AgentSpeak1 con guration is a tuple hB; Ii, where

 B At is b elief base,

 I I is a set of intentions.

By de nition, an AgentSp eakL con guration is mapp ed onto an AgentSp eak1 con g-

uration by  as follows:  hE; B; Ii= hB; I [  Ei.

1 1 1

The rst transition rule, for plan application, corresp onds to the pro of rule IntendMeans of

AgentSp eakL. The rule, however, do es circumvent the notion of event, and directly pushes

a plan for achieving the achievement goal in the intention on the intention. Thus, the Agent-

Sp eak1 rule integrates the rules IntendMeans and ExecAch into one rule.

De nition 4.24 plan application rule

~

Let b e a most general uni er for !P t and !P ~s, and a substitution.

0

+!P ~s :  h ; :::; h 2 P and B j= 8 

1 n

hB; f:::;[p z :::zp ];:::gi ! hB; f:::;[p z :::zp zp] ;:::gi

1 z 1 1 z

where

~

 p = e :  !P t ; g ; :::; g ,

z 2 l

 p =+!P ~s: b ^ :::^ b  h ; :::; h has no o ccurrences of variables which also o ccur

1 m 1 n

in the intention set, and

 X  is not a variable also o ccurring in the intention set.

The other four rules of AgentSp eak1 are the transition rule variants of the rules ExecAct,

ExecTest, CleanStackEntry, and CleanIntSet resp ectively. In these rules, the set of events is

dropp ed from the con gurations.

De nition 4.25 execution rule for actions

0

~

T at; B= B

0

~

hB; f:::; [p z:::ze :   at; h ; :::; h ]; :::gi ! hB ; f:::; [p z:::ze :   h ; :::; h ]; :::gi

1 2 n 1 1 2 n

De nition 4.26 execution rule for rst-order tests

Let b e a substitution such that X isnotavariable which also o ccurs in the intention

set.

~

B j= 8P t  

~

hB; f:::; [p z:::ze :  ?P t ; h ; :::; h ]; :::gi ! hB; f:::; [p z:::ze :   h ; :::; h ] ; :::gi

1 2 n 1 1 2 n

De nition 4.27 clean stack entry rule

0

~

hB; f:::;[p z :::zp z +!P t:  ];:::gi ! hB; f:::;[p z :::zp ];:::gi

1 z 1 1

z

where 16

~

 p = e :  !P t ; h ; :::; h ,

z 2 n

0

 p = e :   h ; :::; h .

2 n

z

De nition 4.28 clean rule for intention set

~

hB; f:::;[+!P t:  ];:::gi ! hB; f:::gi

1

4.4.1 Computations and Observables

The transition system for AgentSp eak1 de nes a transition relation ! on con gurations.

1

A transition rule allows the derivation of an instantiation of such a transition in case the

conditions in the premise of the rule are satis ed.

The transition relation ! is the counterpart of AgentSp eak1 for the derivation relation

1

` of AgentSp eakL. The choice of observables for AgentSp eak1 is the same as that for

AgentSp eakL, the b elief base of an AgentSp eak1 con guration. Therefore, we can use the

identity function as deco der  to map observables from AgentSp eak1 to AgentSp eakL. As

a consequence,  is comp ositional.

De nition 4.29 observables

1 1 1

Let C b e the set of all legal AgentSp eak1 con gurations. The function O : C ! }At

1 1 1

is de ned by O hB; Ii= B for all hB; Ii2 C . O yields the observable of an AgentSp eak1

con guration.

4.5 AgentSp eak1 simulates AgentSp eakL

To show that  is a translation bisimulation and that AgentSp eak1 simulates Agent-

1

Sp eakL, wehavetoshow that every computation step of an AgentSp eakL agent can

b e simulated by the translated AgentSp eak1 agent, and vice versa. Because all but one

rule for AgentSp eak1 are just notational variants of the rules for AgentSp eakL this is not

to o dicult. Therefore, it suces to show that the computation steps de ned by the rules

IntendMeans and ExecAch can b e simulated in AgentSp eak1, and that the plan application

rule of AgentSp eakL can b e simulated by AgentSp eakL.

Theorem 4.30 The pro of rule ExecAch of AgentSp eakL can b e simulated by AgentSp eak1.

Pro of: By insp ection of the pro of rule ExecAch and the de nition of  , it is easy to see

1

that the AgentSp eakL con guration in the premise of the rule and the con guration of

the conclusion of the rule are mapp ed onto the same AgentSp eak1 con guration. The rule

ExecAch thus de nes an internal step, and the computation step corresp onding to this rule is

simulated by p erforming no AgentSp eak1 step at all.

Theorem 4.31 The pro of rule IntendMeans of AgentSp eakL can b e simulated by the plan

application rule for AgentSp eak1. 17

0

~

Pro of: Let A = hE [fh+!P t; [p z :::zp ]ig; B; Ii and A = hE; B; I [f[p z :::zp zp] gi such

1 z 1 z

0

that A ` A by means of the rule IntendMeans.Translation function  maps A onto B =

1

 A=hB; I [  E f[p z :::zp ]gi. By applying the rule for plan application of AgentSp eak1

1 1 z

0 0 0

we get: B = hB; I [  E f[p z :::zp zp] gi. It is easy to see that  A =B . i =

1 1 z 1 1

 i for an intention i. Note that the plan application rule is applicable since pro of rule

1

IntendMeans is applicable.

Note that although rule IntendMeans de nes an internal step, it can not b e simulated by

0 0

not p erforming any step at all. The reason for this is that  C  6=  C if C ` C by the rule

IntendMeans.

Theorem 4.32 The plan application rule of AgentSp eak1 can b e simulated by Agent-

Sp eakL.

Pro of: To simulate the plan application rule, we need the pro of rule IntendMeans as well

as the pro of rule ExecAch. Note that since b oth steps are internal steps, it is allowed to use

b oth rules to proveweak bisimulation. Supp ose A is an AgentSp eakL con guration, and

0 0

B ! B by means of the plan application rule, where B =  A and B is an AgentSp eak1

1

con guration. The con gurations must b e of the form: B =  A= hB; I [f[p z :::z p ]gi,

1 z

0

and B = hB; I [f[p z :::zp zp] gi. By insp ection of the translation function, and by rule

1 z

0 0

~

ExecAch we get a con guration A ` A of the form A = hfE [fh+!P t; [p z :::zp ]ig; B; Ii.

1 z

00

And, nally,by rule IntendMeans we get A = hE; B; I [f[p z :::zp zp] gi. It is easy to see

1 z

00 0

that  A = B .

We summarise the results of this section. AgentSp eak1 syntactically is a prop er subset

of AgentSp eakL. This corresp onds to the condition F3 in the de nition of eliminabil ity 3.7.

The translation function  and the deco der  b oth are comp ositional, which corresp onds to

1

condition F1 in de nition 3.7. And, nally,by the pro ofs given ab ove  is a translation

1

bisimulation. This corresp onds to condition F2 in de nition 3.7. Taken together, this con-

cludes the pro of that events are eliminable from AgentSp eakL. As a consequence, we also

have that AgentSp eak1 has at least the same expressivepower as AgentSp eakL.

In the other direction, although we did not give a formal pro of for it, we claim that Agent-

Sp eakL also has at least the same expressivepower as AgentSp eak1. The pro of is easily

derived from the pro ofs in this section. The translation function needed for the bisimulation

is the identity function. As a consequence, AgentSp eakL and AgentSp eak1 have the same

expressivepower.

5 The Transformation of Intentions to Goals

In this section we de ne a translation of AgentSp eak1 to a language called AgentSp eak2.

In AgentSp eak2 intentions have b een replaced by complex goals of 3APL. We de ne a

comp ositional translation function  . Apart from the replacementofintentions by complex

2

goals, there have b een made a numb er of minor other syntactic changes to the language

AgentSp eak1. AgentSp eak2 is a prop er subset of 3APL. 18

5.1 Syntax of AgentSp eak2

The main di erence b etween the syntax of AgentSp eak1 and AgentSp eak2 is that the latter

do es not haveintentions. Also, a numb er of other changes in the syntax of AgentSp eak1

goals and plan rules have b een made to comp ensate for minor di erences b etween the syntax

of AgentSp eakL and 3APL. The symb ol ! marking that a goal is an achievement goal in !

~

is simply dropp ed. ? is written as ?. And nally, a plan +!P t:  h ; :::; h is written

1 n

~

as P t    j h ; :::; h . Because of the change in the syntax of plan rules, we no longer have

1 n

any need for triggering events. Therefore, triggering events are dropp ed from the language.

De nition 5.1 syntax

The syntax of AgentSp eak2 is given by the syntactic rules Syn-1 to Syn-6, and the three

rules Syn-7a,Syn-8a, and Syn-10a which replace the rules Syn-7 for achievement goals, Syn-8

for test goals, and Syn-10 for plan rules of AgentSp eakL. One other rule is added, namely

Syn-9a, which de nes complex goals, i.e. sequential comp ositions of simple goals.

[Syn-7a] If  2 At, then  2 G,

[Syn-8a] If  2 At, then ? 2 G,

[Syn-9a] If h ;:::;h 2 G [ A, then h ; :::; h 2 G,

1 n 1 n

[Syn-10a] If  2 At, b ;:::;b are b elief literals, and h ;:::;h 2 G [ A, then   b ^ :::^

1 n 1 n 1

b j h ; :::; h 2 P.

n 1 n

Because of the syntactic changes made to AgentSp eak1 the translation function  is

2

more complicated than  .  maps intentions to the complex goals as de ned by rule Syn-9a.

1 2

To do this, the stack of plans intention needs to b e unravelled into a sequence of actions,

0

tests, and achievement goals. For this purp ose, we de ne an auxiliary function  , and use

2

0

a function body to obtain the b o dy of a plan rule.  removes the achievement goals at the

2

head of the plans in an intention, since these goals are implemented by plans at the next

lower entry in the stack except for the rst entry legal intentions have this feature. The

remainder of the plans is transformed into a sequential goal. Recall that a plan rule p in an

intention [:::z p] is the one executed rst cf. semantic rules for AgentSp eak1. Therefore,

0

the plan sp eci ed by p is added to the front of the complex goal which is constructed by  .

2

De nition 5.2 translation function  

2

The translation function  translating AgentSp eak1 into AgentSp eak2 is de ned as the

2

identity, except for the following cases:

  != ,

2

  ?= ?,

2

~ ~

  +!P t:   h ; :::; h = P t    j h ; :::; h ,

2 1 n 1 n

0 0

~

  [p z :::z+!P t:  h ; h ; :::; h ] = h ; :::; h ;  [p z :::zp ],

1 1 2 n 2 n 1 z 1

2 2

0

  [] = ,

2

0

  [p z :::zp ] = body  p ;  [p z :::zp ].

2 1 z 2 z 1 z 1

2 19

As b efore, it is easy to see that  is comp ositional, and therefore satis es condition E1 of

2

de nition 3.6. Also, note that the comp osition    translates AgentSp eakL expressions

1 2

to AgentSp eak2 expressions.

AgentSp eak2 agents consist of a b elief base, a goal base, and a plan base. The goal base

of an AgentSp eak2 agent replaces the intention set of an AgentSp eak1 agent.

De nition 5.3 AgentSpeak2 agent

An AgentSpeak2 agent is a tuple hB; P; Gi where

 B At is a set of base b eliefs,

 P P is a set of plans, and

 G G is a set of goals.

By de nition, an AgentSp eak1 agent hB; P; Gi is mapp ed onto an AgentSp eak2 agent

by  as follows:  hB; P; Ii= hB; P; Ii.  is lifted p oint-wise to sets.

2 2 2 2 2

5.2 Semantics of AgentSp eak2

Since intentions have b een dropp ed from the language, the transition system for Agent-

Sp eak1 has to b e mo di ed such that the transition rules apply to goals instead of intentions.

The con gurations transformed by AgentSp eak2 agents are now pairs hB; Gi of b elief and

goal bases.

De nition 5.4 con guration

An AgentSp eak2 con guration is a pair hB; Gi, where B is a b elief base, and G is a set of

AgentSp eak2 goals, either simple or complex.

By de nition, an AgentSp eak1 con guration is mapp ed onto an AgentSp eak2 con g-

uration by  as follows:  hB; Ii= hB; Ii.

2 2 2

The main di erence b etween the transition rules of AgentSp eak1 and those of Agent-

Sp eak2 is that the transition rules of AgentSp eak2 exploit the recursive capabilities of

transition systems. That is, the transition rules of AgentSp eak2 are de ned on the syntactic

structure of agents and goals. The rules decomp ose a complex goal to its elementary parts,

and the semantics of a complex goal is derived in this way from the rules for the elementary

parts. For example, the rule for sequential comp osition decomp oses a sequential goal, and

transformation of the sequential goal is derived from the transformation of the rst part of

the sequential goal.

The rule for goal bases selects a goal which is executable, or a goal which can b e used in

the plan application rule. This is the only rule for de ning the transition relation ! on

2

con gurations hB; Gi. The transition relation ! is derived from the more basic relation !

2

which op erates on a pair hB;i of b elief base and goal.

De nition 5.5 goal base

0 0

hB;i ! hB ; i

V

0 0

hB; f:::;;:::gi ! hB ; f:::; ;:::gi

2

where V is the set of variables in f:::;;:::g. 20

In case the complex goal that is selected turns out to b egin with an achievement goal,

a plan must b e found which will achieve the goal. The transition rule for plan application of

AgentSp eak2 thus corresp onds to the rule IntendMeans of AgentSp eakL.

De nition 5.6 rule application

~

Let b e a most general uni er for P t and P ~s , and a substitution.

0

P ~s    j h ; :::; h 2 P and B j= 8 

1 n

~

hB;Pti ! hB; h ; :::; h  i

V 1 n

where

 P ~s : b ^ ::: ^ b  h ; :::; h has no o ccurrences of variables which are also in V

1 m 1 n

the set of variables o ccurring in the goal base, and

 X  62 V for all X in the domain of .

The execution of a basic action consists in an up date on the b elief base. ; denotes the

empty substitution and the symbol E denotes termination of a goal.

De nition 5.7 execution rule for actions

0

~

T at; B= B

0

~

hB;ati ! hB ;Ei

V

;

A test is a check on the b elief base.

De nition 5.8 execution rule for rst-order tests

Let b e a substitution such that X  62 V for all X in the domain of .

~

B j= 8P t 

~

hB;Pt?i ! hB;Ei

V

The rule for sequential comp osition rst decomp oses a complex goal into its simpler con-

stituents, executes the rst part of the goal, and comp oses the remaining part sequentially

with the second half of the goal. Substitutions created during execution are also applied to

the second half of the goal.

De nition 5.9 execution rule for sequential composition

Let b e a substitution.

0 0

i hB; i! hB ;

1

1

0

0

hB; ;  i ! hB ; ;  i

1 2 V 2

1

5.3 Computations and Observables

An AgentSp eak2 computation is a nite or in nite sequence of AgentSp eak2 con gurations

where each consecutive pair is related by the transition relation ! . As for AgentSp eak1,

2

we de ne the notion of observables for AgentSp eak2 to b e the b elief base and the deco der

 to b e the identity function.

De nition 5.10 observables

2 2

Let C b e the set of all AgentSp eak2 con gurations, and let hB; Gi2 C denote sucha

2 2 2 2

con guration. The function O : C ! }At is de ned by O hB; Gi= B. O yields the

observable of a given AgentSp eak2 con guration. 21

5.4 AgentSp eak2 simulates AgentSp eak1

To show that  is a translation bisimulation and that AgentSp eak2 simulates Agent-

2

Sp eak1, wehave to show that every computation step of an AgentSp eak1 agent can

b e simulated by the corresp onding translated AgentSp eak2 agent, and vice versa. Since the

transition rules of AgentSp eak1 de ne the legal computation steps, it suces to show that

every transition rule of AgentSp eak1 can b e simulated by the derived transition relation

 of AgentSp eak2, and vice versa. We show this for the most complex case, namely the

2

case that a plan rule is applied in the computation step.

Also note that the rules for cleaning the intention stacks CleanStackEntry and CleanIntSet

do not havetobesimulated the rules are simulated by p erforming no step at all since the

translation function  maps the con guration of the premise of these rules onto the same

2

AgentSp eak2 con guration as the conclusion of the rules.

Theorem 5.11 The plan application rule for AgentSp eak1 can b e simulated by the plan

application rule for AgentSp eak2.

Pro of: We use P to denote the set of plans of the AgentSp eak1 agent, and P to denote

1 2

the set of plans of the AgentSp eak2 agent.

0

 : Supp ose that A ! A by the plan application rule of AgentSp eak1. In that

1

0

case, A = hB; I [f[p z :::zp ]gi and A = hB; I [f[p z :::zp zp] gi, where p = e :  

1 z 1 z z

0

~ ~

!P t; g ; :::; g , and p =+!P ~s:  h ; :::; h 2 P . The achievement goal !P tin

2 l 1 n 1

0

~

plan p is translated by  to P t , and the plan p to P ~s   j h ; :::; h 2 P .By

z 2 1 n 2

an application of the plan application rule for AgentSp eak2 we get:

~

hB;Pti ! hB; h ; :::; h  i

V 1 n

0

Using the de nition of  ,  and this transition as a premise for the rule for sequential

2

2

comp osition, we then get:

0

~

hB;Pt;  [p z :::z p ]i! hB; [p z :::zp zp] i

1 z 2 1 z

2

And nally,by an application of the transition rule for goal bases, wehave:

0

 A !  A .

2 2 2

0

 : Supp ose that  A ! B by using the rule for plan application of AgentSp eak2.

2

~

This means that goal P t ;  2 G for some  p ossibly empty. By insp ection of the

translation function  , this goal must have originated from an intention in the con gu-

2

ration A. But in that case, we can apply the plan application rule of AgentSp eak1 to

transform the intention and add the plan used in the AgentSp eak2 computation step

0

to the stack of plans, yielding a con guration A . The translation function  maps this

2

0 0 0

con guration to B ,  A = B .

We summarise the results of this section. Both the translation function  and the deco der

2

 are comp ositional. This corresp onds to condition E1 in the de nition of relative expressive

power 3.6. Theorem 5.11 proves that  is a translation bisimulation, which corresp onds to

2 22

condition E2 in de nition 3.6. Taken together, this concludes the pro of that AgentSp eak2

has at least the same expressivepower as AgentSp eak1. Since AgentSp eak2 is a prop er

subset of 3APL cf. [4], this also shows by transitivity of the expressiveness relation that

3APL has at least the same expressivepower as AgentSp eak2. The main di erence b etween

AgentSp eak2 and 3APL resides in the set of plan rules, since 3APL allows rules with more

general heads. These rules make a more general typ e of goal revision p ossible cf. [4, 3].

6 Conclusion

The conclusion which can b e drawn from the results concerning the expressivepower is

that every agent which can b e programmed in AgentSp eakL can also b e programmed in

3APL. On the other hand, a numb er of features of 3APL which are discussed in [4]were not

needed to simulate AgentSp eakL. These features include more imp erative programming

constructs like parallel comp osition and non-deterministic choice, and a more general goal

revision mechanism. Although the lack of regular programming constructs may not b e con-

sidered as to o great a di erence, the lack of a more general revision mechanism is of more

interest. Since AgentSp eakL lacks this more general revision mechanism in AgentSp eakL,

we b elieve that it is imp ossible to simulate, in the sense outlined in this pap er, this mechanism

in AgentSp eakL. Therefore, we conjecture that 3APL has strictly more expressivepower

than AgentSp eakL.

Another conclusion which can b e drawn from the expressiveness results is that the notions

of events and intentions can b e identi ed. This conclusion is based on the fact that events and

intentions are simulated by goals they are mapp ed onto goals by the comp osed translation

function    . Similarly, one may conclude that there is no need to maintain a complete

1 2

stack of plans as is done in AgentSp eakL. The same reason applies: No such thing is needed

in the simulation of AgentSp eakL agents by 3APL agents. The b o okkeeping for which

events and intentions are used, therefore, only complicates the pro of system. Since there

is no loss of expressiveness, stacks and triggering events might b e viewed as one p ossible

implementation of the agent language, but should not b e incorp orated into the semantics of

the agent language.

There might b e, however, one intuitive use of intentions which is not incorp orated in

AgentSp eakL. One could argue that it is of use to an agent that it keeps track of the goals

it is pursuing and the plans it is trying to use to achieve these goals as is done in an intention.

For example, if a plan fails to achieve a goal, this plan could b e dropp ed, the old goal could

b e retrieved from the next entry in the intention structure and a new plan could b e tried.

However, the complexity b oth from a theoretical and practical p ersp ective of this kind of

'backtracking' should not b e underestimated. First of all, new typ es of rules should haveto

be intro duced which could change intention structures in this way. These rules would make

the semantics considerably more complex. Furthermore, it is not yet clear when and how

to use this kind of `backtracking'. Researchinto integrating these kinds of p ossibilities into a

formal semantics is still to b e done, as far as we know.

Besides the op erational semantics for AgentSp eakL, in [8] also an algorithm for an

interpreter for AgentSp eakL, or a control structure as wewould like to call it, is de ned.

This control structure sp eci es to some extent in which order the pro of rules should b e used

to execute AgentSp eakL agents. For example, in every cycle of the interpreter rst an event

is pro cessed and then an intention is pro cessed achieve goal, execute action or test. We 23

havelooked in more detail at sp ecifying the semantic structure imp osed on AgentSp eakL,

and also for 3APL, byaninterpreter in [3], using the results obtained in the present pap er

that events and intentions can b e transformed into goals.

References

[1] Mark d'Inverno, David Kinny, Michael Luck, and Michael Wo oldridge. A Formal Sp ec-

i cation of dMARS. In Munindar P. Singh, Anand Rao, and Michael J. Wo oldridge,

editors, Intel ligent Agents IV LNAI 1365, pages 155{176, 1998.

[2] Matthias Felleisen. On the expressivepower of programming languages. In G. Go os and

J. Hartmanis, editors, 3rd European Symposium on Programming LNCS 432, pages

134{151. Springer-Verlag, 1990.

[3] Ko en V. Hindriks, Frank S. de Bo er, Wieb e van der Ho ek, and John-Jules Ch. Meyer.

Control Structures of Rule-Based Agent Languages. Accepted for ATAL98, 1998.

[4] Ko en V. Hindriks, Frank S. de Bo er, Wieb e van der Ho ek, and John-Jules Ch. Meyer.

Formal Semantics for an Abstract Agent Programming Language. In Munindar P. Singh,

Anand Rao, and Michael J. Wo oldridge, editors, Intel ligent Agents IV LNAI 1365,

pages 215{229, 1998.

[5] Robin Milner. and Concurrency. Prentice Hall, 1989.

[6] David M. R. Park. Concurrency and Automata on In nite Sequences LNCS 104.

Springer-Verlag, 1980.

[7] G. Plotkin. A structural approach to op erational semantics. Technical rep ort, Aarhus

University, Computer Science Department, 1981.

[8] Anand S. Rao. AgentSp eakL: BDI Agents Sp eak Out in a Logical Computable Lan-

guage. In W. van der Velde and J.W. Perram, editors, Agents Breaking Away, pages

42{55. Springer, 1996.

[9] Anand S. Rao. Private communication, March 1997.

[10] Krister Segerb erg. Mo dal logics with linear alternative relations. Theoria, 36:301{322,

1970.

[11] Yoav Shoham. Agent-oriented programming. Arti cial Intel ligence, 60:51{92, 1993. 24