<!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>Reflection and Introspection for Humanized Intelligent Agents</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Stefania Costantini</string-name>
          <email>stefania.costantini@univaq.it</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Abeer Dyoub</string-name>
          <email>abeer.dyoub@graduate.univaq.it</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Valentina Pitoni</string-name>
          <email>valentina.pitoni@graduate.univaq.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>DISIM, University of L'Aquila</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Methods for implementing Automated Reasoning in a fashion that is at least reminiscent of human cognition and behavior must refer (also) to Intelligent Agents. In fact they implement many important autonomous applications upon which, nowadays, the life and welfare of living beings may depend. In such contexts, 'humanized' agents should do what is expected of them, but perhaps more importantly they should not behave in improper/unethical ways given the present context. We propose techniques for introspective selfmonitoring and checking.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Methods for implementing Automated Reasoning in a
fashion that is at least reminiscent of human cognition and
behavior must refer (also) to Intelligent Agents. In fact, agent
systems are widely adopted for many important autonomous
applications upon which, nowadays, the life and welfare of
living beings may depend. In such contexts, agents should
do what is expected of them, but perhaps more importantly
they should not behave in improper/unethical ways given the
present context.</p>
      <p>Defining and implementing “humanized” artificial agents
involves two aspects. The first one concerns philosophy and
cognitive sciences, to understand and formalize which are the
principles to which such machines should conform. A
second complementary one concerns Software Engineering and
computer programming, to understand: how such principles
should be specified and formalized in implementable terms;
how they can be implemented; and how compliance can
verified and, if possible, certified.</p>
      <p>
        In order to be trustworthy both in general terms and from
the point of view of ethics, and so in order to be adopted in
applications where living being welfare depend upon their
behavior, certification and assurance1 of agent systems is a
crucial issue. Pre-deployment (or ’static’ or ’a priori’) assurance
1Assurance can be defined as “the level of confidence that
software is free from vulnerabilities, either intentionally designed into
the software or accidentally inserted at any time during its lifecycle,
and that the software functions in the intended manner” is related
to dependability, i.e., to ensuring (or at least obtaining a reasonable
and certification techniques for agent systems include
verification and testing. We restrict ourselves to agent systems
based upon computational logic, i.e., implemented in
logicbased languages and architectures such as those presented in
the survey [Bordini et al., 2006]. Most verification methods
for logical agents rely upon model-checking
        <xref ref-type="bibr" rid="ref30">(cf. [Kouvaros
and Lomuscio, 2017] and the references therein)</xref>
        , and some
        <xref ref-type="bibr" rid="ref38">(e.g., [Shapiro et al., 2010])</xref>
        upon theorem proving.
      </p>
      <p>In our view, any ’animated’ being (including software
agents) that tries to be truly rational at a ’human-level’ must
compare and reconcile at any time its ’instinctive’ behavior
with the underlying general rules of ’humanistic’ behavior.
Such rules depend upon the agent’s environment, and include
moral/ethical principles. An agent should thus be able to
detect violations/inconsistencies and to correct its behavior
accordingly. Thus, in this paper we advocate methods for
runtime monitoring and self-correction of agent systems, so that
they exhibit forms of human-like behavior emulating
selfcriticism and the ability to put in question and correct
themselves.</p>
      <p>We believe in particular that, in changing circumstances,
agents should stop to reflect on their own behavior: such
an act of context-dependent introspection may lead to
selfmodification. Our approach can be seen under the
perspective of Self-aware computing, where, citing [Tørresen et al.,
2015], Self-aware and self-expressive computing describes
an emerging paradigm for systems and applications that
proactively gather information; maintain knowledge about
their own internal states and environments; and then use
this knowledge to reason about behaviors, revise self-imposed
goals, and self-adapt.: : : Systems that gather unpredictable
input data while responding and self-adapting in uncertain
environments are transforming our relationship with and use
of computers. As argued in [Amir et al., 2007], From an
autonomous agent view, a self-aware system must have sensors,
effectors, memory (including representation of state), conflict
detection and handling, reasoning, learning, goal setting, and
an explicit awareness of any assumptions. The system should
be reactive, deliberative, and reflective.</p>
      <p>An example of such a system concerning
computationallogic-based agents is presented in [Anderson and Perlis,
2005], which defines a time-based active logic and a
confidence) that system designers and users can rely upon the
system.</p>
      <p>Metacognitive Loop (MCL), that involves a system
monitoring, reasoning and meta-reasoning about and if necessary
altering its own behavior. As discussed in [Anderson and Perlis,
2005], MCL continuously monitors an agent’s expectations,
notices when they are violated, assesses the cause of the
violation and guides the system to an appropriate response. In
the terms of [Amir et al., 2007] this is an example of Explicit
Self-Awareness, where the computer system has a full-fledged
self-model representing knowledge about itself.</p>
      <p>In this paper we propose methods based upon relevant
existing work on reification, introspection and reflection. In
particular we introduce meta-rules and meta-constraints for
agents’ run-time self-checking, to be exploited to ensure
respect of machine ethics principles. The methods that we
propose are not in alternative but rather complementary to
a-priori existing verification and testing methodologies.
Differently from [Anderson and Perlis, 2005] we do not aim to
continuously monitor the entire system’s state, but rather to
monitor either upon every occurrence or at suitable
customizable frequency only the activities that a designer deems to be
relevant for keeping the system’s behavior within a desired
range. In the terms of [Amir et al., 2007] we aim to build
SelfMonitoring systems that “monitor, evaluate and intervene in
their internal processes, in a purposive way”.</p>
      <p>In [Rushby, 2008], it is advocated in fact that for adaptive
systems (of which agents are clearly a particularly
interesting case) assurance methodologies should whenever possible
imply not only detection but also recovery from software
failure, due often to incomplete specifications or to unexpected
changes in the system’s environment.</p>
      <p>
        The proposed approach provides the possibility of
correcting and/or improving agent’s behavior: the behavior can be
corrected whenever an anomaly is detected, but can also be
improved whenever it is acceptable, yet there is room for
getting a better behavior. Counter measures can be at the
objectlevel, i.e., they can be related to the application, or at the
meta-level, e.g., they can result in replacing
        <xref ref-type="bibr" rid="ref37">(as suggested in
[Rushby, 2008])</xref>
        a software component by a diverse
alternative.
      </p>
      <p>Introspection and reflection have long being studied in
Computational Logic, see among others [Konolige, 1988;
van Harmelen et al., 1992; Perlis and Subrahmanian, 1994;
Barklund et al., 2000], and the survey [Costantini, 2002].
So, in this paper we do not propose new techniques or new
semantics. The application of concepts of introspection and
reflection to ’Humanizing Intelligent Software Agents’
however is new, and to the best of our knowledge unprecedented
in the literature. So, in our proposal techniques that have been
widely applied in many fields in the past can now find a new
important realm of application. We have been stimulated and
to some extent influenced by the important recent book by
Luis Moniz Pereira on programming Machine Ethics [Pereira
and Saptawijaya, 2016]: in fact, along the paper we consider
Machine Ethics topics as a testbed. The proposed techniques
can in fact contribute to ’humanize’ agents under many
respects, where the machine Ethics field can be considered as
an interesting and very important ’drosophila’ for
demonstration purposes. The paper is organized as follows. We
first provide basic concepts concerning reification and
introspection/reflection. Then we introduce special metarules and
meta-constraints for agents’ self-checking. Then we show
their usability on a case study. Finally we discuss related
work and propose some concluding remarks.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Background: Reification and Reflection</title>
      <p>For a system to be able to inspect (components of) its own
state, such state must be represented explicitly, i.e., it must
be reified: via reification, the state is transformed into a
first-class object (in computational logic, it is represented
via a special term). A reification mechanism, also known as
“naming relation” or “self-reference mechanism”, is in fact a
method for representing within a first-order language
expressions of the language itself, without resorting to higher-order
features. Naming relations can be several; for a discussion
of different possibilities, with their different features and
objectives, advantages and disadvantages, see, e.g., [Perlis and
Subrahmanian, 1994; van Harmelen, 1992; Barklund et al.,
1995] where the topic is treated in a fully formal way.
However, all naming mechanisms are based upon introducing
distinguished constants, function symbols (if needed) and
predicates, devised to construct names. For instance, gives atom
p(a; b; c) a name might be atom(pred (p0); args([a0; b0; c0])
where p0 and a0; b0; c0 are new constants intended as names for
the syntactic elements p and a; b; c and notice that: p is a
predicate symbol (which is not a first-class object in first-order
settings), atom is a distinguished predicate symbol, args a
distinguished function symbol and [: : :] is a list.</p>
      <p>More precisely (though, for lack of space, still informally),
let us consider a standard first-order language L including
sets of predicate, constant and (possibly) function symbols,
and a (possibly denumerable) set of variable symbols. As
usual, well-formed formulas have atoms as their basic
constituents, where an atom is built via the application of a
predicate to a number n (according to the predicate arity) of terms.
The latter can be variables, constants, or compound terms
built by using function symbols (if available). We assume
to augment L with new symbols, namely a new constant (say
of the form p0) for each predicate symbol p, a new constant
(say f 0) for each predicate symbol f , a new constant (say c0)
for each constant symbol c, and a denumerable set of
metavariables, that we assume to have the form X0 so as to
distinguish them syntactically from “plain” variables X. The
new constants are intended to act as names, where we will
say that, syntactically, p0 denotes p, f 0 denotes f and c0
denotes c, respectively. The new variables can be instantiated to
meta-level formulas, i.e., to terms involving names, where we
assume that plain variables can be instantiated only to terms
not involving names. We assume an underlying mechanism
managing the naming relation (however defined), so by abuse
of notation we can indicate the name of, e.g., atom p(a; b; c)
as p0(a0; b0; c0) and the name of a generic atom A as "A.</p>
      <p>Reification of atoms can be extended in various rather
straightforward ways, as discussed in the aforementioned
references, to reification of entire formulas.</p>
      <p>In the seminal work of [Smith, 1984] for LISP, then
extended to Prolog [Dell’Acqua, 1989], an upward reflection
operation determines the reification of the entire language
interpreter’s state, the interruption of the interpreter’s
functioning and the activation of a new instance of the
interpreter on the reified state (at an “upper level”). Such state
could thus be inspected and modified with the aim to
improve the system’s behavior and performance; at the end,
an operation of downward reflection resumed the
functioning of the “lower level” interpreter on the modified state. The
process might iterate over any number of levels, thus
simulating an “infinite tower” of interpreters. The advantage of
having the entire interpreter’s state available is however
balanced by the disadvantage of such state representation being
quite low-level, and so modification related to reasoning are,
if not impossible, quite difficult and awkward to perform.
Other approaches such as [Costantini and Lanzarone, 1989;
Grosof et al., 2017] reify upon need aspects of an agent’s
state. In this paper we embrace the viewpoint of the latter
approaches.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Meta-Rules for checking Agents’ activities</title>
      <p>
        In this paper we mainly consider logic rule-based languages,
where rules are typically represented in the form Head
Body where indicates implication; other notations for this
connective can alternatively be employed. In Prolog-like
languages, is indicated as : , and Body is intended as a
conjunction of literals (atoms or negated atoms) where ^ is
conventionally indicated by a comma. Literals occurring in
the body are also called “subgoals” or simply ’goals’ and are
meant to be executed left-to-right’ whenever the rule is used
during the resolution-based inference process aimed at
proving an overall ’goal’, say A
        <xref ref-type="bibr" rid="ref33">(cf. [Lloyd, 1987] for the
technical specification of logic programming languages)</xref>
        .
      </p>
      <p>We introduce a mechanism to verify and enforce desired
properties by means of metalevel rules (w.r.t. usual, or
“baselevel” or “object-level” rules). To define such new rules, we
assume to augment the language L at hand not only with
names, but with the introduction of two distinguished
predicates, solve and solve not . An atom A is a base atom if the
predicate is not one of solve or solve not , and A does not
involve names. Distinguished predicates will allow us to
respectively integrate the meaning of the other predicates in a
declarative way. In fact, solve and solve not take as
arguments (names of) atoms (involving any predicate excluding
themselves), and thus they are able express sentences about
relations. Names of atoms in particular are allowed only as
arguments of solve and solve not . Also, solve and solve not
can occur in the body of a metarule only if the predicate of its
head is in turn either solve and solve not .</p>
      <p>Below is a simple example of the use of solve to
specify action Act can be executed in present agent’s context
of operation C only if such action is deemed to be ethical
w.r.t. context C. To make an example, what can be
ethical in C = ’videogame’ can not be ethical in C = ’citizen
assistance’, etc. Clearly, in more general cases any kind of
reasoning might be performed via metalevel rules in order to
affect/modify/improve base-level behavior.</p>
      <p>solve(execute action0(Act 0)) :</p>
      <p>present context (C ); ethical (C ; Act 0):
Our approach is to automatically invoke
solve(execute action0(Act 0)) whenever subgoal (atom)
execute action(Act ) is attempted at the base level. More
generally, given any subgoal A at the base level, if there
exists an applicable solve rule such rule is automatically
applied, and A can succeed only if solve("A) succeeds.</p>
      <p>Symmetrically we can defin metarules to forbid unwanted
base-level behavior, e.g.:
solve not (execute action0(Act 0)) :</p>
      <p>present context (C ); ethical exception(C ; Act 0):
with the aim to prevent success of the argument "A of
solve not , in the example execute action(Act ), whenever
solve not ("A) succeeds. In general, whenever there are
metarules applicable to "A, then A can succeed (according
to its base-level definition) only if solve("A) (if defined)
succeeds and solve not ("A) (if defined) does not succeed.</p>
      <p>The outlined functioning corresponds to upward
reflection when the current subgoal A is reified and an applicable
solve and solve not metarules are searched; if found,
control in fact shifts from base level to metalevel (as solve and
solve not metarules can rely upon a set of auxiliary metalevel
rules). If no rule is found or whenever solve and solve not
metarules complete their execution, downward reflection
returns control to the base level, to subgoal A if confirmed or
to the subsequent subgoal if A has been canceled by either
failure of the applicable solve metarule or success of the
applicable solve not metarule.</p>
      <p>Via solve and solve not metarules,activities of an agent
can be punctually checked and thus allowed and disallowed
or modified, according to the context an agent is presently
involved into. Notice that it would be convenient, upon
conclusion of a checking activity, to confirm, e.g., that the context
has not changed meanwhile, or that other relevant conditions
hold. More generally, the envisaged system should allow for
interrupts and updating, to allow for on the fly introspection
and corrective measures. To this aim, we introduce in the next
section suitable self-checking metalevel constraints.</p>
      <p>
        Semantics of the proposed approach can be sketched as
follows
        <xref ref-type="bibr" rid="ref13 ref14 ref35">(a full semantic definition can be found in [Costantini
and Lanzarone, 1994b; 1994a])</xref>
        . According to [Dix, 1995],
in general terms we understand a semantics SEM for logic
knowledge representation languages/formalisms as a function
which associates a theory/program with a set of sets of atoms,
which constitute the intended meaning. When saying that
P is a program, we mean that it is a program/theory in the
(here unspecified) logic languages/formalism that one wishes
to consider.
      </p>
      <p>We introduce the following restriction on sets of atoms that
should be considered for the application of SEM . First, as
customary we only consider sets of atoms I composed of
atoms occurring in the ground version of P . The ground
version of program P is obtained by substituting in all possible
ways variables occurring in P by constants also occurring in
P . In our case, metavariables occurring in an atom must be
substituted by metaconstants, with the following obvious
restrictions: a metavariable occurring in the predicate position
must be substituted by a metaconstant denoting a predicate; a
metavariable occurring in the function position must be
substituted by a metaconstant denoting a function; a metavariable
occurring in the position corresponding to a constant must be
substituted by a metaconstant denoting a constant. According
to well-established terminology [Lloyd, 1987], we therefore
require I BP , where BP is the Herbrand Base of P , given
previously-stated limitations on variable substitution. Then,
we pose some more substantial requirements. As said before,
by "A we intend a name of base atom A.</p>
      <p>Definition 1 Let P be a program. I
acceptable set of atoms.</p>
      <p>BP is a potentially
Definition 2 Let P be a program, and I be a potentially
acceptable set of atoms for P . I is an acceptable set of atoms
iff I satisfies the following axiom schemata for every base
atom A:
:A
:solve("A)
:A
solve not ("A)</p>
      <p>We restrict SEM to determine acceptable sets of atoms
only, modulo bijection: i.e., SEM can be allowed to
produce sets of atoms which are in one-to-one correspondence
with acceptable sets of atoms. In this way, we obtain the
implementation of properties that have been defined via solve
and solve not rules without modifications to SEM for any
formalism at hand. For clarity however, one can assume to
filter away solve and solve not atoms from acceptable sets.
In fact, the Base version IB of an acceptable set I can be
obtained by omitting from I all atoms of the form solve("A)
and solve not ("A).</p>
      <p>
        Procedural semantics and the specific naming relation that
one intends to use remain to be defined, where it is easy to
see that the above-introduced semantics is independent of
the naming mechanism. For approaches based upon
(variants of) Resolution
        <xref ref-type="bibr" rid="ref15 ref27 ref36">(like, e.g., Prolog and like many
agentoriented languages such as, e.g., AgentSpeak [Rao, 1996],
GOAL [Hindriks, 2009], 3APL [Dastani et al., ] and DALI
[Costantini and Tocchio, 2004])</xref>
        one can extend their proof
procedure so as to automatically invoke rules with
conclusion solve("A) and solve not ("A) whenever applicable, to
validate success of subgoal A.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Self-checking Metalevel Constraints</title>
      <p>In previous section we have introduced a mechanism for
checking an agent’s activities in a fine-grained way, i.e., by
allowing or disallowing conclusions that can be drawn, actions
that can be performed, etc. However, a more broad
perspective is also needed, i.e., an agent might be able to self-check
more complex aspects of its own functioning, for instance,
goals undertaken, entire plans, planning module adopted, ect.
The agent should also be able to modify and improve its own
behavior if a violation or a weakness is detected.</p>
      <p>
        Under this respect we draw inspiration from Runtime
Monitoring
        <xref ref-type="bibr" rid="ref10 ref24 ref25 ref30 ref6">(c.f., e.g., [Francalanza et al., 2017] and the
references therein)</xref>
        as a lightweight dynamic verification technique
in which the correctness of a program is assessed by
analyzing its current execution; correctness properties are
generally specified as a formula in a logic with precise formal
semantics, from which a monitor is then automatically
synthesized. We have devised a new executable logic where
the specification of the correctness formula constitutes the
monitor itself. In [Costantini et al., 2008; Costantini, 2012;
Costantini and Gasperis, 2014] we have in fact proposed an
extension to the well-known LTL Linear Temporal Logic
[Ben-Ari et al., 1983; Emerson, 1990; Lichtenstein et al.,
1985] called A-ILTL, for “Agent-Interval LTL”, which is
tailored to the agent’s world in view of run-time verification.
      </p>
      <p>Based on this new logic, we are able to enrich agent
programs by means of A-ILTL rules. These rules are defined
upon a logic-programming-like set of formulas where all
variables are implicitly universally quantified. They use operators
over intervals that are reminiscent of LTL operators. For
AILTL, we take the stance of Runtime Adaptation that has been
recently adopted in [Cassar et al., 2017]: in fact, A-ILTL rules
(monitors) can execute adaptation actions upon detecting
incorrect behavior, rather than just indicating violations.</p>
      <p>In a-ILTL, we can define the following meta-axioms.
Definition 3 The general form of a Reactive Self-checking
constraint (or rule) to be immersed into a host agent-oriented
language L is the following: OP (M ; N ; K )' ::
where:</p>
      <p>OP (M ; N ; F )' :: is called the monitoring condition,
where: (i) ' and are formulas expressed in language
L, and ' :: can be read ’' given ’. (ii) OP is an
operator reminiscent of temporal logic, in particular OP
can be NEVER, ALWAYS , EVENTUALLY . (iii) M
and N express the starting and ending point of the
interval [M; N ] where ' is supposed to hold. (iv) F
(optional) is the frequency for checking the constraint at run
time.</p>
      <p>(optional) is called the recovery component of the rule,
and it consists of a complex reactive pattern to be
executed if the monitoring condition is violated.</p>
      <p>So, such a constraint is automatically checked (i.e.,
executed) at frequency F . This allows to check whether
relevant properties ' are or are not NEVER, ALWAYS , or
EVENTUALLY respected in interval [M; N ]. If not, the
recovery component is executed, so as to correct/improve the
agent’s behavior. As said, syntax and semantics of ' and
depend upon the ’host’ language: thus, for the evaluation of
' and we rely upon the procedural semantics of such
language. In the examples proposed in next section, we adopt a
sample syntax suitable for logic-programming-based settings.
Thus, we may reasonably restrict ' to be a conjunction of
literals, that must be ground when the formula is checked. We
allow variables to occur in a constraint, however they are
instantiated via the conjunction of conditions that enables the
overall formula to be evaluated. Specifying frequency is very
important, as it concerns how promptly a violation or
fulfillment are detected, or a necessary measure is undertaken; the
appropriate frequency depends upon each particular property.</p>
      <p>For instance,</p>
      <p>EVENTUALLY (now ; 30m; 3m) ambulance
states that ambulance should become true (i.e., an ambulance
should come) within 30 minutes from now, and a check about
arrival is made every 3 minutes. No reaction is specified in
case of violation, however several measures might be
specified. In fact, in runtime self-checking an issue of particular
importance in case of violation of a property is exactly that of
undertaking suitable measures in order to recover or at least
mitigate the critical situation. Actions to be undertaken in
such circumstances can be seen as an internal reaction. For
lack of space reactive patterns will be discussed informally in
relation to examples.</p>
      <p>The A-ILTL semantics is fully defined in the above
references, where moreover it is rooted in the Evolutionary
Semantics of agent-oriented languages [Costantini and Tocchio,
2005], (applicable to virtually all computational-logic-based
languages). In this way, time instants correspond to states in
agents’ evolution.
5</p>
    </sec>
    <sec id="sec-5">
      <title>A Case Study</title>
      <p>In this section, in order to illustrate the potential usefulness
of self-checking axioms, we consider a humorous though
instructive case study proposed in an invited talk some years
ago by Marek Sergot (Imperial College, London). As a
premise let us recall that, since 1600, ethics and morals
relate to “right” and “wrong” conduct. Though these terms are
sometimes used interchangeably, they are different: ethics
refer to rules provided by an external source (typically by a
social/cultural group), while morals refer to an individual’s own
principles regarding right and wrong: for instance, a lawyer’s
morals may tell her that murder is reprehensible and that
murderers should be punished, but her ethics as a professional
lawyer, require her to defend her client to the best of her
abilities, even if she knows that the client is guilty. However, in
the following we intentionally assume that immoral
behavior can also be considered as unethical: though in general
personal morality transcends cultural norms, is a subject of
future debate if this can be the case for artificial agents.</p>
      <p>The case study considers Romeo and Juliet who, as it is
well-known, strongly wish to get married. As we will see,
many plans are actually possible to achieve this goal (beyond
getting killed or committing suicide like in Shakespeare’s
tragedy), but they must be evaluated w.r.t. effectiveness and
feasibility, and also w.r.t. deontic (ethical/moral and legal)
notions. Marek Sergot refers, due to its simplicity, to an
excerpt of the Swiss Family Law reported in Figure1.</p>
      <p>The problem for Romeo and Juliet is that they are both
minors, and will never get their parents’ consent to marry each
other. Surprisingly enough, there are a number of feasible
plans beyond waiting for reaching the majority age, among
which the following:
(P1) Both Romeo and Juliet marry someone else, then
divorce, and marry each other as married people acquire
majority by definition; this plan requires a minimum of
24 months to be completed.
(P1.bis) Variation of Plan 1 in case the spouse would not agree
upon divorce: sleep with someone else, so as to force
such agreement.
(P2) Both Romeo and Juliet marry someone else, then kill
the spouses and marry each other; this plan is faster, as
it takes a minimum of 12 months to be completed.
(P2.bis) Variation of Plan 2 in case the act of killing constitutes a
problem: hire a killer to do the job.</p>
      <p>All the above plans are feasible, though some of them
include actions which are generally considered as immoral,
namely sleeping with someone else when married, and
actions which are generally considered as unethical, namely
killing someone or hiring a killer, where the latter ones are
also illegal and imply a punishment. Notice that the possible
plans would be different in case one referred not to the Swiss
law but to some other country; also what is illegal might
change, for instance sleeping with someone else accounts to
adultery which in many countries is punished; even divorce
is not allowed everywhere. Instead, if one does not refer to
reality but, e.g., to virtual storytelling or to a videogame, then
every action assumes a different weight, as in playful contexts
everything is allowed (except however for serious games,
devised with educational purposes).</p>
      <p>So, we can draw at least the following indications from the
case study:
the context is relevant to moral/ethical/legal issues;
some actions are not moral or non-ethical, and some of
them are also illegal and lead to punishment;
agents’ plans to reach a goal should be evaluated ’a
priori’ against including immoral/unethical/illegal actions;
immoral/unethical/illegal actions should be prevented
anyway, whenever they occur.</p>
      <p>Marek Sergot made use of a concept of counts as
(wellknown in legal theory and other fields). For instance, sleep
with (someone else than the spouse) counts as adultery, which
is an institutional concept considered as immoral and
potentially also illegal, and kill counts (not always but in many
situations, including that of the example) as murder, another
institutional concept normally considered as both unethical and
illegal.</p>
      <p>Notice that the above aspects relate to safety properties that
should be enforced, and that can be rephrased as follows:
never operate w.r.t. an incorrect context (the information
about the present context must always be up-to-date);
never execute actions that are deemed not acceptable
(immoral/unethical/illegal) in the present context, and
never execute plans including such actions.</p>
      <p>In order to demonstrate the potential usefulness of runtime
self-cheking and correction in enforcing/verifying agents’
ethical behavior we discuss some examples that should
provide a general idea. Let us assume to add to the language
a transitive predicate COUNTS AS which is used (in infix
form) in expressions of the form exemplified below. The
kills COUNTS AS murder CONDS : : :
where after CONDS we have the (optional) conditions
under which COUNTS AS applies, in this case they define in
which cases killing accounts to murder (e.g., it was no self
defence, it does not occur during a battle in war, etc.). Such
statements are related to the present context, so in the
example and assuming reality under European legislation we
would also have:
sleep with COUNTS AS adultery
adultery COUNTS AS immoral
adultery COUNTS AS unethical
murder COUNTS AS unethical
adultery COUNTS AS illegal</p>
      <p>Clearly, we will also have general context-independent
statement that we do not consider here. We now show
selfchecking constraints that usefully employ COUNTS AS
facts. Such facts are either explicit or can implicitly derived
by transitivity (we do not enter in the detail of how to
implement transitivity).</p>
      <p>Below we introduce a constraint for context change:
ALWAYS context change(C ; C1 )</p>
      <p>discharge context (C ); assume context (C1 )</p>
      <p>In particular, whenever the agent perceives a change of
context (e.g., the agent stops working and starts a videogame,
or finishes a videogame and goes to help children with their
homework, etc.) then all the relevant ethic assumptions
(among which, for instance, the COUNTS AS facts) about
the new context C1 must be loaded, while those relative to
previous context C must be dismissed; this is important
because, e.g., after finishing a videogame it is no longer allowed
to kill any living being in view just for fun... Frequency
of check of this constraint is not specified here, however it
should guarantee a prompt enough adaptation to a change.</p>
      <p>Given now the present context for granted, no plan or
single action can be allowed which counts as unethical in the
context. So, we can have the following constraints:</p>
      <p>NEVER goal (G ); plan(G ; P ); element (Action; P ) ::
Action COUNTS AS unethical execute plan(P )
The next example is a meta-statement expressing the
capability of an agent to modify its own behavior. If a goal
G which is crucial to the agent for its ethical behavior (e.g.,
providing a doctor or an ambulance to a patient in need) has
not been achieved (in a certain context) and the initially
allotted time has elapsed, then the recovery component implies
replacing the planning module (if more than one is
available) and retrying the goal. We suppose that the possibility
of achieving a goal G is evaluated w.r.t. a module M that
represents the context for G (notation P (G; M ), P standing
for ’possible’). Necessity and possibility evaluation with
reasonable complexity has been discussed in relevant literature
(omitted for anonymity). Ife the goal is still deemed to be
possible but has not been achieved before a certain deadline, the
reaction consists in substituting the present planning module
and re-trying the goal.</p>
      <p>NEVER goal (G );
eval context (G ; M ); P (G ; M );
timed out (G ); not achieved (G )</p>
      <p>replace planning module; retry (G )</p>
      <p>Time intervals have never been exploited in the above
examples. It can however been useful in many cases for the
punctual definition of moral/ethical specific behaviors, e.g.,
never leave a patient or a child alone at night, and the like.
Also, expressions that check over (partially specified)
sequences of past and expected events as discussed in relevant
literature (omitted for anonymity) can be potentially useful.
6</p>
    </sec>
    <sec id="sec-6">
      <title>Related Work and Concluding Remarks</title>
      <p>In this paper we have proposed to adopt special metarules and
runtime constraints for agents’ self-checking and monitoring
in the perspective of implementing ’humanized’ agents. We
have shown how to express useful properties apt to enforce
ethical behavior in agents. We have provided a flexible
framework, general enough to accommodate several logic-based
agent-oriented languages, so as to allow both metarules and
constraints to be adopted in different settings.</p>
      <p>We may notice similarities with event-calculus
formulations [Kowalski and Sergot, 1986]. In fact, recent work
presented in [Berreby et al., 2017] extends the event calculus
for a-priori checking of agents’ plans. [Tufis and Ganascia,
2014] treats the run-time checking of actions performed by
BDI agents, and proposes an implementation under the JADE
platform; this approach is related to ours, though the temporal
aspects and the correction of violations are not present there.</p>
      <p>
        Deontic logic has been used for building well-behaved
ethical agents, like, e.g., in the approach of [Bringsjord et al.,
2006]. However, this approach requires an expressive
deontic logic. To obtain such expressiveness, one needs highly
hybrid modal and deontic logics that are undecidable. Even
for decidable logics such as the zero-order version of Horty’s
System [Horty, 2001], decision procedures are likely to
exhibit inordinate computational complexity. In addition, their
approach is not generally applicable to agent-oriented
frameworks. There are also other challenges related to some
paradoxes and limitations of deontic logic family
        <xref ref-type="bibr" rid="ref26 ref9">([Hilpinen and
McNamara, 2013], [Broersen and van der Torre, 2011])</xref>
        .
Therefore, although our approach cannot compete in
expressivity with deontic logic, still in its simplicity it can be
usefully exploited in practical applications.
      </p>
      <p>Future work includes making self-checking constraints
adaptable to changing conditions, thus to some extent
emulating what humans would be able to do. This, as suggested
in [Rushby, 2008], might be done via automated synthesis of
runtime constraints. This by extracting from the history of
an agent’s activity invariants expressing relevant situations.
An important issue is that of devising a useful integration and
synergy between declarative a-priori verification techniques
such as those of [Berreby et al., 2017] with the proposed
runtime self-checking. The idea of [Tufis and Ganascia, 2014] of
a dynamic set of abstract and active rules will also be taken
into serious consideration.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [Amir et al.,
          <year>2007</year>
          ]
          <string-name>
            <given-names>Eyal</given-names>
            <surname>Amir</surname>
          </string-name>
          , Michael L.
          <string-name>
            <surname>Andreson</surname>
          </string-name>
          , and
          <string-name>
            <surname>Vinay</surname>
            <given-names>K.</given-names>
          </string-name>
          <string-name>
            <surname>Chaudri</surname>
          </string-name>
          .
          <source>Report on darpa workshop on self aware computer systems</source>
          .
          <source>Technical Report</source>
          , SRI International Menlo Park United States,
          <year>2007</year>
          . Full Text : http://www.dtic.mil/dtic/tr/fulltext/ u2/1002393.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <source>[Anderson and Perlis</source>
          , 2005]
          <string-name>
            <surname>Michael L. Anderson</surname>
            and
            <given-names>Donald</given-names>
          </string-name>
          <string-name>
            <surname>Perlis</surname>
          </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>
          ):
          <fpage>21</fpage>
          -
          <lpage>40</lpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [Barklund et al.,
          <year>1995</year>
          ]
          <string-name>
            <given-names>J.</given-names>
            <surname>Barklund</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Costantini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Dell'Acqua</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G. A.</given-names>
            <surname>Lanzarone</surname>
          </string-name>
          .
          <article-title>Semantical properties of encodings in logic programming</article-title>
          .
          <source>In Logic Programming - Proc. 1995 Intl. Symp.</source>
          , pages
          <fpage>288</fpage>
          -
          <lpage>302</lpage>
          , Cambridge, Mass.,
          <year>1995</year>
          . MIT Press.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [Barklund et al.,
          <year>2000</year>
          ]
          <string-name>
            <given-names>Jonas</given-names>
            <surname>Barklund</surname>
          </string-name>
          , Pierangelo Dell'Acqua,
          <string-name>
            <given-names>Stefania</given-names>
            <surname>Costantini</surname>
          </string-name>
          , and Gaetano Aurelio Lanzarone.
          <article-title>Reflection principles in comp</article-title>
          . logic.
          <source>J. Log. Comput.</source>
          ,
          <volume>10</volume>
          (
          <issue>6</issue>
          ):
          <fpage>743</fpage>
          -
          <lpage>786</lpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [
          <string-name>
            <surname>Ben-Ari</surname>
          </string-name>
          et al.,
          <year>1983</year>
          ]
          <string-name>
            <given-names>M.</given-names>
            <surname>Ben-Ari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Manna</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Pnueli</surname>
          </string-name>
          .
          <article-title>The temporal logic of branching time</article-title>
          .
          <source>Acta Informatica</source>
          ,
          <volume>20</volume>
          :
          <fpage>207</fpage>
          -
          <lpage>226</lpage>
          ,
          <year>1983</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [Berreby et al.,
          <year>2017</year>
          ]
          <string-name>
            <given-names>Fiona</given-names>
            <surname>Berreby</surname>
          </string-name>
          , Gauvain Bourgne, and
          <string-name>
            <given-names>JeanGabriel</given-names>
            <surname>Ganascia</surname>
          </string-name>
          .
          <article-title>A declarative modular framework for representing and applying ethical principles</article-title>
          .
          <source>In Kate Larson</source>
          , Michael Winikoff,
          <string-name>
            <surname>Sanmay Das</surname>
          </string-name>
          , and
          <string-name>
            <surname>Edmund H</surname>
          </string-name>
          . Durfee, editors,
          <source>Proceedings of the 16th Conference on Autonomous Agents and MultiAgent Systems, AAMAS 2017</source>
          , pages
          <fpage>96</fpage>
          -
          <lpage>104</lpage>
          . ACM,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [Bordini et al.,
          <year>2006</year>
          ]
          <string-name>
            <surname>Rafael</surname>
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Bordini</surname>
          </string-name>
          , Lars Braubach, Mehdi Dastani,
          <string-name>
            <surname>Amal El</surname>
            Fallah-Seghrouchni,
            <given-names>Jorge J</given-names>
          </string-name>
          .
          <string-name>
            <surname>Go</surname>
          </string-name>
          <article-title>´mez-</article-title>
          <string-name>
            <surname>Sanz</surname>
          </string-name>
          , Joa˜o Leite,
          <string-name>
            <surname>Gregory M. P. O'Hare</surname>
            ,
            <given-names>Alexander</given-names>
          </string-name>
          <string-name>
            <surname>Pokahr</surname>
            , and
            <given-names>Alessandro</given-names>
          </string-name>
          <string-name>
            <surname>Ricci</surname>
          </string-name>
          .
          <article-title>A survey of programming languages and platforms for multi-agent systems</article-title>
          .
          <source>Informatica (Slovenia)</source>
          ,
          <volume>30</volume>
          (
          <issue>1</issue>
          ):
          <fpage>33</fpage>
          -
          <lpage>44</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [Bringsjord et al.,
          <year>2006</year>
          ]
          <string-name>
            <given-names>Selmer</given-names>
            <surname>Bringsjord</surname>
          </string-name>
          , Konstantine Arkoudas, and
          <string-name>
            <given-names>Paul</given-names>
            <surname>Bello</surname>
          </string-name>
          .
          <article-title>Toward a general logicist methodology for engineering ethically correct robots</article-title>
          .
          <source>IEEE Intelligent Systems</source>
          ,
          <volume>21</volume>
          (
          <issue>4</issue>
          ):
          <fpage>38</fpage>
          -
          <lpage>44</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <source>[Broersen and van der Torre</source>
          , 2011]
          <string-name>
            <surname>Jan</surname>
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Broersen</surname>
            and
            <given-names>Leendert W. N. van der Torre.</given-names>
          </string-name>
          <article-title>Ten problems of deontic logic and normative reasoning in computer science</article-title>
          .
          <source>In ESSLLI</source>
          , volume
          <volume>7388</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>55</fpage>
          -
          <lpage>88</lpage>
          . Springer,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [Cassar et al.,
          <year>2017</year>
          ]
          <string-name>
            <given-names>Ian</given-names>
            <surname>Cassar</surname>
          </string-name>
          , Adrian Francalanza, Duncan Paul Attard, Luca Aceto, and
          <article-title>Anna Ingo´lfsdo´ttir. A suite of monitoring tools for erlang</article-title>
          . In RV-CuBES
          <year>2017</year>
          . An International Workshop on Competitions, Usability, Benchmarks, Evaluation, and
          <article-title>Standardisation for Runtime Verification Tools</article-title>
          , pages
          <fpage>41</fpage>
          -
          <lpage>47</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <source>[Costantini and Gasperis</source>
          , 2014]
          <string-name>
            <given-names>Stefania</given-names>
            <surname>Costantini and Giovanni De Gasperis. Runtime</surname>
          </string-name>
          self
          <article-title>-checking via temporal (meta-)axioms for assurance of logical agent systems</article-title>
          .
          <source>In Proc. of the 29th Italian Conf. on Comp. Logic CILC</source>
          <year>2014</year>
          , volume
          <volume>1195</volume>
          <source>of CEUR Works. Proc.</source>
          , pages
          <fpage>241</fpage>
          -
          <lpage>255</lpage>
          . CEUR-WS.org,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <source>[Costantini and Lanzarone</source>
          , 1989]
          <article-title>Stefania Costantini and Gaetano Aurelio Lanzarone. A metalogic programming language</article-title>
          .
          <source>In Logic Programming, Proceedings of the Sixth International Conference</source>
          , pages
          <fpage>218</fpage>
          -
          <lpage>233</lpage>
          . MIT Press,
          <year>1989</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <source>[Costantini and Lanzarone</source>
          , 1994a]
          <article-title>Stefania Costantini and Gaetano Aurelio Lanzarone</article-title>
          .
          <article-title>Metalevel negation and non-monotonic reasoning</article-title>
          .
          <source>Meth. of Logic in CS</source>
          ,
          <volume>1</volume>
          (
          <issue>1</issue>
          ):
          <fpage>111</fpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <source>[Costantini and Lanzarone</source>
          , 1994b]
          <article-title>Stefania Costantini and Gaetano Aurelio Lanzarone. A metalogic programming approach: language, semantics and applications</article-title>
          .
          <source>J. Exp. Theor. Artif. Intell.</source>
          ,
          <volume>6</volume>
          (
          <issue>3</issue>
          ):
          <fpage>239</fpage>
          -
          <lpage>287</lpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <source>[Costantini and Tocchio</source>
          , 2004]
          <string-name>
            <given-names>S.</given-names>
            <surname>Costantini</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Tocchio</surname>
          </string-name>
          .
          <article-title>The DALI logic pr. agent-oriented language</article-title>
          .
          <source>In Logics in Artificial Intelligence, Proc. of the 9th European Conf., Jelia</source>
          <year>2004</year>
          , LNAI 3229. Springer-Verlag, Berlin,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <source>[Costantini and Tocchio</source>
          , 2005]
          <string-name>
            <given-names>Stefania</given-names>
            <surname>Costantini</surname>
          </string-name>
          and
          <string-name>
            <given-names>Arianna</given-names>
            <surname>Tocchio</surname>
          </string-name>
          .
          <article-title>About declarative semantics of logic-based agent languages</article-title>
          .
          <source>In Matteo Baldoni</source>
          , Ulle Endriss, Andrea Omicini, and Paolo Torroni, editors,
          <source>Declarative Agent Languages</source>
          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>
          of Lecture Notes in Computer Science, pages
          <fpage>106</fpage>
          -
          <lpage>123</lpage>
          . Springer,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [Costantini et al.,
          <year>2008</year>
          ]
          <string-name>
            <given-names>Stefania</given-names>
            <surname>Costantini</surname>
          </string-name>
          ,
          <article-title>Pierangelo Dell'Acqua, and Lu´ıs Moniz Pereira. A multi-layer framework for evolving and learning agents</article-title>
          . In A.
          <string-name>
            <surname>Raja M. T.</surname>
          </string-name>
          Cox, editor,
          <source>Proc. of Metareasoning: Thinking about thinking Works. at AAAI</source>
          <year>2008</year>
          , Chicago, USA,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <source>[Costantini</source>
          , 2002]
          <string-name>
            <given-names>Stefania</given-names>
            <surname>Costantini</surname>
          </string-name>
          .
          <article-title>Meta-reasoning: a Survey</article-title>
          .
          <source>In Comp. Logic: Logic Pr. and Beyond</source>
          , Essays in Honour of Robert A.
          <string-name>
            <surname>Kowalski</surname>
          </string-name>
          ,
          <string-name>
            <surname>Part</surname>
            <given-names>II</given-names>
          </string-name>
          , volume
          <volume>2408</volume>
          <source>of LNCS</source>
          , pages
          <fpage>253</fpage>
          -
          <lpage>288</lpage>
          . Springer,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <source>[Costantini</source>
          , 2012]
          <string-name>
            <given-names>Stefania</given-names>
            <surname>Costantini</surname>
          </string-name>
          .
          <article-title>Self-checking logical agents</article-title>
          .
          <source>In Mauricio Osorio</source>
          , Claudia Zepeda,
          <source>Iva´n Olmos</source>
          , Jose´ Luis Carballido, and R. Carolina Medina Ram´ırez, editors,
          <source>Proceedings of the Eighth Latin American Workshop on Logic / Languages, Algorithms and New Methods of Reasoning</source>
          <year>2012</year>
          , volume
          <volume>911</volume>
          <source>of CEUR Workshop Proceedings</source>
          , pages
          <fpage>3</fpage>
          -
          <lpage>30</lpage>
          . CEUR-WS.org,
          <year>2012</year>
          . Extended Abstract in
          <source>Proceedings of AAMAS2013.</source>
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [Dastani et al., ] Mehdi Dastani,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Birna van Riemsdijk, and</article-title>
          <string-name>
            <given-names>John-Jules</given-names>
            <surname>Ch</surname>
          </string-name>
          . Meyer. Pr.
          <source>multi-agent systems in 3APL.</source>
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          <string-name>
            <surname>[Dell'Acqua</surname>
          </string-name>
          , 1989]
          <article-title>Pierangelo Dell'Acqua. Development of an interpreter for a metalogic programming language. M.Sc</article-title>
          . in Computer Science at the Dept. of Computer Science, Univ. degli Studi di Milano, Italy,
          <year>1989</year>
          .
          <string-name>
            <given-names>Supervisor</given-names>
            <surname>Prof</surname>
          </string-name>
          . Stefania Costantini, in Italian.
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          <source>[Dix</source>
          , 1995]
          <article-title>Ju¨rgen Dix. A classification theory of semantics of normal logic programs: I. Strong properties</article-title>
          . Fundam. Inform.,
          <volume>22</volume>
          (
          <issue>3</issue>
          ):
          <fpage>227</fpage>
          -
          <lpage>255</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          <source>[Emerson</source>
          , 1990]
          <string-name>
            <given-names>E. A.</given-names>
            <surname>Emerson</surname>
          </string-name>
          .
          <article-title>Temporal and modal logic</article-title>
          . In J. van Leeuwen, editor,
          <source>Handbook of Theoretical Comp. Sc.</source>
          , vol. B. MIT Press,
          <year>1990</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [Francalanza et al.,
          <year>2017</year>
          ]
          <string-name>
            <given-names>Adrian</given-names>
            <surname>Francalanza</surname>
          </string-name>
          , Luca Aceto, Antonis Achilleos, Duncan Paul Attard, Ian Cassar,
          <article-title>Dario Della Monica, and Anna Ingo´lfsdo´ttir. A foundation for runtime monitoring</article-title>
          .
          <source>In Runtime Verification - 17th International Conference, RV</source>
          <year>2017</year>
          , Proceedings, pages
          <fpage>8</fpage>
          -
          <lpage>29</lpage>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [Grosof et al.,
          <year>2017</year>
          ]
          <string-name>
            <given-names>Benjamin N.</given-names>
            <surname>Grosof</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Michael</given-names>
            <surname>Kifer</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Paul</given-names>
            <surname>Fodor</surname>
          </string-name>
          . Rulelog:
          <article-title>Highly expressive semantic rules with scalable deep reasoning</article-title>
          .
          <source>In Pr. of the Doctoral Consortium</source>
          , Challenge, Industry Track, Tutorials and Posters @ RuleML+
          <article-title>RR 2017 hosted by RuleML</article-title>
          +
          <source>RR</source>
          <year>2017</year>
          ,
          <article-title>volume 1875 of CEUR Workshop Pr</article-title>
          . CEUR-WS.org,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          <source>[Hilpinen and McNamara</source>
          , 2013]
          <string-name>
            <given-names>Risto</given-names>
            <surname>Hilpinen</surname>
          </string-name>
          and
          <string-name>
            <given-names>Paul</given-names>
            <surname>McNamara</surname>
          </string-name>
          .
          <article-title>Deontic logic: a historical survey and introduction. Handbook of deontic logic and normative systems</article-title>
          .
          <source>College Publications</source>
          ,
          <volume>80</volume>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          <source>[Hindriks</source>
          , 2009]
          <string-name>
            <surname>Koen</surname>
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Hindriks</surname>
          </string-name>
          .
          <article-title>Programming rational agents in goal</article-title>
          .
          <source>In Multi-Agent Programming</source>
          , pages
          <fpage>119</fpage>
          -
          <lpage>157</lpage>
          . Springer US,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          <source>[Horty</source>
          ,
          <year>2001</year>
          ] John F Horty.
          <article-title>Agency and deontic logic</article-title>
          . Oxford University Press,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          <source>[Konolige</source>
          , 1988]
          <string-name>
            <given-names>K.</given-names>
            <surname>Konolige</surname>
          </string-name>
          .
          <article-title>Reasoning by introspection</article-title>
          .
          <source>In Meta-Level Architectures and Reflection</source>
          , pages
          <fpage>61</fpage>
          -
          <lpage>74</lpage>
          . NorthHolland,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          <source>[Kouvaros and Lomuscio</source>
          , 2017]
          <string-name>
            <given-names>Panagiotis</given-names>
            <surname>Kouvaros</surname>
          </string-name>
          and
          <string-name>
            <given-names>Alessio</given-names>
            <surname>Lomuscio</surname>
          </string-name>
          .
          <article-title>Verifying fault-tolerance in parameterised multiagent systems</article-title>
          . In Carles Sierra, editor,
          <source>Proc. of the Twenty-Sixth Intl. Joint Conf. on Artificial Intelligence, IJCAI2017</source>
          , pages
          <fpage>288</fpage>
          -
          <lpage>294</lpage>
          . ijcai.org,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          <source>[Kowalski and Sergot</source>
          , 1986]
          <string-name>
            <given-names>R.A.</given-names>
            <surname>Kowalski</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Sergot</surname>
          </string-name>
          .
          <article-title>A logic-based calculus of events</article-title>
          .
          <source>New Generation Computing</source>
          ,
          <volume>4</volume>
          :
          <fpage>67</fpage>
          -
          <lpage>95</lpage>
          ,
          <year>1986</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          [Lichtenstein et al.,
          <year>1985</year>
          ]
          <string-name>
            <given-names>O.</given-names>
            <surname>Lichtenstein</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pnueli</surname>
          </string-name>
          , and
          <string-name>
            <surname>L. Zuch.</surname>
          </string-name>
          <article-title>The glory of the past</article-title>
          .
          <source>In Proc. Conf. on Logics of Programs, LNCS 193</source>
          . Springer Verlag,
          <year>1985</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref33">
        <mixed-citation>
          <source>[Lloyd</source>
          , 1987]
          <string-name>
            <given-names>J. W.</given-names>
            <surname>Lloyd</surname>
          </string-name>
          .
          <article-title>Foundations of Logic Programming</article-title>
          ,
          <source>Second Edition</source>
          . Springer, Berlin,
          <year>1987</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref34">
        <mixed-citation>
          <source>[Pereira and Saptawijaya</source>
          , 2016]
          <article-title>Lu´ıs Moniz Pereira and Ari Saptawijaya</article-title>
          .
          <source>Pr. Machine Ethics</source>
          , volume
          <volume>26</volume>
          of Studies in Applied Philosophy, Epistemology and
          <string-name>
            <given-names>Rational</given-names>
            <surname>Ethics</surname>
          </string-name>
          . Springer,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref35">
        <mixed-citation>
          <source>[Perlis and Subrahmanian</source>
          , 1994]
          <string-name>
            <given-names>Donald</given-names>
            <surname>Perlis</surname>
          </string-name>
          and
          <string-name>
            <given-names>V. S.</given-names>
            <surname>Subrahmanian</surname>
          </string-name>
          .
          <article-title>Meta-languages, reflection principles, and selfreference</article-title>
          .
          <source>In Handbook of Logic in Artificial Intelligence and Logic Programming</source>
          , Volume2, Deduction Methodologies, pages
          <fpage>323</fpage>
          -
          <lpage>358</lpage>
          . Oxford University Press,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref36">
        <mixed-citation>
          <source>[Rao</source>
          , 1996]
          <string-name>
            <surname>Anand</surname>
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Rao</surname>
          </string-name>
          . Agentspeak(l):
          <article-title>BDI agents speak out in a logical computable language</article-title>
          .
          <source>In Agents Breaking Away, 7th European Works. on Modelling Autonomous Agents in a Multi-Agent World, Proc.,</source>
          volume
          <volume>1038</volume>
          <source>of LNCS</source>
          , pages
          <fpage>42</fpage>
          -
          <lpage>55</lpage>
          . Springer,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref37">
        <mixed-citation>
          <source>[Rushby</source>
          ,
          <year>2008</year>
          ]
          <string-name>
            <given-names>John M.</given-names>
            <surname>Rushby</surname>
          </string-name>
          .
          <article-title>Runtime certification</article-title>
          . In Martin Leucker, editor,
          <source>Runtime Verification, 8th Intl. Works</source>
          .,
          <string-name>
            <surname>RV</surname>
          </string-name>
          <year>2008</year>
          .
          <article-title>Selected Papers</article-title>
          , volume
          <volume>5289</volume>
          <source>of LNCS</source>
          , pages
          <fpage>21</fpage>
          -
          <lpage>35</lpage>
          . Springer,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref38">
        <mixed-citation>
          <string-name>
            <surname>[Shapiro</surname>
          </string-name>
          et al.,
          <year>2010</year>
          ]
          <string-name>
            <given-names>S.</given-names>
            <surname>Shapiro</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y.</surname>
          </string-name>
          <article-title>Lespe´rance, and</article-title>
          <string-name>
            <given-names>H.J.</given-names>
            <surname>Levesque</surname>
          </string-name>
          .
          <article-title>The cognitive agents specification language and verification environment</article-title>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref39">
        <mixed-citation>
          <source>[Smith</source>
          ,
          <year>1984</year>
          ]
          <article-title>Brian Cantwell Smith. Reflection and semantics in lisp</article-title>
          .
          <source>In Conference Record of the Eleventh Annual ACM Symposium on Principles of Programming Languages</source>
          , pages
          <fpage>23</fpage>
          -
          <lpage>35</lpage>
          ,
          <year>1984</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref40">
        <mixed-citation>
          [Tørresen et al.,
          <year>2015</year>
          ]
          <string-name>
            <given-names>J.</given-names>
            <surname>Tørresen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Plessl</surname>
          </string-name>
          , and
          <string-name>
            <given-names>X.</given-names>
            <surname>Yao</surname>
          </string-name>
          .
          <article-title>Selfaware and self-expressive systems</article-title>
          .
          <source>IEEE Computer</source>
          ,
          <volume>48</volume>
          (
          <issue>7</issue>
          ):
          <fpage>18</fpage>
          -
          <lpage>20</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref41">
        <mixed-citation>
          <source>[Tufis and Ganascia</source>
          , 2014]
          <string-name>
            <given-names>Mihnea</given-names>
            <surname>Tufis</surname>
          </string-name>
          and
          <string-name>
            <surname>Jean-Gabriel Ganascia</surname>
          </string-name>
          .
          <article-title>A normative extension for the bdi ahent model</article-title>
          .
          <source>In Proceedings of the 17th INternational Conference on Climbing and Walking Robots and the Support Technologies for Mobile Machines</source>
          , pages
          <fpage>691</fpage>
          -
          <lpage>702</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref42">
        <mixed-citation>
          <string-name>
            <surname>[van Harmelen</surname>
          </string-name>
          et al.,
          <year>1992</year>
          ]
          <string-name>
            <surname>F. van Harmelen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Wielinga</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Bredeweg</surname>
          </string-name>
          , G. Schreiber,
          <string-name>
            <given-names>W.</given-names>
            <surname>Karbach</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Reinders</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Voss</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Akkermans</surname>
          </string-name>
          ,
          <string-name>
            <surname>B.</surname>
          </string-name>
          <article-title>Bartsch-Spo¨rl, and</article-title>
          <string-name>
            <given-names>E.</given-names>
            <surname>Vinkhuyzen</surname>
          </string-name>
          .
          <article-title>Knowledge-level reflection</article-title>
          .
          <source>In Enhancing the Knowledge Engineering Process - Contributions from ESPRIT</source>
          , pages
          <fpage>175</fpage>
          -
          <lpage>204</lpage>
          . Elsevier Science,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref43">
        <mixed-citation>
          <string-name>
            <surname>[van Harmelen</surname>
          </string-name>
          ,
          <year>1992</year>
          ]
          <string-name>
            <surname>F. van Harmelen.</surname>
          </string-name>
          <article-title>Definable naming relations in meta-level systems</article-title>
          .
          <source>In Meta-Programming in Logic, LNCS 649</source>
          , pages
          <fpage>89</fpage>
          -
          <lpage>104</lpage>
          , Berlin,
          <year>1992</year>
          . Springer.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>