<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Developing Formal Specifications of MAS in SLABS</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Hong Zhu</string-name>
          <email>hzhu@brookes.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept of Computing, Oxford Brookes University Wheatley Campus</institution>
          ,
          <addr-line>Oxford, OX33 1HX</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The recent years has seen a rapid growth of research interests in agent-oriented software development methodology. A great amount of work has been reported in the literature on formal models and logics of software agents. However, how to use such formalisms in the analysis and specification of agent-based systems remains as an open problem. Alternative approaches using semi-formal diagrammatic notations for the analysis and specification of agentbased software systems have emerged recently. Unfortunately, there is a big gap between the formal and informal approaches. This paper investigates a process and method of agent-oriented software analysis and specification that use a simple diagrammatic notation for the development of agent models and derive a formal specification of multi-agent systems with the help of such diagrammatic notations. The method is illustrated by an example of the evolutionary multiagent ecosystem Amalthaea developed at MIT Media Lab.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Agent technology is widely perceived to be a viable solution for large-scale industrial
and commercial applications [1,2]. However, it has not been widely adopted by IT
industry. It has been recognised that the lack of rigour is one of the major factors
hampering the wide-scale adoption of agent technology [3].</p>
      <p>Much work has been done on formal modelling of agents' rational behaviour by
logic systems and game theories, c.f. [4, 5, 6, 7, 8, 9]. In [10,11], we proposed a
formal specification language for agent-based systems called SLABS. The language is
powerful enough to specify different types of agent-based systems [10, 11, 12 ].
However, developing formal specifications of multi-agent systems in SLABS and
other formalisms as well is difficult due to the complexity of agent-based systems. On
the other hand, in recent years, a large amount of research work has been reported in
the literature about the development processes and methods for engineering
agentbased systems, e.g. [13, 14, 15, 16, 17]. These works mostly utilise diagrammatic
notations to support the analysis and design of multi-agent systems. How such
diagrammatic notations are related to the logic and formal models of agents remains
as an open problem.</p>
      <p>In this paper, we investigate how descriptions of multi-agent systems in a simple
diagrammatic notation can be used to derive formal specifications of multi-agent
systems in SLABS. A process of analysis and specification of multi-agent systems is
proposed and illustrated by a case study of the evolutionary multi-agent ecosystem
Amalthaea, which was developed in MIT's Media Lab [18]. The paper is organised as
follows. Section 2 is a brief introduction to SLABS. Section 3 proposes a process
model and the diagrammatic notation. Section 4 illustrates the process by an example.
Section 5 is the conclusion of the paper.</p>
    </sec>
    <sec id="sec-2">
      <title>2 Overview of SLABS language</title>
      <p>SLABS is a model-based formal specification language designed for engineering
multi-agent systems [10, 11]. This section briefly reviews the main features of the
language.</p>
      <sec id="sec-2-1">
        <title>2.1 The underlying model</title>
        <p>In our model, agents are defined as encapsulations of data, operations and behaviours
that situate in their designated environments. Here, data represents an agent's state.
Operations are the actions that an agent can take. Behaviour is a collection of
sequences of state changes and operations performed by the agent in the context of its
environment. By encapsulation, we mean that an agent's state can only be changed by
the agent itself. Moreover, an agent has its own rules that govern its behaviour in its
designated environment. Constructively, agents are active computational entities with
a structure comprising the following elements.
1. Name, which is the agent’s identity.
2. Environment description, which indicates what the agent interacts with.
3. State, which consists of a set of variables and is divided into two parts: the visible
state and internal state.
4. Actions, which are the atomic actions that the agent can take. Each action has a
name and may have parameters.
5. Behaviour rules, which determine the behaviour of the agent.</p>
        <p>Agents constructively defined above have a number of features. First, they are
autonomous in the sense of [17] and [19]. Second, they are communicative and social,
yet it is independent of any particular agent communication language or protocol.
Third, agents are situated in their designated environments. It requires an explicit and
clear specification of the boundary and interface between an agent and its
environment as well as the effects of the environment on the agent's behaviour.
Fourth, as argued in [11], our definition implies that objects are special cases of
agents in a degenerate form, while agents may be not objects. Finally, our model is
independent of any particular model or theory of agents. We believe that specific
agent models can be naturally defined in our model. In fact, using the SLABS
language, we have formally specified examples of personal assistants [10], ants,
learning agents [11], communication protocols [12], etc. In this paper, we will also
demonstrate how an evolutionary multi-agent ecosystem can be formally specified in
SLABS. A formal definition of the model can be found in [11].</p>
        <p>There are two important implications of our model of agents and multi-agent
systems. First, since agents are not objects, existing language facilities provided by
object-oriented languages cannot solve all the problems that software engineers face
in developing agents [20]. Therefore, new language facilities must be introduced to
support agent-oriented software development. Second, because agents are
generalisations of objects, we believe that agent-orientation should be and can be a
natural evolution of object-orientation so that the so-called agent-oriented paradigm
can be built on the bases of object-oriented paradigm. In particular, the notion of caste
is a natural evolution of the key notion of class in object-oriented paradigm. Here, a
caste is a template of agents as class is a template of objects. Similarly, agents are
instances of castes just as objects are instances of classes. The agents of a caste, thus,
have common structural and behavioural characteristics. Castes also have inheritance
relations between them. However, there are a number of significant differences
between classes and castes; hence, they deserve a new name. Readers are referred to
[12] for more details about the notion of caste and its role in the development of
multi-agent systems.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>The SLABS language</title>
        <p>The specification of a multi-agent system in SLABS consists of a set of specifications
of agents and castes. The main body of a caste specification in SLABS contains a
description of the structure of its states and actions, a description of its behaviour, and
a description of its environment. The following gives the graphic form of
specifications of castes and agents. Their syntax in EBNF can be found in [21].</p>
        <p>Name &lt;= castes (instantiation)</p>
        <sec id="sec-2-2-1">
          <title>Visible state-variables and actions</title>
        </sec>
        <sec id="sec-2-2-2">
          <title>Invisible state-variables and actions</title>
        </sec>
        <sec id="sec-2-2-3">
          <title>Environment</title>
          <p>description</p>
        </sec>
        <sec id="sec-2-2-4">
          <title>Behaviour-specification</title>
        </sec>
        <sec id="sec-2-2-5">
          <title>Name: castes (Instantiation)</title>
        </sec>
        <sec id="sec-2-2-6">
          <title>Visible state-variables and actions</title>
        </sec>
        <sec id="sec-2-2-7">
          <title>Invisible state-variables and actions</title>
        </sec>
        <sec id="sec-2-2-8">
          <title>Environment</title>
          <p>description</p>
        </sec>
        <sec id="sec-2-2-9">
          <title>Behaviour-specification</title>
          <p>Every agent must be an instance of a caste. It has all the structural, behaviour and
environment descriptions given in the caste's specification. Moreover, it may have
additional structural, behaviour and environment descriptions to extend its state space,
to enhance its ability to take actions and to widen its view of the environment. If an
agent is specified as an instance of a caste, all the parameters in the specification of
the caste must be instantiated in the specification of the agent.</p>
          <p>The SLABS language enables software engineers to explicitly specify the
environment of an agent as a subset of the agents in the system that may influence its
behaviour. Environment description can be in three forms: (a) an agent-name, which
means the agent is in its environment, (a) All: caste-name, which means all agents of
the caste are in the environment, (3) variable: caste-name, which is a parameter of the
caste. When the parameter is instantiated, it represents an agent in the environment.</p>
          <p>Agents behave in real-time concurrently and autonomously. To capture the
realtime features, an agent's behaviour is modelled by a set of sequences of events
indexed by the time when the events happen. The state space of an agent is described
by a set of variables with keyword VAR. The set of actions is described by a set of
identifiers with keyword ACTION. An action can have a number of parameters. The
global state of a multi-agent system at any particular time consists of the states and
actions of all agents in the system. However, each agent A can only view the
externally visible states and actions of the agents in its environment explicitly
specified in its description. Because an agent's view is only a part of the global state,
two different global states may become equivalent from its view. Although an agent
may not be able to distinguish two global states, the histories of the runs leading to
states may be different. The SLABS language provides language facilities to express
an agent's view of the current state as well as the history of the run of the system so
that intelligent behaviours such as learning and evolution can be easily specified. A
pattern describes the behaviour of an agent in the environment by a sequence of
observable state changes and observable actions. Table 1 gives the formats and the
meanings of patterns.</p>
          <p>Pattern Meaning
$ The wild card, which matches with all actions
∼ The silence event
Action variable It matches an action</p>
          <p>P^k A sequence of k events that match pattern P
! Predicate The state of the agent satisfies the predicate
Act (a1, a2, ...ak) An action Act that takes place with parameters match (a1, a2, ...ak)
[p1,..., pn] The previous sequence of events match the patterns p1, ..., pn
SLABS also provides scenario description facilities to describe global situations of
the whole system. The syntax and semantics of scenarios are given below.
Scenario Meaning
A: P The situation when agent A's behaviour matches pattern P</p>
          <p>The situation when the behaviours of all agents in caste C match
∀X∈C: P pattern P</p>
          <p>The situation when there exists at least m agents in caste C whose
∃[m]X∈C: P behaviour matches pattern P where the default value of the optional
expression m is 1
µ X∈C: P The number of agents in caste C whose behaviour matches pattern P
S1 &amp; S2 The situation when both scenario S1 and scenario S2 are true
S1 ∨ S2 The situation when either scenario S1 or scenario S2 or both are true
¬ S The situation when scenario S is not true</p>
          <p>An agent's behaviour is defined by a set of rules as its responses to environment
scenarios.</p>
          <p>Behaviour-rule ::= [&lt;rule-name&gt;] pattern|[ prob]−&gt;event, [if Scenario] [where pre-cond] ;
In a behaviour rule, the pattern on the left-hand-side of the −&gt; symbol describes the
pattern of the agent's previous behaviour. The scenario describes the situation in the
environment, which are the behaviours of the agents in the environment. The
whereclause is the pre-condition of the action. The event on the right-hand-side of −&gt;
symbol is the action to be taken when the scenario happens and if the pre-condition is
satisfied. The agent may have a non-deterministic behaviour. The expression prob in a
behaviour rule is an expression that defines the probability for the agent to take the
specified action on the scenario. SLABS also allows the specification of
nondeterministic behaviour without giving the probability distribution. In such cases, the
probability expression is omitted. It means that the probability is greater than 0 and
less than 1. For example, the following is a behaviour rule of search engine. It states
that if there is an agent A in the environment that takes the action of calling the search
engine with a set of keywords, it will return a set of urls that matches the keywords.</p>
          <p>[$]|−&gt; Search_Result(keywords, urls); if ∃A:[Search(Self, keywords)]
3</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Proposed process and method</title>
      <p>In this section, we propose a process for developing formal specifications of
multiagent systems and devise a simple diagrammatic notation to support the process. As
shown in Fig 1, the process is an iteration of the following activities.</p>
      <p>When an agent’s behaviour is too
complicated to analyse its behaviour
Architectural
analysis
Formal Spec
in SLABS</p>
      <p>Structural</p>
      <p>Model
Derivation of
formal spec</p>
      <p>Interaction
analysis
Behaviour</p>
      <p>Rules</p>
      <p>Interaction</p>
      <p>Model
Scenario
analysis
Architectural analysis. The process starts with the architecture analysis of the
multiagent system. The main purpose of the analysis is to define the overall structure of the
system by specifying the agents of the system and in the environment as well as their
interrelationships. The main activity of the step is to identify the agents and castes and
the relationships between the agents in terms of how agents influence each other. An
architectural model of the system can be built and represented in a simple
diagrammatic notation given in Fig 2.</p>
      <p>There are two types of nodes in an agent diagram. An agent node represents an
agent in the system. A caste node represents a set of agents in a caste. A link from
node A to node B represents that the visible behaviour of agent/caste A is observed by
agent/caste B. Therefore, agent/caste A influences agent/caste B. An agent may have
an ‘open end arrow’ from a caste to an agent. It means all the agents in the caste may
influence the agent. If an ‘open end arrow’ pointing to the agent connects to no caste,
it means that all agents in the environment influents its behaviour.
Links</p>
      <p>A
A
A
A
A
A</p>
      <p>Agent</p>
      <p>Caste
B
B
B
B
B
B
B</p>
      <p>Agent B observes the visible behaviour of
agent A
Agent A takes an action that agent B observes
for all agents in the environment
Agent B observes the visible behaviour of all
agents in the caste A
Agent B observes the visible behaviour of all
agents in its environment
Each agent in caste B observes the visible
behaviour of a specific agent XB in caste A
Every agent in caste B observes the visible
behaviour of all agents in the caste A
Every agent in caste B observes the visible
behaviour of agent A
Interaction analysis. Based on the result of architectural analysis, interaction
analysis further identifies the visible actions and states that are observed by each
agent or a caste of agents. The visible actions and states observed by an agent or a
caste of agent is then associated with the link between the nodes in the agent diagram.
The parameters of the actions and the data type of the state are also identified and
annotated on the diagram. The meanings of the state variables and actions and their
parameters should be recorded in a separate dictionary.</p>
      <p>Scenario analysis. Scenario analysis is applied to each agent or each caste of agents
to identify the typical scenarios that the agent will deal with and its designed
behaviour in such a scenario. The result of scenario analysis is a set of behaviour rules
that characterize the dynamic behaviour of the agent or the caste of agents.
Decomposition and refinement. When an agent's behaviour is too complicated to
express in terms of the scenarios in the environment and the events that the agent
responds to, the internal structure of the agent must be analysed. The architectural
analysis is then applied to the agent so that it can be decomposed into a number of
agents or sometimes just a number of state variables. Interaction analysis also follows
to identify the interactions between internal components and the agents and/or castes
in the environment that interact with the agent. Internal actions can also be
introduced. A lower level diagram is drawn for the node that represents the agent. Fig
3 shows an example of lower level diagrams for a node AgentX, where agents E1, and
E2 and caste C1 are the agents and castes in the environment that interact with
AgentX. Y1 and Y2 are the component agents internal to the AgentX.</p>
      <p>AgentX
Action
Action</p>
      <p>ActInternal(...)
E1
E2
C1</p>
      <p>Act1(...)
Act2(...)</p>
      <p>ActInternal(...)
Y1</p>
      <p>Y2
Derivation of formal specification. From a set of agent diagrams and a set of
behaviour rules, a formal specification in SLABS of the multi-agent system can be
derived. The topological structure of the systems determines the environment
description of each agent/caste. The actions and states annotated on the links between
the nodes determine the visible part of actions and states of the agent/caste. The lower
level diagram provides the details of the internal state and actions. The rules are the
descriptions of the behaviour.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Example: Specification of Amalthaea</title>
      <p>Amalthaea is an evolutionary multi-agent ecosystem developed at MIT Media
Laboratory [18]. Its main purpose was to assist its users in finding interesting
information on the web. There are two species of agents in the system: filtering agents
that model and monitor the interests of the user and discovery agents that model the
information sources. These agents evolve, compete and collaborate in a market-like
ecosystem. Agents that are useful to the user or other agents reproduce while
lowperforming agents are destroyed. The evolution of the system enables it to keep track
of the changing interests of the user.
4.1</p>
      <sec id="sec-4-1">
        <title>System's architecture</title>
        <p>Amalthaea is composed of the User Interface, The Ecosystem, the WWW search
engines, WKV Generator and a Database of the retrieved documents [18]. These
components plus the user are the agents of the MAS system. The structure of the
system can be represented in our diagrammatic notation as in Fig 4.</p>
        <p>User
Database</p>
        <p>Interface</p>
        <p>Ecosystem</p>
        <p>Search engine
Fig. 4. Agent diagram of the multi-agent system Amalthaea
WKV Generator
4.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Interactions between the agents</title>
        <p>The visible states and actions of the agents are determined by how information flows
in the system. For example, in Amalthaea, the user browses the information presented
on the interface and gives a rating for each item. The only visible action of the user is
'rate on a digest'. Notice that, in some systems that use agent technology for Internet
browsing, whether the user browses a webpage and/or how long the user stays at a
website are used to indicate whether the user is interested in the information. In such
cases, browsing a webpage becomes a visible action.</p>
        <p>The analysis of the interactions between the agents can be represented on the
diagram by annotating the links with the actions that an agent / caste is interested in.
Fig 5 is the result of the analysis of Amalthaea. Details can be found in [22].</p>
        <p>The visible actions and states of the agents / castes can be derived directly from
such a diagram. For example, the Interface should have two visible actions:
Pass_Rate(url, r) and Present_Digest(url) according to the diagram. The former is
observed by the ecosystem and the later is observed by the User.</p>
        <p>Rate(url, r)</p>
        <p>Present_Digest(url)</p>
        <p>Pass_Rate(url, r)
Store(url, wkv),</p>
        <p>Query(url, wkv)
Database</p>
        <p>Stored(url, wkv,succ)
Query_Result(url, wkv, answer)</p>
        <p>Search(engine, keywords)</p>
      </sec>
      <sec id="sec-4-3">
        <title>Scenario analysis and the description of behaviour</title>
        <p>Agent and castes of simple behaviour can be easily described via scenario analysis.
For example, the Search Engines in the Amalthaea system is a caste that consists of a
number of search engines. All these search engines have a common behaviour. That
is, whenever a search engine receives a search request, it performs the Internet search
and returns a set of URLs as search results. This can be specified as follows.
[$] |−&gt; [Search_Result(keywords, urls)]; if ∃A:[Search(Self, keywords)]
We can derive the following formal specification of the caste of Search Engines.</p>
        <p>Search Engines</p>
        <p>Action Search_Result (K: Keywords, urls: set of URL)
All</p>
        <p>[$] |−&gt; Search_Result(keywords, urls); if ∃A: [Search( Self, keywords)]</p>
        <p>Similarly, we can obtain the following description of the Database, User, Interface
and WKV generator.</p>
        <p>Action</p>
        <p>Database</p>
        <p>Query_Result (url: URL, wkv: WKV, answer:{'yes', 'no'})</p>
        <p>Stored (url: URL, wkv: WKV, answer:{'success', 'failure'})
All
[$, Stored(url, wkv, ‘success’), $^k || k≥0 ] |−&gt; Query_Result(url, wkv, 'yes');
if ∃A:[Query(url, wkv)]
~ [$, Stored(url, wkv, ‘success’), $^k || k≥0 ] |−&gt; Query_Result(url, wkv, 'no');
if ∃A:[Query(url, wkv)]
[$] |−&gt; Stored(url, wkv, 'success'); if ∃A:[Store(url, wkv)]</p>
        <p>User</p>
        <p>Action Rate(url: URL, r: {1, 2, 3, 4, 5})
Interface
[$] |−&gt; Rate(url, r);</p>
        <p>if Interface: [$, Present_Digest(url), $^k || N &gt; k ≥ 0 ]</p>
        <p>Interface
Action Present_Digets(url: URL)</p>
        <p>Pass_Rate (url: URL, rate: {1, 2, 3, 4, 5})</p>
        <p>User
Ecosystem
[$] |−&gt; Pass_Rate(url, r); if User: [Rate(url, r)]
[$] |−&gt; Present_digest(url); if Ecosystem: [Submit(url)]</p>
        <p>WKV Generator
Action</p>
        <p>Extracted (f: HTML_file, k: WKV)
All</p>
        <p>[$] |-&gt; Extracted(f, wkv) ; if ∃A:[Extract(f)]
4.4</p>
      </sec>
      <sec id="sec-4-4">
        <title>Decomposition and analysis of internal structure</title>
        <p>An agent may have complicated behaviour that cannot be described straightforwardly
as above. The Ecosystem in Amalthaea is such an example. In such cases, it is
inevitable to decompose the agent / caste and to analyse its internal structure. Such
analysis, therefore, provides the information to specify the internal structure of the
agent and enables scenario analysis and description of behaviour according to its
internal structure. This refinement step follows the same process as described above
and continues until the behaviours of all agents and castes can be clearly specified.</p>
        <p>For example, the Ecosystem contains two types of agents: the information filtering
agents and the information discovery agents. Therefore, we add two castes of agents
as the internal components of the ecosystem. Hence, we have the following refined
description of the Ecosystem in Fig 6.</p>
        <p>Although the visible actions and states of the information filtering and discovery
agents are clear now, their behaviours are still difficult to specify. The following
further analyses the internal structures of these castes.</p>
        <p>Ecosystem</p>
        <p>Search(E: Engine, K: Keywords); Submit(url: URL, confidence: Real);
Store(url:URL, wkv: WKV); Extrat(F: HTML_file);</p>
        <p>Query(url, URL, wkv: WKV);
Pass-Rate(url, r)</p>
        <p>Credit(Agent, c)</p>
        <p>Pay(c)
Interface
Search
Engines</p>
      </sec>
      <sec id="sec-4-5">
        <title>A. Information Filtering Agents (IFA) and Information Discovery Agents (IDAs)</title>
        <p>Each information filtering agent only selects on a specific type of documents that is
determined by the ‘phenotype’ of the agent. As shown in Fig 7, the phenotype
consists of the following parts.
• Fitness: it is a positive integer value indicating how well the agent is
performing. When the fitness is too low, it will be purged by the system.
• Creation date: it is the date that the agent was created.
• User created?: it is a tag indicating if the agent is created by the user or
generated by the system during its evolution process. User generated agents are
less easy to be purged by the system.
• Genotype: it is a weighted keyword vector. The agent only selects the document
that has a weighted keyword vector close enough to the genotype.
• Execution code: it is the execution code of the agent.</p>
        <p>Genotype
Phenotype</p>
        <p>Weight
Keyword</p>
        <p>Weight</p>
        <p>Keyword
Fitness
(Credits)</p>
        <p>Creation</p>
        <p>Date</p>
        <p>User
Created?</p>
        <p>Weight
Keyword
Execution
code</p>
        <p>The structure of information filtering agents can be specified by the following caste
in SLABS. In the specification, an information filtering agent has four internal state
variables: (1) the fitness, (2) creation date, (3) the tag for if it is user created, and (4)
the genotype of the agent in the form of a weighted keyword vector.</p>
        <p>Var Fitness: Integer; CreationDate: Date; UserCreated: Bool;</p>
        <p>Genotype: WKV;</p>
        <p>Notice that, the owner of an agent can access the internal state of the agent. Having
specified the internal structure of the caste, we can now apply scenario analysis and
describe the behaviour. Four scenarios are identified.
• Scenario 1: when the Ecosystem credits the agent.
• Scenario 2: when it is the time to pay the rent.
• Scenario 3: announce interests in a topic.
• Scenario 4: select url when the information about a topic is available after an
information discovery agent retrieved from the Internet.</p>
        <p>For each scenario, a rule is obtained to describe the behaviour of the agent in the
scenario. For example, in scenario 1, when the Ecosystem takes an internal action of
crediting the agent, the agent will increase the fitness by the amount of the credit
assigned. Therefore, the rule is as follows.</p>
        <p>[!(fitness=x) ] |−&gt; !(fitness = x+c); if Ecosystem: [credit(self, c)]
In scenario 2, when it is the time to pay the rent, the agent will take a visible action of
pay and decrease the fitness by the amount of payment. Hence, we have the following
behaviour rule.</p>
        <p>[!(fitness=x) ] |−&gt; t: pay(c) !(fitness = x-c); where pay_time(t)
where pay_time is a predicate, which is true if the time t is for the agent to pay. Such
concepts can be specified using schemas in Z. For example, the following schema
specifies that the agents pay once in every 100 units of time.</p>
        <p>pay_time: Time → Bool
pay_time(t) = true; t mod 100 = 0
pay_time(t) = false; t mod 100 ≠ 0
The complete specification of information filtering agents is given below.</p>
        <p>IFA
Action Recommend(Title, URL); Request(keywords); Pay Rental (Natural)
Var Fitness: Integer; Creation Date: Date; User Created: Bool;</p>
        <p>Genotype: WKV
All: IDA [[!!((ffiittnneessss==xx)) ]] ||−−&gt;&gt; t!:(fpitanye(scs) =!(fxi+tnce)s;sif=Exc-ocs)y;swtehmer:e[cpraeyd_itti(mseelf(,t)c)]
Ecosystem [$] |−&gt; Interest(keys(Self.genotype));</p>
        <p>[Interest(keywords)] |−&gt; Submit(url, confidence);
Interface if ∃A∈IDA: [Available(urls, wkv)]</p>
        <p>where confidence=Distance(genotype, wkv) and confidence &gt; threshold</p>
        <p>The information discovery agents are responsible for posting queries to various
Internet search engines, collecting the results and presenting them to the information
filtering agents that requested them. Each information discovery agent also has a
genotype that contains information on the keywords it should utilise when querying
the search engine, along with the canonical URL of the engine (or information source)
that it contacts. Depending on the search engine it uses, each IDA uses different query
types. Similar to information filtering agents, the caste IDA can be specified as
follows.</p>
        <p>IDA
Search(engine:Search Engine, keywords: set of keywords, max, min: Natural)
Pay (rent: Natural); Extract(f: HTML_file); Query(url: URL, wkv: WKV)
Store(url: URL, wkv: WKV); Available(url: URL, wkv: WKV)
Fitness: Integer; Creation Date: Date; SearchEngine: Search Engines
NumberOfkKeywords, MinimumHits, MaximunHits: Natural
[!(fitness=x) ] |−&gt; !(fitness = x+c); if Ecosystem: credit(Self, c)
[!(fitness=x) ] |−&gt; t: pay(c) !(fitness = x−c); where pay_time(t)
[$] |−&gt; search(Self.SearchEngine, keywords, Self.minimum_hit,</p>
        <p>Self.maximum_hit);
if ∃A: [Interest(keywords)], where Good_Track_Record(A)=true
[search(Engine, keywords, min, max) ]
|−&gt; Forall file ∈{f at u | u ∈ urls}. Extract(file);</p>
        <p>if Engine:[Search_Result(keyword, urls)]
[Extract(file)] |−&gt; Query(url, wkv); if WKV Generator : [Extracted(file, wkv)]
[Query(url, wkv)] |−&gt; Available(url, wkv);</p>
        <p>if DataBase:[Query_Result(url, wkv, 'no')]</p>
      </sec>
      <sec id="sec-4-6">
        <title>B. Behaviour of the Ecosystem.</title>
        <p>The interactions between filtering agents and discovery agents determine the global
behaviour of the system. Amalthaea is a miniature economy model. The agents that
constitute the Ecosystem operate under a penalty / reward scheme that is supported by
the notion of credit. Each agent has fitness level expressed in the form of the
accumulated amount of credit it has received. Credit, thus, serves as the fitness
function of the agents. The higher the fitness of an agent, the more chances it gets to
survive and produce offspring. In the analysis of the behaviour of the Ecosystem, the
following scenarios are identified.
• Scenario 1: when the user's rating on a presented digest is passed to the Ecosystem
through the interface.
• Scenario 2: when it is the time for the agents to pay.</p>
        <p>In scenario 1, when credit is assigned by the user indirectly through feedback on
the relevance of an item in the digest, the system relates this feedback to the filtering
agents that proposed the item and the discovery agent that retrieved it and assigns the
credit. We assume the function Credit_IFA: Rate × Confidence → N calculates the
amount of the credit give to the information filtering agent and Credit_IDA: Rate ×
Confidence → N for information discovery agents. Then, the behaviour of the
ecosystem in the scenario that a rating on a digest is received can be described as
follows.</p>
        <p>[$] |−&gt; (Credit(A, c1), Credit(B, c2)) ;
if Interface: [Pass_rate( url, r)] &amp; A: [$, Submit(url, confidence), $^k]</p>
        <p>&amp; B: [Available(url, wkv), $^k'],
where c1=Credit_IFA(r, confidence) and c2=Credit_IDA(r)</p>
        <p>The evolution of the Ecosystem is triggered by scenario 2. It depends on two
factors: the fitness of individual agent and the fitness of the whole system. The overall
fitness is measured according to the percentage of positive feedbacks from the user in
the past N ratings. Only a variable number of the best performed agents of the whole
population are allowed to produce offspring, while a number of worst performed
agents are purged. Assume that function Number_of_Purges(N_rating) calculates the
number of agents to be purged from the most recent N ratings. After all agents have
paid their rents, decisions are made on who will be purged and who will produce
offspring according to the following rule.</p>
        <p>[!(A∈IFA∪IDA)] |−&gt; Purge(A) !(A∉IFA∪IDA) ;
if ∀X:IFA:[Pay(c)] and ∀Y:IDA:[Pay(c)] and Interface:[Pass_rating(rn)^N]
where A∈PurgeSet &amp; PurgeSet⊆{X| X∈IFA or X∈IDA} &amp;
∀X∈PurgeSet.∀Y∉PurgeSet. (X.fitness≤Y.Fitness} &amp; ||PurgeSet|| = Number_of_Purges(&lt;rn&gt;n=1,...,N)
where Purge is an internal operation. Its function is to remove the agent from the
system.</p>
        <p>Assume that function Number_of_Offspring(N_rating) calculates the number of
agents to be generated. Also, assume that Offspring_Set is the set of agents that are
allowed to produce offspring, and the set NewAgentSet are the agents generated from
the OffspringSet by applying mutation and crossover operations. The NewAgentSet
can be specified similarly to the PurgeSet. The behaviour of producing offspring can
be described by the following rule.</p>
        <p>[!(A∉IFA∪IDA)] |−&gt; Generate(A) !(A∈IFA∪IDA) ;</p>
        <p>if ∀X:IFA:[Pay(c)] &amp; ∀Y:IDA:[Pay(c)] &amp; Interface:[Pass_rating(rn)^N], where A∈NewAgentSet
where Generate is an internal action of the Ecosystem. Its function is to add an agent
to the system. Therefore, we have the following specification of the ecosystem.</p>
        <p>Ecosystem
Action Search(E: Engine, K: Keywords); Submit(url: URL, confidence: Real)
Store(url:URL, wkv: WKV); Extract_WKV(F:HTML_file);</p>
        <p>Query(url, URL, wkv: WKV)
Var IFA: Caste Information_Filtering_Agents;</p>
        <p>IDA: Caste Information_Discovery_Agents</p>
        <p>Action Purge(A: Agent); Generate(A: Agent)
[$] |-&gt; (Credit(A, c1), Credit(B, c2)) ;
if Interface: [Pass_rating( url, r)] &amp; A: [$, Submit(url, confidence), $^k]</p>
        <p>&amp; B: [Available(url, wkv), $^k'],
where c1=Credit_IFA(r, confidence) and c2=Credit_IDA(r, confidence)
[!(A∈IFA∪IDA)] |-&gt; Purge(A) !(A∉IFA∪IDA) ;
if ∀X:IFA:[Pay(c)] &amp; ∀Y:IDA:[Pay(c)] &amp; Interface:[Pass_rating(rn)^N]
where A∈PurgeSet and PurgeSet⊆{X| X∈IFA or X∈IDA}
and ∀X∈PurgeSet.∀Y∉PurgeSet. (X.fitness≤Y.Fitness}
and ||PurgeSet|| = Number_of_Purges(&lt;rn&gt;n=1,...,N)
[!(A∉IFA∪IDA)] |-&gt; Generate(A) !(A∈IFA∪IDA) ;
if ∀X:IFA:[Pay(c)] &amp; ∀Y:IDA:[Pay(c)] &amp; Interface:[Pass_rating(rn)^N]</p>
        <p>where A∈NewAgentSet &amp; NewAgentSetSpec</p>
        <p>This completes our specification of the Amalthaea system.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>In this paper, we proposed a process model for developing formal specifications of
multi-agent systems in SLABS. The process is an iteration of the following activities.
Architectural analysis identifies the component agents / castes of a multi-agent
system. Interaction analysis identifies the visible actions and states for each agent /
caste. Scenario analysis identifies the rules that govern the dynamic behaviour of each
agent /caste. Further decomposition and analysis of internal structures of an agent /
caste are applied to the agents / castes if necessary. It continues until the behaviours
of all agents can be clearly specified. A simple diagrammatic notation is devised
based on our general model of multi-agent systems to support the development
process. The development of a formal specification of an evolutionary multi-agent
ecosystem Amalthaea, which was developed at MIT Media Lab, is presented in the
paper to demonstrate the method proposed in this paper and to illustrate the style of
formal specification in SLABS.</p>
      <p>Existing work on agent-oriented software development methodology has been
focused on process models for analysis and design of agent-based systems using
diagrammatic notations. Little work has been reported that enable software engineers
to use formal logic and other formalisms that have been investigated in the literature
for agent technology. The method proposed in this paper naturally bridges the gap
between informal and formal notations. We are further investigating how tools can be
developed to automate the transformation from the diagrammatic notation to formal
specification in SLABS in the way that structured requirements definitions are
translated into formal specification in Z [23, 24].
9. Wooldridge, M.J. and Jennings, N.R.: Agent Theories, Architectures, and
Languages: A Survey. In: Intelligent Agents. LNAI, Vol. 890. Springer-Verlag
(1995) 1−32
10. Zhu, H.: Formal Specification of Agent Behaviour through Environment</p>
      <p>Scenarios. In: Proc. of FAABS 2000. LNCS, Vol. 1871. Springer 263−277
11. Zhu, H.: SLABS: A Formal Specification Language for Agent-Based Systems.</p>
      <p>Int. J. of Software Engineering and Knowledge Engineering 11(5) (2001)
529−558
12. Zhu, H.: The Role of Caste in Formal Specification of MAS. In: Proc. of</p>
      <p>PRIMA’2001. LNCS, 2132. Springer (2001) 1−15
13. Kinny, D., Georgeff, M., Rao, A.: A Methodology and Modelling Technology
for Systems of BDI Agents. In: Agents Breaking Away: Proc. of MAAMAW'96.</p>
      <p>LNAI, Vol. 1038. Spriger-Verlag (1996)
14. Moulin, B., Brassard, M.: A Scenario-Based Design Method and An
Environment for the Development of Multiagent Systems. In: Lukose, D. and
Zhang C. (eds.): First Australian Workshop on Distributed Artificial
Intelligence. LNAI, Vol. 1087. Springer-Verlag (1996) 216−231
15. Wooldridge, M., Jennings, N., Kinny, D.: A Methodology for Agent-Oriented
Analysis and Design. In: Proc. of ACM Third International Conference on
Autonomous Agents, Seattle, WA, USA (1999) 69−76
16. Iglesias, C.A., Garijo, M., Gonzalez, J.C.: A Survey of Agent-Oriented
Methodologies. In: Muller, J. P., Singh, M. P., Rao, A., (eds.): Intelligent Agents
V. LNAI, Vol. 1555. Springer, Berlin (1999) 317−330
17. Bauer, B., Muller, J.P., and Odell, J.: Agent UML: a Formalism for Specifying
Multiagent Software Systems. In: Ciancarini, P. and Wooldridge, M. (Eds.):
Agent-Oriented Software Engineering. LNCS, Vol. 1957. Springer (2001)
91−103
18. Moukas, A.: Amalthaea: Information Discovery and Filtering Using a
MultiAgent Evolving Ecosystem. Journal of Applied Artificial Intelligence 11(5)
(1997) 437−457
19. Jennings, N.R.: Agent-Oriented Software Engineering. In: Garijo, F.J., Boman,
M. (eds.): Multi-Agent System Engineering, Proc. of 9th European Workshop on
Modelling Autonomous Agents in a Multi-Agent World, Valencia, Spain
(June/July 1999). LNAI, Vol. 1647. Springer, Berlin (1999) 1−7
20. Lange, D.B., Oshima, M.: Mobile Agents with Java: The Aglet API. World</p>
      <p>Wide Web Journal (1998)
21. Spivey, J.M.: The Z Notation: A Reference Manual. 2nd edn. Prentice Hall
(1992)
22. Zhu, H.: Developing Formal Specifications of Multi-Agent Systems in SLABS,
Technical Report CMS-02-01, School of Computing and Mathematical Sciences, Oxford
Brookes University, UK (April 2002)
23. Jin, L., Zhu, H.: Automatic Generation of Formal Specification from
Requirements Definition. In: Proc. of IEEE 1st Int. Conf. on Formal Engineering
Methods, Hiroshima, Japan (1997) 243−251
24. Zhu, H., Jin, L.: Scenario Analysis in an Automated Tool for Requirements
Engineering. J. of Requirements Engineering 5(1) (2000) 2~22</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Jennings</surname>
            ,
            <given-names>N.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wooldridge</surname>
            ,
            <given-names>M.J</given-names>
          </string-name>
          . (eds.): Agent Technology: Foundations,
          <string-name>
            <surname>Applications</surname>
          </string-name>
          , And Markets. Springer, Berlin Heidelberg New York (
          <year>1998</year>
          ) Huhns,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Singh</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.P</surname>
          </string-name>
          . (eds.):
          <article-title>Readings in Agents</article-title>
          . Morgan Kaufmann, San Francisco (
          <year>1997</year>
          )
          <string-name>
            <surname>Brazier</surname>
            ,
            <given-names>F.M.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dunin-Keplicz</surname>
            ,
            <given-names>B.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jennings</surname>
            ,
            <given-names>N.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Treur</surname>
            ,
            <given-names>J.: DESIRE</given-names>
          </string-name>
          :
          <article-title>Modelling Multi-Agent Systems in a Compositional Formal Framework</article-title>
          .
          <source>Int. J.</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <source>of Cooperative Information Systems</source>
          <volume>1</volume>
          (
          <issue>6</issue>
          ) (
          <year>1997</year>
          )
          <fpage>67</fpage>
          −
          <lpage>94</lpage>
          Rao,
          <string-name>
            <given-names>A.S.</given-names>
            ,
            <surname>Georgreff</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.P.</surname>
          </string-name>
          :
          <article-title>Modeling Rational Agents within a BDIArchitecture</article-title>
          .
          <source>In: Proc. of the International Conference on Principles of Knowledge Representation and Reasoning</source>
          (
          <year>1991</year>
          )
          <fpage>473</fpage>
          −
          <lpage>484</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Singh</surname>
            ,
            <given-names>M.P.</given-names>
          </string-name>
          :
          <article-title>Semantic Considerations on Some Primitives for Agent Specification</article-title>
          . In: Wooldridge,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Muller</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Tambe</surname>
          </string-name>
          , M. (eds):
          <source>Intelligent Agents. LNAI</source>
          , Vol.
          <volume>1037</volume>
          . Springer (
          <year>1996</year>
          )
          <fpage>49</fpage>
          −
          <lpage>64</lpage>
          Wooldridge,
          <string-name>
            <surname>M.</surname>
          </string-name>
          :
          <article-title>Reasoning About Rational Agents</article-title>
          . The MIT Press (
          <year>2000</year>
          ) Ambroszkiewicz,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Komar</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.:</surname>
          </string-name>
          <article-title>A Model of BDI-Agent in Game-Theoretic Framework</article-title>
          . In: [8] (
          <year>1999</year>
          )
          <fpage>8</fpage>
          −
          <lpage>19</lpage>
          Myer,
          <string-name>
            <given-names>J-J.</given-names>
            ,
            <surname>Schobbens</surname>
          </string-name>
          , P-Y. (eds.):
          <source>Formal Models of Agents - ESPRIT Project ModelAge Final Workshop Selected Papers. LNAI</source>
          , Vol.
          <volume>1760</volume>
          . Springer (
          <year>1999</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>