Norm-oriented programming of electronic institutions: A rule-based approach
Available from www.garcia-camino.es
Page 1
Norm-oriented programming of electronic institutions: A rule-based approach
Norm-Oriented Programming of Electronic
Institutions: A Rule-based Approach
Andre´s Garc´ıa-Camino1, Juan-Antonio Rodr´ıguez-Aguilar1, Carles Sierra1, and
Wamberto Vasconcelos2
1 IIIA-CSIC, Campus UAB, 08193 Bellaterra, Spain
{andres, jar, sierra}@iiia.csic.es
2 Dept. of Computing Science, University of Aberdeen,
Aberdeen AB24 3UE, United Kingdom
wvasconcelos@acm.org
Abstract. Norms constitute a powerful coordination mechanism among
heterogeneous agents. We propose means to specify and explicitly man-
age the normative positions of agents (permissions, prohibitions and obli-
gations), with which distinct deontic notions and their relationships can
be captured. Our rule-based formalism includes constraints for more ex-
pressiveness and precision and allows the norm-oriented programming of
electronic institutions: normative aspects are given a precise computa-
tional interpretation. Our formalism has been conceived as a machine lan-
guage to which other higher-level normative languages can be mapped,
allowing their execution.
1 Introduction
A major challenge in multi-agent system (MAS) research is the design and imple-
mentation of open multi-agent systems in which coordination must be achieved
among agents defined with different languages by several designers who may not
trust each other. Norms can be used for this purpose as a means to regulate the
observable behaviour of agents as they interact in pursuit of their goals [1–3].
There is a wealth of socio-philosophical and logic-theoretical literature on the
subject of norms (e.g., [4, 5]), and, more recently, much attention is being paid
to more pragmatic and implementational aspects of norms, that is, how norms
can be given a computational interpretation and how norms can be factored in
in the design and execution of MASs (e.g. [6–10]).
A normative position [4] is the “social burden” associated with individual
agents, that is, their obligations, permissions and prohibitions. Depending on
what agents do, their normative positions may change – for instance, permis-
sions/prohibitions can be revoked or obligations, once fulfilled, may be removed.
Ideally, norms, once captured via some suitable formalism, should be directly ex-
ecuted, thus realising a computational, normative environment wherein agents
interact. This is what we mean by norm-oriented programming. We try to make
headway along this direction by introducing an executable language to specify
Institutions: A Rule-based Approach
Andre´s Garc´ıa-Camino1, Juan-Antonio Rodr´ıguez-Aguilar1, Carles Sierra1, and
Wamberto Vasconcelos2
1 IIIA-CSIC, Campus UAB, 08193 Bellaterra, Spain
{andres, jar, sierra}@iiia.csic.es
2 Dept. of Computing Science, University of Aberdeen,
Aberdeen AB24 3UE, United Kingdom
wvasconcelos@acm.org
Abstract. Norms constitute a powerful coordination mechanism among
heterogeneous agents. We propose means to specify and explicitly man-
age the normative positions of agents (permissions, prohibitions and obli-
gations), with which distinct deontic notions and their relationships can
be captured. Our rule-based formalism includes constraints for more ex-
pressiveness and precision and allows the norm-oriented programming of
electronic institutions: normative aspects are given a precise computa-
tional interpretation. Our formalism has been conceived as a machine lan-
guage to which other higher-level normative languages can be mapped,
allowing their execution.
1 Introduction
A major challenge in multi-agent system (MAS) research is the design and imple-
mentation of open multi-agent systems in which coordination must be achieved
among agents defined with different languages by several designers who may not
trust each other. Norms can be used for this purpose as a means to regulate the
observable behaviour of agents as they interact in pursuit of their goals [1–3].
There is a wealth of socio-philosophical and logic-theoretical literature on the
subject of norms (e.g., [4, 5]), and, more recently, much attention is being paid
to more pragmatic and implementational aspects of norms, that is, how norms
can be given a computational interpretation and how norms can be factored in
in the design and execution of MASs (e.g. [6–10]).
A normative position [4] is the “social burden” associated with individual
agents, that is, their obligations, permissions and prohibitions. Depending on
what agents do, their normative positions may change – for instance, permis-
sions/prohibitions can be revoked or obligations, once fulfilled, may be removed.
Ideally, norms, once captured via some suitable formalism, should be directly ex-
ecuted, thus realising a computational, normative environment wherein agents
interact. This is what we mean by norm-oriented programming. We try to make
headway along this direction by introducing an executable language to specify
Page 2
agents’ normative positions and manage their changes as agents interact via
speech acts [11].
In this paper we present a language that acts as a “machine language” for
norms on top of which different, higher-level normative languages can be accom-
modated. This language can represent distinct flavours of deontic notions and
relationships. Although our language is rule-based, we achieve greater flexibility,
expressiveness and precision than production systems by allowing constraints to
be part of our rules and states of affairs. In this way, normative positions can
be further refined. For instance, picture a selling agent that is obliged to deliver
a good satisfying some quality requirements before a deadline. Notice that both
the quality requirements and the delivery deadline can be regarded as constraints
that must be considered as part of the obligations. Thus, when the agent de-
livers the good satisfying all the constraints, we should regard the obligation as
fulfilled. Notice too that since the deadline might eventually be changed, we also
require the capability of modifying constraints at run-time. Hence, constraints
are considered as first-class citizens in our language.
Although in this paper we restrict to a particular class of MASs, namely elec-
tronic institutions [12], our work sets the foundations to specify and implement
open regulated MASs via norms.
The structure of this paper is as follows. In the next section we present
desirable properties of normative languages. In section 3 we propose a simple
normative language that covers all these requirements along with a sketch of an
implementation of an interpreter. Section 4 summarises electronic institutions
and explains how we capture normative positions of participating agents. We
put our language to use by specifying the Dutch Auction protocol in section
5. In section 6 we contrast our approach with a sample of other contemporary
work. Finally, we draw conclusions and outline future work in section 7.
2 Norm-Oriented MAS: Desiderata
Our main goal is to produce a language that supports the specification of coordi-
nation mechanisms in multi-agent systems by means of norms. For this purpose,
we identify below the desirable features we expect in candidate languages.
Explicit Management of normative positions We take the stance that we
cannot refer to agents’ mentalistic notions, but only to their observable ac-
tions and their normative positions. Notice that as a result of agents’ ob-
servable, social interactions, their normative positions [4] change. Hence, the
first requirement of our language is to support the explicit management of
agents’ normative positions.
General purpose Turning our attention to theoretical models of norms, we
notice that there is a plethora of deontic logics with different axioms to
establish relationships among deontic notions. Thus, we require that our
language captures different deontic notions along with their relationships. In
other words, the language must be of general purpose so that it helps MAS
speech acts [11].
In this paper we present a language that acts as a “machine language” for
norms on top of which different, higher-level normative languages can be accom-
modated. This language can represent distinct flavours of deontic notions and
relationships. Although our language is rule-based, we achieve greater flexibility,
expressiveness and precision than production systems by allowing constraints to
be part of our rules and states of affairs. In this way, normative positions can
be further refined. For instance, picture a selling agent that is obliged to deliver
a good satisfying some quality requirements before a deadline. Notice that both
the quality requirements and the delivery deadline can be regarded as constraints
that must be considered as part of the obligations. Thus, when the agent de-
livers the good satisfying all the constraints, we should regard the obligation as
fulfilled. Notice too that since the deadline might eventually be changed, we also
require the capability of modifying constraints at run-time. Hence, constraints
are considered as first-class citizens in our language.
Although in this paper we restrict to a particular class of MASs, namely elec-
tronic institutions [12], our work sets the foundations to specify and implement
open regulated MASs via norms.
The structure of this paper is as follows. In the next section we present
desirable properties of normative languages. In section 3 we propose a simple
normative language that covers all these requirements along with a sketch of an
implementation of an interpreter. Section 4 summarises electronic institutions
and explains how we capture normative positions of participating agents. We
put our language to use by specifying the Dutch Auction protocol in section
5. In section 6 we contrast our approach with a sample of other contemporary
work. Finally, we draw conclusions and outline future work in section 7.
2 Norm-Oriented MAS: Desiderata
Our main goal is to produce a language that supports the specification of coordi-
nation mechanisms in multi-agent systems by means of norms. For this purpose,
we identify below the desirable features we expect in candidate languages.
Explicit Management of normative positions We take the stance that we
cannot refer to agents’ mentalistic notions, but only to their observable ac-
tions and their normative positions. Notice that as a result of agents’ ob-
servable, social interactions, their normative positions [4] change. Hence, the
first requirement of our language is to support the explicit management of
agents’ normative positions.
General purpose Turning our attention to theoretical models of norms, we
notice that there is a plethora of deontic logics with different axioms to
establish relationships among deontic notions. Thus, we require that our
language captures different deontic notions along with their relationships. In
other words, the language must be of general purpose so that it helps MAS
Page 3
designers to encode any axiomatisation, and thus specify the widest range
of normative systems as possible.
Pragmatic In a sense, we pursue a “machine language” for norms on top of
which higher-level languages may be accommodated. Along this direction,
and from a language designer’s point of view, it is fundamental to identify
the norm patterns (e.g., conditional obligation, time-based permissions and
prohibitions, continuous obligation, and so on) in the literature to ensure
that the language supports their encoding – this is demonstrated in sec-
tion 6. In this way, not only shall we be guaranteeing the expressiveness of
our language, but also addressing pragmatic concerns by providing design
patterns to guide and ease MAS design.
Declarative In order to ease MAS programming, we shall also require our
language to be declarative, with an implicit execution mechanism to reduce
the number of issues designers ought to concentrate on. As an additional
benefit, we expect its declarative nature to facilitate verification of properties
of the specifications.
3 A Rule Language for Norms
In this section we introduce a rule language for the explicit management of
norms associated with a population of agents. Our rule-based language allow
us to represent changes in an elegant way and also fulfils the requirement that
a normative language should be declarative. The rules depict how normative
positions change as agents interact with each other. We achieve greater flexibility,
expressiveness and precision by allowing constraints [13] to be part of our rules
– such constraints associate further restrictions with permissions, prohibitions
and obligations.
The building blocks of our language are first-order terms (denoted as τ) and
implicitly, universally quantified atomic formulae (denoted as α) without free
variables . We shall make use of numbers and arithmetic functions to build terms;
arithmetic functions may appear infix, following their usual conventions3. We
also employ arithmetic relations (e.g., =, 6=, and so on) as predicate symbols, and
these will appear in their usual infix notation with their usual meaning. Atomic
formulae with arithmetic relations represent constraints on their variables and
have a special status, as we explain below. We give a definition of our constraints,
a subset of atomic formulae:
Definition 1. A constraint γ is an atomic formula of the form τ C τ ′, where
C∈ {=, 6=, >,≥, <,≤}.
We need to differentiate ordinary atomic formula from constraints. We shall use
α′ to denote atomic formulae that are not constraints.
3 We adopt Prolog’s convention using strings starting with a capital letter to represent variables
and strings starting with a small letter to represent constants.
of normative systems as possible.
Pragmatic In a sense, we pursue a “machine language” for norms on top of
which higher-level languages may be accommodated. Along this direction,
and from a language designer’s point of view, it is fundamental to identify
the norm patterns (e.g., conditional obligation, time-based permissions and
prohibitions, continuous obligation, and so on) in the literature to ensure
that the language supports their encoding – this is demonstrated in sec-
tion 6. In this way, not only shall we be guaranteeing the expressiveness of
our language, but also addressing pragmatic concerns by providing design
patterns to guide and ease MAS design.
Declarative In order to ease MAS programming, we shall also require our
language to be declarative, with an implicit execution mechanism to reduce
the number of issues designers ought to concentrate on. As an additional
benefit, we expect its declarative nature to facilitate verification of properties
of the specifications.
3 A Rule Language for Norms
In this section we introduce a rule language for the explicit management of
norms associated with a population of agents. Our rule-based language allow
us to represent changes in an elegant way and also fulfils the requirement that
a normative language should be declarative. The rules depict how normative
positions change as agents interact with each other. We achieve greater flexibility,
expressiveness and precision by allowing constraints [13] to be part of our rules
– such constraints associate further restrictions with permissions, prohibitions
and obligations.
The building blocks of our language are first-order terms (denoted as τ) and
implicitly, universally quantified atomic formulae (denoted as α) without free
variables . We shall make use of numbers and arithmetic functions to build terms;
arithmetic functions may appear infix, following their usual conventions3. We
also employ arithmetic relations (e.g., =, 6=, and so on) as predicate symbols, and
these will appear in their usual infix notation with their usual meaning. Atomic
formulae with arithmetic relations represent constraints on their variables and
have a special status, as we explain below. We give a definition of our constraints,
a subset of atomic formulae:
Definition 1. A constraint γ is an atomic formula of the form τ C τ ′, where
C∈ {=, 6=, >,≥, <,≤}.
We need to differentiate ordinary atomic formula from constraints. We shall use
α′ to denote atomic formulae that are not constraints.
3 We adopt Prolog’s convention using strings starting with a capital letter to represent variables
and strings starting with a small letter to represent constants.
Page 4
Intuitively, a state of affairs is a set of atomic formulae. As we will show
below, they can store the state of the environment4, observable agent attributes
and the normative positions of agents:
Definition 2. A state of affairs ∆ = {α0, . . . , αn} is a a finite and possibly
empty set of implicitly, universally quantified atomic formulae αi , 0 ≤ i ≤ n,n ∈
IN .
Our rules are constructs of the form LHS RHS, where LHS contains a
representation of parts of the current state of affairs which, if they hold, will cause
the rule to be triggered. RHS depicts the updates to the current state of affairs,
yielding the next state of affairs. The grammar in Fig. 1 defines our rules, where x
is a variable name and LHS∗ is a LHS without set constructors (see below). The
Us represent the updates: they add (via operator ⊕) or remove (via operator )
atomic formulae αs. Furthermore, we make use of a special kind of term, called
a set constructor, represented as {α′ | LHS∗}. This construct is useful when we
need to refer to all α′s for which LHS∗ holds,e.g., {p(A,B) | A > 20∧B < 100}
is the set of atomic formulae p(A,B) such that A > 20 and B < 100.
R ::= LHS RHS
LHS ::= LHS ∧ LHS | ¬LHS | Lit
RHS ::= U •RHS | U
Lit ::= α | x = {α′ | LHS∗}
U ::= ⊕α | α
Fig. 1. Grammar for Rules
We need to refer to the set of constraints that belongs to a state of affairs.
We call Γ = {γ0, . . . , γn} the set of all constraints in ∆.
Definition 3. Given a state of affairs ∆, relationship constrs(∆,Γ ) holds iff
Γ is the smallest set such that for every γ ∈ ∆ then γ ∈ Γ .
In the definitions below we rely on the concept of substitution, that is, the set
of values for variables in a computation, as well as the concept of its application
to a term [14]. We now define the semantics of our rules as relationships between
states of affairs: rules map an existing state of affairs to a new state of affairs.
We adopt the usual semantics of production rules, that is, we exhaustively apply
each rule by matching its LHS against the current state of affairs and use the
values of variables obtained in this match to instantiate the RHS via s∗.
Definition 4. s∗(∆,LHS RHS,∆′) holds iff s∗l (∆,LHS, {σ1, . . . , σn}) and
sr (∆,RHS · σi ,∆′), 1 ≤ i ≤ n,n ∈ IN , hold.
That is, two states of affairs ∆ and ∆′ are related by a rule LHS RHS if, and
only if, we obtain all different substitutions {σ1, . . . , σn} that make the left-hand
4 We refer to the state of the environment as the set of atomic formulae that represent the aspects
of the environment in a given point in time.
below, they can store the state of the environment4, observable agent attributes
and the normative positions of agents:
Definition 2. A state of affairs ∆ = {α0, . . . , αn} is a a finite and possibly
empty set of implicitly, universally quantified atomic formulae αi , 0 ≤ i ≤ n,n ∈
IN .
Our rules are constructs of the form LHS RHS, where LHS contains a
representation of parts of the current state of affairs which, if they hold, will cause
the rule to be triggered. RHS depicts the updates to the current state of affairs,
yielding the next state of affairs. The grammar in Fig. 1 defines our rules, where x
is a variable name and LHS∗ is a LHS without set constructors (see below). The
Us represent the updates: they add (via operator ⊕) or remove (via operator )
atomic formulae αs. Furthermore, we make use of a special kind of term, called
a set constructor, represented as {α′ | LHS∗}. This construct is useful when we
need to refer to all α′s for which LHS∗ holds,e.g., {p(A,B) | A > 20∧B < 100}
is the set of atomic formulae p(A,B) such that A > 20 and B < 100.
R ::= LHS RHS
LHS ::= LHS ∧ LHS | ¬LHS | Lit
RHS ::= U •RHS | U
Lit ::= α | x = {α′ | LHS∗}
U ::= ⊕α | α
Fig. 1. Grammar for Rules
We need to refer to the set of constraints that belongs to a state of affairs.
We call Γ = {γ0, . . . , γn} the set of all constraints in ∆.
Definition 3. Given a state of affairs ∆, relationship constrs(∆,Γ ) holds iff
Γ is the smallest set such that for every γ ∈ ∆ then γ ∈ Γ .
In the definitions below we rely on the concept of substitution, that is, the set
of values for variables in a computation, as well as the concept of its application
to a term [14]. We now define the semantics of our rules as relationships between
states of affairs: rules map an existing state of affairs to a new state of affairs.
We adopt the usual semantics of production rules, that is, we exhaustively apply
each rule by matching its LHS against the current state of affairs and use the
values of variables obtained in this match to instantiate the RHS via s∗.
Definition 4. s∗(∆,LHS RHS,∆′) holds iff s∗l (∆,LHS, {σ1, . . . , σn}) and
sr (∆,RHS · σi ,∆′), 1 ≤ i ≤ n,n ∈ IN , hold.
That is, two states of affairs ∆ and ∆′ are related by a rule LHS RHS if, and
only if, we obtain all different substitutions {σ1, . . . , σn} that make the left-hand
4 We refer to the state of the environment as the set of atomic formulae that represent the aspects
of the environment in a given point in time.
Page 5
side match ∆ and apply these substitutions to RHS (that is, RHS ·σi) in order
to build ∆′.
Our rules are exhaustively applied on the state of affairs thus considering
all matching atomic formulae. We thus need relationship s∗l (∆,LHS,Σ) which
obtains in Σ = {σ0, . . . , σn} all possible matches of the left-hand side of a rule:
Definition 5. s∗l (∆,LHS,Σ) holds, iff Σ = {σ1, . . . , σn} is the largest non-
empty set such that sl(∆,LHS, σi), 1 ≤ i ≤ n,n ∈ IN , holds.
We now define the semantics of the LHS of a rule:
Definition 6. sl(∆,LHS, σ) holds between state ∆, the left-hand side of a rule
LHS and a substitution σ depending on the format of LHS:
1. sl(∆,LHS ∧ LHS
′, σ) holds iff sl(∆,LHS, σ′) and sl(∆,LHS
′, σ′′) hold
and σ = σ′ ∪ σ′′.
2. sl(∆,¬ LHS, σ) holds iff sl(∆,LHS, σ) does not hold.
3. sl(∆,α′, σ) holds iff α′ · σ ∈ ∆ and constrs(∆,Γ ) and satisfiable(Γ · σ)
hold.
4. sl(∆, γ, σ) holds iff constrs(∆,Γ ) and satisfiable((Γ ∪ {γ}) · σ) hold.
5. sl(∆, x = {α′ | LHS
′}, σ) holds iff σ = {x/{α′ · σ1, . . . , α′ · σn}} for the
largest n ∈ IN such that sl(∆,α′ ∧ LHS
′, σi), 1 ≤ i ≤ n
Cases 1-3 depict the semantics of atomic formulae and how their individual
substitutions are combined to provide the semantics for a conjunction. Case 4
formalises the semantics of our constraints when they appear on the left-hand
side of a rule: we apply the substitution σ to them (thus reflecting any values of
variables given by the matchings of atomic formula), then check satisfiability of
constraints 5. Case 5 specifies the semantics for set constructors: x is the set of
atomic formulae that satisfy the conditions of the set constructor.
Definition 7. Relation sr (∆,RHS,∆′) mapping a state ∆, the right-hand side
of a rule RHS and a new state ∆′ is defined as:
1. sr (∆, (U •RHS),∆′) holds iff both sr (∆,U,∆1) and sr (∆1, RHS,∆′) hold.
2. sr (∆,⊕α′,∆′) holds iff ∆′ = ∆ ∪ {α′}.
3. sr (∆,⊕γ,∆′) = true iff constrs(∆,Γ ) and satisfiable(Γ ∪ {γ}) hold and
∆′ = ∆ ∪ {γ}.
4. sr (∆, α,∆′) holds iff ∆′ = ∆ \ {α}
Case 1 decomposes a conjunction and builds the new state by merging the
partial states of each update. Case 2 cater for the insertion of atomic formulae
α′ which do not conform to the syntax of constraints. Case 3 defines how a
constraint is added to a state ∆: the new constraint is checked whether it can
be satisfied with constraints Γ and then it is added to ∆′. Case 4 cater for the
removal of atomic formulae.
We extend s∗ to handle sequences of rules: s∗(∆0, 〈R1, . . . ,Rn〉,∆n) holds iff
s∗(∆i−1,Ri ,∆i), 1 ≤ i ≤ n hold.
5 Our work builds on standard technologies for constraint solving – in particular, we have been
experimenting with SICStus Prolog constraint satisfaction libraries.
to build ∆′.
Our rules are exhaustively applied on the state of affairs thus considering
all matching atomic formulae. We thus need relationship s∗l (∆,LHS,Σ) which
obtains in Σ = {σ0, . . . , σn} all possible matches of the left-hand side of a rule:
Definition 5. s∗l (∆,LHS,Σ) holds, iff Σ = {σ1, . . . , σn} is the largest non-
empty set such that sl(∆,LHS, σi), 1 ≤ i ≤ n,n ∈ IN , holds.
We now define the semantics of the LHS of a rule:
Definition 6. sl(∆,LHS, σ) holds between state ∆, the left-hand side of a rule
LHS and a substitution σ depending on the format of LHS:
1. sl(∆,LHS ∧ LHS
′, σ) holds iff sl(∆,LHS, σ′) and sl(∆,LHS
′, σ′′) hold
and σ = σ′ ∪ σ′′.
2. sl(∆,¬ LHS, σ) holds iff sl(∆,LHS, σ) does not hold.
3. sl(∆,α′, σ) holds iff α′ · σ ∈ ∆ and constrs(∆,Γ ) and satisfiable(Γ · σ)
hold.
4. sl(∆, γ, σ) holds iff constrs(∆,Γ ) and satisfiable((Γ ∪ {γ}) · σ) hold.
5. sl(∆, x = {α′ | LHS
′}, σ) holds iff σ = {x/{α′ · σ1, . . . , α′ · σn}} for the
largest n ∈ IN such that sl(∆,α′ ∧ LHS
′, σi), 1 ≤ i ≤ n
Cases 1-3 depict the semantics of atomic formulae and how their individual
substitutions are combined to provide the semantics for a conjunction. Case 4
formalises the semantics of our constraints when they appear on the left-hand
side of a rule: we apply the substitution σ to them (thus reflecting any values of
variables given by the matchings of atomic formula), then check satisfiability of
constraints 5. Case 5 specifies the semantics for set constructors: x is the set of
atomic formulae that satisfy the conditions of the set constructor.
Definition 7. Relation sr (∆,RHS,∆′) mapping a state ∆, the right-hand side
of a rule RHS and a new state ∆′ is defined as:
1. sr (∆, (U •RHS),∆′) holds iff both sr (∆,U,∆1) and sr (∆1, RHS,∆′) hold.
2. sr (∆,⊕α′,∆′) holds iff ∆′ = ∆ ∪ {α′}.
3. sr (∆,⊕γ,∆′) = true iff constrs(∆,Γ ) and satisfiable(Γ ∪ {γ}) hold and
∆′ = ∆ ∪ {γ}.
4. sr (∆, α,∆′) holds iff ∆′ = ∆ \ {α}
Case 1 decomposes a conjunction and builds the new state by merging the
partial states of each update. Case 2 cater for the insertion of atomic formulae
α′ which do not conform to the syntax of constraints. Case 3 defines how a
constraint is added to a state ∆: the new constraint is checked whether it can
be satisfied with constraints Γ and then it is added to ∆′. Case 4 cater for the
removal of atomic formulae.
We extend s∗ to handle sequences of rules: s∗(∆0, 〈R1, . . . ,Rn〉,∆n) holds iff
s∗(∆i−1,Ri ,∆i), 1 ≤ i ≤ n hold.
5 Our work builds on standard technologies for constraint solving – in particular, we have been
experimenting with SICStus Prolog constraint satisfaction libraries.
Page 6
∆0 V
∆0
α01, · · · , α
0
n
l l
ag1 · · · agn
∗
∆1 V
∆1
α11, · · · , α
1
m
l l
ag1 · · · agm
∗
· · ·
Fig. 2. Semantics as a Sequence of ∆’s
The semantics above define an infinite sequence of states 〈∆0,∆1, . . .〉 if
s∗(∆i , {R1, . . . ,Rn},∆i+1), that is, ∆i+1 (obtained by applying the rules to ∆i)
is used to obtain ∆i+2 and so on. Fig. 2 illustrates how this sequence can ac-
commodate the intervention of agents sending/receiving messages. The diagram
shows an initial state ∆0 (possibly empty) that is offered (represented by “V”)
to a set of agents {ag1, . . . , agn}. These agents exchange messages, adding a
record (via “l”) {α01, . . . , α
0
n} of these messages to ∆0. After the agents add
their utterances, then the rules are exhaustively applied (represented by “
∗
”)
to ∆0 ∪ {α01, . . . , α
0
n}. The resulting state ∆1 is, on its turn, offered to agents,
and so on.
3.1 Implementation
The semantics above provide a basis for the implementation of our rule inter-
preter. Although we have implemented it with SICStus Prolog we show such
interpreter in Fig. 3 as a logic program, interspersed with built-in Prolog predi-
cates; for easy referencing, we show each clause with a number on its left.
1. s∗(∆,Rules,∆′)←
findall(〈RHS,Σ〉, (member((LHS RHS), Rules), s∗l (∆,LHS,Σ)),RHSs),
s′r (∆,RHSs, ∆
′)
2. s∗l (∆,LHS,Σ)← findall(σ, sl (∆,LHS, σ), Σ)
3. sl (∆, (LHS ∧ LHS
′), σ)← sl (∆,LHS, σ
′), sl (∆,LHS
′, σ′′), union(σ′, σ′′, σ)
4. sl (∆,¬ LHS, σ)← ¬ sl (∆,LHS, σ)
5. sl (∆,α
′, σ)← member(α′ · σ,∆), constrs(∆,Γ ), satisfiable(Γ · σ)
6. sl (∆, γ, σ)← constrs(∆,Γ ), satisfiable([γ | Γ ] · σ)
7. sl (∆, x = {α
′ | LHS′}, {x/AllAlphas})← findall(α′ · σ, sl (∆,α
′ ∧ LHS′, σ), AllAlphas)
8. s′r (∆, [ ], ∆
′)← ∆ = ∆′
9. s′r (∆, [〈RHS,Σ〉 | RHSs], ∆
′)← s′′r (∆,RHS,Σ,∆
′′), s′r (∆
′′,RHSs, ∆′)
10. s′′r (∆,RHS, [ ], ∆
′)← ∆ = ∆′
11. s′′r (∆,RHS, [σ | Σ], ∆
′)← sr (∆,RHS · σ,∆
′′), s′′r (∆
′′, RHS,Σ,∆′)
12. sr (∆, (U • RHS), ∆
′)← sr (∆,U, ∆1), sr (∆1, RHS,∆
′)
13. sr (∆,⊕α
′, [α′ | ∆])←
14. sr (∆, α,∆
′)← delete(∆,α,∆′)
15. sr (∆,⊕γ, [γ | ∆])← constrs(∆,Γ ), satisfiable([γ | Γ ])
Fig. 3. An Interpreter for Rules
Clause 1 contains the top-most definition: given an existing ∆ and a set
of rules Rules, it obtains the next state ∆′ by finding all those rules in Rules
(picked by the member built-in) whose LHS holds in ∆ (checked via the auxiliary
∆0
α01, · · · , α
0
n
l l
ag1 · · · agn
∗
∆1 V
∆1
α11, · · · , α
1
m
l l
ag1 · · · agm
∗
· · ·
Fig. 2. Semantics as a Sequence of ∆’s
The semantics above define an infinite sequence of states 〈∆0,∆1, . . .〉 if
s∗(∆i , {R1, . . . ,Rn},∆i+1), that is, ∆i+1 (obtained by applying the rules to ∆i)
is used to obtain ∆i+2 and so on. Fig. 2 illustrates how this sequence can ac-
commodate the intervention of agents sending/receiving messages. The diagram
shows an initial state ∆0 (possibly empty) that is offered (represented by “V”)
to a set of agents {ag1, . . . , agn}. These agents exchange messages, adding a
record (via “l”) {α01, . . . , α
0
n} of these messages to ∆0. After the agents add
their utterances, then the rules are exhaustively applied (represented by “
∗
”)
to ∆0 ∪ {α01, . . . , α
0
n}. The resulting state ∆1 is, on its turn, offered to agents,
and so on.
3.1 Implementation
The semantics above provide a basis for the implementation of our rule inter-
preter. Although we have implemented it with SICStus Prolog we show such
interpreter in Fig. 3 as a logic program, interspersed with built-in Prolog predi-
cates; for easy referencing, we show each clause with a number on its left.
1. s∗(∆,Rules,∆′)←
findall(〈RHS,Σ〉, (member((LHS RHS), Rules), s∗l (∆,LHS,Σ)),RHSs),
s′r (∆,RHSs, ∆
′)
2. s∗l (∆,LHS,Σ)← findall(σ, sl (∆,LHS, σ), Σ)
3. sl (∆, (LHS ∧ LHS
′), σ)← sl (∆,LHS, σ
′), sl (∆,LHS
′, σ′′), union(σ′, σ′′, σ)
4. sl (∆,¬ LHS, σ)← ¬ sl (∆,LHS, σ)
5. sl (∆,α
′, σ)← member(α′ · σ,∆), constrs(∆,Γ ), satisfiable(Γ · σ)
6. sl (∆, γ, σ)← constrs(∆,Γ ), satisfiable([γ | Γ ] · σ)
7. sl (∆, x = {α
′ | LHS′}, {x/AllAlphas})← findall(α′ · σ, sl (∆,α
′ ∧ LHS′, σ), AllAlphas)
8. s′r (∆, [ ], ∆
′)← ∆ = ∆′
9. s′r (∆, [〈RHS,Σ〉 | RHSs], ∆
′)← s′′r (∆,RHS,Σ,∆
′′), s′r (∆
′′,RHSs, ∆′)
10. s′′r (∆,RHS, [ ], ∆
′)← ∆ = ∆′
11. s′′r (∆,RHS, [σ | Σ], ∆
′)← sr (∆,RHS · σ,∆
′′), s′′r (∆
′′, RHS,Σ,∆′)
12. sr (∆, (U • RHS), ∆
′)← sr (∆,U, ∆1), sr (∆1, RHS,∆
′)
13. sr (∆,⊕α
′, [α′ | ∆])←
14. sr (∆, α,∆
′)← delete(∆,α,∆′)
15. sr (∆,⊕γ, [γ | ∆])← constrs(∆,Γ ), satisfiable([γ | Γ ])
Fig. 3. An Interpreter for Rules
Clause 1 contains the top-most definition: given an existing ∆ and a set
of rules Rules, it obtains the next state ∆′ by finding all those rules in Rules
(picked by the member built-in) whose LHS holds in ∆ (checked via the auxiliary
Page 7
definition s∗l ). This clause then uses the RHS of those rules with their respective
sets of substitutions Σ as the arguments of s′r to finally obtain ∆
′. Clause 2
implements s∗l : it finds all the different ways that the left-hand side LHS of a
rule can be matched in∆ – the individual σ’s are stored in setsΣ of substitutions,
as a result of the findall/3 execution. Clauses 8 and 9 show how s′r computes
the new state from a list RHSs of pairs 〈RHS,Σ〉 (obtained in the second body
goal of clause 1): it picks out each pair 〈RHS,Σ〉 and uses s′′r (clauses 10 and
11) to compute each intermediate state of affairs after applying the RHS to
∆ via predicate sr for all the substitutions in Σ. Clauses 3-7 and 12-15 are,
respectively, adaptations of the cases depicted in Def. 6 and Def. 7.
4 Electronic Institutions
Our work extends electronic institutions (EIs) [12], providing them with an ex-
plicit normative layer. There are two major features in EIs: the states and il-
locutions (i.e., messages) uttered (i.e., sent) by those agents taking part in the
EI. The states are connected via edges labelled with the illocutions that ought
to be sent at that particular point in the EI. Another important feature in EIs
are the agents’ roles: these are labels that allow agents with the same role to be
treated collectively thus helping engineers abstract away from individuals. We
define below the class of illocutions we aim at – these are a special kind of term:
Definition 8. Illocutions I are terms p(ag, r, ag′, r′, τ, t) where p is an illocu-
tionary particle ( e.g., ask); ag, ag′ are agent identifiers; r , r ′ are role labels; τ
is a term with the actual content of the message and t ∈ IN is a time stamp.
We shall refer to illocutions that may have uninstantiated (free) variables as
illocution schemes, denoted by I¯.
Another important concept in EIs we employ here is that of a scene. Scenes
offer means to break down larger protocols into smaller ones with specific pur-
poses. We can uniquely refer to the point of the protocol where an illocution I
was uttered by the pair (s,w) where s is a scene name and w is the state from
which an edge labelled with I¯ leads to another state.
An institutional state is a state of affairs that stores all utterances during the
execution of a MAS, also keeping a record of the state of the environment, all
observable attributes of agents and all obligations, permissions and prohibitions
associated with the agents that constitute their normative positions.
We differentiate seven kinds of atomic formulae in our institutional states ∆,
with the following intuitive meanings:
1. oav(o, a, v) – object (or agent) o has an attribute a with value v .
2. att(s,w , I) – an agent attempted to get illocution I accepted at state w of
scene s.
3. utt(s,w , I) – I was accepted as a legal utterance at w of s.
4. ctr(s,w , ts) – the execution of scene s reached state w at time ts .
5. obl(s,w , I¯) – I¯ ought to be uttered at w of s.
6. per(s,w , I¯) – I¯ is permitted to be uttered at w of s.
7. prh(s,w , I¯) – I¯ is prohibited at w of s.
sets of substitutions Σ as the arguments of s′r to finally obtain ∆
′. Clause 2
implements s∗l : it finds all the different ways that the left-hand side LHS of a
rule can be matched in∆ – the individual σ’s are stored in setsΣ of substitutions,
as a result of the findall/3 execution. Clauses 8 and 9 show how s′r computes
the new state from a list RHSs of pairs 〈RHS,Σ〉 (obtained in the second body
goal of clause 1): it picks out each pair 〈RHS,Σ〉 and uses s′′r (clauses 10 and
11) to compute each intermediate state of affairs after applying the RHS to
∆ via predicate sr for all the substitutions in Σ. Clauses 3-7 and 12-15 are,
respectively, adaptations of the cases depicted in Def. 6 and Def. 7.
4 Electronic Institutions
Our work extends electronic institutions (EIs) [12], providing them with an ex-
plicit normative layer. There are two major features in EIs: the states and il-
locutions (i.e., messages) uttered (i.e., sent) by those agents taking part in the
EI. The states are connected via edges labelled with the illocutions that ought
to be sent at that particular point in the EI. Another important feature in EIs
are the agents’ roles: these are labels that allow agents with the same role to be
treated collectively thus helping engineers abstract away from individuals. We
define below the class of illocutions we aim at – these are a special kind of term:
Definition 8. Illocutions I are terms p(ag, r, ag′, r′, τ, t) where p is an illocu-
tionary particle ( e.g., ask); ag, ag′ are agent identifiers; r , r ′ are role labels; τ
is a term with the actual content of the message and t ∈ IN is a time stamp.
We shall refer to illocutions that may have uninstantiated (free) variables as
illocution schemes, denoted by I¯.
Another important concept in EIs we employ here is that of a scene. Scenes
offer means to break down larger protocols into smaller ones with specific pur-
poses. We can uniquely refer to the point of the protocol where an illocution I
was uttered by the pair (s,w) where s is a scene name and w is the state from
which an edge labelled with I¯ leads to another state.
An institutional state is a state of affairs that stores all utterances during the
execution of a MAS, also keeping a record of the state of the environment, all
observable attributes of agents and all obligations, permissions and prohibitions
associated with the agents that constitute their normative positions.
We differentiate seven kinds of atomic formulae in our institutional states ∆,
with the following intuitive meanings:
1. oav(o, a, v) – object (or agent) o has an attribute a with value v .
2. att(s,w , I) – an agent attempted to get illocution I accepted at state w of
scene s.
3. utt(s,w , I) – I was accepted as a legal utterance at w of s.
4. ctr(s,w , ts) – the execution of scene s reached state w at time ts .
5. obl(s,w , I¯) – I¯ ought to be uttered at w of s.
6. per(s,w , I¯) – I¯ is permitted to be uttered at w of s.
7. prh(s,w , I¯) – I¯ is prohibited at w of s.
Page 8
We only allow fully ground attributes, illocutions and state control formulae
(cases 1-4 above) to be present6; however, in formulae 5-7 s and w may be
variables and I¯ may contain variables. We shall use formulae 4 to represent state
change in a scene in relation to a global clock. We shall use formulae 5–7 above
to represent normative positions of agents within EIs.
We do not “hardwire” deontic notions in our semantics: the predicates above
represent deontic operators but not their relationships. These are captured with
rules (also called in this context institutional rules), conferring the generality
claimed on section 2 on our approach as different deontic relationships can be
forged, as we show below. We can confer different grades of enforcement on EIs .
On the one hand, we can transform only legal attempts into accepted utterances:
att(S ,W , I )∧
per(S ,W , I ) ∧ ¬ prh(S ,W , I )
att(S ,W , I )•
⊕utt(S ,W , I )
(1)
This rule states that if an agent attempts to say something and it is permitted
and not prohibited, then that attempt becomes a (confirmed) utterance. On the
other hand, we can allow agents to do certain illegal actions under more harsh
penalties:
att(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))∧
Ag1 6= Ag2 ∧Ag1 6= Ag3 ∧Ag2 6= Ag3
att(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))•
⊕utt(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))
(2)
The rule above states that if an agent attempts to reveal to Ag2 (secret)
information about agent Ag3, it is accepted without taking into account if it
is forbidden or not. In both cases (rules 1 and 2), we can punish agents that
violate prohibitions. Although we can address all forbidden utterances if we use
a variable as the third parameter of att and prh, the following rule punishes only
the revelation of beliefs of third parties:
0
B
B
@
att(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))∧
Ag1 6= Ag2 ∧Ag1 6= Ag3 ∧Ag2 6= Ag3∧
prh(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))∧
oav(Ag1, rep,VRep) ∧ (V ′Rep = VRep − 10)
1
C
C
A
oav(Ag1, rep,VRep) • ⊕oav(Ag1, rep,V ′Rep)
The rule above states that when agent Ag1 tries to reveal to Ag2 informa-
tion about agent Ag3, it gets punished. Notice that agents can be punished by
decreasing the value of any of their observable attributes. But only for exempli-
fying purposes, we use here an attribute called rep (for reputation) that models
in which degree an agent is norm compliant. In the example, the punish consists
in decreasing the trust of agents to share information with Ag1, that is, the value
of Ag1’s reputation is decreased by 10.
6 We allow agents to utter whatever they want (via att formulae). However, the illegal utterances
may be discarded and/or may cause sanctions, depending on the deontic notions we want or need
to implement. The utt formulae are thus confirmations of the att formulae.
(cases 1-4 above) to be present6; however, in formulae 5-7 s and w may be
variables and I¯ may contain variables. We shall use formulae 4 to represent state
change in a scene in relation to a global clock. We shall use formulae 5–7 above
to represent normative positions of agents within EIs.
We do not “hardwire” deontic notions in our semantics: the predicates above
represent deontic operators but not their relationships. These are captured with
rules (also called in this context institutional rules), conferring the generality
claimed on section 2 on our approach as different deontic relationships can be
forged, as we show below. We can confer different grades of enforcement on EIs .
On the one hand, we can transform only legal attempts into accepted utterances:
att(S ,W , I )∧
per(S ,W , I ) ∧ ¬ prh(S ,W , I )
att(S ,W , I )•
⊕utt(S ,W , I )
(1)
This rule states that if an agent attempts to say something and it is permitted
and not prohibited, then that attempt becomes a (confirmed) utterance. On the
other hand, we can allow agents to do certain illegal actions under more harsh
penalties:
att(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))∧
Ag1 6= Ag2 ∧Ag1 6= Ag3 ∧Ag2 6= Ag3
att(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))•
⊕utt(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))
(2)
The rule above states that if an agent attempts to reveal to Ag2 (secret)
information about agent Ag3, it is accepted without taking into account if it
is forbidden or not. In both cases (rules 1 and 2), we can punish agents that
violate prohibitions. Although we can address all forbidden utterances if we use
a variable as the third parameter of att and prh, the following rule punishes only
the revelation of beliefs of third parties:
0
B
B
@
att(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))∧
Ag1 6= Ag2 ∧Ag1 6= Ag3 ∧Ag2 6= Ag3∧
prh(S ,W , inform(Ag1,R,Ag2,R′, info(Ag3,C ),T ))∧
oav(Ag1, rep,VRep) ∧ (V ′Rep = VRep − 10)
1
C
C
A
oav(Ag1, rep,VRep) • ⊕oav(Ag1, rep,V ′Rep)
The rule above states that when agent Ag1 tries to reveal to Ag2 informa-
tion about agent Ag3, it gets punished. Notice that agents can be punished by
decreasing the value of any of their observable attributes. But only for exempli-
fying purposes, we use here an attribute called rep (for reputation) that models
in which degree an agent is norm compliant. In the example, the punish consists
in decreasing the trust of agents to share information with Ag1, that is, the value
of Ag1’s reputation is decreased by 10.
6 We allow agents to utter whatever they want (via att formulae). However, the illegal utterances
may be discarded and/or may cause sanctions, depending on the deontic notions we want or need
to implement. The utt formulae are thus confirmations of the att formulae.
Page 9
5 Example: The Dutch Auction
We now illustrate the pragmatics of our norm-oriented language, as required
in section 2, by specifying, with the rules of Fig. 4, the auction protocol for
a fish market as described in [15]. In the fish market several scenes [12] take
place simultaneously, at different locations, but with some causal continuity.
The principal scene is the auction itself, where buyers bid for boxes of fish that
are presented by an auctioneer who calls prices in descending order, the so-called
downward bidding protocol, a variation of the traditional Dutch auction protocol
that proceeds as follows: 1. The auctioneer chooses a good out of a lot of goods
that is sorted according to the order in which sellers deliver their goods to the
sellers’ admitter; 2. With a chosen good, the auctioneer opens a bidding round
by quoting offers downward from the good’s starting price, previously fixed by
a sellers’ admitter, as long as these price quotations are above a reserve price
previously defined by the seller; 3. For each price the auctioneer calls, several
situations might arise during the open round described below. 4. The first three
steps repeat until there are no more goods left.
The situations arising in step 3 are:
Multiple bids – Several buyers submit their bids at the current price. In this
case, a collision comes about, the good is not sold to any buyer, and the auc-
tioneer restarts the round at a higher price;
One bid – Only one buyer submits a bid at the current price. The good is sold
to this buyer whenever his credit can support his bid. Otherwise, the round is
restarted by the auctioneer at a higher price, the unsuccessful bidder is fined;
No bids – No buyer submits a bid at the current price. If the reserve price has
not been reached yet, the auctioneer quotes a new price obtained by decreasing
the current price according to the price step. Otherwise, the auctioneer declares
the good as withdrawn and closes the round.
5.1 Proposed Solution
I. Multiple bids – it obliges the auctioneer to inform the buyers, whenever a
collision comes about, about the collision and to restart the bidding round
at a higher price (in this case, 120% of the collision price). Notice that X will
hold all the utterances at scene dutch and state w4 issued by buyer agents
that bid for an item It at price P at time T0 after the last offer. We obtain
the last offers by checking that there are no further offers whose time-stamps
are greater than the time-stamp of the first one. If the number of illocutions
in X is greater than one, the rule fires the obligation above;
II. One bid/winner determination – If only one bid has occurred during the
current bidding round and the credit of the bidding agent is greater than or
equal to the price of the good in auction, the rule adds the obligation for the
auctioneer to inform all the buyers about the sale.
III. Prevention – It prevents agents from issuing bids they cannot afford (their
credit is insufficient) and states that if agent Ag ’s credit is less than P (the
last offer the auctioneer called for item It , at state w3 of scene dutch), then
agent Ag is prohibited to bid.
We now illustrate the pragmatics of our norm-oriented language, as required
in section 2, by specifying, with the rules of Fig. 4, the auction protocol for
a fish market as described in [15]. In the fish market several scenes [12] take
place simultaneously, at different locations, but with some causal continuity.
The principal scene is the auction itself, where buyers bid for boxes of fish that
are presented by an auctioneer who calls prices in descending order, the so-called
downward bidding protocol, a variation of the traditional Dutch auction protocol
that proceeds as follows: 1. The auctioneer chooses a good out of a lot of goods
that is sorted according to the order in which sellers deliver their goods to the
sellers’ admitter; 2. With a chosen good, the auctioneer opens a bidding round
by quoting offers downward from the good’s starting price, previously fixed by
a sellers’ admitter, as long as these price quotations are above a reserve price
previously defined by the seller; 3. For each price the auctioneer calls, several
situations might arise during the open round described below. 4. The first three
steps repeat until there are no more goods left.
The situations arising in step 3 are:
Multiple bids – Several buyers submit their bids at the current price. In this
case, a collision comes about, the good is not sold to any buyer, and the auc-
tioneer restarts the round at a higher price;
One bid – Only one buyer submits a bid at the current price. The good is sold
to this buyer whenever his credit can support his bid. Otherwise, the round is
restarted by the auctioneer at a higher price, the unsuccessful bidder is fined;
No bids – No buyer submits a bid at the current price. If the reserve price has
not been reached yet, the auctioneer quotes a new price obtained by decreasing
the current price according to the price step. Otherwise, the auctioneer declares
the good as withdrawn and closes the round.
5.1 Proposed Solution
I. Multiple bids – it obliges the auctioneer to inform the buyers, whenever a
collision comes about, about the collision and to restart the bidding round
at a higher price (in this case, 120% of the collision price). Notice that X will
hold all the utterances at scene dutch and state w4 issued by buyer agents
that bid for an item It at price P at time T0 after the last offer. We obtain
the last offers by checking that there are no further offers whose time-stamps
are greater than the time-stamp of the first one. If the number of illocutions
in X is greater than one, the rule fires the obligation above;
II. One bid/winner determination – If only one bid has occurred during the
current bidding round and the credit of the bidding agent is greater than or
equal to the price of the good in auction, the rule adds the obligation for the
auctioneer to inform all the buyers about the sale.
III. Prevention – It prevents agents from issuing bids they cannot afford (their
credit is insufficient) and states that if agent Ag ’s credit is less than P (the
last offer the auctioneer called for item It , at state w3 of scene dutch), then
agent Ag is prohibited to bid.
Page 10


