<!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>Complex Events and Actions in Logical Agents</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Stefania Costantini</string-name>
          <email>stefania.costantini@univaq.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Regis Riveret</string-name>
          <email>r.riveret@imperial.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Imperial College London</institution>
          ,
          <country country="UK">UK</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Universita` di L'Aquila</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <fpage>256</fpage>
      <lpage>271</lpage>
      <abstract>
        <p>Complex Event Processing (CEP) has emerged as a relevant new field of software engineering and computer science. Many of the current approaches to CEP are declarative and based on rules, and often on logic-programming-like languages and semantics. Some work on CEP is situated within the field of logical agents. Usually, event processing is based upon Event-Condition-Action rules, which are however able to manage only simple events or unstructured sets of events. In this paper, we refine the notion of “complex event”, which is an event that cannot be detected directly, but rather can be identified (not necessarily in a deterministic way) by interrelating sets of simple events. We propose a formalization and a possible implementation of such notion, that we extend to complex actions.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        1 Introduction
“Complex Event Processing” (CEP) has emerged as a relevant new field of software
engineering and computer science [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. In fact, a lot of practical applications have the
need to actively monitor vast quantities of event data to make automated decisions and
take time-critical actions (the reader may refer, e.g., to the Proceedings of the RuleML
Workshop Series). Complex Event Processing is discussed in depth in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. With cloud
computing, the importance of event processing is even more visible, and a connection
of “event pattern languages” with ontologies and with the semantic web is envisaged.
Many of the current approaches are declarative and based on rules, and often on
logicprogramming-like languages and semantics: for instance, [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is based upon a
specifically defined interval-based Event Calculus [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        Complex Event Processing is particularly important in software agents. Naturally,
most agent-oriented languages architectures and frameworks are to some extent
eventoriented and are able to perform event-processing. The issue of event processing agents
(EPAs) is of growing importance in the industrial field, since agents and multi-agent
systems are able to manage rapid change and thus to allow for scalability in
applications aimed at supporting the ever-increasing level of interaction. In particular this paper
is concerned with logical agents, i.e., agents whose syntax and semantics is rooted in
Computational Logic. There are several approaches to logical agents (for a recent
survey cf., e.g., [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]). For lack of space, we are not able here to properly discuss and compare
their event-processing features. Rather, we recall only the approaches that have more
strongly influenced the present work.
      </p>
      <p>
        A recent but well-established and widely used approach to CEP in computational
logic is ETALIS [
        <xref ref-type="bibr" rid="ref6 ref7 ref8">6–8</xref>
        ], which is an open source plug-in for Complex Event Processing
implemented prolog which runs in many prolog systems. ETALIS is in fact based on
a declarative semantics, grounded in Logic Programming. Complex events can be
derived from simpler events by means of deductive rules. ETALIS, in addition, supports
reasoning about events, context, and real-time complex situations, and has a nice
representation of time and time intervals aimed at stream reasoning. Relations among events
can be expressed via several operators, reminiscent of causal reasoning and Event
Calculus.
      </p>
      <p>
        In logical agents, some relevant work about CEP is related to DALI, a logic
agentoriented language (first appeared in 1999 [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]) that extends prolog with reactive and
proactive features [
        <xref ref-type="bibr" rid="ref10 ref11 ref12 ref9">9–12</xref>
        ] and is fully implemented and publicly available [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. DALI,
like virtually all agent-oriented languages, is equipped with “event-condition-action”
rules (ECA rules) for defining the behavior of an agent in consequence of perception
of external events. The feature that makes DALI proactive and strongly event-oriented
is however the internal events construct: i.e., the programmer can indicate internal
conditions to be interpreted as events, to which a reaction can be defined. Management of
events which occur “together” (with the possibility to specify in which time interval),
priorities between events, and aggregation of simple events into complex ones via the
internal event construct are other useful features. Related to (the pre-existing) DALI
approach is for instance the work of [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], also providing ECA rules and a “snapshot”
semantics similar to the one already introduced in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Work on CEP in DALI is
presented in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] and [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], which discuss the issue of of selecting different reactive patterns
by means of simple preferences, then extended to more complex forms of preferences in
[
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. Such preferences can be also defined in terms of “possible worlds” elicited from
a declarative description of a current or hypothetical situation, and can depend upon
past events, and the specific sequence in which they occurred. [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] and [
        <xref ref-type="bibr" rid="ref19 ref20">19, 20</xref>
        ] discuss
event-based memory-management, and temporal-logic-based constraints for complex
dynamic self-checking and reaction.
      </p>
      <p>
        Teleo-Reactive Computing by Kowalski and Sadri [
        <xref ref-type="bibr" rid="ref21 ref22 ref23">21–23</xref>
        ] is an attempt to
reconcile and combine conflicting approaches in logic programming, production systems,
active and deductive databases, agent programming languages, and the representation
of causal theories in AI. In this approach, enhanced reactive rules determine the
interaction of an agent with the environment in a logical but not necessarily “just” deductive
way. The semantics relies upon an infinite Herbrand-like model which is incrementally
constructed.
      </p>
      <p>
        The motivation of the present work relies in the observation that a complex event
cannot always be defined and recognized from simple deterministic incremental
aggregation of simple events. Rather, complex events sometimes require a more involved
and not necessarily deterministic description. In fact, in order to be flexible and
versatile instead of brittle and rigid an agent should be able to possibly interpret a set of
simple events in different ways, and to assign/learn the plausibility and reliability of
each interpretation (for a discussion of brittleness w.r.t. versatility in agents, cf. [
        <xref ref-type="bibr" rid="ref24 ref25 ref26">24–
26</xref>
        ]). For instance, in diagnosis a number of symptoms, if occurring together, might
lead to hypothesize the presence of one or more illness/fault, possibly with some
certainty/probability. Another reason why event patterns should be carefully described is to
make an agent able to detect unknown events or wrong patterns, and take the necessary
counter-measures (see, e.g., [
        <xref ref-type="bibr" rid="ref19 ref20">19, 20</xref>
        ]).
      </p>
      <p>In this paper, we propose a novel conceptual view of complex events and a
possible formalization of the new concepts. In our view, an agent should be able to possibly
interpret a set of simple events in different ways, and to assign/learn a plausibility and
reliability of each interpretation. We also consider complex actions, which we
consider as agent-generated events. To this aim, we propose to equip agents with specific
modules, that we call Event-Action modules, describing complex events and complex
actions. Such modules receives as “input” a set of simple events, either perceived by the
agent at its present stage of operation (external events), or generated internally by the
agent itself. Each module returns: (i) possible interpretations of a set of simple events
in terms of complex events; (ii) an ordering of such interpretations (if more than one is
possible) in terms of preferences and/or of certainty factors; (iii) detection of anomalies;
(iv) (sets of) actions to perform in response. Modules are (automatically) re-evaluated
whevener new instances of the “triggering” events become available.</p>
      <p>
        From a practical point of view, for both providing a formal semantics and an
implementation of modules we have presently adopted Answer Set Programming (ASP, cf.,
among many, [
        <xref ref-type="bibr" rid="ref27 ref28">27, 28</xref>
        ]). ASP is a well-established logic programming paradigm, where
a program may have several (rather than just one) “model”, called “answer set”, each
one representing a possible interpretation of the situation described by the program.
So, in the proposed framework, a logical agents can be seen as composed of a “main
program” including event processing, planning, action making, etc. and a set of
EventAction modules (implemented in ASP) for event/action recognition, generation,
aggregation and management. We propose to exploit, in order to discern among alternatives,
both preferences and probabilities, refined via reinforcement learning. The approach
is encompassed into the general declarative semantics for logical agents introduced in
[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] (and summarized below). This makes our proposal immediately applicable to many
agent-oriented logic languages/framework.
      </p>
      <p>To define Event-Action modules we presently refer to a quite simple logical setting
which can be in fact translated into ASP. However, in principle such modules might
be based upon more expressive logics (e.g., modal and/or probabilistic logics which
would certainly be suitable to express event recognition/aggregation). The structure of
our proposal is such that the basic concept, i.e, modules for (non-deterministic,
defeasible) reasoning about event aggregation, might be easily rephased upon another logic.
Clearly, in such case a suitable semantic and execution model (other than ASP) should
then be provided.</p>
      <p>
        The paper is organized as follows. In Section 2 we provide some background about
the building blocks of the proposed apprach. In Section 3 we present the proposal,
and in Sections 4 and 5 its formalization, and some considerations about learning. In
Section 6 we conclude. This paper is the extended version of [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ].
2
      </p>
      <p>Background
In this section, we recall notions that define some basic foundation elements of the
proposed approach.
2.1</p>
      <p>
        Evolutionary Semantics of Logical Agent-Oriented Languages
The Evolutionary semantics (introduced in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]) is meant to provide a high-level general
account of evolving agents, trying to abstract away from the details of specific
agentoriented frameworks. As seen below, the Evolutionary semantics in fact generalizes the
specific semantic approaches underlying well-known logical agent-oriented languages.
Actually, the Evolutionary semantics can be seen as a meta-semantics, as it accounts
for agent evolution in terms of transformation steps. The precise definition of an agent
and how a transformation step is determined and described attains to the specific
agentoriented language.
      </p>
      <p>We define in fact, in very general terms, an agent as the tuple Ag = &lt; PA, E &gt;
where A is the agent name and PA (that we call “agent program”, but can be in turn a
tuple) describes the agent according to some agent-oriented formalism L. E is the set
of the events that the agent is able to recognize or determine (so, E includes actions that
the agent is able to perform), according to the specific agent-oriented framework.</p>
      <p>Let H be the history of an agent as recorded by the agent itself (in a form that will
depend upon the specific agent-oriented framework), i.e., H includes agent’s
perceptions and memories. We assume that events that either happen externally or are
generated internally, actions which are performed, and other relevant agent’s activities are
recorded in H.</p>
      <p>We assume that program PA as written by the programmer is in general transformed
into an initial agent program P0 by means of an initialization phase (possibly doing
nothing). When agent A is activated P0 will go into execution, and will evolve
according to the evolution of H.</p>
      <p>Evolution is represented via program-transformation steps, each one transforming
Pi into Pi+1 according to Hi, which is the partial history up to stage i. The choice of
which elements of Hi do actually trigger an evolution step is part of the definition of a
specific agent framework.</p>
      <p>Thus, we obtain a Program Evolution Sequence P E = [P0, . . . , Pn, . . .]. The
program evolution sequence will imply a corresponding Semantic Evolution Sequence
M E = [M0, . . . , Mn, . . .] where Mi is the semantics of Pi according to L. Notice
in fact that the approach is parametric w.r.t L.</p>
      <p>Definition 1 (Evolutionary semantics). Let Ag be an agent. The evolutionary
semantics " Ag of Ag is a tuple hH, P E, M Ei, where H is the history of Ag , and P E and
M E are respectively its program and semantic evolution sequences.</p>
      <p>The next definition introduces the notion of instant view of " Ag, at a certain stage
of the evolution (which is in principle of unlimited length).</p>
      <p>Definition 2 (Evolutionary semantics snapshot). Let Ag be an agent, with
evolutionary semantics " Ag = hH, P E, M Ei. The snaphot at stage i of " iAg is the tuple
hHi, Pi, Mii, where Hi is the history up to the events that have determined the
transition from Pi 1 to Pi.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], program transformation steps associated with DALI language constructs
[
        <xref ref-type="bibr" rid="ref10 ref11">10, 11</xref>
        ] are defined in detail. They can easily be adapted to AgentSpeak (cf. [
        <xref ref-type="bibr" rid="ref30">30</xref>
        ] and
the references therein). The evolutionary semantics may also express the notion of trace
of a GOAL agent (cf. [
        <xref ref-type="bibr" rid="ref31">31</xref>
        ] and the references therein) where agent program Pi
encompasses the agent’s mental state and each evolution step, which in GOAL is called
computation step and is determined by a conditional action. For 3APL (cf. [
        <xref ref-type="bibr" rid="ref32">32</xref>
        ] and
the references therein), agent program Pi encompasses the agent’s initial configuration,
and the related sets GR of goal rules, PR of plan rules, IR of interactive rules; the
evolutionary semantics corresponds to a 3APL agent computation run, and evolution steps
are determined by the 3APL transition system.
      </p>
      <p>In Section 4.1 we provide an integration of the proposed approach to Complex Event
Processing into the Evolutionary semantics, in order to make it applicable to many
agent-oriented logic programming languages among which the above-mentioned ones.
2.2</p>
      <p>
        Background on Answer Set Semantics
The answer set semantics is used in this paper to provide both a formal semantics and
an execution model for the proposed modules. In fact, this logic gives rise to answer set
programming (ASP), which is a very well-established and fully logical programming
paradigm. Many efficient solvers have become freely available for ASP, [
        <xref ref-type="bibr" rid="ref33">33</xref>
        ], each one
proposing many extension to aid practical programming.
      </p>
      <p>
        In the answer set semantics (originally named “stable model semantics”),
a (logic) program ⇧ (cf., [
        <xref ref-type="bibr" rid="ref34">34</xref>
        ]) is a collection of rules of the form H
A1, . . . , An, not B1, . . . , not Bm where the Ais (i  n and the Bj s (j  m are atoms,
and in literals not Bj not is default negation. A rule with empty body is called a fact.
A rule with empty head is a constraint, where a constraint L1, . . . , Ln. states that
literals L1, . . . , Ln cannot be all true in an answer set.
      </p>
      <p>The answer sets semantics is a view of a logic program as a set of inference rules
(more precisely, default inference rules), or, equivalently, a set of constraints on the
solution of a problem: each answer set represents a solution compatible with the
constraints expressed by the program. In simple program {q not p p not q}, the first
rule is read as “assuming that p is false, we can conclude that q is true.” This program
has two answer sets. In the first one, q is true while p is false; in the second one, p is
true while q is false. Thus, this program represent choice among two alternatives.</p>
      <p>
        In the ASP (Answer Set Programming) paradigm, each answer set is seen as a
solution of given problem, encoded as an ASP program. An ASP program is basically
composed by program fragments like the above ones that generate the search space by
defining available alternatives, and by constraints which prune the generated space thus
selecting solutions. To find these solutions, one employes one of the several existing
ASP solvers [
        <xref ref-type="bibr" rid="ref33">33</xref>
        ]. The expressive power of ASP and its computational complexity have
been deeply investigated (cf., e.g., [
        <xref ref-type="bibr" rid="ref35">35</xref>
        ]).
3
      </p>
      <p>Complex Event Processing in Logical Agent Languages
In this section we present our approach to advanced Complex Event Processing in
logical agents. First, we recall how event processing and aggregation can be performed in
most existing frameworks. Then, we argue that new methods and tools would be useful,
and introduce our proposal.
3.1</p>
      <p>Complex Events Recognition and Evaluation: Simple Event Aggregation
Event processing is traditionally based upon Event-Condition-Action (ECA) rules, of
the form “IF Event then Reaction” where sometimes reaction is limited to performing
a sequence of actions, sometimes is enlarged so as to allow forms of reasoning and
various kinds of constraints. Most (virtually all) agent-oriented languages provide ECA
rules of some form.</p>
      <p>For instance, the following sample ECA rules defined in DALI evaluate medical
symptoms, stating that to cope with high temperature one should assume an antipyretic,
and to cope with cough one should take a syrup (clearly, we do not aim at medical
precision). External events are indicated with postfix E, actions with postfix A, and
connective :&gt; indicates reaction. I.e., :&gt; is a specific connective used to define ECA
rules. Since DALI is an extension of prolog, the comma represents conjunction.
high temperatureE :&gt; take antipyreticA.
intense coughE :&gt; take cough syrupA.</p>
      <p>Plain ECA rules can hardly provide more than this kind of simple reaction. Agent
languages may offer empowering mechanisms that allow for some form of CEP. In
DALI for instance, by means of the “internal event” construct evaluation can become
more involved. In the example we may, e.g., consider the possibility that a
combination of symptoms suggests the occurrence of a more serious illness. For
illustration purposes we assume to hypothesize the presence of either pneumonia, or just
flu, or both. In DALI external events are, a short while after perception (that may or
may not imply reaction), recorded as past events (postfix P ), with a time-stamp. By
high temperatureP : [4days] it is intended that at least two past events of the form
high temperatureP : T 1 and high temperatureP : T 2 have been recorded, where
T 2 T 1 is no less than four days. By default, the most recent records are considered,
so the interval refers to the last and to the immediately previous measures of
temperature (if the time-stamp of a past event is omitted, the most recent version is implicitly
referred to).</p>
      <p>The first rule below “reasons” about what has happened: if in fact both high
temperature and cough have occurred, and high temperature has lasted for at least
four days, one may conclude that occurrence of pneumonia should be suspected.
Therefore, from the occurrence of a set of simple events, the occurrence of a
complex event is inferred, as an internal event suspect pneumoniaI . Once inferred, such
an event can be reacted to exactly like external ones by an ECA rule, the one
below stating that the patient shoul take an antibiotic and consult a lung doctor.
suspect pneumoniaI
:high temperatureP : [4days],
intense coughP ,
compatible(prenumonia, anamnesis).
suspect pneumoniaI :&gt; take antibioticA,</p>
      <p>consult lung doctorA.</p>
      <p>Internal events are periodically re-evaluated at a certain (customizable) frequency.
Between one attempt and the next one, the agent’s belief base will evolve as new events
will have happened, reacted to and recorded. Thus, at each attempt an internal event
can be either generated (and reacted to) or not, according to the agent’s belief state. In
the example, the suspect of pneumonia will not raise immediately, but rather after four
days of high temperature measurements.</p>
      <p>Clarly, the proposed example might be formalized also in ETALIS and in many
other agent-oriented frameworks, each one offering its own improvements over
simple ECAs in view of CEP. In summary, by means of ECA rules little can be done for
CEP. By means of suitable empowring mechanisms such as the internal events, complex
events can posibly be generated (ad then reacted to) by reasoning on simple external
events.</p>
      <p>We believe however that such a simple pattern is often not sufficient, as there are
many cases where the interpretation of sets of simple events is not univocal or
straightforward. Therefore, different hypotheses about the meaning of a situation at hand should
be generated and evaluated. We then propose a novel view and a novel formalization of
event aggregation.
3.2</p>
      <p>Complex Events Recognition and Evaluation: Event-Action Modules
Below we introduce the notion of Event and Action modules. For lack of space we
illustrate these modules by means of two examples that we consider as representatives of
significant situations. The first example concerns complex event recognition, the second
one concerns complex actions generation. We do not intend to propose here a specific
syntax for Event and Action modules: rather, we intend to point out what should be
the elements and functions of such modules. In the sample syntax, adopted only for
illustration purposes, as before postfix ’P’ indicates past events, i.e., events which have
occurred (after the ’:’ there is the time-stamp or the interval of occurrence). Postfix ’A’
indicates actions. Connective :&gt; indicated Event-Condition-Action rules, while :- is
the usual prolog if.</p>
      <p>Event Interpretation</p>
      <p>The following example illustrates an Event-Action Module that re-elaborates the
previosly-introduced example concerning medical diagnosis. This should allow the
reader to appreciate the improvements over the simple formulation.</p>
      <p>An Event-Action Module will be (re-)evaluated whenever the triggering events
occur within a certain time interval, and according to specific conditions: in the example,
the module is evaluated whenever in the last two days both high temperature and intense
cough have been recorded.</p>
      <p>EVENT-ACTION-MODULE</p>
    </sec>
    <sec id="sec-2">
      <title>TRIGGER</title>
      <p>(high temperatureP AND intense coughP ) : [2days]</p>
    </sec>
    <sec id="sec-3">
      <title>COMPLEX EVENTS</title>
      <p>suspect flu OR suspect preumonia
suspect flu :- high temperatureP .
suspect pneumonia :- high temperatureP : [4days],
intense coughP .</p>
      <sec id="sec-3-1">
        <title>PREFERENCES</title>
        <p>suspect flu :- patient is healthy .
suspect pneumonia :- patient is at risk .</p>
      </sec>
      <sec id="sec-3-2">
        <title>ACTIONS</title>
        <p>suspect flu :&gt; stay in bedA.
suspect flu, high temperatureP : [4days], not suspect pneumonia :&gt;
take antibioticA.
suspect preumonia :&gt;</p>
        <p>take antibioticA, consult lung doctorA.</p>
      </sec>
      <sec id="sec-3-3">
        <title>MANDATORY</title>
        <p>suspect preumonia :- high temperatureP : [4days],
suspect fluP ,
take antibioticP : [2days].</p>
        <p>
          From given symptoms, either a suspect flu or a suspect pneumonia or both can
be concluded, though for suspecting pneumonia high temperature should have lasted
for at least four days, accompanied by intense cough. This is stated in the
COMPLEX EVENTS section, where each of the listed complex events (in the example,
suspect flu and suspect pneumonia) can be inferred, though according to the specified
conditions. Notice that the whole agent’s belief base (including the history) is implicitly
included in the definition of an Event-Action module. Explicit preferences are expressed
in the PREFERENCES section, here stating that hypothesizing a flu should be preferred
in case the patient is healthy, while pneumonia is more plausible for risky patients. If
either none or both options hold, then they are equally preferred. More involved forms
of preferences might be specified, that for lack of space we do not discuss here (cf.,
e.g., [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] and the references therein). Actions to undertake in the two cases are
specified. As mentioned, the module is re-evaluated at subsequent new occurrences of high
temperature and intense cough. Re-evaluation is performed on the (possibly) updated
belief base.
        </p>
        <p>Actions will be actually performed depending upon the outcome that the agent will
prefer to choose. In particular, if a flu is suspected then the patient should stay in bed,
and if the high temperature persists then an antibiotic should also be assumed (even if
pneumonia is not suspected). In case of suspect pneumonia, an antibiotic is mandatory,
plus a consult with a lung doctor.</p>
        <p>The MANDATORY section of the module includes constraints, that may be of
various kinds: in this case, it specifies which complex events must be mandatorily inferred
in module (re)evaluations if certain conditions occur. Specifically, pneumonia is to be
assumed mandatorily whenever flu has been previously assumed, but high temperature
persists despite at least two days of antibiotic therapy.</p>
        <p>
          Answer set modules for possibility and necessity (cf. [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ]) find a fruitful integration
in the present approach. In the example, it may be for instance that clinical history and
conditions of a patient force to assume a pneumonia. A constraint such as the following
might be added:
        </p>
      </sec>
      <sec id="sec-3-4">
        <title>MANDATORY suspect pneumonia :</title>
      </sec>
      <sec id="sec-3-5">
        <title>Necessary (clinical history , suspect pneumonia).</title>
        <p>We have noted before that event interpretation is not necessarily deterministic and
straightforward. The same happens for actions: devising which actions and agent should
perform can be highly context-dependent, and can be subjected to various kinds of
uncertainty. To avoid brittleness, an agent should in our opinion be able to flexibly
choose what to do in specific circumstances, and to dynamically adapt to changes of
context/role/situation. This is why we propose to adapt previously introduced modules
to action generation.</p>
        <p>We illustrate the approach by means of an example related to what happens when
two persons meet. The representation is simplicistic and is meant only to illustration
purposes. A “real” encoding of the module below might be much more involved, and
imply various kinds of knowledge representation methods, possibly including a theory
of emotions.</p>
        <p>In the sample representation, we assume that the person/agent who first gets sight
of a person/agent (s)he knows possibly smiles, and then either simply waves or stops to
shake hands. Section RELATED EVENTS specifies, as a boolean combination, events
that may occur contextually to the triggering ones. There are some conditions, for
instance that one may smil and/or waves if (s)he is neither in a bad temper nor angry
at the other. Also, one who is in a hurry just waves, while good friends or people
who meet each other in a formal setting should shake hands. Actions simply consist
in returning what the other one does, and it is anomalous not doing so (e.g., if one
smiles and the other does not smile back). In the formalization below, the expression
meet friend (A, F ) means that agent A meets agent F : then, each one possibly makes
some actions and the other one will normally respond. This module is totally
revertible, in the sense that it manages both the case where “we” meet a friend and the case
where vice versa somebody else meets us. This is the reason why in some module
sections events have no postfixes. In fact, meet friend(A,F), smile, wave and shake hands
are present events if a friend meets “us”, and are actions if “we” meet a friend.
Postfixes appear in the ACTIONS and ANOMALY sections, where all elements (whatever
their origin) have become past events to be coped with. The PRECONDITIONS section
expresses action preconditions, via connective :&lt; . Section MANDATORY defines
obligations, here via a rule stating that it is mandatory to shake hands in a formal situation.
The anomaly management section (left undefined here) may include counter-measures
to be taken in case of unexpected behavior, that in the example may go from asking for
explanation to getting angry, etc.</p>
        <p>EVENT-ACTION-MODULE
TRIGGER meet friend (A, F ),
RELATED EVENTS
smile(A, F )OR (wave(A, F ) XOR shake hands(A, F ))</p>
        <sec id="sec-3-5-1">
          <title>PRECONDITIONS</title>
          <p>smileA(A, F ) :&lt; not angry(A, F ), not bad temper (A).
waveA(A, F ) :&lt; not angry(A, F ).
shake handsA(A, F ) :&lt;
good friends(A, F ),
not angry(A, F ), not in a hurry(A), not in a hurry(F ).</p>
        </sec>
        <sec id="sec-3-5-2">
          <title>MANDATORY</title>
          <p>shake handsA(A, F ) :- formal situation(A, F ).</p>
          <p>ACTIONS
smiled (A, F ) :- smileP (A, F ).
waved (A, F ) :- waveP (A, F ).
shaken hands(A, F ) :&gt; shake handsP (F , A).
smiled (A, F ) :&gt; smileA(F, A).
waved (A, F ) :&gt; waveA(F, A).
shaken hands(A, F ) :&gt; shake handsA(F , A).</p>
          <p>ANOMALY
anomaly1 (meet friend (A, F ))
:</p>
          <p>smileP (A, F ), not smileA(F, A).
anomaly2 (meet friend (A, F ))
:</p>
          <p>waveP (A, F ), not waveA(F, A).
anomaly3 (meet friend (A, F ))
:</p>
          <p>shake handsP (A, F ), not shake handsA(F, A).</p>
          <p>ANOMALY MANAGEMENT ACTIONS
. . .
4 Formalization of Event-Action Modules
In this section we provide a formalization of Event-Action modules based upon
previously-introduced building blocks. To ensure integration of modules within the
most common agent-oriented programming languages, we suitably merge them into the
Evolutionary semantics. To provide (as a proof of concept) a formal semantics and an
execution model, we define a translation of Event-Action modules into ASP modules.
4.1 Evolutionary Semantics Extended
We now briefly illustrate how to refine the Evolutionary semantics so as encompass the
proposed approach. The agent program PA becomes now a tuple including at least the
“main” agent program PM, and the available Event-Action modules EA1, . . . , EAk.
Definition 3 (Evolutionary Semantics). Let Ag be an agent, defined by agent program</p>
          <p>PA = hPM, hEA1, . . . , EAki, . . .i
where PM is the main agent program, and EA1, . . . , EAk, k
Event-Action modules.</p>
          <p>0, are the available</p>
          <p>Its evolutionary semantics is "Ag = hH, PExt , M Ei. The program evolution
sequence, indicated by PExt , stems from an Extended initial program PExt 0 obtained
from PM by means of a a suitable initialization phase. In particular, PExt 0 includes
the following elements:
– Program P0, obtained by adding to given main agent program the rules included
in sections ACTIONS, ANOMALY MANAGEMENT ACTIONS and
PRECONDITIONS of EA1, . . . , EAk.
– Tuple of ASP modules h⇧ 1, . . . , ⇧ ki, where each ⇧ i is obtained by translating
Event-Action module EAi into ASP.</p>
          <p>At the i-th evolution step, the agent’s history in general evolves, as new
events/knowledge items may be recorded/removed. This determines an evolution of
both the main agent program Pi and of the ASP modules: in fact, the main program
and the modules implicitly encompass the agent’s history as the set of given facts. This
implies that both the main program and modules semantics needs to be re-evaluated at
each step. Each module will admit none, one or several answer sets, among which just
one has to be selected. Such answer set will encompass a number of inferred complex
events and actions, as well as possibly a number of anomalies, that have to be added
to the agent’s history in order to be respectively reacted to (for events) or executed (for
actions) or coped with (for anomalies). Precisely, at each step we have:
Definition 4 (Evolutionary Semantics Snapshot). The snaphot at stage i of "iAg is the
tuple hHi, PExt i, Mii, where Mi is in turn a tuple, i.e.,</p>
          <p>Mi = hFi, S1, . . . , Sri
where Fi is the semantics of Pi, and Si (i  r  k) is the set composed of the answer
sets of each ⇧ i which has been (re-)evaluated at stage i. The evolution step to stage
i + 1 will imply: (i) the choice of one answer set Ai for each ⇧ i (selected among the
elements of Si); (ii) and the addition to Hi+1 of all the complex events and actions and
anomalies included in Ai.</p>
          <p>Therefore, at step i + 1, complex events, actions and anomalies generated at step
i by each ASP module will be coped with as specified in the original corresponding
Event-Action module, and then recorded as past events in the agent’s history.</p>
          <p>In summary, the integration of Event-Action modules within a logical agent’s basic
functioning can be described as follows.</p>
          <p>– At every agent’s evolution step, the TRIGGER headline of each Event-Action
module has to be checked, in order to state whether the module is to be re-avaluated.
We cannot treat here complexity of this check, that will depend upon complexity of
expressions involved.
– ASP modules corresponding to Event-Action modules that are to be (re-)evaluated
will be fed to an answer set solver. A module will admit as a result of evaluation
none, one or more answer sets.
– If the module admits answer sets, each one will encompass a number of complex
events, actions and anomalies. One answer set will be selected, according to
preferences (if expressed within the module), or by random choice, or by informed choice
deriving from a learning process, as discussed in Section 5. The rules for coping
with the inferred complex events, actions and anomalies are defined in sections
ACTIONS, ANOMALY MANAGEMENT ACTIONS and PRECONDITIONS, which
can be found in the main agent program.
4.2</p>
          <p>ASP Representation of Modules
Each Event-Action module can be translated in a fully automated way into an ASP
module. This except sections ACTIONS, ANOMALY MANAGEMENT ACTIONS and
PRECONDITIONS, whose content as seen before has to be added to the main agent
program.</p>
          <p>The answer set program (module) ⇧ corresponding to a given Event-Action module
will be obtained by translating into ASP the contents of sections COMPLEX EVENTS,
CHECK, RELATED EVENTS, ANOMALIES and MANDATORY. The translation is
straightforward and can be fully automated.</p>
          <p>
            For the sake of simplicity we outline a translation into basic ASP, thus not
considering the various additional useful constructs that have been introduced in the literature
and in the implementations. It can be noted that extensions of ASP oriented to stream
reasoning have been defined (cf., e.g., [
            <xref ref-type="bibr" rid="ref36">36</xref>
            ]). We observe however that we do not
perform stream reasoning, rather we perform periodical re-evaluation of modules, so at
present we do not deem it necessary to resort to such approach.
          </p>
          <p>For lack of space we cannot properly describe how to cope with time intervals:
however, our method consists in representing time-stamps as additional arguments of
ASP predicates representing events. Intervals are then computed by trivial arithmetic
constraints.</p>
          <p>The translation of (the relevant sections of) an Event-Action module into ASP can
be performed by means of the following guidelines (a formal definition of the
translation, including the treatment of time intervals, is deferred to an extended version of this
paper).
conj In ASP, the conjunction among a number of elements a1, . . . , an is simply
expressed as conj a1, . . . , an.
or-xor Disjunction among two elements a and b is expressed by the cycle a b b
a. This disjunction is not exclusive, since either a or b or both might be derived
elsewhere in the program. To obtain exclusive disjunction, a constraint
a, b must be added. A constraint in ASP can be read as it cannot be that.... In
the case of exclusive disjunction, it cannot be that both a and b belong to the same
answer set. Disjunction (also exclusive) can be expressed also on several elements.
choice Choice, or possibility, or hypothesis, expressing that some element a may or
may not be included in an answer set, can be expressed by means of a cycle
involving a fresh atom, say na. The cycle is of the form a na na a. Therefore, an
answer set will contain either a or na, the latter signifying the absence of a.
choyf A choice that can be done (by pattern choice) on element a only if certain
conditions Conds are satisfied, is expressed by a choice pattern plus a rule c Conds
and a constraint a, not c. The constraint states that a cannot be hypothesized in
an answer set if c does not hold, i.e., if Conds are not implied by that answer set.
mand Mandatory presence in an answer set of atom a defined by rule a Body
whenever Body is implied by that answer set can be obtained as follows. In addition to
the defining rule a Body , a constraint must be added of the form not a, Body
stating that it cannot be that an answer set implies Body but does not contain a. The
constraint is necessary for preventing a to be ruled out by some other condition
occurring elsewhere in the program.
– Events in the RELATED EVENTS section can be expressed by means of the choice
pattern, and their combinations via the conj and or-xor patterns. Constraints in the
MANDATORY can be expresses by means of the mand pattern.
– Section COMPLEX EVENTS is coped with by the choice and choyf patterns.
– Sections CHECK and ANOMALIES can be translated by a plain transposition of
their rules into ASP, possibly exploiting the conj and or-xor patterns.
5</p>
          <p>
            Evaluating Outcomes and Reinforcement Learning
Outcomes of an Event-Action Module are often not univocal: thus, at each stage the
agent face a choice among the answer sets of corresponding ASP module ⇧ . As we
have seen in the example, preferences may help the agent in choosing an outcome rather
than another one. However, knowledge can be incomplete or partial about reliability of
such preferences, and in general about plausibility of the choice. This choice is akin to
the “multi-armed bandit problem” [
            <xref ref-type="bibr" rid="ref37">37</xref>
            ], and thus machine learning techniques can be
used so that an agent will learn over time to make the ‘best’ choice over the answer sets
of each module ⇧ (i.e., over the outcomes of each Event-Action Module).
          </p>
          <p>
            Therefore, a self-improving process is in order, and for this purpose, an agent can be
endowed with a simple reinforcement learning mechanism [
            <xref ref-type="bibr" rid="ref38">38</xref>
            ]: at each evolution step,
occurring at a time t, an agent: (i) senses its environment; (ii) re-evaluates ⇧ obtaining
the answer sets A1, . . . , Ak, k &gt; 0; (iii) adopt one of them, say A, and evaluates its
“quality”, denoted with Q(A). In order to evaluate the quality of an answer set, we
assume that at stage t, a numerical value denoted V t(A) is associated to it: this value
can be either epistemic or practical. Its expression shall be dependent on the application
so we leave it unspecified in the description of the present general framework. At time t,
the quality of the selected answer A will be computed as a discounted moving average
of its value over time:
          </p>
          <p>Qt+1(A) = Qt(A) + ↵. (V t(A)</p>
          <p>Qt(A))
where ↵ is the discount rate. Then, an agent draws an answer set A amongst all the
possible answer sets A1, . . . , Ak of ⇧ with probability P t(A). This probability can be
computed using a Gibbs-Boltzmann distribution:</p>
          <p>P t(M ) = eQt(A)/⌧ / X eQt(Ai)/⌧</p>
          <p>i
where ⌧ is a ‘learning temperature’ to balance the exploitation and the exploration of
possible models.
6</p>
          <p>Concluding Remarks
In summary, in this paper we have introduced kinds of Event-Action modules that allow
an agent to: aggregate simple events into complex ones, also according to constraints;
check events that occur w.r.t. expectations; cope with events possibly occurring
contextually to certain other events; detect anomalies; decide actions to be performed in
both normal or anomalous cases, according to a number of issues among which we may
include context, role, circumstances, past experience, etc.</p>
          <p>In future work, other event aggregation and recognition patterns might be
introduced. The approach might be extended to a more involved definition of complex
actions, and to the choice among possible action patterns. The proposed simple learning
mechanism might be refined based on experimentations on suitable test cases. We may
notice that the approach is basically independent of the underlying logic, so that more
expressive (e.g., modal) logic might be employed in future extensions. Clearly, a
semantics and execution model going beyond ASP should then be provided.</p>
          <p>
            We intend to introduce forms of ’deep’ learning of Event-Action modules. In our
intention, an Event-Action Modules might be initially defined in a tentative or
embryonic form: then, module elements might be learnt via a training phase, and refined via
reinforcement learning during the agent’s ’life’ thus adding to agent’s flexibility and
adaptability. To this aim, we have been developing suitable argomentation-based
learning techniques [
            <xref ref-type="bibr" rid="ref39">39</xref>
            ].
          </p>
          <p>We do not intend to claim that all events can be recognized and reacted to, and all
actions generated, only in a logic-based way. Nevertheless, also based upon relevant
literature, we claim that event/actions recognition, generation and management oftens
require forms of (even non-trivial) reasoning. Overall, any really “intelligent” agent
capable of flexible interaction with complex real-world environment will presumably
result from a graceful integration of several kind of components, possibly based upon
different approaches.</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Chandy</surname>
            ,
            <given-names>M.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Etzion</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>von</surname>
            <given-names>Ammon</given-names>
          </string-name>
          , R.: 10201
          <string-name>
            <given-names>Executive</given-names>
            <surname>Summary and Manifesto - Event Processing</surname>
          </string-name>
          . In Chandy,
          <string-name>
            <given-names>K.M.</given-names>
            ,
            <surname>Etzion</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            ,
            <surname>von</surname>
          </string-name>
          <string-name>
            <surname>Ammon</surname>
          </string-name>
          , R., eds.
          <source>: Event Processing. Number 10201 in Dagstuhl Seminar Proceedings</source>
          , Dagstuhl, Germany, Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, Germany (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Etzion</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Niblett</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          : Event Processing in Action. Manning Publications Co.
          <article-title>(</article-title>
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Paschke</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kozlenkov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Rule-based event processing and reaction rules</article-title>
          .
          <source>In: RuleML</source>
          . Volume
          <volume>5858</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2009</year>
          )
          <fpage>53</fpage>
          -
          <lpage>66</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Kowalski</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sergot</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>A logic-based calculus of events</article-title>
          .
          <source>New Generation Computing</source>
          <volume>4</volume>
          (
          <year>1986</year>
          )
          <fpage>67</fpage>
          -
          <lpage>95</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Fisher,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Bordini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.H.</given-names>
            ,
            <surname>Hirsch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Torroni</surname>
          </string-name>
          ,
          <string-name>
            <surname>P.</surname>
          </string-name>
          :
          <article-title>Computational logics and agents: a road map of current technologies and future trends</article-title>
          .
          <source>Computational Intelligence Journal</source>
          <volume>23</volume>
          (
          <issue>1</issue>
          ) (
          <year>2007</year>
          )
          <fpage>61</fpage>
          -
          <lpage>91</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Anicic</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rudolph</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fodor</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stojanovic</surname>
          </string-name>
          , N.:
          <article-title>Real-time complex event recognition and reasoning-a logic programming approach</article-title>
          .
          <source>Applied Artificial Intelligence</source>
          <volume>26</volume>
          (
          <issue>1-2</issue>
          ) (
          <year>2012</year>
          )
          <fpage>6</fpage>
          -
          <lpage>57</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Anicic</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rudolph</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fodor</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stojanovic</surname>
          </string-name>
          , N.:
          <article-title>Stream reasoning and complex event processing in ETALIS</article-title>
          .
          <source>Semantic Web</source>
          <volume>3</volume>
          (
          <issue>4</issue>
          ) (
          <year>2012</year>
          )
          <fpage>397</fpage>
          -
          <lpage>407</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. :
          <article-title>Etalis web site</article-title>
          . http://code.google.com/p/etalis/
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Towards active logic programming</article-title>
          . In Brogi,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Hill</surname>
          </string-name>
          , P., eds.:
          <source>Electronic Proceedings of COCL'99</source>
          ,
          <string-name>
            <given-names>Second</given-names>
            <surname>Intl</surname>
          </string-name>
          . Works.
          <article-title>on Component-Based Software Development in Computational Logic (included in PLI'99, Principles, Logics and Implementation of High-level Programming Languages)</article-title>
          .
          <article-title>On-line at the URL</article-title>
          : http://www.di.unipi. it/˜brogi/ResearchActivity/COCL99/proceedings/index.html, year =
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tocchio</surname>
            ,
            <given-names>A.:</given-names>
          </string-name>
          <article-title>A logic programming language for multi-agent systems</article-title>
          .
          <source>In: Logics in Artificial Intelligence, Proc. of the 8th Europ. Conf.,JELIA 2002. LNAI 2424</source>
          , Springer-Verlag, Berlin (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tocchio</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>The DALI logic programming agent-oriented language</article-title>
          .
          <source>In: Logics in Artificial Intelligence, Proc. of the 9th European Conference, Jelia 2004. LNAI 3229</source>
          , Springer-Verlag, Berlin (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tocchio</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>About declarative semantics of logic-based agent languages</article-title>
          . In Baldoni,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Endriss</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            ,
            <surname>Omicini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Torroni</surname>
          </string-name>
          , P., eds.: Declarative Agent Languages and
          <string-name>
            <surname>Technologies</surname>
            <given-names>III</given-names>
          </string-name>
          , Third International Workshop, DALT 2005,
          <article-title>Selected</article-title>
          and
          <string-name>
            <given-names>Revised</given-names>
            <surname>Papers</surname>
          </string-name>
          . Volume
          <volume>3904</volume>
          <source>of LNAI</source>
          . Springer (
          <year>2006</year>
          )
          <fpage>106</fpage>
          -
          <lpage>123</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>D'Alessandro</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lanti</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tocchio</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , al.:
          <article-title>DALI web site, download of the interpreter (2012) Released: basic DALI features. For beta versions please ask the authors</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Alferes</surname>
            ,
            <given-names>J.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Banti</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brogi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>An event-condition-action logic programming language</article-title>
          .
          <source>In: Logics in Artificial Intelligence, 10th European Conference</source>
          ,
          <string-name>
            <surname>JELIA</surname>
          </string-name>
          <year>2006</year>
          . Volume
          <volume>4160</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2006</year>
          )
          <fpage>29</fpage>
          -
          <lpage>42</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dell'Acqua</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tocchio</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Expressing preferences declaratively in logicbased agent languages</article-title>
          .
          <source>In: Proc. of Commonsense'07, the 8th International Symposium on Logical Formalizations of Commonsense Reasoning</source>
          , AAAI Press (
          <year>2007</year>
          )
          <article-title>Event in honor of the 80th birthday of John McCarthy</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Answer set modules for logical agents</article-title>
          . In de Moor,
          <string-name>
            <given-names>O.</given-names>
            ,
            <surname>Gottlob</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Furche</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Sellers</surname>
          </string-name>
          , A., eds.: Datalog Reloaded: First International Workshop,
          <year>Datalog 2010</year>
          . Volume 6702 of LNCS. Springer (
          <year>2011</year>
          )
          <article-title>Revised selected papers</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Gasperis</surname>
          </string-name>
          , G.:
          <article-title>Complex reactivity with preferences in rule-based agents</article-title>
          . In Bikakis,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Giurca</surname>
          </string-name>
          , A., eds.
          <source>: Rules on the Web: Research and Applications</source>
          , RuleML 2012 - Europe, Montpellier, France,
          <source>August 27-29</source>
          ,
          <year>2012</year>
          . Proceedings. Volume
          <volume>6826</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2012</year>
          )
          <fpage>167</fpage>
          -
          <lpage>181</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gasperis</surname>
          </string-name>
          , G.D.:
          <article-title>Memory, experience and adaptation in logical agents</article-title>
          . In Casillas, J., Mart´
          <fpage>inez</fpage>
          -Lo´pez,
          <string-name>
            <given-names>F.J.</given-names>
            ,
            <surname>Vicari</surname>
          </string-name>
          , R., la
          <string-name>
            <surname>Prieta</surname>
          </string-name>
          , F.D., eds.:
          <source>Management Intelligent Systems: Second International Symposium, Proceedings. Advances in Intelligent and Soft Computing</source>
          , Springer (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Self-checking logical agents</article-title>
          . In Gini,
          <string-name>
            <given-names>M.L.</given-names>
            ,
            <surname>Shehory</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            ,
            <surname>Ito</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Jonker</surname>
          </string-name>
          , C.M., eds.: International conference on Autonomous Agents and
          <string-name>
            <surname>Multi-Agent</surname>
            <given-names>Systems</given-names>
          </string-name>
          ,
          <string-name>
            <surname>AAMAS</surname>
          </string-name>
          <year>2013</year>
          ,
          <article-title>Proceedings</article-title>
          , IFAAMAS (
          <year>2013</year>
          )
          <fpage>1329</fpage>
          -
          <lpage>1330</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gasperis</surname>
          </string-name>
          , G.D.:
          <article-title>Meta-level constraints for complex event processing in logical agents</article-title>
          .
          <source>In: Online Proceedings of Commonsense</source>
          <year>2013</year>
          , the 11th
          <source>International Symposium on Logical Formalizations of Commonsense Reasoning</source>
          . (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Kowalski</surname>
            ,
            <given-names>R.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sadri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Towards a logic-based unifying framework for computing</article-title>
          .
          <source>CoRR abs/1301</source>
          .6905 (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Kowalski</surname>
            ,
            <given-names>R.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sadri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Teleo-reactive abductive logic programs</article-title>
          . In Artikis,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Craven</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Cicekli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.K.</given-names>
            ,
            <surname>Sadighi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Stathis</surname>
          </string-name>
          , K., eds.: Logic Programs, Norms and Action - Essays
          <source>in Honor of Marek J. Sergot on the Occasion of His 60th Birthday</source>
          . Volume
          <volume>7360</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Kowalski</surname>
            ,
            <given-names>R.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sadri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>A logic-based framework for reactive systems</article-title>
          .
          <source>In: Rules on the Web: Research and Applications - 6th International Symposium, RuleML 2012. Proceedings. Volume 7438 of Lecture Notes in Computer Science</source>
          ., Springer (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Brachman</surname>
            ,
            <given-names>R.J.</given-names>
          </string-name>
          :
          <article-title>(AA)AI more than the sum of its parts</article-title>
          .
          <source>AI</source>
          Magazine
          <volume>27</volume>
          (
          <issue>4</issue>
          ) (
          <year>2006</year>
          )
          <fpage>19</fpage>
          -
          <lpage>34</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>Anderson</surname>
            ,
            <given-names>M.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perlis</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Logic, self-awareness and self-improvement: the metacognitive loop and the problem of brittleness</article-title>
          .
          <source>J. Log. Comput</source>
          .
          <volume>15</volume>
          (
          <issue>1</issue>
          ) (
          <year>2005</year>
          )
          <fpage>21</fpage>
          -
          <lpage>40</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <surname>Anderson</surname>
            ,
            <given-names>M.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fults</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Josyula</surname>
            ,
            <given-names>D.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Oates</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perlis</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , Wilson,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Wright</surname>
          </string-name>
          ,
          <string-name>
            <surname>D.:</surname>
          </string-name>
          <article-title>A self-help guide for autonomous systems</article-title>
          .
          <source>AI Magazine</source>
          <volume>29</volume>
          (
          <issue>2</issue>
          ) (
          <year>2008</year>
          )
          <fpage>67</fpage>
          -
          <lpage>73</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <surname>Baral</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Knowledge representation, reasoning and declarative problem solving</article-title>
          . Cambridge University Press (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Answer sets</article-title>
          .
          <source>In: Handbook of Knowledge Representation, Chapter</source>
          <volume>7</volume>
          .
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riveret</surname>
          </string-name>
          , R.:
          <article-title>Event-action modules for complex reactivity in logical agents</article-title>
          . In Lomuscio,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Scerri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Bazzan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Huhns</surname>
          </string-name>
          , M., eds.: International conference on Autonomous Agents and
          <string-name>
            <surname>Multi-Agent</surname>
            <given-names>Systems</given-names>
          </string-name>
          ,
          <string-name>
            <surname>AAMAS</surname>
          </string-name>
          <year>2014</year>
          ,
          <article-title>Proceedings</article-title>
          , IFAAMAS (
          <year>2014</year>
          )
          <fpage>1503</fpage>
          -
          <lpage>1504</lpage>
          Extended Abstract.
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          30.
          <string-name>
            <surname>Bordini</surname>
            ,
            <given-names>R.H.</given-names>
          </string-name>
          , Hu¨ bner,
          <string-name>
            <surname>J.F.</surname>
          </string-name>
          :
          <article-title>Semantics for the jason variant of agentspeak (plan failure and some internal actions)</article-title>
          . In Coelho, H.,
          <string-name>
            <surname>Studer</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wooldridge</surname>
          </string-name>
          , M., eds.
          <source>: ECAI 2010 - 19th European Conference on Artificial Intelligence, Proceedings. Volume 215 of Frontiers in Artificial Intelligence and Applications</source>
          ., IOS Press (
          <year>2010</year>
          )
          <fpage>635</fpage>
          -
          <lpage>640</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          31.
          <string-name>
            <surname>Hindriks</surname>
            ,
            <given-names>K.V.</given-names>
          </string-name>
          :
          <article-title>Programming rational agents in GOAL</article-title>
          . In El Fallah Seghrouchni,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Dix</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Dastani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Bordini</surname>
          </string-name>
          , R.H., eds.:
          <string-name>
            <surname>Multi-Agent</surname>
            <given-names>Programming</given-names>
          </string-name>
          :. Springer US (
          <year>2009</year>
          )
          <fpage>119</fpage>
          -
          <lpage>157</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          32.
          <string-name>
            <surname>Dastani</surname>
          </string-name>
          , M.,
          <string-name>
            <surname>van Riemsdijk</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <article-title>B</article-title>
          ., Meyer,
          <string-name>
            <surname>J.J.C.</surname>
          </string-name>
          :
          <article-title>Programming multi-agent systems in 3APL</article-title>
          . In Bordini, R.H.,
          <string-name>
            <surname>Dastani</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dix</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fallah-Seghrouchni</surname>
          </string-name>
          , A.E., eds.:
          <string-name>
            <surname>Multi-Agent</surname>
            <given-names>Programming</given-names>
          </string-name>
          :
          <article-title>Languages, Platforms and Applications</article-title>
          . Volume
          <volume>15</volume>
          of
          <string-name>
            <surname>Multiagent</surname>
            <given-names>Systems</given-names>
          </string-name>
          ,
          <source>Artificial Societies, and Simulated Organizations</source>
          . Springer (
          <year>2005</year>
          )
          <fpage>39</fpage>
          -
          <lpage>67</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref33">
        <mixed-citation>
          33.
          <article-title>Web-references: Some ASP solvers Clasp: potassco.sourceforge.net; Cmodels: www</article-title>
          .cs.utexas.edu/users/tag/cmodels; DLV: www.dbai.tuwien. ac.at/proj/dlv; Smodels: www.tcs.hut.fi/Software/smodels.
        </mixed-citation>
      </ref>
      <ref id="ref34">
        <mixed-citation>
          34.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lifschitz</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>The stable model semantics for logic programming</article-title>
          .
          <source>In: Logic Programming, Proc. of the Fifth Joint Int. Conf. and Symposium</source>
          , MIT Press (
          <year>1988</year>
          )
          <fpage>1070</fpage>
          -
          <lpage>1080</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref35">
        <mixed-citation>
          35.
          <string-name>
            <surname>Dantsin</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Voronkov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Complexity and expressive power of logic programming</article-title>
          .
          <source>ACM Computing Surveys</source>
          <volume>33</volume>
          (
          <issue>3</issue>
          ) (
          <year>2001</year>
          )
          <fpage>374</fpage>
          -
          <lpage>425</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref36">
        <mixed-citation>
          36.
          <string-name>
            <surname>Gebser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grote</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaminski</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Obermeier</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sabuncu</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schaub</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Stream reasoning with answer set programming: Preliminary report</article-title>
          . In Brewka, G.,
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McIlraith</surname>
            ,
            <given-names>S.A</given-names>
          </string-name>
          ., eds.:
          <source>Principles of Knowledge Representation and Reasoning: Proceedings of the Thirteenth International Conference, KR</source>
          <year>2012</year>
          ,
          <article-title>year = 2012</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref37">
        <mixed-citation>
          37.
          <string-name>
            <surname>Cesa-Bianchi</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lugosi</surname>
          </string-name>
          , G.:
          <article-title>Prediction, Learning, and Games</article-title>
          . Cambridge University Press, New York, NY, USA (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref38">
        <mixed-citation>
          38.
          <string-name>
            <surname>Sutton</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barto</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Reinforcement learning: An introduction</article-title>
          . Volume
          <volume>116</volume>
          . Cambridge Univ Press (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref39">
        <mixed-citation>
          39.
          <string-name>
            <surname>Caianiello</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riveret</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Draief</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Concept learning by a monte-carlo tree search of argumentations</article-title>
          .
          <source>In: Proc. of RCRA2014</source>
          , 21st RCRA International Workshop on
          <article-title>Experimental Evaluation of Algorithms for solving problems with combinatorial explosion</article-title>
          ,
          <source>Part of the 2014 Vienna Summer of Logic</source>
          . (
          <year>2014</year>
          ) To appear.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>