<!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>
      <journal-title-group>
        <journal-title>AT</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Towards runtime support for norm change from a monitoring perspective?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ignasi Go´mez-Sebastia`</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sergio A´ lvarez Napagao</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Javier Va´zquez Salceda</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Luis Oliva Felipe</string-name>
          <email>lolivag@lsi.upc.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universitat Polite`cnica de Catalunya Software Department (LSI) c/Jordi Girona 1-3</institution>
          ,
          <addr-line>E08034, Barcelona</addr-line>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2012</year>
      </pub-date>
      <volume>15</volume>
      <fpage>15</fpage>
      <lpage>16</lpage>
      <abstract>
        <p>Nowadays electronic specifications of norms are one of the mechanisms that can be applied to define and enforce acceptable behaviour within distributed electronic systems which should comply with some (human) regulations. As in human legal systems, it is easy to foresee that some of these electronic normative environments will not be static. They should be able to evolve through time as regulations change, effectively adapting to new situations and behaviours. In this paper we present an extension of a formal normative monitoring framework capable of updating normative contexts at runtime without stopping the monitoring process.</p>
      </abstract>
      <kwd-group>
        <kwd>normative systems</kwd>
        <kwd>normative monitoring</kwd>
        <kwd>runtime support</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>Electronic specifications of norms can be applied to define and enforce acceptable
behaviour within distributed electronic systems, especially those that should comply with
some regulations. Some of these electronic normative systems will not be static, will
evolve through time as regulations change, adapting to new situations and behaviours.</p>
      <p>
        One of the requirements to effectively implement Normative Systems is to be able
to assess, at runtime, the state of the normative environment. Some existing lines of
research (e.g., [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]) have already tried to tackle this issue on some simple
scenarios. However, more complex scenarios may appear, for instance, scenarios where the
normative context that defines the normative environment is not static, but it expands
and contracts as new norms are added to the institution and removed from it
respectively. Under these conditions, a monitoring system must be able to continue
computing the state of the normative environment at runtime, as often we can not afford to
perform the changes on the normative context off-line. Furthermore, it must be
guaranteed the monitoring system can keep producing states of the normative environment
that are consistent with the changes performed on the normative context. For instance,
if a norm has been removed from the normative context, it makes no sense any more to
compute normative states where the norm has been violated.
      </p>
      <p>
        In this paper we present an approach for extending the normative monitoring
framework presented in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] allowing it to support normative expansion and contraction
operations at runtime, without having to stop computing the normative state and, at the
same time, computing states that are consistent with the expansion and contraction
operations performed. The framework focuses on norm monitoring from an institutional
perspective (e.g., detecting violations of norms, so institutional agents can enforce
sanctions and repair actions) without neglecting agent’s ability to query the normative state,
effectively allowing agents to make sure they comply with the norms in the institution.
      </p>
      <p>We illustrate our approach via a scenario that models a simplified version of the
2005 Spanish smoking law that has been amended in 2011. Basically, the 2005 law
obliges bars and restaurants with a size bigger than 100m2 to provide an isolated area
for smoking customers. They will incur in a violation if they do not fulfil this
obligation and the violation is considered as repaired once the bar habilitates an area for their
smoking customers. The amended 2011 law forbids bars and restaurants to have any
smoking area. They will incur in a violation if they have a smoking area and the
violation will be considered as repaired once the bar removes the smoking area. We will use
this scenario for providing examples along this paper.</p>
      <p>
        The rest of this paper is structured as follows: in Section 2 we summarise the
monitoring formalism presented in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] which we extend in this work. Then in Section 3 we
formalise the operations to be supported in order to allow for normative context
expansion and contraction. We also extend the formal framework providing support for a
more expressive norm life cycle. Next, in Section 4 we provide formal algorithms for
implementing the expansion and contraction operations on the existing framework.
Section 5 puts our proposal in contrast with existing approaches. Finally Section 6 presents
our conclusions and outlines future lines of research.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Monitoring Formalism</title>
      <p>
        In this section we summarise the formalism for monitoring normative systems which
we will use in the rest of the paper. For more details on this formalism, please refer to
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>We assume the use of a predicate based propositional logic language LO with
predicates and constants taken from an ontology O, and the logical connectives f:; _; ^g.
The set of all possible well-formed formulas of LO is denoted as wf f (LO) and we
assume that each formula from wf f (LO) is normalised in Disjunctive Normal Form
(DNF). Formulas in wf f (LO) can be partially grounded, if they use at least one free
variable, or fully grounded if they use no free variables.</p>
      <p>We define the state of the world st as the set of predicates holding at a specific
timestamp t, where st O, and we denote S as the set of all possible states of the world,
where S = P(O). We call expansion F (s) of a state of the world s as the minimal
subset of wf f (LO) that uses the predicates in s in combination of the logical connectives
f:; _; ^g. We define a substitution instance = fx1 t1; x2 t2; :::; xi tig
as the substitution of the terms t1; t2; :::; ti for variables x1; x2; :::; xi in a formula f 2
wf f (LO). Thus, (f (x1; x2; :::; xi)) f (t1; t2; :::; ti). We denote as #(wff(LO);S)
the set of all possible substitution instances containing the variables in wf f (LO) and
the terms in S.</p>
      <p>Definition 1. (Norm) A ’norm’ n is a tuple n = hfA; fM ; fD; fw; wi, where
– fA; fM ; fD; fw 2 wf f (LO), w 2 O,
– fA; fM ; fD respectively represent the activation, maintenance, and deactivation
conditions of the norm.
– fw is the explicit representation of the target of the norm, and w is the subject of
the norm (role or agent).</p>
      <p>A norm is defined in an abstract manner, affecting all possible participants enacting
a given role. Whenever a norm is active, we will say that there is a norm instance
ni = hn; i for a particular norm n and a substitution instance .</p>
      <p>
        We can formalise the norms of Definition 1 as the equivalent deontic expression
(using the inference rules formalism in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]):
      </p>
      <sec id="sec-2-1">
        <title>Property 1. A norm is considered fulfilled if, and only if:</title>
        <p>fA ! [Ow(Ewfw
:fM ) U fD]
where Ow(Eap) means that agent a has the obligation to see to it that (stit) p
becomes true and U is the CTL until operator.
:(fM U fD) ` f A0</p>
        <p>Intuitively, Property 1 states that after the norm activation, the subject is obliged to
see to it that the target becomes true before the maintenance condition is negated (either
the deadline is reached or some other condition is broken) until the norm is deactivated
(which is either when the norm is fulfilled or has otherwise expired).</p>
        <p>Definition 2. (Violation handling norm1) A norm n0 = hf A0; f M0 ; f D0; f w0; w0i is a
violation handling norm of n = hfA; fM ; fD; fw; wi, denoted as n ; n0 iff fA ^</p>
        <p>Violation handling norms are special in the sense that they are only activated once
another norm is violated. Please notice we consider a norm is not violated if the
maintenance condition is kept until the deactivation condition holds, and is violated otherwise.
Violation handling norms are used as sanctioning norms, if they are to be fulfilled by
the norm violating actor (e.g., the obligation to pay a fine if the driver broke a traffic
sign), or as reparation norms, if they are to be fulfilled by an institutional actor (e.g.,
the obligation of the authorities to fix the broken traffic sign).</p>
        <p>
          One common problem for the monitoring of normative states is the need for an
interpretation of brute events as institutional facts, also called constitution of social
reality[
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. The use of counts-as rules helps solving this problem. Counts-as rules are
multi-modal statements of the form [c]( 1 ! 2), read as “in context c, 1 counts-as
2”. In our proposal, we consider a context as a set of predicates:
Definition 3. (Counts-as rule) A counts-as rule is a tuple c = h 1; 2; si, where 1; 2 2
wf f (LO), and s O.
1 Informally: the unfulfillment of the obligation of norm n entails the activation of norm n0.
        </p>
        <p>
          A set of counts-as rules is denoted as C. Although the definition of counts-as in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]
assumes that both 1 and 2 can be any possible formula, in our work we limit 2 to a
conjunction of predicates. This will ensure every well-formed-formula is on a standard
Disjunctive Normal Form. Knowing before hand all well-formed-formula are on the
same format, effectively simplifies the process of detecting information dependencies
between well-formed formulas.
        </p>
        <p>Definition 4. (Institution) Following the definitions above, we define an institution as
a tuple of norms, roles, participants, counts-as rules, and an ontology:</p>
        <p>I = hN; R; P; C; Oi where: N; R; P; C is a set of norms, roles, participants and
counts-as rules respectively and O is an Ontology.</p>
        <p>
          In order to track the normative state of an institution at any given point of time, the
state of each of the norms inside the context should be tracked. In order to ease this task,
we define three sets: an instantiation set IS, a fulfillment set F S, a violation set V S, and
a repairment set RS. Each of them contains norm instances fhni; j i; :::; hni0 ; j0 ig.
In order to define the states a norm may be in, we adapt the semantics for normative
states from [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]:
Definition 5. (Norm Life-cycle) Let ni = hn; i be a norm instance, such that n =
hfA; fM ; fD; wi, and s be a state of the world with an expansion F (s). Then we define
the life-cycle for a norm instance ni by the following normative state predicates:
activated(ni) , 9f 2 F (s); (fA) f
maintained(ni) , 9 0; 9f 2 F (s); 0(fM ) f ^ 0
deactivated(ni) , 9 0; 9f 2 F (s); 0(fD) f ^ 0
instantiated(ni) , ni 2 IS
violated(ni) , ni 2 V S
f ulf illed(ni) , ni 2 F S
repaired(ni; ni0) , hni; ni0i 2 RS
        </p>
        <p>Where IS is the instantiation set, F S is the fulfilment set, V S is the violation set,
and RS is the set of those norm instances ni0 that have repaired a norm instance ni.
Definition 6. (Event) An event e is a tuple e = h ; t; pi, where
– 2 O, an actor of the system,
– t is the timestamp of the reception of the event, and
– given a fully grounded subset of the set of states of the world p0 2 S : p = p0 _ p =
:p0</p>
        <p>We define E as the set of all possible events, E = P(P t S) where t is a
timestamp. From these definition we can formalise the concept of Normative Monitor
and the concept of Labelled Transition System for a Normative Monitor as follows:
Definition 7. (Normative Monitor) A Normative Monitor MN for a set of norms N is
a tuple MN = hN; S; IS; V S; F S; Ei.</p>
        <p>Where: S = P(O)^ IS = P(N S Dom(S))^ V S = P(N S Dom(S))^
F S = P(N S Dom(S))^ E is the set of all possible events as defined before.</p>
        <p>MN is the set of all possible configurations of a Normative Monitor MN .
Definition 8. (Labelled Transition System) The Labelled Transition System LT SMN
for a Normative Monitor MN is defined by LT SMN = h MN ; L; i where
– L = fep; nii; niv; nif; nirg is a set of labels, respectively representing event
processed, norm instantiation, norm instance violation, norm instance fulfilled, and
norm instance violation repaired, and
– is a transition relation such that MN L MN</p>
        <p>This formalism has been reduced to the semantics of general production systems
and an implementation in DROOLS is already available.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>A formal framework for norm change</title>
      <p>This section defines the operations required for supporting expansion and contraction of
normative contexts. It also depicts the norm life-cycle extension required for supporting
these operations.</p>
      <p>According to legal literature, one can specify two types of change operations on a
normative context, context expansion (adding norms) and context contraction
(removing norms; norm updates can be seen as norm removal followed by a norm addition).
Each of these operations comes in two forms: Ex Tunc(i.e., from the outset) and Ex
Nunc (i.e., from now on). Both terms are Latin legal terms which are common in law
literature. An Ex Tunc norm is a norm that retroactively changes the normative
consequences (or status) of actions committed prior to the existence of the norm, whereas an
Ex Nunc norm affects only actions committed after the existence of the norm. To
summarize, two operations with two forms, means one can apply four distinct operations to
normative contexts, as depicted on Figure 1. We can provide a more formal definition
of the four operations:
– Prospective promulgation: Introduces a new norm on the normative context. Events
happening on the context can instantiate the norm as soon as it has been
promulgated. The norm will not check for violations caused by past events, but it can be
activated by past events. This is because if a given fact has been made true in the
past we assume it to be true until we have proof of the contrary. For instance, if
we received the event bornAt(Spain, Manolete) in the past we can assume the fact
Manolete is born in Spain still holds in the present. Thus, if a norm applies to (i.e.,
is activated by) individuals born in Spain, it should apply to the individual Manolete
even if he was born before the norm promulgation.
– Retroactive promulgation: Introduces a new norm on the normative context. Events
happening on the context can instantiate the norm as soon as it is promulgated. The
norm will check for norm instance activations or violations caused by past events.
Retroactive promulgation can lead to a massive amount of norm instances being
violated (especially if the number of past events is high). Few scenarios should
require this operation for normative context modification. In fact, most real-world
normative contexts forbid this operation (e.g., most countries forbid retrospective
law promulgation on their constitutions and bills of rights).
– Annulment: Removes a norm from the normative context. All the instances of the
norm are removed as well, including violated ones. This implies removing
sanctions and repair actions that are yet to be enacted. Repair actions already enacted
must be de-enacted, so the agents responsible of enacting repair actions (e.g.,
institutional agents managing the institution) must be aware of the annulment. As an
example, if someone is imprisoned for violating an annulled norm, he/she should
be set free.
– Abrogation: Tags a norm from the normative context as being In transition.
Therefore, the norm can not be instantiated any more. Instances of the norm remain in the
normative context as long as they are not in a terminal state (that is, either fulfilled
or repaired). Once all norm’s instances have reached a terminal state, the norm is
removed from the system along with its instances. As an example, if someone is
imprisoned for violating an abrogated norm, he/she should remain imprisoned
until the violation has been repaired (i.e. the offender has spent a given amount of
time imprisoned). However, once set free, he/she should be able to violate the norm
again without any legal consequences.</p>
      <p>We have introduced some extra norm states when defining the expansion and
contraction operations. Therefore, in order to effectively support these operations we have
to extend our norm life-cycle, as depicted in Figure 2, adding the following states:
– In force: Once a norm has been promulgated (either in a prospective or retroactive
form) it achieves an In force state. From this point, the norm can be effectively
activated if its activation condition is met. In some scenarios, norms introduced in
the system off-line (i.e., they are already there when the system starts its execution)
are by default in this state. In other scenarios they can lack this state (i.e., be in
Deleted stated instead) and are moved to it by institutional agents in case they
consider they are beneficial for the overall goals of the system. This will effectively
provide agents with a pool of norms that can be promulgated (either in a prospective
or retroactive form) if required. A mixture of both approaches is also possible,
where system designers put some important norms In force since the beginning of
system’s execution, leaving a second set of norms in the pool of norms that can be
put into force by institutional agents.
– In transition: Abrogated norms go into this state. It means the norm can not be
instantiated any more. However, instances of the norm that have been already
instantiated (i.e., they are in active or violated state) remain in the system. Once
these instances change to Fulfilled or Repaired states the norm in transition can
effectively move on to Deleted state.
– Deleted: As stated before, abrogated norms with no active instances are moved to
this state. Annulled norms are also moved to this state, no matter if they contain
active instances or not. Therefore, active instances of annulled norms are removed
from the system. Mechanisms based on the already available violation handling can
be defined to compensate for violated instances of annulled norms that have been
repaired (e.g., if an agent pays a fine for violating a norm, and then the norm is
annulled, return the amount paid to the agent). Deleted norms can be promulgated
again either via prospective or retroactive promulgation.</p>
      <p>
        Two lines of research have already tackled this issue, Aucher et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and
Governatori et al. [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The first one defines both expansion and contraction operations, but
only supports ex tunc operations. The second line of research supports both ex tunc and
ex nunc operations but it focuses on context expansion. Our approach can be seen as an
attempt to mix the expressivity of both proposals, defining at the same a richer norm
life-cycle able to cope with normative context modification operations.
      </p>
      <p>Figure 3 shows examples of some operations on a normative context. Specifically it
shows how the norm (N1) and the amendment (N2) are activated, fulfilled, violated or
repaired depending on the events happening on the environment.</p>
      <p>Basically N1 is activated as soon as bar instances with more than 100m2 are detected
on the environment. Notice how both prospective and retroactive norm promulgation
check for past events. In this case, it is because if in the past a bar instance had more
than 100m2 we assume this fact to be still true if we have not proof of the contrary.
Once promulgated, the norm goes to fulfilled state if the bar has an isolated area for
smoking customers, and to violated state if it does not. If the norm is violated, violation
can be repaired by creating an isolated area for smokers. This action will take the norm
to repaired state.</p>
      <p>Then, norm N1 is abrogated and N2 promulgated. Once promulgated N2
instantiates as soon as bar instances are detected, no size constraints are to be met. The norm is
fulfilled if the bar has no smoking area, and violated if it does. If the norm is violated,
violation can be repaired by removing the isolated smoking area from the bar. As norm
N1 has been abrogated, Bars that are on violated state on instances of N1 have to
perform their repair actions in order to move to repaired state even if N1 has been already
abrogated and N2 promulgated. It would not be the case if norm N1 was annulled
instead of abrogated as annulment would force norm violations to be removed from the
system, even if such violations have not been repaired.</p>
      <p>
        This simple scenario allows us to reinforce the idea system designers need to be very
careful when using norm abrogation. Bars that have spent money in creating areas for
smokers due to the promulgation of N1, have to spend money again for removing these
areas once norm N2 is promulgated. Otherwise they would be violating N2. Therefore,
in order to achieve a fair norm promulgation, system designers should include a reward
for bars that fulfilled norm N1 by creating areas for smokers when promulgating norm
N2. The situation is even worse for bars with more than 100m2 that do not have an
isolated area for smokers. Once norm N1 is abrogated and N2 promulgated, these bars have
to create an isolated area for smokers, effectively repairing the violation of N1. But once
this area is created, they are violating N2, and have to disable the area in order to repair
the violation of N2. This would have been avoided if norm N1 was annulled instead of
abrogated. This fact reinforces the idea norm design has to be carefully analysed when
expanding and contracting the normative context, in order to bring the system closer
to its overall (multiple and sometimes even conflicting) goals. In particular, it depicts
how norm designers have to carefully balance the benefits of norm abrogation and
annulment, choosing the correct operation for contracting the normative context on every
situation.
In this section we show how the monitoring formalism presented in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] can be extended
to support normative context modifications at run-time. We also depict the different
normative context operations that our monitoring system supports and the pseudo-code
algorithms required for fulfilling each normative context operation form a monitor
component perspective.
      </p>
      <p>
        If norms are represented as rules, then rule change can be represented as
nonmonotonic inference. According to [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], changing a normative system would amount to
adding new rules or removing the existing ones. The formalism presented in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], based
on rule creation from normative specifications, allows us to define the
operationalisation of norm change, in its four forms, as extensions of the main monitoring process.
By using all or some of the labels described in Definition 8, we can constrain the exact
normative-related actions that the monitor will be able to carry out, and thus we can
define and create, at runtime, diverse monitoring contexts.
      </p>
      <p>The ability to create a different monitoring context is due to the fact that some norm
changes can be retroactive. Thus the only way to generate a normative state compliant
with the one we had before the norm change is to analyse the full stream of events
generated since the beginning of the monitoring process. Such a monitoring context
can be created at runtime by using two constructs from the monitoring formalism: the
normative monitor and the labels of its labelled transition system. With the first one
we can create a new monitor, specific to a set of norms (the ones to be added), and
by constraining the labels we can control the level of retro-activity of the norm change
type.</p>
      <p>How these constructs have to be used depends on each type of norm change, as
defined in Section 3. As seen on Figure 1 there are a total of four possible operations on
a normative context, formalised by the following Algorithms:
– Prospective Promulgation Algorithm 1 Figure 4: The norm is inserted into the
normative monitor. A secondary monitor computes the instantiations of the norm
caused by past events. Once computed, the instantiations are inserted on the
normative monitor.
– Retrospective Promulgation Algorithm 2 Figure 5: The norm is inserted into
the normative monitor. A secondary monitor computes the following norm states
caused by past events: norm instantiation, norm fulfilment, norm violation and
norm repair. Once computed, the states are inserted on the normative monitor.
– Annulment Algorithm 3 Figure 6: Instances of the norm in instantiated, repaired,
violated or fulfilled state are removed from the normative monitor. In the case of
instances in repaired state, the institutional agents are notified in case an action
to undo the reparation is required. Then, the norm is removed from the normative
monitor.
– Abrogation Algorithm 4 Figure 7: Instances of the norm in fulfilled or repair state
are removed. Then, the norm goes to transition state. Therefore, the norm can not
be instantiated any more. It is checked periodically if the norm contains instances
in instantiated or violated state. If it does not, instances of the norm on fulfilled or
repair state are removed. Then, the norm is removed from the system. If the norm
contains instances in instantiated or violated state, the process waits a given amount
of time before checking again for instances in instantiated or violated state.</p>
      <sec id="sec-3-1">
        <title>Algorithm 1 Prospective Promulgation of PPNorm</title>
        <p>Require: P P N orm = hfA; fM ; fD; fw; wi
Require: MN = hN; S; IS; V S; F S; RS; Ei</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Require: P P N orm 62 N</title>
      <p>MN0 = h;; ;; ;; ;; ;; N [ fP P N ormg; Ei
LT SMN0 = f ; fniig; .g
engine:create(LT SMn0 )
it = E:iterator
while it:hasN ext
engine:insert(it:next)
engine:inf er
MN :IS = MN :IS [ MN0 :IS
There is currently an important amount of work being done in context change
management, we have identified four main trends.</p>
      <p>
        Governatori [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] proposes an extension of his logics for normative monitoring that
enables capturing the different temporal aspects of abrogation and annulment. The
extension increases the expressive power of his logics allowing it to represent meta-norms
describing norm modifications. Meta-norms refer to a variety of possible time-lines
through which conclusions, rules and derivations can persist over time. In particular,
the extension defines temporal constraints that permit either allowing for or blocking
persistency with respect to specific time lines. The idea behind Governatori’s approach
is blocking of derivations across repositories (i.e., time-lines). When a modification is
applied to the normative context, it is split into two repositories: where the modification
occurs and where it does not. For instance, if a norm is abrogated, norm’s conclusions
      </p>
      <sec id="sec-4-1">
        <title>Algorithm 2 Retrospective Promulgation of RPNorm</title>
        <p>Require: RP N orm = hfA; fM ; fD; fw; wi
Require: MN = hN; S; IS; V S; F S; RS; Ei</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Require: RP N orm 62 N</title>
      <p>MN0 = h;; ;; ;; ;; ;; N [ fRP N ormg; Ei
LT SMN0 = f ; fnii; niv; nif; nirg; .g
engine:create(LT SMn0 )
it = E:iterator
while it:hasN ext
engine:insert(it:next)
engine:inf er
MN :IS = MN :IS [ MN0 :IS
MN :V S = MN :V S [ MN0 :V S
MN :F S = MN :F S [ MN0 :F S</p>
      <p>MN :RS = MN :RS [ MN0 :RS</p>
      <sec id="sec-5-1">
        <title>Algorithm 3 Annulment of AnNorm</title>
        <p>hni; ni0i
are derived only in the repositories where the rule has not been abrogated. When
compared to our approach, Governatori’s has the following drawbacks: 1) Norm annulment
presents a problem under this approach, conclusions of annulled norms might remain
on the repository after the norm has been annulled, and the solution proposed to
remove the conclusion seems quite ad-hoc. 2) Governatori’s solution provides no explicit
support for retroactive promulgation. 3) Governatori’s approach is not able to update
the deontic part of the context (i.e., obligations and permissions), in fact Governatori
states that an explicit differentiation between norms, obligations and permissions has to
be made. 4) Governatori’s approach does not provide support for constitutive rules (i.e.,
counts-as).</p>
        <p>
          Aucher’s proposal [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] is similar to ours, in the sense both are event-based, it does not
make distinctions between deontic statements and norms and has full support for
constitutive rules. However, neither context expansion or contraction provides support for
ex tunc operations. In fact, only one expansion and one contraction operations are
introduced on his approach; both operations seem to (implicitly) be of ex nunc type. Means
for ensuring that the normative context is consistent (after the expansion/contraction
operation) are included on Aucher’s approach, whereas we have not taken care of such
issues.
        </p>
        <p>
          Campos’ approach [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] raises from the need of turning Electronic Institutions (EI
from now on) into Situated Electronic Institutions (SEI from now on). EI are static and
self-contained, agent actions are filtered so norm violations will never occur. SEI control
over external agents is not tight, therefore violations can occur, and SERI can adapt
themselves to changes in the dynamic existing social systems. Campos’ approach uses
a Bridge for communicating the SEI with the environment. The Bridge is similar to the
event-bus we use on our approach, but contains an API tightly coupled with the domain
the environment refers to, while our event-bus is domain independent. Besides this,
Campos’ approach does not support constitutive rules. However, Campos’ approach
allows for SEI to automatically adapt the normative context in order to perform better in
new environments. Re-configuration is achieved via transition functions (TF) that define
some basic updates on the normative context of the SEI. For instance, if violating the
norm N implies the payment of a fine, and the system detects the number of violations
of N is higher than the expected value, a TF can increase the value of the fine. Thus,
TF define very simple modifications to the normative context, without support for norm
promulgation, abrogation and annulment.
        </p>
        <p>
          Tinnemeier et al. [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] propose a framework based on the syntax and the operational
semantics of generic programming constructs for norm modification. Using their
framework, programmers can modify norms and norm instances via rule-based constructs. On
the framework proposed by Tinnemeier et al. norms take the form of conditional
obligations and prohibitions. The rule-based constructs for changing norms come in two
flavours, norm instance change rules and norm scheme change rules (ic-rules and
scrules respectively). Ic-rules and sc-rules are of the form ) [ni0; :::; nin][ni00; :::; ni0n]
with the intuitive reading that under circumstances the set of norm instances or norm
schemes [ni0; :::; nin] are to be removed and the set of norm instances or norm schemes
[ni00; :::; ni0n] are to be added. Regarding sc-rules, in some cases it is desirable that the
instantiated norm instances remain unaffected, whereas in other cases the associated
norm instances should be changed accordingly. For covering both cases Tinnemeier
et al. defines instance-preserving sc-rules that leave the instantiated norm-instances
unaltered and instance-revising sc-rules that revise the associated norm-instances
accordingly. Tinnemeier et al.’s approach is similar to ours in the sense it provides the
syntax and operational semantics for performing norm-change at run-time. However,
Tinnemeier et al.’s approach subjects norm change to a pre-existing condition (i.e. )
and does not support retroactive norm promulgation. What’s more, in Tinnemeier et
al.’s approach norm-change is restricted by a set of norm change rules specified by the
normative framework, whereas in our approach it is open.
6
        </p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Conclusions and future work</title>
      <p>
        In this paper we have introduced a formal method for monitoring electronic normative
environments able to evolve through time as regulations change to adapt to new
situations and behaviours. We have started by introducing the four operations supported
for updating normative contexts. The operations mix the expressivity of two previous
approaches [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] effectively supporting both prospective and retroactive context
expansion and contraction. Then we have proposed a formal extension of the base
normative monitoring framework that will allow it to support normative context modifications
at run-time. That is, the normative environment can be expanded and contracted
without having to stop the monitoring process. Furthermore, all expansions and contractions
performed leave the normative context in a consistent state (e.g., if a norm was violated,
it will remain violated, unless an Ex Tunc contraction of the norm has been performed).
The extension is outlined by providing algorithms for supporting the four operations for
updating normative contexts.
      </p>
      <p>
        The proposed framework has room for improvement. The interaction between the
support for runtime change of constitutive rules that is already available [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and the
support we present in this paper has to be analysed. We also have to analyse the
interaction between the extension proposed in this paper and another extension for scaling
the framework via distributed monitors [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] that has been developed previously. We also
plan using the formalisation presented in this paper to extend the available prototype
implementing support for runtime norm change. The implementation will effectively
allow for testing the framework on use-case scenarios, making an assessment on the
framework’s efficiency. We have already explored scenarios based on adaptable AIs for
video-games [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Finally, we plan to include measures [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] to ensure normative-context
modifications result in a consistent and non-redundant model.
      </p>
      <p>
        Having support for dynamic normative contexts opens one main line of research,
adaptive normative contexts, able to insert or remove norms into the system depending
on how the system evolves with respect to its overall objectives. In order to go ahead
with this line of research we have to extend our framework with methods for detecting
when norm change is required from an institutional point of view [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Then, we should
provide means to institutional agents to perform this norm change [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>H.</given-names>
            <surname>Aldewereld</surname>
          </string-name>
          ,
          <string-name>
            <surname>S.</surname>
          </string-name>
          <article-title>A´ lvarez-</article-title>
          <string-name>
            <surname>Napagao</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Dignum</surname>
            , and
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Va</surname>
          </string-name>
          <article-title>´zquez-Salceda. Making norms concrete</article-title>
          .
          <source>Proc. of 9th Int. Conf. on Autonomous Agents and Multiagent Systems (AAMAS</source>
          <year>2010</year>
          ), (Toronto, Canada),
          <year>Nov 2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>H.</given-names>
            <surname>Aldewereld</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Dignum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Dignum</surname>
          </string-name>
          , and
          <string-name>
            <given-names>L.</given-names>
            <surname>Penserini</surname>
          </string-name>
          .
          <article-title>A formal specification for organizational adaptation</article-title>
          . In M. P. Gleizes and
          <string-name>
            <given-names>J. J.</given-names>
            <surname>Go´</surname>
          </string-name>
          mez-Sanz, editors,
          <source>AOSE</source>
          , volume
          <volume>6038</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>18</fpage>
          -
          <lpage>31</lpage>
          . Springer,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>S.</surname>
          </string-name>
          <article-title>A´ lvarez-</article-title>
          <string-name>
            <surname>Napagao</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Aldewereld</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <article-title>Va´zquez-</article-title>
          <string-name>
            <surname>Salceda</surname>
            , and
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Dignum</surname>
          </string-name>
          .
          <article-title>Normative monitoring: semantics and implementation</article-title>
          .
          <source>In Proceedings of the 6th international conference on Coordination</source>
          , organizations, institutions, and
          <article-title>norms in agent systems</article-title>
          ,
          <source>COIN@AAMAS'10</source>
          , pages
          <fpage>321</fpage>
          -
          <lpage>336</lpage>
          , Berlin, Heidelberg,
          <year>2011</year>
          . Springer-Verlag.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>S.</surname>
          </string-name>
          <article-title>A´ lvarez-</article-title>
          <string-name>
            <surname>Napagao</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          <article-title>Go´mez-Sebastia`</article-title>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          <article-title>Va´zquez-</article-title>
          <string-name>
            <surname>Salceda</surname>
            , and
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Koch</surname>
          </string-name>
          . conciens:
          <article-title>Organizational awareness in real-time strategy games</article-title>
          . In R. Alque´zar, A. Moreno, and J. AguilarMartin, editors,
          <source>CCIA</source>
          , volume
          <volume>210</volume>
          <source>of Frontiers in Artificial Intelligence and Applications</source>
          , pages
          <fpage>69</fpage>
          -
          <lpage>78</lpage>
          . IOS Press,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>G.</given-names>
            <surname>Aucher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Grossi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Herzig</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Lorini</surname>
          </string-name>
          .
          <article-title>Dynamic context logic and its application to norm change</article-title>
          .
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>J.</given-names>
            <surname>Campos</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Lo´pez-Sa´nchez</article-title>
          ,
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Rodr</surname>
          </string-name>
          <article-title>´ıguez-</article-title>
          <string-name>
            <surname>Aguilar</surname>
            , and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Esteva</surname>
          </string-name>
          .
          <article-title>Formalising situatedness and adaptation in electronic institutions</article-title>
          . Coordination, Organizations,
          <source>Institutions and Norms in Agent Systems IV, Lecture Notes in Computer Science</source>
          , Springer Berlin / Heidelberg, 5428:
          <fpage>126</fpage>
          -
          <lpage>139</lpage>
          ,
          <year>Jan 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>F.</given-names>
            <surname>Dignum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Broersen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Dignum</surname>
          </string-name>
          , and J.
          <string-name>
            <surname>-J. C.</surname>
          </string-name>
          <article-title>Meyer. Meeting the deadline: Why, when and how</article-title>
          .
          <source>In FAABS</source>
          , pages
          <fpage>30</fpage>
          -
          <lpage>40</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>I.</surname>
          </string-name>
          <article-title>Go´mez-Sebastia`</article-title>
          ,
          <string-name>
            <surname>S.</surname>
          </string-name>
          <article-title>A´ lvarez-</article-title>
          <string-name>
            <surname>Napagao</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>J.</given-names>
            <surname>Va</surname>
          </string-name>
          <article-title>´zquez-Salceda. A distributed norm compliance model</article-title>
          . In C. Ferna´ndez, H. Geffner, and
          <string-name>
            <given-names>F.</given-names>
            <surname>Manya</surname>
          </string-name>
          `, editors,
          <source>CCIA</source>
          , volume
          <volume>232</volume>
          <source>of Frontiers in Artificial Intelligence and Applications</source>
          , pages
          <fpage>110</fpage>
          -
          <lpage>119</lpage>
          . IOS Press,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>G.</given-names>
            <surname>Governatori</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Rotolo</surname>
          </string-name>
          .
          <article-title>Changing legal systems: Abrogation and annulment part i: Revision of defeasible theories</article-title>
          .
          <source>In DEON</source>
          , pages
          <fpage>3</fpage>
          -
          <lpage>18</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>G.</given-names>
            <surname>Governatori</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Rotolo</surname>
          </string-name>
          .
          <article-title>Changing legal systems: Abrogation and annulment. part ii: Temporalised defeasible logic</article-title>
          .
          <source>In NORMAS</source>
          , pages
          <fpage>112</fpage>
          -
          <lpage>127</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>D.</given-names>
            <surname>Grossi</surname>
          </string-name>
          .
          <article-title>Designing invisible handcuffs : Formal investigations in institutions and organizations for multi-agent systems</article-title>
          .
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>N.</given-names>
            <surname>Oren</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Luck</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Miles</surname>
          </string-name>
          .
          <article-title>A model of normative power</article-title>
          .
          <source>In AAMAS</source>
          , pages
          <fpage>815</fpage>
          -
          <lpage>822</lpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>N.</given-names>
            <surname>Oren</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Panagiotidi</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.</surname>
          </string-name>
          <article-title>Va´zquez-</article-title>
          <string-name>
            <surname>Salceda</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Modgil</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Luck</surname>
            , and
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Miles</surname>
          </string-name>
          .
          <article-title>Towards a formalisation of electronic contracting environments</article-title>
          . In J.
          <string-name>
            <surname>Hbner</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          <string-name>
            <surname>Matson</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <string-name>
            <surname>Boissier</surname>
          </string-name>
          , and V. Dignum, editors, Coordination, Organizations,
          <source>Institutions and Norms in Agent Systems IV, Lecture Notes in Computer Science</source>
          , pages
          <fpage>156</fpage>
          -
          <lpage>171</lpage>
          . Springer Berlin / Heidelberg,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>N. A. M. Tinnemeier</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Dastani</surname>
          </string-name>
          , and J.
          <string-name>
            <surname>-J. C.</surname>
          </string-name>
          <article-title>Meyer. Programming norm change</article-title>
          .
          <source>In 9th International Conference on Autonomous Agents and Multiagent Systems (AAMAS</source>
          <year>2010</year>
          ), Toronto, Canada, May
          <volume>10</volume>
          -14,
          <year>2010</year>
          , Volume
          <volume>1</volume>
          -
          <issue>3</issue>
          , pages
          <fpage>957</fpage>
          -
          <lpage>964</lpage>
          . IFAAMAS,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. W. W. Vasconcelos,
          <string-name>
            <given-names>M. J.</given-names>
            <surname>Kollingbaum</surname>
          </string-name>
          , and
          <string-name>
            <given-names>T. J.</given-names>
            <surname>Norman</surname>
          </string-name>
          .
          <article-title>Normative conflict resolution in multi-agent systems</article-title>
          . Autonomous Agents and
          <string-name>
            <surname>Multi-Agent</surname>
            <given-names>Systems</given-names>
          </string-name>
          ,
          <volume>19</volume>
          (
          <issue>2</issue>
          ):
          <fpage>124</fpage>
          -
          <lpage>152</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>