<!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>Normative Programming for Organisation Management Infrastructures</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jomi F. H u¨bnery Olivier Boissiery</string-name>
          <email>Floriano´polis, Brazil Email: fhubner, boissierg@emse.fr Email: jomi@das.ufsc.br</email>
          <email>jomi@das.ufsc.br</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rafael H. Bordiniz</string-name>
          <email>R.Bordini@inf.ufrgs.br</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept Automation and Systems Eng. yEcole Nationale Supe ́rieure des Mines, Federal University of Santa Catarina Saint Etienne</institution>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>zIntitute of Informatics, Federal University of Rio Grande do Sul</institution>
          ,
          <addr-line>Porto Alegre</addr-line>
          ,
          <country country="BR">Brazil</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>-Recent work shows a tendency to use programming languages specific to the social aspects of multi-agent systems, for example in programming norms that agents ought to follow. In this paper, we introduce a simple and elegant normative programming language called NPL and show its operational semantics. We then define a particular class of NPL programs that are suitable for programming Organisation Management Infrastructures (OMI) for MOISE, defining a Normative Organisation Programming Language (NOPL). We show how MOISE's Organisation Modelling Language can be translated into NOPL, and briefly describe how this all has been implemented on top of an artifact-based OMI for MOISE.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        The use of organisational and normative concepts is widely
accepted as a suitable approach for the design and
implementation of Multi-Agent Systems (MAS) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]–[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Although these
concepts are useful for MAS methodologies and therefore
used at design time, in this paper we focus on their use at
run-time. We conceive of a multi-agent system as a set of
agents participating to an organisation by playing roles in it.
An important component of MAS is thus the Organisation
Management Infrastructure (OMI), which exists in a system
to help and supervise agents in the achievement of the purpose
of the organisation.
      </p>
      <p>
        A recent trend in the development of OMIs is to provide
languages that the MAS designer (human or artificial in
the case of self-organisation) uses to write a program that
will define the organisational functioning of the system,
complementing agent programming languages that defines
the individual functioning of the system. The former type
of languages can focus on different aspects of the overall
system, for example: structural aspects (roles and groups) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ],
dialogical aspects [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], coordination aspects [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and normative
aspects [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The OMI is then responsible for interpreting
such a language and providing corresponding services to the
agents. For instance, in the case of MOISE+ [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], the designer
can program a norm such as “an agent playing the role ‘seller’
is obliged to deliver some goods after being payed by the agent
playing role ‘buyer”’. The OMI is responsible for identifying
the activation of that obligation and to enforce the compliance
to that norm by the agents playing the corresponding roles.
      </p>
      <p>We are particularly interested in a flexible and adaptable
implementation of OMIs. Such implementation is normally
coded using an object-oriented programming language (e.g.
Java). However, the exploratory stage of current OMI
languages often requires changes in the implementation so that
one can experiment with new features. The refactoring of the
OMI for such experiments is usually an expensive task that
we would like to simplify. Our work therefore addresses one
of the main missing ingredients for the practical development
of sophisticated multi-agent systems where the macro-level
requires complex organisational and normative structures in
the context of so many different views and approaches still
being actively researched by the MAS research community.</p>
      <p>This problem is particularly complex for organisation
models that consider elements with different natures like groups,
roles, common goals, and norms. These elements have their
own life cycle, are bound together, and are constrained by a
set of properties (e.g. role compatibility and cardinality). Our
proposal is thus an uniformed approach where all kinds of
constraints are expressed by norms. These norms then can be
explicitly and flexibly enforced by different mechanisms. The
OMI is then mainly concerned with providing such mechanism
instead of considering all kinds of constraints. However, we
do not want to force the MAS designer to program the
organisation using only norms. The designer should program their
organisation using more suitable constructors. For example,
using a role cardinality constructor to state “a classroom has
one professor” instead of a norm like “it is prohibited that two
agents play the role professor in the same classroom”).</p>
      <p>The solution presented in this paper is to translate a more
abstract language into another simpler language. The problem
of implementing the OMI is thus reduced to a translation
problem, which is usually much simpler and less error prone.
We start from an organisational modelling language which is
then automatically translated into a normative programming
language. The language available to the MAS designer has
thus more abstract concepts (such as groups, roles, and global
plans) than normative languages. More precisely, our starting
language is the MOISE Organisation Modelling Language
(OML — see Sec. III) and our target language is the Normative
Organisation Programming Language (NOPL — Sec. IV).
NOPL is a particular class of programs of a normative
programming language presented and formalised in this paper
(Sec. II). All of this has been implemented on top of our
previous work on OMI where an artifact-based approach,
called ORA4MAS, is used (Sec. V).</p>
      <p>The main contributions of this work are: (i) a normative
programming language and its formalisation using operational
semantics; (ii) the translation from an organisational language
into the normative language; and (iii) an implemented
artifactbased OMI that interprets the target normative language. These
contributions are better discussed and placed in the context of
the relevant literature in Sec. VI.</p>
      <p>II. NORMATIVE PROGRAMMING LANGUAGE</p>
      <p>
        Although several languages for norms are available, (e.g.
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]–[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]), for this project we need a language that handles
obligations and regimentation. While agents can violate
obligations (and sanctions might take place later), regimentation is
a preventive strategy of enforcement: agents are not capable to
violate a regimented norm [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Regimentation is important for
an OMI to allow situations where the designer wants to define
norms that must be followed because its violation represent a
serious risk for the organisation.1 The current languages either
consider obligation or regimentation as enforcement strategies,
and do not allow the designers (nor the agents) to dynamically
choose the best strategy for their application.
      </p>
      <p>
        Our language can be relatively simple because we do not
need prohibitions nor permission as primitives. By default,
everything is permitted and thus the designer does not need
to code permissions. Prohibitions can be represented either by
regimentation or as an obligation for someone else to decide
how to handle the situation (this approach is inspired by the
approach by Grossi et al. [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]). For example, consider the
norm “it is prohibited to submit a paper with more than 6
pages”. In case of regimentation of this norm, tentatives to
submit a paper with more than 6 pages will fail. In case this
norm is not regimented, the designer has to define a norm
such as “when a paper with more than 6 pages is submitted,
the chair has to decide wether to accept the submission or
not”. Another assumption that allowed us to devise a simple
language is that we do not consider inconsistent norms. Either
the programmer or the program generator are supposed to
handle this issue.
      </p>
      <sec id="sec-1-1">
        <title>A. Syntax</title>
        <p>Given the above requirements and simplifications, we
introduce below a new Normative Programming Language (NPL)
(Fig. 1 contains the definition of its syntax).2 A normative
program np is composed of: (i) a set of facts and inference
rules (as in Prolog); and (ii) a set of norms. A NPL norm has
the general form norm id : ' -&gt; , where id is a unique
identifier of the norm; ' is a formula that determines the
activation condition for the norm; and is the consequence of
1The importance of regimentation is corroborated by relevant
implementations of OMI, such as AGR, S-MOISE+, and ISLANDER, which consider
regimentation as an important enforcement mechanism.</p>
        <p>2The non-terminals not included in the specification, atom, id, var, and
number, correspond, respectively, to predicates, identifiers, variables, and
numbers as used in Prolog.
np
rule
norm
fail
obl
::= “np” atom “f” ( rule j norm )* “g”
::= atom [ “:-” formula ] “.”
::= “norm” id “:” formula “-&gt;” ( fail j obl ) “.”
::= “fail(” atom “)”
::= “obligation(”</p>
        <p>(var j id) “,” atom “,” formula “,” time “)”
formula ::= atom j “not” formula j</p>
        <p>atom ( “&amp;” j “|”) formula
time ::= “‘” ( “now” j
number ( “second” j “minute” j ...))
“‘” [ ( “+” j “-” ) time ]
the activation of the norm. Two types of norm consequences
are considered:
fail – fail(r): represents the case where the norm is
regimented. Argument r represents the reason for the
failure;
obl – obligation(a; r; g; d): represents the case where a
new obligation has to be created for some agent a as the
consequence of the norm activation. Argument r is the
reason for the obligation (which has to include the norm’s
id); g is the formula that represents the obligation (a state
of the world that the agent must try to bring about, i.e. a
goal it has to achieve); and d is the deadline to fulfil the
obligation.</p>
        <p>A simple example to illustrate the language is given below;
we used source code comments to explain the program.
np example {
a(1). a(2). // facts
ok(X) :- a(A) &amp; b(B) &amp; A&gt;B &amp; X = A*B. // rule
// note that b/1 is not defined in the program;
// it is a dynamic fact provided at run-time
// alice has 4 hours to achieve a value of X &lt; 5
norm n1: ok(X) &amp; X &gt; 5
-&gt; obligation(alice,n1,ok(X) &amp; X&lt;5,‘now‘+‘4 hours‘).
// bob is obliged to sanction alice in case X &gt; 10
norm n2: ok(X) &amp; X &gt; 10
-&gt; obligation(bob,n2,sanction(alice),‘now‘+‘1 day‘).
// example of regimented norm; X cannot be &gt; 15
norm n3: ok(X) &amp; X &gt; 15 -&gt; fail(n3(X)).</p>
        <p>}</p>
        <p>
          As in other approaches (e.g. [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ], [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]), we have a
static/declarative aspect of the norm (where norms are
expressed in NPL resulting in a normative program) and a
dynamic/operational aspect (where obligations are created for
existing agents). We call the first aspect simply norm and the
second obligation. An obligation has thus a run-time life-cycle.
It is created when the activation condition ' of some norm n
holds. The activation condition formula is used to instantiate
the values of variables a,r,g, and d of the obligation to be
created. Once created, the initial state of an obligation is active
(Fig. 2). The state changes to fulfilled when agent a fulfils the
norm’s obligation g before the deadline d. The obligation state
changes to unfulfilled when agent a does not fulfil the norm’s
ø
active
d &gt; now
        </p>
        <p>unfulfilled
¬ ø</p>
        <p>inactive
obligation g before the deadline d. As soon as the activation
condition of the norm that creates the the obligation (') ceases
to hold, the state changes to inactive. Note that a reference to
the norm that led to the creation of the obligation is kept as
part of the obligation itself (the r argument), and the activation
condition of this norm must remain true for the obligation
to stay active; only an active obligation will become either
fulfilled or unfulfilled, eventually. Fig. 2 shows the obligation
life-cycle.</p>
      </sec>
      <sec id="sec-1-2">
        <title>B. Semantics</title>
        <p>
          We now give semantics to NPL using the well known
structural operational semantics approach [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
        </p>
        <p>A program in NPL is essentially a set of norms where each
norm is given according to the grammar in Fig. 1; it can also
contain a set of initial facts and inference rules specific to the
program’s domain (all according to the grammar of the NPL
language). The normative system operates in conjunction with
an agent execution system; the former is constantly fed by the
latter with “facts” which, possibly together with the domain
rules, express the current state of the execution system. Any
change in such facts leads to a potential change in the state of
the normative system, and the execution system checks that the
normative system is still in a sound state before committing
towards particular execution steps; similarly, it can have access
to current obligations generated by the normative system. The
overall system’s clock also causes potential changes in the
state of the transition system, by changing the time component
of its configuration.</p>
        <p>As we use operational semantics to give semantics to the
normative programming language (i.e. the language used to
program the normative system specifically), we first need
to define a configuration of the transition system that will
be defined through the semantic rules presented later. A
configuration of our normative system, giving semantics to
NPL, is a tuple hF; N; &gt;; OS; ti where:</p>
        <p>F is a set of facts received from the execution system
and possibly rules expressing domain knowledge. The
former works as a form of input from the agent execution
system to the normative system. Each formula f 2 F is,
as explained earlier, an atomic first order formula or a
Horn clause.</p>
        <p>N is a set of norms, where each norm n 2 N is a norm
in the syntax defined for norm in the grammar in Fig. 1.
The state of the normative system is either a sound state
denoted by &gt; or a failure state denoted by ?; the latter
is caused by regimentation through the fail( ) language
construct within norms. This is accessible to the agent
execution system which prevents the execution of the
action which would lead to the facts causing the failure
state, and rolls back the facts about the state of the
execution system.</p>
        <p>OS is a set of obligations, each accompanied by its
current state; each element os 2 sosts is of the form
ho; ost i where o is an obligation, again according to
the syntax for obligations given in Fig. 1, and ost 2
factive; ful lled; unful lled; inactiveg (the
possible states of each individual obligation). This is also of
interest to the agent execution system and thus accessible
to it.
t is the current time which is automatically changed
by the underlying execution system, using, of course, a
discrete, linear notion of time. For the purpose of the
operational semantics, it is assumed that all rules that
apply at a given time are actually applied before the
system changes the state to the next time.</p>
        <p>Given a normative program P — which is, remember, a
set of facts and rules (PF ) and a set of norms (PN ) written
in NPL — the initial configuration of the normative system
(before the system execution starts) is hPF ; PN ; &gt;; ;; 0i.</p>
        <p>In the semantic rules, we use the notation Tc to denote the
component c of tuple T . The semantic rules are as follows.</p>
        <p>1) Norms: The rule below formalises regimentation: when
any norm n becomes active — i.e. its condition component
holds in the current state — and its consequence is fail( ),
we move to a configuration where the normative state is no
longer sound but a failure state (?). Note that we use n' to
refer to the condition part of norm n (the formula between “:”
and “-&gt;” in NPL’s syntax) and n to refer to the consequence
part of n (the formula after “-&gt;”).</p>
        <p>n 2 N
hF; N; &gt;; OS; ti</p>
        <p>F j= n'
n</p>
        <p>= fail( )
! hF; N; ?; OS; ti</p>
        <p>The underlying execution system, after realising a failure
state caused by Rule Regim above, needs to ensure the facts
are rolled back to the previously consistent state, which will
make the following rule apply.</p>
        <p>8n 2 N:(F j= n' ) n 6= fail( ))
hF; N; ?; OS; ti ! hF; N; &gt;; OS; ti</p>
        <p>The next rule is similar to Rule Regim but instead of
failure, the consequence is the creation of an obligation. In
the rule, ‘m.g.u.’ means “most general unifier” as in
Prologlike unification; the notation t means the application of the
variable substitution function to formula t. Note that we
required that the deadlines of newly created obligations are not
(Regim)
(Consist)
yet past. The notation o=bl is used for equality of obligations,
which ignores the deadline in the comparison. That is, we
define that an obligation obligation(a; r; g; d) is equals to
an obligation obligation(a0; r0; g0; d0) if and only if a = a0,
r = r0, and g = g0. Because of this, Rule Oblig does not
allow the creation of the same obligation with two different
deadlines. Note also that if there already exists an equal
obligation but it has become inactive, this does not prevent
the creation of the obligation.
(Oblig)
n 2 N F j= n' n = o o d &gt; t
:9ho0; ost i 2 OS : (o0 o=bl o ^ ost 6= inactive)</p>
        <p>hF; N; &gt;; OS; ti !
hF; N; &gt;; OS [ ho ; activei; ti
where</p>
        <p>is the m.g.u. such that F j= o
2) Obligations: Recall that a NPL obligation has the
general form obligation(a; r; g; d). With a slight abuse of
notation, we shall use oa to refer to the agent that has the
obligation o; or to refer to the reason for obligation o; og
to refer to the state of the world that agent oa is obliged to
achieve (the goal the agent should adopt); and od to refer to
the deadline for the agent to do so. An important aspect of
obligation syntax is that the NPL parser always ensures that
the programmer used the norm’s id as predicate symbol in
or and so in the semantics, when we say or, we are actually
referring to the activation condition n' of the norm used to
create the obligation.</p>
        <p>Rule Fulfil says that the state of an active obligation o
should be changed to ful lled if the state of the world og
that the agent agent was obliged to achieve has already been
achieved (i.e. the domain rules and facts from the underlying
system imply g). Note however that such state must have been
achieved within the deadline.</p>
        <p>os 2 OS</p>
        <p>F j= og
os = ho; activei</p>
        <p>od t
hF; N; &gt;; OS; ti !
hF; N; &gt;; (OS n fosg) [ fho; ful lledig; ti
(Fulfil)</p>
        <p>Rule Unfulfil says that the state of an active obligation o
should be changed to unful lled if the deadline is already
past; note that the rule above would have changed the status
to ful lled so the obligation would no longer be active if it
had been achieved in time.</p>
        <p>os 2 OS
os = ho; activei</p>
        <p>od &lt; t
hF; N; &gt;; OS; ti !
hF; N; &gt;; (OS n fosg) [ fho; unful lledig; ti
(Unfulfil)</p>
        <p>
          Rule Inactive says that the state of an active obligation o
should be changed to inactive if the reason (i.e. motivation)
for the obligation no longer holds in the current system state
reflected in F .
os = ho; activei
hF; N; &gt;; OS; ti !
hF; N; &gt;; (OS n fosg) [ fho; inactiveig; ti
(Inactive)
III. MOISE ORGANISATIONAL MODELLING LANGUAGE
MOISE proposes an organisational modelling language
(OML) that explicitly decomposes the specification of
organisation into structural, functional, and normative
dimensions [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. The structural dimension specifies the roles, groups,
and links of the organisation. The definition of roles states
that when an agent chooses to play some role in a group, it
is accepting some behavioural constraints and rights related to
this role. The functional dimension specifies how the global
collective goals should be achieved, i.e. how these goals are
decomposed (within global plans), grouped in coherent sets
(through missions) to be distributed among the agents. The
decomposition of global goals results in a goal-tree, called
scheme, where the leaf-goals can be achieved individually by
the agents. The normative dimension is added in order to bind
the structural dimension with the functional one by means
of the specification of the roles’ permissions and obligations
within missions.
        </p>
        <p>As an illustrative and simple example of an organisation
specified using MOISE+, we consider agents that aim at
writing a paper and therefore have an organisational specification
to help them collaborate. Due to lack of space, we will focus
on the functional and normative dimensions in the remainder
of this paper. For the structure of the organisation, it is enough
to know that there is only one group (wpgroup) where two
roles (editor and writer) can be played.</p>
        <p>To coordinate the achievement of the goal of writing a
paper, a scheme is defined in the functional specification of
the organisation (Fig. 3(a)). In this scheme, a draft version of
the paper has to be written first (identified by the goal fdv
in Fig. 3(a)). This goal is decomposed into three sub-goals:
write a title, an abstract, and the section titles; the sub-goals
have to be achieved in this very sequence. Other goals, such
as finish, have sub-goals that can be achieved in parallel. The
specification also includes a “time-to-fulfil” (TTF) attribute for
goals indicating how much time an agent has to achieve the
goal. The goals of this scheme are distributed in three missions
which have specific cardinalities (see Fig. 3(c)): the mission
mM an is for the general management of the process (one and
only one agent must commit to it), mission mCol is for the
collaboration in writing the paper’s content (from one to five
agents can commit to it), and mission mBib is for gathering
the references for the paper (one and only one agent must
commit to it). A mission defines all goals an agent commits to
when participating in the execution of a scheme; for example,
a commitment to mission mM an is effectively a commitment
to achieve four goals of the scheme. Goals without an assigned
mission are satisfied by the achievement of their sub-goals.</p>
        <p>The normative specification relates roles to missions
(Table I). For example, norm n2 states that any agent playing the
role writer has one day to commit to mission mCol. Designers
can also define their own application-dependent conditions (as
(a) Paper Writing Scheme
(b) Monitoring Scheme
mission
mM an
mCol
mBib
cardinality
1..1
1..5
1..1
mr 1..1
ms 1..1
(c) Mission Cardinalities
Fig. 3. Functional Specification for the Paper Writing Example
id
n1
n2
n3
n4
n5
n6
condition
unfulfilled(n2)
fulfilled(n3)
#mc
role
editor
writer
writer
editor
editor
editor
type
per
obl
obl
obl
obl
obl
mission
mM an
mCol
mBib
ms
mr
ms</p>
        <p>TTF</p>
        <p>–
1 day
1 day
3 hours
3 hours
1 hour
#mc stands for the condition “more agents committed to a mission than
permitted by the mission cardinality”
in norms n4–n6). Norms n4 and n5 define sanction and reward
strategies for fulfilment and unfulfilment of norms n2 and n3
respectively. Norm n5 can be read as “the agent playing role
‘editor’ has 3 hours to commit to mission mr when norm n3
is fulfilled”. Once committed to mission mr, the editor has
to achieve the goal reward. Note that a norm in MOISE is
always an obligation or permission to commit to a mission.
Goals are therefore indirectly linked to roles since a mission
is a set of goals.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>IV. NORMATIVE ORGANISATION</title>
      <p>PROGRAMMING LANGUAGE</p>
      <p>The NOPL is a particular class of NPL programs applied to
MOISE. The syntax and semantics are the same as presented
in Sec. II, but the set of facts, rules, and norms are specific
for MOISE model and the organisational artifacts presented
in Sec. V. The main idea is that an OS is translated to
different programs in NOPL, such programs define then the
management of norms for groups and schemes. In this section
we consider only the programs for schemes.</p>
      <sec id="sec-2-1">
        <title>A. Facts</title>
        <p>For scheme programs, the following facts, defined in the
OS, are considered:
scheme_mission(m,min,max): is a fact
that defines the cardinality of a mission (e.g.
scheme_mission(mCol,1,5)).
goal(m,g,pre-cond,‘ttf ‘): is a fact that defines the
arguments for a goal g: its mission, pre-conditions, and
TTF (e.g. goal(mMan,wsec,[wcon],‘2 days‘)).</p>
        <p>The NOPL also defines some dynamic facts that represent
the current state of the organisation and will be provided by
the artifact that manage the scheme instance:
plays(a, ,gr): agent a plays the role in the group
instance identified by gr.
responsible(gr,s): the group instance gr is
responsible for the missions of scheme instance s.
committed(a,m,s): agent a is committed to mission
m in scheme s.
achieved(s,g,a): goal g in scheme s has been
achieved by agent a.</p>
      </sec>
      <sec id="sec-2-2">
        <title>B. Rules</title>
        <p>Besides facts, we define some rules that will be useful for
the norms. The rules are used to infer the state of the scheme
(e.g. whether it is well-formed) and goals (e.g. whether it is
ready to be achieved or not). Note that the semantics of
wellformed and ready goal are formally given by these rules. As
an example, some of such rules for the paper writing scheme
are listed below.</p>
        <p>// number of players of a mission M in scheme S
mplayers(M,S,V) :- .count(committed(_,M,S),V).
// status of a scheme S
well_formed(S)
:mplayers(mBib,S,V1) &amp; V1 &gt;= 1 &amp; V1 &lt;= 1 &amp;
mplayers(mCol,S,V2) &amp; V2 &gt;= 1 &amp; V2 &lt;= 5 &amp;
mplayers(mMan,S,V3) &amp; V3 &gt;= 1 &amp; V3 &lt;= 1.
// ready goals: all pre-conditions have been achieved
ready(S,G)
:goal(_, G, PCG, _) &amp; all_achieved(S,PCG).
all_achieved(_,[]).
all_achieved(S,[G|T])
:achieved(S,G,_) &amp; all_achieved(S,T).</p>
      </sec>
      <sec id="sec-2-3">
        <title>C. Norms</title>
        <p>We have three classes of norms in NOPL: norms for goals,
norms for properties, and domain norms (which are explicitly
stated in the normative specification). For the former class, we
have the following norm:
// agents are obliged to fulfil their ready goals
norm ngoa:
committed(A,M,S) &amp; goal(M,G,_,D) &amp;
well_formed(S) &amp; ready(S,G)
-&gt; obligation(A,ngoa,achieved(S,G,A),‘now‘ + D).</p>
        <p>This norm can be read as “when an agent A: (1) is committed
to a mission M that (2) includes a goal G, and (3) the mission’s
scheme is well-formed, and (4) the goal is ready, then agent
A is obliged to achieve the goal G before the deadline for the
goal”. This norm thus gives a precise semantics for
commitment. It also illustrates the advantage of using a translation to
implement the OMI instead of an object oriented programming
language. For example, if some application or experiment
requires a semantics of commitment where the agent is obliged
to achieve the goal even if the scheme is not well-formed,
it is simply a matter of changing the translation to a norm
that does not include the well_formed(S) predicate in the
activation condition of the norm. One could even conceive an
application using schemes being managed by different NOPL
programs (i.e. schemes translated differently).</p>
        <p>For the second class of norms, only the mission cardinality
property is considered in this paper since other properties are
handled in a similar way. In the case of mission cardinality, the
norm has to define the consequences of a circumstance where
there are more agents committed to a mission than permitted
in the scheme specification. As presented in Sec. II, two kinds
of consequences are possible, obligation and regimentation,
and the designer chooses one or the other when writing
the OS. Regimentation is the default consequence and it
is used when there is no norm with condition #mc in the
normative specification. Otherwise, as in norm n6 of Table I,
the consequence will be an obligation. The norm for mission
cardinality regimentation is:
// norm for the cardinality regimentation
norm mission_cardinality:
scheme_mission(M,_,MMax) &amp;
mplayers(M,S,MP) &amp; MP &gt; MMax
-&gt; fail(mission_cardinality).
and the norm without regimentation is:
// norm for the cardinality regimentation
norm mission_cardinality:
scheme_mission(M,_,MMax) &amp;
mplayers(M,S,MP) &amp; MP &gt; MMax
responsible(Gr,S) &amp; plays(A,editor,Gr)
-&gt; obligation(A,mission_cardinality,</p>
        <p>committed(A,ms,_), ‘now‘+‘1 hour‘).
where the agent playing editor is obliged to commit to the
mission ms in one hour.</p>
        <p>For the third class of norms, each norm in the normative
specification of the OML has a corresponding norm in NOPL.
Whereas OML obligations refer to roles and missions, NPL
requires that obligations are for agents and towards a goal.
The NOPL norm thus identifies the agents playing the role
in groups responsible for the scheme and, if the number of
players still does not reach the maximum, the agent is obliged
to achieve a state where it is committed to the mission. For
example, the NOPL norm for norm n2 of Table I is:
norm n2:
plays(A,writer,Gr) &amp; responsible(Gr,S) &amp;
mplayers(mCol,S,V) &amp; V &lt; 5
-&gt; obligation(A,n2,committed(A,mCol,S),‘now‘+‘1 day‘).</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>V. ARTIFACT-BASED ARCHITECTURE</title>
      <p>
        The proposals of this paper have been implemented on
an OMI that follows the Agent &amp; Artifact [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. In
this approach, a set of organisational artifacts is available
in the MAS environment providing operations for the agents
so that they can interact with the OMI. For example, each
scheme instance is managed by an artifact. We can effortlessly
distribute the OMI by deploying as many artifacts as necessary
for the application.
      </p>
      <p>
        Each organisational artifact has an NPL interpreter loaded
with (i) the NOPL program automatically generated from
the OS for the type of the artifact and (ii) dynamic facts
representing the current state of (part of) the organisation. The
interpreter is then used to compute: (i) whether some operation
will bring the organisation into a inconsistent state (where
inconsistency is defined by the designer by means of
regimentations), and (ii) the current state of the obligations. The
following algorithm, implemented on top of CArtAgO [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ],
shows the general pattern we used to implement every
operation (e.g. role adoption, commitment to mission) in the
organisational artifacts. In this new approach, the artifacts
still provide an interface for the agents, and are now mostly
programmed in NOPL instead of Java.
      </p>
      <p>// let oe be the current state of the organisation managed by the
artifact
// let p be the current NOPL program
// let npi be the NPL interpreter
when an operation o is triggered by agent a do
oe0 oe // creates a “backup” of current oe
executes operation o to change oe
f a list of predicates representing oe
r npi(p; f ) // runs the interpreter for the new state
if r = fail then
oe oe0 // restore the state backup
fail operation o
else
update obligations in the observable properties
succeed operation o</p>
      <p>We also developed a program that automatically generate
the NOPL given an OS, however, due the lack of space, it is
not presented here. The reader will find more details about this
architecture, the translation, and a complete implementation of
this OMI at https://sourceforge.net/scm/?type=svn&amp;group id=
163721.</p>
    </sec>
    <sec id="sec-4">
      <title>VI. RELATED WORKS</title>
      <p>This work is based on several approaches to organisation,
institutions, and norms (cited throughout the paper). In this
section, we briefly relate and compare our main contributions
to such work.</p>
      <p>
        The first contribution of the paper, the NPL, should be
considered specially for two properties of the language: its
simplicity and its formalisation (that led to an available
implementation). Similar work has been done by Tinnemeier
et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], where the operational semantics for a normative
language was also proposed. They assume the availability of
a snapshot of the global state of the organisation to evaluate
activation of norms, which may hinder the implementation in
a distributed scenario. Our NPL also requires a snapshot of
the organisational artifact state to evaluate norms, however
the distribution problem is solved by generating different
normative programs for several distributed artifacts where only
the local state of the organisation is required. Another
important difference is that in our approach the designer specifies
the organisation in a higher-level language (OML) that is
translated into a normative programmin language (NOPL).
      </p>
      <p>
        Regarding the second contribution, namely the automatic
translation, we were inspired by work on ISLANDER [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ].
The main difference here is the initial and target languages.
While they translate a normative specification into a rule-based
language, we start from an organisational language and target
at a normative language. It is simpler to translate organisational
norms into NPL norms, since we have norms in both sides
of the translation it is a 1-to-1 translation, than translate
organisational norms into rules.
      </p>
      <p>
        Regarding the third contribution, the OMI, we started from
ORA4MAS [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. The advantages of the approach presented
here are twofold: (i) it is easier to change the translation
than the Java implementation of the OMI; and (ii) from the
operational semantics of NPL and the formal translation we
are taking significant steps towards a formal semantics for
      </p>
      <p>In this paper we showed an approach for translating an
organisation specification written in MOISE OML into a
normative program that can be interpreted by an artifact based
OMI. Focusing on the translation instead of Java coding,
we have brought flexibility to the development of the OMI.
We also stressed the point that such a normative language
can be based on only two basic concepts: regimentation and
obligation. Prohibitions are considered either as regimentation
or as an obligation for someone else. The resulting NPL is thus
simpler to formalise (only 6 rules in operational semantics)
and implement. Future work will explore NPL translations for
other organisational and institutional languages. We also plan
to prove correctness of the translation from OML into NOPL
in future work.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>O.</given-names>
            <surname>Boissier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Hu</surname>
          </string-name>
          <article-title>¨bner, and</article-title>
          <string-name>
            <given-names>J. S.</given-names>
            <surname>Sichman</surname>
          </string-name>
          , “
          <article-title>Organization oriented programming from closed to open organizations,” in Engineering Societies in the Agents World VII (ESAW 06), ser</article-title>
          . LNCS,
          <string-name>
            <surname>G. O'Hare</surname>
          </string-name>
          ,
          <string-name>
            <surname>M. O'Grady</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <string-name>
            <surname>Dikenelli</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <surname>A</surname>
          </string-name>
          . Ricci, Eds., vol.
          <volume>4457</volume>
          . Springer,
          <year>2007</year>
          , pp.
          <fpage>86</fpage>
          -
          <lpage>105</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>M.</given-names>
            <surname>Esteva</surname>
          </string-name>
          , D. de la Cruz, and
          <string-name>
            <given-names>C.</given-names>
            <surname>Sierra</surname>
          </string-name>
          , “
          <article-title>ISLANDER: an electronic institutions editor</article-title>
          ,
          <source>” in Proc. of the First International Joint Conference on Autonomous Agents and MultiAgent Systems (AAMAS</source>
          <year>2002</year>
          )
          <article-title>, ser</article-title>
          . LNAI 1191,
          <string-name>
            <given-names>C.</given-names>
            <surname>Castelfranchi</surname>
          </string-name>
          and W. L. Johnson, Eds. Springer,
          <year>2002</year>
          , pp.
          <fpage>1045</fpage>
          -
          <lpage>1052</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>V.</given-names>
            <surname>Dignum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Vazquez-Salceda</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Dignum</surname>
          </string-name>
          , “OMNI:
          <article-title>Introducing social structure, norms and ontologies into agent organizations,” in Proc. of the Programming Multi-Agent Systems (ProMAS 2004), ser</article-title>
          . LNAI 3346,
          <string-name>
            <given-names>R. H.</given-names>
            <surname>Bordini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dastani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Dix</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>El</surname>
          </string-name>
          Fallah-Seghrouchni, Eds. Berlin: Springer,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Hu</surname>
          </string-name>
          <article-title>¨bner</article-title>
          ,
          <string-name>
            <given-names>J. S.</given-names>
            <surname>Sichman</surname>
          </string-name>
          , and
          <string-name>
            <given-names>O.</given-names>
            <surname>Boissier</surname>
          </string-name>
          , “
          <article-title>Developing organised multi-agent systems using the MOISE+ model: Programming issues at the system and agent levels</article-title>
          ,”
          <source>International Journal of Agent-Oriented Software Engineering</source>
          , vol.
          <volume>1</volume>
          , no.
          <issue>3</issue>
          /4, pp.
          <fpage>370</fpage>
          -
          <lpage>395</lpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>J.</given-names>
            <surname>Ferber</surname>
          </string-name>
          and
          <string-name>
            <given-names>O.</given-names>
            <surname>Gutknecht</surname>
          </string-name>
          , “
          <article-title>A meta-model for the analysis and design of organizations in multi-agents systems,”</article-title>
          <source>in Proc. of the 3rd International Conference on Multi-Agent Systems (ICMAS'98)</source>
          , Y. Demazeau, Ed. IEEE Press,
          <year>1998</year>
          , pp.
          <fpage>128</fpage>
          -
          <lpage>135</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>D. V.</given-names>
            <surname>Pynadath</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Tambe</surname>
          </string-name>
          , “
          <article-title>An automated teamwork infrastructure for heterogeneous software agents and humans</article-title>
          ,” Autonomous Agents and
          <string-name>
            <surname>Multi-Agent</surname>
            <given-names>Systems</given-names>
          </string-name>
          , vol.
          <volume>7</volume>
          , no.
          <issue>1-2</issue>
          , pp.
          <fpage>71</fpage>
          -
          <lpage>100</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>N.</given-names>
            <surname>Tinnemeier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dastani</surname>
          </string-name>
          , and J.-J. Meyer, “
          <article-title>Roles and norms for programming agent organizations,”</article-title>
          <source>in Proc. of AAMAS 09</source>
          ,
          <string-name>
            <surname>J. Sichman</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          <string-name>
            <surname>Decker</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Sierra</surname>
          </string-name>
          , and C. Castelfranchi, Eds.,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Garc</surname>
          </string-name>
          <article-title>´ıa-</article-title>
          <string-name>
            <surname>Camino</surname>
            ,
            <given-names>J. A.</given-names>
          </string-name>
          <string-name>
            <surname>Rodr</surname>
          </string-name>
          <article-title>´ıguez-</article-title>
          <string-name>
            <surname>Aguilar</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Sierra</surname>
          </string-name>
          , and W. Vasconcelos, “
          <article-title>Constraining rule-based programming norms for electronic institutions</article-title>
          ,
          <source>” Journal of Autonomous Agents and Multi-Agent Systems</source>
          , vol.
          <volume>18</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>186</fpage>
          -
          <lpage>217</lpage>
          ,
          <year>Feb 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>F. L.</surname>
          </string-name>
          y Lo´pez, M. Luck, and M. d'Inverno, “
          <article-title>Constraining autonomy through norms,”</article-title>
          <source>in Proc. of first ICMAS. ACM</source>
          ,
          <year>2002</year>
          , pp.
          <fpage>674</fpage>
          -
          <lpage>681</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>D.</given-names>
            <surname>Grossi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Aldewered</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Dignum</surname>
          </string-name>
          , “Ubi Lex, Ibi Poena:
          <article-title>Designing norm enforcement in e-institutions,” in Coordination, Organizations, Institutions, and Norms in Agent Systems II, ser</article-title>
          . LNAI,
          <string-name>
            <given-names>P.</given-names>
            <surname>Noriega</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          <article-title>Va´zquez-</article-title>
          <string-name>
            <surname>Salceda</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <string-name>
            <surname>Boella</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <string-name>
            <surname>Boissier</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Dignum</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Fornara</surname>
          </string-name>
          , and E. Matson, Eds., vol.
          <volume>4386</volume>
          . Springer,
          <year>2007</year>
          , pp.
          <fpage>101</fpage>
          -
          <lpage>114</lpage>
          , revised Selected Papers.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>N.</given-names>
            <surname>Fornara</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Colombetti</surname>
          </string-name>
          , “
          <article-title>Specifying and enforcing norms in artificial institutions,”</article-title>
          <source>in Proc. of the 4th European Workshop on Multi-Agent Systems (EUMAS 06)</source>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Dunin-Keplicz</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <surname>J</surname>
          </string-name>
          . Padget, Eds.,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J.</given-names>
            <surname>Va</surname>
          </string-name>
          <article-title>´zquez-</article-title>
          <string-name>
            <surname>Salceda</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Aldewereld</surname>
            , and
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Dignum</surname>
          </string-name>
          , “
          <article-title>Norms in multiagent systems: some implementation guidelines,”</article-title>
          <source>in Proc. of the Second European Workshop on Multi-Agent Systems (EUMAS</source>
          <year>2004</year>
          ),
          <year>2004</year>
          ,
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>G. D.</given-names>
            <surname>Plotkin</surname>
          </string-name>
          , “
          <article-title>A structural approach to operational semantics</article-title>
          ,” Computer Science Department, Aarhus University, Aarhus, Denmark,
          <source>Tech. Rep.</source>
          ,
          <year>1981</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ricci</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Viroli</surname>
          </string-name>
          , “
          <article-title>Artifacts in the A&amp;A meta-model for multi-agent systems</article-title>
          ,” Autonomous Agents and
          <string-name>
            <surname>Multi-Agent</surname>
            <given-names>Systems</given-names>
          </string-name>
          , vol.
          <volume>17</volume>
          (
          <issue>3</issue>
          ), pp.
          <fpage>432</fpage>
          -
          <lpage>456</lpage>
          , Dec.
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Hu</surname>
          </string-name>
          <article-title>¨bner,</article-title>
          <string-name>
            <surname>O. Boissier</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Kitio</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Ricci</surname>
          </string-name>
          , “
          <article-title>Instrumenting multiagent organisations with organisational artifacts and agents: “giving the organisational power back to the agents”</article-title>
          ,
          <source>” Journal of Autonomous Agents and Multi-Agent Systems</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>A.</given-names>
            <surname>Ricci</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Piunti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Viroli</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          , “
          <article-title>Environment programming in CArtAgO,” in Multi-Agent Programming: Languages, Tools and Applications</article-title>
          ,
          <string-name>
            <given-names>R. H.</given-names>
            <surname>Bordini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dastani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Dix</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>El Fallah</surname>
          </string-name>
          Seghrouchni, Eds. Springer,
          <year>2009</year>
          , ch. 8, pp.
          <fpage>259</fpage>
          -
          <lpage>288</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>V. T.</surname>
          </string-name>
          <article-title>da Silva, “From the specification to the implementation of norms: an automatic approach to generate rules from norm to govern the behaviour of agents,” Journal of Autonomous Agents and Multi-Agent Systems</article-title>
          , vol.
          <volume>17</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>113</fpage>
          -
          <lpage>155</lpage>
          ,
          <year>Aug 2008</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>