<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A framework to model norm dynamics in Answer Set Programming</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sofia Panagiotidi</string-name>
          <email>panagiotidi@lsi.upc.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Juan Carlos Nieves</string-name>
          <email>jcnieves@lsi.upc.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Javier Vázquez-Salceda Knowledge Engineering</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Machine Learning Group</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universitat Politecnica de Catalunya</institution>
          ,
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>-This paper presents ongoing work in the formal definition and implementation of a normative framework in Answer Set Programming. The framework uses as basis an existing action language and enriches it with a formal definition of norms (implementing standard deontic operators such as obligations and permissions). Properties of a norm's lifecycle such as active, inactive, violated are specified. We argue that such properties can serve as a reasoning basis for the agent's cycle. A partial implementation of the framework is then presented. An example is used in order to illustrate the application of the principles presented.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>The field of normative systems is an active area where
researchers try to find formalisations and mechanisms to model
and reason about normative statements. There is a lot of
formal work on the formalisation of norms, typically based
in variants of monadic or dyadic Deontic Logic. In this way,
normative systems predefine the desired behaviour in terms
of deontic concepts (obligations, prohibitions, permissions),
which typically are extended with other concepts such as
deadlines, violations and sanctions. But there is few work on
how to bring these theories into practice.</p>
      <p>
        One of the main barriers for the use of deontic-like
formalisations is the lack of operational semantics [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Without
clear operational semantics an agent cannot clearly reason
about the influence of these norms in its practical reasoning
mechanism. Some attempts have been made to reduce deontic
formalisations of norms into operational formalisations based
on, e.g. dynamic Logic [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] or Linear Temporal Logic [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], but
often such formalisations cannot really be used at execution
time.
      </p>
      <p>
        Other attempts focus on extending existing operational
formalisms with some normative concepts. These attempts
mainly concern the design of action languages based on the
effects of axioms and drawing inferences from the axioms and
concentrate on ways of reasoning about actions. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] presents an
action description language capable of expressing causal laws
which describe effects of actions as well as statements about
values of fluents in possible states of the world. Work of the
same authors covers some aspects of reasoning over dynamic
domains [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and representation and reasoning over properties
of actions [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] the authors intent to provide a logic based
language in order to represent authorizations and obligation
policies within dynamic environments as well as methods for
checking compliance of performed actions with the defined
policies. Still, the work lacks support for time. Insight into
intelligent decision and possible prediction of desired or
nondesired behaviours in advance seems to be absent too.
      </p>
      <p>
        We are aware of the work in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] in which the authors present
a language for implementing multi-agent systems consisting of
individual agents that interact with a computational
organization specified in terms of roles, norms and sanctions. Still,
this piece of work adopts an organisation-centered view more
on the flexible role enactment within a BDI cycle while ours
assumes a static role enactment and focuses on a decision
making mechanism inferring possible future action taking and
violated states.
      </p>
      <p>
        In the last two decades, one of the most successful logic
programming approach has been Answer Set Programming
(ASP) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. ASP is the realization of much theoretical work
on Non-monotonic Reasoning and Artificial Intelligence
applications. It represents a new paradigm for logic programming
that allows, using the concept of negation as failure, to handle
problems with default knowledge and produce non-monotonic
reasoning. Since its inception, ASP has been regarded as the
computational embodiment of Nonmonotonic Reasoning and
a primary candidate for an effective knowledge representation
tool. This view has been boosted by the emergence of highly
efficient solvers for ASP [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. The efficiency of the
answer set solvers has allowed to increase the list of ASP’s
practical applications, e.g., planning [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], Bioinformatics [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ],
[
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], argumentation theory [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], etc. Answer Set Programming
does not represent a conventional logic programming approach
as PROLOG. Usually an answer set program P can be
regarded as a specification of a given problem where each
answer set (a model) of P represents a possible solutions of
the given problem.
      </p>
      <p>
        In this paper (Figure 1) we propose, based on a previous
normative formalisation [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], a methodology to represent
such normative frameworks in Answer Set Programming.
This representation can be used as a basis for decision
making procedures as well as planning methodologies.
We use as example the obligations between two actors (a
Insurance Company and a Repair Company) defined in a
electronic contract. This contract is composed by deontic
clauses which will become norms of the expected behaviour
of the contractual parties. Therefore each instantiated contract
becomes a normative context at execution time.
The work is at a preliminary state. Still, integrated within an
agent’s operating cycle, such a framework can operate as the
brain of the agent [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], providing the necessary information
over the current state of the world such as pending norms
and currently violated obligations. Additional layers of
planning rules and preferred choices might lead to the desired
intelligence and flexibility an agent needs to perform in a
normative environment. We define several layers of abstraction
(Figure 1). An agent (possibly interacting with an ontology)
can interpret the environment it operates in through an action
language. The deontic restrictions (which in this paper come
from a contract, but in other scenario could come from a
Institutional specification) provide guidelines over the agent’s
behaviour and are formalised through a deontic framework.
      </p>
      <p>Generic rules over the interpretation of norms, the
interpretation of the action language and planning rules
defined with respect to the action language might be added on
top of the previous in order to be able to extract information
over the agent’s state, know the possible actions to take,
predict possible violations and foresee future paths. Our
interest and focus can be summarised in the following four:</p>
    </sec>
    <sec id="sec-2">
      <title>An action language representation Contract (viewed as a set of norms) representation Generic rules over the norm lifecycle Generic planning and choice rules</title>
      <p>Currently, the three first of the above are implemented while
the fourth and equally interesting issue is under research. In
this paper we are aiming to provide the functionality of the
aforementioned as well as some preliminary planning rules.
We argue that the implemented layers leave further space
for future research over the agent’s planning capabilities and
behavioural choices.</p>
      <p>The rest of the paper is structured as follows. Section II
defines the stable model semantics which is the basis for
Answer Set Programming. In section III we present a simple
motivating example which supports our work while in section
IV we detail the action and normative language used and
define formal properties of the framework with respect to the
aforementioned. A partial implementation of the action and
normative language in Answer Set Programming is provided
in sections V and VI and parts of the motivating example
presented in the beginning are cited in section VIII. We
conclude in section IX and summarise future work.</p>
    </sec>
    <sec id="sec-3">
      <title>II. BACKGROUND In this section, we present some basic definitions w.r.t. normal programs and the stable model semantics.</title>
      <sec id="sec-3-1">
        <title>A. Syntax</title>
        <p>A signature L is a finite set of elements that we call atoms.
A literal is either an atom a, called positive literal; or the
negation of an atom not a, called negative literal. Given a set
of atoms fa1; :::; ang, we write not fa1; :::; ang to denote the
set of atoms fnot a1; :::; not ang. A normal clause, C, is a
clause of the form
a</p>
        <p>b1; : : : ; bn; not bn+1; : : : ; not bn+m
where a and each of the bi are atoms for 1 i n + m.
In a slight abuse of notation we will denote such a clause by
the formula a B+ [ not B where the set fb1; : : : ; bng
will be denoted by B+, and the set fbn+1; : : : ; bn+mg will be
denoted by B . We define a normal program P , as a finite
set of normal clauses.</p>
        <p>If the body of a normal clause is empty, then the clause is
known as a fact and can be denoted just by a : or simply
a. We write LP , to denote the set of atoms that appear in
the clauses of P . We denote by HEAD(P ) the set faja
B+; not B 2 P g.</p>
      </sec>
      <sec id="sec-3-2">
        <title>B. Stable model semantics.</title>
        <p>
          The stable model semantics was defined in terms of the
so called Gelfond-Lifschitz reduction [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ] and it is usually
studied in the context of syntax dependent transformations
on programs. The following definition of a stable model for
normal programs was presented in [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ]:
        </p>
        <p>Let P be any normal program. For any set S LP , let P S
be the definite program obtained from P by deleting
(i) each rule that has a formula not l in its body with
l 2 S, and then
(ii) all formulae of the form not l in the bodies of the
remaining rules.</p>
        <p>Clearly P S does not contain not. Hence S is a stable model
of P if and only if S is a minimal model of P S .</p>
        <p>In order to illustrate this definition let us consider the
following example:</p>
        <p>Let S = fbg and P be the following logic program:
b not a. b &gt;.</p>
        <p>c not b. c a.</p>
        <p>We can see that P S is:</p>
        <p>b &gt;. c a.</p>
        <p>Notice that P S has three models: f g
b , fb; cg and fa; b; cg.</p>
        <p>Since the minimal model amongst these models is fbg, we
can say that S is a stable model of P .</p>
        <p>III. EXAMPLE</p>
        <p>The focus of interest of this example is to show how a
contract and a set of instantiated norms over the repair of
a car operate within the domain and normative environment
implemented in ASP. Such a case is useful to demonstrate how
reasoning and planning over the norms defined in a contract
can be done throughout its execution.</p>
        <p>Our scenario is as follows: Two actors, a Repair Company
and a Client create a contract (RepairContract) over the
repair of a broken car. Initially, the Client takes the car to the
Repair Company. Once the car is there, the Repair Company
has to repair it. Whenever it is repaired, the Client has to pay
a previously agreed price. Once the car is repaired, the client
has the right to make a complaint.</p>
        <p>Figure 2 depicts a pseudo-diagram including the interesting
states that the process will go into.</p>
        <p>The focus of interest of this example is to show how the
norms of an electronic contract (explicitly expressed as clauses
in the contract) can be mapped into ASP rules and, in a
combination with an appropriate action language, to reason
over, plan future actions and detect violations within the
agent’s scope.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>IV. LANGUAGE USED</title>
      <sec id="sec-4-1">
        <title>A. Actions</title>
        <p>
          The action description in our approach is done as in most
action description languages. In this work we use the
formalisation of [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] but adapt several rules to fit our requirements.
        </p>
        <p>Thus the alphabet of the action language A consists of
two nonempty disjoint sets of symbols F and A. They are
called the set of fluents and the set of actions. Fluents express
the property of an object in a state of the world. A fluent
or fluent literal (e.g. car_at_shop) is a positive literal or a
strongly negated literal (a fluent preceded by :). A state
is a collection of fluents. We say a fluent f holds in a state
if f 2 . We say a fluent literal :f holds in if f 62 .</p>
        <p>An action domain description D within the action language
A consists of effect propositions of the following form:
a
causes
f
if
p1; :::; pn; :q1; :::; :qr
(4:1)
where a is an action in A, f is a fluent literal in F (also
called postcondition of the action a) and p1; :::; pn; q1; :::; qr
are fluents (also called preconditions of the action a) in F .</p>
        <p>We assume a set of initial observations O that consists of
value propositions of the following form:
f
after
a1; :::; am
(4:2)
where f is a fluent literal and a1; :::; am are actions.
Intuitively that means that f will hold after the execution of
a1; :::; am.</p>
        <p>When a1; :::; am is an empty sequence then we write:
initially
f</p>
        <p>(4:3)
We also condense a set of value propositions of the
form {initially f1; :::; initially fn} by
initially
f1; :::; fn</p>
        <p>(4:4)
The role of effect propositions is to define a transition
function from states and actions to states. Given a domain
description D, such a transition function should satisfy the
following properties. For all actions , fluents g, and states
:
if D includes an effect proposition of the form (4.1)
where f is the fluent g and p1; :::; pn; :q1; :::; :qr hold
in then g 2 ( ; );
if D includes an effect proposition of the form
(4.1) where f is a negative fluent literal :g and
p1; :::; pn; :q1; :::; :qr hold in then g 62 ( ; );
if D does not include such effect propositions then
g 2 ( ; ) iff g 2 ;</p>
        <p>If such a transition function exists, then we say that D is
consistent, and refer to its transition function by D. Given
a consistent domain description D the set of observations O
is used to determine the states corresponding to the initial
situation, referred to as the initial states and denoted by 0.
While D determines a unique transition function, an O may
not always lead to a unique initial state.</p>
        <p>We say 0 is an initial state corresponding to a consistent
domain description D and a set of observations O, if for all
observations of the form (4.2) in O, the fluent literal f holds
in the state ( m; ( m 1; ::: ( 1; 0):::)) (We will denote
this state by [ m; :::; 1] 0). We then say that ( 0; D)
satisfies O.</p>
        <p>Given a consistent domain description D and a set of
observations O, we refer to the pair ( D; 0) where D
is the transition function of D and 0 is an initial state
corresponding to (D, O) as a model of (D, O). We say (D,
O) is consistent if it has a model and say it is complete if it
has a unique model.</p>
        <p>We say a consistent domain description D in the presence of
a set of observations O entails a query Q of the form (4.2)
if for all initial states corresponding to (D, O), the fluent
literal f holds in the state [ m; :::; 1] 0]. We denote this as
D j=O Q.</p>
        <p>Example 1:
let’s assume
frepair(Actor);
set of fluents</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>With respect</title>
      <p>that the set
pay(Actor);</p>
      <p>to our example,
of actions A =
complain(Actor)g, the
F = fcar_at_shop; repaired(Actor);
paid(Actor); complained(Actor)g
and that the domain description consists of the following:
repair(Actor) causes repaired(Actor) if car_at_shop
pay(Actor) causes paid(Actor)
complain(Actor) causes complained(Actor)</p>
    </sec>
    <sec id="sec-6">
      <title>Also suppose we have a set of observations</title>
      <p>O = finitially car_at_shop; :repaired(rc);
: paid(cl); : complained(cl)g. 2
A set of observations O is said to be initial state complete,
if O only consists of propositions of the form (4.3) and for
all fluents, either initially f is in O, or initially : f is in O,
but not both.</p>
      <sec id="sec-6-1">
        <title>B. Deontic statements</title>
        <p>
          Norms (clauses) express agreements between parties in the
form of deontic statements. In order to express the clauses we
have adopted a variation [
          <xref ref-type="bibr" rid="ref20">20</xref>
          ] [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] of the norm representation
defined in [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
        </p>
        <p>
          Since norms may have normative force only in certain
situations, they are associated with an activation condition.
Norms are thus typically abstract, and are instantiated when
the norm’s activation condition holds. Once a norm has been
instantiated, it remains active, irrespective of its activation
condition, until a specific expiration condition holds. When
the expiration condition occurs, the norm is assumed no
longer to have normative force. Independent of these two
conditions is the norm’s normative goal, which is used
to identify when the norm is violated (in the case of an
obligation), or what the agent is actually allowed to do
(in the case of a permission). Obligations and permissions
are the two norm types on which our framework focuses.
For every norm there is a maintenance condition which, if
does not hold while the norm is active then a violation is
considered to be taking place. Finally, for every norm there
exists another one (violation norm) indicating what happens
if it gets violated. Such properties of norms with respect to a
normative environment are implemented in section VI.
We assume a set of norms DS. A norm N in DS is
represented as a tuple of the form [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ]:
&lt;N ormT ype; DeonticStatement; ActivatingCondition;
M aintenanceCondition; DisactCondition; Actor&gt; (4.5)
such that:
        </p>
        <p>
          N ormT ype 2 {obligation, permission}
DeonticStatement is an action a in the set of actions
Anorm subset of A
an ActivatingCondition is of the type:
k1; :::; kn; :l1; :::; :ln, where k1; :::; kn; l1; :::; ln are
fluents in F
a DisactCondition is of the type:
u1; :::; un; :v1; :::; :vn, where u1; :::; un; v1; :::; vn
are fluents in F
a M aintenanceCondition is of the type:
w1; :::; wn; :z1; :::; :zn, where w1; :::; wn; z1; :::; zn
are fluents in F
a Actor is the actor responsible for the deontic statement
The definition and semantics of permissions are not trivial.
For example, it is dubious whether their existence can
be assumed within the context of an environment without
obligations. In [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ] the authors discuss the different types of
permissions and their role in deontic logic. We assume that
permissions are an explicit indication on what an actor can
perform. As in standard deontic logic we assume further that
whenever there is an obligation it is always implied that the
same is a permission too (Oa ! Pa, axiom D of deontic
logic).
        </p>
        <p>Example 2: Figure 3 depicts the formal representation
of the deontic statements within the contract of the example
presented in the third section. 2</p>
        <p>Below we give some definitions with respect to the action
language and the deontic statements. Let a norm N be in the
form of (4.5) and be a state.</p>
        <p>N is activated in iff k1; :::; kn; :l1; :::; :ln hold in
. We denote this as D j=DS; O; activated(N ). In
the contrary case, N is not activated. We denote this as
D j=DS; O; :activated(N ).</p>
        <p>N is disactivated in iff u1; :::; un; :v1; :::; :vn hold in
. We denote this as D j=DS; O; disactivated(N ). In
the contrary case, N is not disactivated. We denote this
as D j=DS; O; :disactivated(N ).</p>
        <p>N is violated in iff at least one of
w1; :::; wn; :z1; :::; :zn does not hold in . We
denote this as D j=DS; O; violated(N ). In the
contrary case, N is not violated. We denote this as
D j=DS; O; :violated(N ).
Queries with respect to norms consist of value propositions
of the form:
activated(N ) after a1; :::; am
disactivated(N ) after a1; :::; am
violated(N ) after a1; :::; am
(4:6)
where N is a deontic statement of the form (4.5), and
a1; :::; am are actions in A.</p>
        <p>We say a consistent domain description D in the
presence of a set of observations O and a set of norms
DS entails a query Q of the form (4.6) if for all
initial states 0 corresponding to (D,O) the proposition
activated(N ); disactivated(N ); violated(N ) holds
respectively in the state [ m; :::; 1] 0. We denote this
as D j=DS; O Q.</p>
        <p>Example 3: Let’s assume the set of actions A, the set
of fluents F and the set of observations O in example 1
and the set of norms DS in example 2. O is an initial state
complete. Then the initial state corresponding to (D; O) will
be</p>
        <p>0 = finitially car_at_shop; :repaired(rc);
: paid(cl); : complained(cl)g.</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>Then:</title>
      <p>D j=DS; O activated(NRC2) since activated(NRC2)
holds in the state [repair(rc)] 0.</p>
      <p>D j=DS; O activated(NRC3) since activated(NRC3)
holds in the state [repair(rc)] 0.
where NRC2 is the norm RC2 and NRC3 is the norm
RC3. 2
Proposition 1: Let D be a consistent domain description, O
be an initial state complete set of observations and DS a set
of deontic statements. If (D; O) is consistent then 8N 2 DS
and for any state reached by D:</p>
      <p>D j=DS;O; activated(N ) or D j=DS;O;
:activated(N )
D j=DS;O; disactivated(N ) or D j=DS;O;
:disactivated(N )</p>
      <p>D j=DS;O; violated(N ) or D j=DS;O; :violated(N )</p>
      <sec id="sec-7-1">
        <title>C. Temporal Projection</title>
        <p>Planning: In the case of planning we are given a domain
description D, a set of observations about the initial state
O, a collection of deontic statements DS and a collection
of fluent literals G = fg1; :::; ghg which we will refer to as
goal. We are required to find a sequence of actions aa; :::; an
such that for all 1 i h; D j=O gi after a1; :::; an and for
all states passed throughout the execution of the actions,
6 9 such that D j=DS;O; violated(N ).</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>V. REPRESENTATION OF ACTIONS</title>
      <p>
        Given an action domain description D, a set of observations
O and a set of deontic statements DS we construct a program
that partially implements the above. The basic elements and
definitions of types are ( basic). The program putting into
effect (D; O) consists of three parts namely ef ; obs; in
which represent the effect propositions, observations and
inertia rules. In addition, norm and ( lc) partly implement
the norms specification and norm lifeycle. We denote the
union of basic [ ef [ obs [ in [ norm [ lc as .
In addition to the approach of [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], we assume that actions are
durative. That is, they have a starting and ending time and
a duration which is the interval between the two. For this,
we use predicates like started and teminated to indicate
the time that an action starts being executed and the time it
      </p>
      <sec id="sec-8-1">
        <title>A. Basic elements</title>
        <p>f luent(f )
action(a)
(1) The predicate f luent. For every fluent f 2 F we
add the following rule to the program.
(2) The predicate action. For every action a 2
add a rule:
A we
(3) The predicate time. The predicate is used to represent
number of distinct times which in their turn represent the
time flow. Initially time(T ) where T is a constant.
B. Action rules</p>
        <p>(1) Translating effect propositions ( ef ). The effect
propositions in D are translated as follows. For every effect
proposition of the form (4.1) if f is a fluent in F then the
following rules are created:
holds(f; T + 1)</p>
        <p>terminated(a; T ); time(T ):
ab(f; a; T )</p>
        <p>terminated(a; T ); time(T ):
else if f is the negative fluent literal :g then the following
rules are created:
: holds(g; T + 1)</p>
        <p>terminated(a; T ); time(T ):
ab(g; a; T )</p>
        <p>terminated(a; T ); time(T ):
Intuitively, predicate holds indicates whether a fluent’s
value is true or false throughout time. The ab predicate
represents changes of a fluent’s value at some specific
timestep.
(2) Translating observations ( obs). We intentionally omit
observations of the type (4.2) and assume that all observations
are of the type (4.3). The value propositions in O then are
translated as follows. For every value proposition of the form
(4.3) if f is a positive fluent literal then the following rule is
made:
holds(f; 1) :
else if f is the negative fluent literal :g then the following
rule is created:
: holds(g; 1)
(3) Inertia rules ( in). Besides the above, we have the
following inertia rules. The first one makes sure that if no
action is executed during a timestep then a fluent will keep
holding a true value at the next timestep if it already holds
true at the current timestep. The second one makes sure that
if a fluent holds a true value and the action that is performed
at some timestep does not make it false, then in the next
timestep it will also hold true. The third one says that if no
action is executed during a timestep then a fluent will keep
holding a flse value at the next timestep if it already holds
false at the current timestep. The fourth one makes sure that
if a fluent holds a false value and the action that is performed
at some timestep does not make it true, then in the next
timestep it will also hold false.
holds(F; T + 1)</p>
        <p>holds(F; T ); not terminated(A; T ):
holds(F; T + 1)
: holds(F; T + 1)
: holds(F; T + 1)
holds(F; T ); terminated(A; T );
not ab(F; A; T ):</p>
        <p>not holds(F; T );
not terminated(A; T ):</p>
        <p>not holds(F; T ); terminated(A; T );
not ab(F; A; T ):
The following proposition demonstrates how the holds
predicate of will hold a true value at some time step if f
holds true at some state reached by the function D.
Proposition 2: Let D be a consistent domain description
and O be an initial complete set of observations such that
(D; O) is consistent. Let ( 0; D) be the unique model
of (D; O) and M a stable model of . If f is a fluent in F then
f 2 D( n; :::; D( 1;
some T 2 N.</p>
        <p>0)) iff holds(f; T ) 2 M for
(4) Executability rules. It is assumed that every action
might be executed whenever the conditions are fulfiled. We
use the predicate executable to model the state where the
preconditions of action are fulfiled and the action might be
executed.</p>
        <p>Thus, for every effect proposition of the form (4.1) the
following is created:
executable(a; T )
holds(p1; T ); :::; holds(pn; T );
not holds(q1; T ); :::; not holds(qn; T );
time(T ):
holds(k1; T ); :::;
holds(kn; T );
not holds(l1; T ); :::;
not holds(ln; T );
time(T ):
holds(u1; T ); :::;
holds(un; T );
not holds(v1; T ); :::;
not holds(vn; T );
time(T ):
holds(w1; T ); :::;
holds(wn; T );
not holds(z1; T ); :::;
not holds(zn; T );
action(Action); time(T ):
disact_condition(id; a; T )
maintain_cond(id; a; T )
Keeping in mind the normative semantics described in IV-B
we define the rules that implement a norm’s lifecycle ( lc).
obligation_activated(Id; Action; T )
activating_condition(Id; Action; T );
not active(Id; Action; T 1);
action(Action); time(T );
obligation_id(Id):
obligation_disactivated(Id; Action; T )
disact_condition(Id; Action; T );
active(Id; Action; T 1);
action(Action); time(T );
obligation_id(Id):
The two rules below define when an obligation is active.
active(Id; Action; T )
obligation_activated(Id; Action; T );
action(Action); time(T );
obligation_id(Id):
active(Id; Action; T ) active(Id; Action; T 1);
not obligation_disactivated(Action; T );
action(Action); time(T ); obligation_id(Id):</p>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>VII. REPRESENTATION OF PLANNING We assume that for every action we have an estimated duration on its execution time:</title>
      <p>estimated_time(a; t)
ensures that an action starts whenever it is executable and an
obligation to execute it becomes active.
terminated(Action; T 2) started(Action; T 1);
estimated_time(Action; EstimatedT ime);
T 2 = T 1 + EstimatedT ime;
time(T 2); time(T 1):</p>
    </sec>
    <sec id="sec-10">
      <title>The generic rule</title>
      <p>violation(Id; Action; T ) active(Id; Action; T );
not maintain_cond(Id; Action; T );
action(Action); time(T ); obligation_id(Id):
detects a violation whenever a clause is active and the
maintenance condition is not true.</p>
      <p>The following propositions ensure the correctness of
the program implementing the norm’s lifecycle properties.
Proposition 3: Let D be a consistent domain description,
O be an initial state complete set of observations such that
(D; O) is consistent, DS a set of norms and M a stable
model of . If there is a state reached by D such that
D j=DS;O; activated(N ) then there is a T 2 N such that
activating_condition(id; a; T ) 2 M where id is the unique
identifier of the norm N and a is the DeonticStatement of
the norm N .</p>
      <p>Proposition 4: Let D be a consistent domain description,
O be an initial state complete set of observations such that
(D; O) is consistent, DS a set of norms and M a stable
model of . If there is a state reached by D such that
D j=DS;O; disactivated(N ) then there is a T 2 N such
that disact_condition(id; a; T ) 2 M where id is the unique
identifier of the norm N and a is the DeonticStatement of
the norm N .</p>
      <p>Proposition 5: Let D be a consistent domain description,
O be an initial state complete set of observations such that
(D; O) is consistent, DS a set of norms and M a stable
model of . If there is a state reached by D such that
D j=DS;O; violated(N ) then there is a T 2 N such that
maintain_cond(id; a; T ) and active(id; a; T ) 2 M where
id is the unique identifier of the norm N and a is the
DeonticStatement of the norm N .</p>
      <p>Example 4: Let D; O; DS be the domain description,
observations and deontic statements of the examples
1 and 2, the program modeling D; O and
DS and M one of its stable models. As seen in
the example 3, in the state =
[repair(rc)] 0
activated(NRC2) will hold. Thus, there for some T 2 N
activating_condition(idRC2; repair(rc); T ) 2 M where
idRC2 is the unique identifier of the norm RC2.</p>
    </sec>
    <sec id="sec-11">
      <title>VIII. EXAMPLE In our example, the initial observation can be:</title>
      <p>holds(at_shop; 0):
time(0::30):
The model will include the following:
obligation_activated(rc1; repair(rc); 0)
obligation_disactivated(rc1; repair(rc); 10)
obligation_activated(rc2; pay(cl); 10)
obligation_disactivated(rc2; pay(cl); 11)
action_started(repair(rc); 0)
action_f inished(repair(rc); 10)
action_started(pay(cl); 10)
action_f inished(pay(cl); 11)
For further information and the ASP code, the reader
is referred to the web page where the code is hosted:
http://www.lsi.upc.edu/ panagiotidi/aspcode</p>
      <p>
        IX. CONCLUSIONS, DISCUSSION AND FUTURE WORK
Assuming the environment that an agent operates can be
modelled by an action languange, norms impose restrictions
on the behaviour of the agent. This paper presents ongoing
work on the formal specification and development of a
framework that enables to model an action language with
respect to a normative environment. Semantics of the action
language are based on [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and the language is partially
implemented and further enriched with temporal projection.
The deontic statements such as obligations and permissions as
well as properties related to the norm’s lifecycle (activation,
disactivation, violation) are formalised and implemented
according to [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. An attempt to define and apply planning
techniques within the formal model and the implementation
is made.
      </p>
      <p>This piece of work can be extended in various directions.
Formal aspects of planning need to be carefully considered
and taken into consideration while advancing with the use
of the framework in order to reach conclusions on the future
states. A formal notion of goal needs to be introduced in
order to reach a desired state. Another interesting aspect to
be examined is the use of weighted rules when reasoning
with respect to norms against the possible effects of one or
more violations. This will ensure that each agent can make
decisions on execution time based not only on a set of norms
indicating a desired behaviour but also on criteria such as
desires, preferences and time constraints.</p>
    </sec>
    <sec id="sec-12">
      <title>X. ACKNOWLEDGEMENTS</title>
      <p>This research has been funded by the FP7-215890 ALIVE
project, funded by the European Commission. Javier
VázquezSalceda’s work has been also partially funded by the "Ramón
y Cajal" program of the Spanish Ministry of Education and
Science.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J.</given-names>
            <surname>Vázquez-Salceda</surname>
          </string-name>
          and
          <string-name>
            <given-names>F.</given-names>
            <surname>Dignum</surname>
          </string-name>
          , “
          <article-title>Modelling electronic organizations,” Multi-Agent Systems and Applications III: 3rd</article-title>
          .
          <source>International/Central and Eastern European Conference on Multi-Agent Systems -CEEMAS'03, Lecture Notes in Artificial Intelligence 2691</source>
          , pp.
          <fpage>584</fpage>
          -
          <lpage>593</lpage>
          ,
          <year>2003</year>
          . [Online]. Available: http://people.cs.uu.nl/dignum/papers/harmonia-CEEMAS03.pdf
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.-J. C.</given-names>
            <surname>Meyer and R. J. Wieringa</surname>
          </string-name>
          , “
          <article-title>Deontic logic: a concise overview</article-title>
          ,” pp.
          <fpage>3</fpage>
          -
          <lpage>16</lpage>
          ,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>H.</given-names>
            <surname>Aldewereld</surname>
          </string-name>
          ,
          <article-title>Autonomy vs</article-title>
          .
          <source>Conformity: an Institutional Perspective on Norms and Protocols</source>
          .
          <source>PhD thesis</source>
          , Utrecht University,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>C.</given-names>
            <surname>Baral</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gelfond</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Provetti</surname>
          </string-name>
          , “
          <article-title>Representing actions: Laws, observations</article-title>
          and hypotheses,”
          <source>The Journal of Logic Programming</source>
          , vol.
          <volume>31</volume>
          , no.
          <issue>1-3</issue>
          , pp.
          <fpage>201</fpage>
          -
          <lpage>243</lpage>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>C.</given-names>
            <surname>Baral</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Gelfond</surname>
          </string-name>
          , “
          <article-title>Reasoning agents in dynamic domains</article-title>
          ,”
          <year>2000</year>
          , pp.
          <fpage>257</fpage>
          -
          <lpage>279</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gelfond</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Lifschitz</surname>
          </string-name>
          , “
          <article-title>Representing action and change by logic programs</article-title>
          ,
          <source>” Journal of logic programming</source>
          ,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gelfond</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Lobo</surname>
          </string-name>
          , “
          <article-title>Authorization and obligation policies in dynamic systems</article-title>
          ,
          <source>” Proceedings of the 24th International Conference on Logic Programming</source>
          , pp.
          <fpage>22</fpage>
          -
          <lpage>36</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>N.</given-names>
            <surname>Tinnemeier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dastani</surname>
          </string-name>
          , and J.-J. Meyer, “
          <article-title>Roles and norms for programming agent organizations,”</article-title>
          <source>in AAMAS '09: Proceedings of The 8th International Conference on Autonomous Agents and Multiagent Systems. Richland, SC: International Foundation for Autonomous Agents and Multiagent Systems</source>
          ,
          <year>2009</year>
          , pp.
          <fpage>121</fpage>
          -
          <lpage>128</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>C.</given-names>
            <surname>Baral</surname>
          </string-name>
          ,
          <article-title>Knowledge Representation, Reasoning and Declarative Problem Solving</article-title>
          . Cambridge: Cambridge University Press,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>S. DLV</surname>
          </string-name>
          , “Vienna University of Technology,” http://www.dbai.tuwien.ac.at/proj/dlv/,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>S. SMODELS</surname>
          </string-name>
          , “Helsinki University of Technology,” http://www.tcs.hut.fi/Software/smodels/,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Potassco</surname>
          </string-name>
          , “University of Potsdam,” http://potassco.sourceforge.net/,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>T.</given-names>
            <surname>Eiter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Faber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Leone</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Pfeifer, and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Polleres</surname>
          </string-name>
          , “
          <article-title>A logic programming approach to knowledge-state planning, ii: The DLVk system</article-title>
          .” Artif. Intell., vol.
          <volume>144</volume>
          , no.
          <issue>1-2</issue>
          , pp.
          <fpage>157</fpage>
          -
          <lpage>211</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>S.</given-names>
            <surname>Dworschak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Grell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Nikiforova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Schaub</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Selbig</surname>
          </string-name>
          , “
          <article-title>Modeling Biological Networks by Action Languages via Answer Set Programming,” Constraints</article-title>
          , vol.
          <volume>13</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>21</fpage>
          -
          <lpage>65</lpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>C.</given-names>
            <surname>Baral</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Chancellor</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Tran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Tran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. M.</given-names>
            <surname>Joy</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M. E.</given-names>
            <surname>Berens</surname>
          </string-name>
          , “
          <article-title>A knowledge based approach for representing and reasoning about signaling networks,” in ISMB/ECCB (Supplement of Bioinformatics</article-title>
          ),
          <year>2004</year>
          , pp.
          <fpage>15</fpage>
          -
          <lpage>22</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>J. C.</given-names>
            <surname>Nieves</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Osorio</surname>
          </string-name>
          , and U. Cortés, “
          <article-title>Preferred Extensions as Stable Models,” Theory and Practice of Logic Programming</article-title>
          , vol.
          <volume>8</volume>
          , no.
          <issue>4</issue>
          , pp.
          <fpage>527</fpage>
          -
          <lpage>543</lpage>
          ,
          <year>July 2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <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>
            <given-names>J.</given-names>
            <surname>Vázquez-Salceda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Modgil</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>Towards a formalisation of electronic contracting environments</article-title>
          ,” Coordination, Organization,
          <source>Institutions and Norms in Agent Systems, the International Workshop at AAAI</source>
          <year>2008</year>
          , pages
          <fpage>61</fpage>
          -
          <lpage>68</lpage>
          , Chicago, Illinois, USA,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>R.</given-names>
            <surname>Confalonieri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Alvarez-Napagao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Panagiotidi</surname>
          </string-name>
          , J. VázquezSalceda, and S. Willmott, “
          <article-title>A middleware architecture for building contract-aware agent-based services</article-title>
          ,
          <source>” LECTURE NOTES IN COMPUTER SCIENCE</source>
          , Jan
          <year>2008</year>
          . [Online]. Available: http://www.springerlink.com/index/m84n55h118j86178.pdf
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gelfond</surname>
          </string-name>
          and
          <string-name>
            <given-names>V.</given-names>
            <surname>Lifschitz</surname>
          </string-name>
          , “
          <article-title>The stable model semantics for logic programming</article-title>
          .”
          <string-name>
            <given-names>R.</given-names>
            <surname>Kowalski</surname>
          </string-name>
          and K. Bowen, editors,
          <source>5th Conference on Logic Programming</source>
          ,
          <article-title>pages 1070âA˘S¸ 1080</article-title>
          . MIT Press,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>S.</given-names>
            <surname>Panagiotidi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Vázquez-Salceda</surname>
          </string-name>
          ,
          <string-name>
            <surname>S.</surname>
          </string-name>
          <article-title>ÃA˛lvarez Napagao, S</article-title>
          . OrtegaMartorell, S. Willmott,
          <string-name>
            <given-names>R.</given-names>
            <surname>Confalonieri</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Storms</surname>
          </string-name>
          , “
          <article-title>Intelligent contracting agents language</article-title>
          ,
          <source>” Proceedings of the Symposium on Behaviour Regulation in Multi-Agent Systems -BRMAS</source>
          '
          <fpage>08</fpage>
          -,
          <string-name>
            <surname>Aberdeen</surname>
          </string-name>
          , UK,
          <year>April 2008</year>
          ,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>G.</given-names>
            <surname>Boella</surname>
          </string-name>
          and
          <string-name>
            <surname>L. van der Torre</surname>
          </string-name>
          , “
          <article-title>Permissions and obligations in hierarchical normative systems</article-title>
          ,
          <source>” Proceedings of the 9th international conference on Artificial intelligence and law</source>
          , pp.
          <fpage>109</fpage>
          -
          <lpage>118</lpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>