<!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>Augmenting Knowledge Representation and Reasoning Languages with Customizable Metalogic Features ?</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="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrea Formisano</string-name>
          <email>andrea.formisano@unipg.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universita di L'Aquila</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Universita di Perugia</institution>
          ,
          <addr-line>INdAM-GNCS</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper we present a methodology for introducing customizable metalogic features in logic-based knowledge representation and reasoning languages. The proposed approach is based on concepts of introspection and re ection previously introduced and discussed by various authors in relevant literature. This allows a knowledge engineer to specify enhanced reasoning engines by de ning properties and meta-properties of relations as expressible for instance in OWL. We employ meta-level axiom schemata based upon a naming (rei cation) device. We propose general principles for extending the semantics of \host" formalisms accordingly. Suitable pre-de ned libraries of properties can be made available, while user-de ned new schemata are also allowed. We make the speci c case of Answer Set Programming (ASP), where such features may be part of software engineering toolkits for this programming paradigm. We show how to extend the Answer Set Programming principles and practice to accommodate the proposed methodology, so as to perform meta-reasoning within the plain ASP semantics (where we mention and discuss approaches where signi cant extensions are required).</p>
      </abstract>
      <kwd-group>
        <kwd>Web-ontologies ming</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Meta-reasoning</p>
      <p>
        Answer Set
ProgramThe OWL ontology language [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ] provides a powerful data modeling language,
and automated reasoning abilities based upon Description Logics [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. There are,
as is well known, di erent versions of OWL depending upon the kind of reasoning
one wishes to use and can computationally a ord; in fact, such versions range
from polynomial-time complexity, with reasoning capabilities equivalent to SQL,
to very complex reasoning capabilities even leading to undecidability. Relevant
? This work is partially supported by INdAM-GNCS-17 and INdAM-GNCS-19
projects, by project B.I.M.{2018.0419.021, by Univ.of Perugia (projects
\ricerca-dibase-2016", YASMIN, CLTP, and RACRA). Supported by Action COST CA17124
\DigForASP".
aspects concerning knowledge representation and reasoning that can be found
in OWL are: (i) properties of relations: e.g., symmetry/asymmetry, transitivity,
functionality, re exivity/irre exivity, domain/range; (ii) relations between
relations (meta-properties): e.g., inverse-of, equivalence, disjointness, subclass; (iii)
cardinality of relations.
      </p>
      <p>Such features have widely demonstrated their usefulness in the de nition and
use of ontologies in the Semantic Web, and in our opinion they would nd useful
application in many knowledge engineering and automated reasoning languages.
In fact, ontologies are pervading many areas of knowledge and data
representation and management, and a lot of e ort has been spent on the development of
su ciently expressive languages for the representation and querying of
ontologies.</p>
      <p>
        In this paper we present a methodology for introducing OWL-like features
in logic-based knowledge engineering, representation and reasoning languages.
In fact, ontology languages such as OWL have been devised in the context of
the Semantic Web to help automated processes (\intelligent agents") to access
information in a uniform and principled way [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Therefore ontologies (expressed
in such languages) are expected to provide structured vocabularies and de
nitions that specify the relationships between terms and properties, thus
allowing intelligent agents (and, possibly, also humans) to interpret their meaning
exibly yet unambiguously. This, however, is useful and important also within
knowledge representation languages that de ne knowledge bases which are at
the \core" of intelligent systems and support their reasoning processes. Thus,
here we introduce an approach based on concepts of introspection and re ection
discussed, among others, in [4{6]. In order to implement an engine realizing
properties and meta-properties of relations inspired by those expressible in OWL, we
employ meta-level axiom schemata based upon a naming (rei cation) device.
We propose a method for extending the semantics accordingly. Practically, such
schemata should be added by default to any program/theory. We do not claim
to reproduce all OWL features and maybe not even most of them. In fact we
could not, as we stay within decidable frameworks based upon CWA
(ClosedWorld Assumption). However, the features that we reproduce are widely used,
and they are useful in many practical contexts. Moreover, we improve over OWL
as user-de ned new properties are allowed in our proposal.
      </p>
      <p>
        As a proof of concept we consider Answer Set Programming (ASP, cf. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and
the references therein), where the proposed techniques can be seen as a software
engineering method to be employed, together with others, in the development of
ASP programs. The ASP programming paradigm in fact, though general,
powerful and widely used, is at present employed in a quite basic way. The available
software engineering constructs include aggregates and weight and cardinality
constraints (discussed below in the section on ASP), and tools for modularity
of ASP programs (cf. [
        <xref ref-type="bibr" rid="ref8 ref9">8, 9</xref>
        ] and the references therein) and for \templates" [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ],
where one can de ne subprograms/macros. We will try to demonstrate that our
techniques can usefully enrich the available toolkit.
      </p>
      <p>
        The possibility of improving knowledge engineering capabilities by means of
metaprogramming and metareasoning has been explored in the past [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. In logic
settings such as Prolog [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] the aim was to enlarge representation and reasoning
possibilities while avoiding to resort to a higher-level setting, mainly by using
meta-interpreters [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] and trying to equip them with a logical semantics [
        <xref ref-type="bibr" rid="ref14 ref15">14,
15</xref>
        ], or by devising specialized language extensions [
        <xref ref-type="bibr" rid="ref16 ref6">16, 6</xref>
        ]. Recently, the Rulelog
language [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] features some seemingly higher-order characteristics inspired by
the HiLog second-order language [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], though transposed into a simple (though
limited under the point of view of reasoning capabilities) rst-order
representation.
      </p>
      <p>The mechanisms that we propose allow programmers to de ne relations (also)
in terms of their properties and meta-properties; this on the basis of metalevel
de nitions that should be part of any program using them. Many such de
nitions (namely, those concerning the most commonly-used properties) might be
prede ned and imported by a program upon need, e.g. via libraries. However,
the approach also allows programmers to de ne their own new (meta)
properties. So, the average programmer does not de ne and does not need to see the
de nition of properties of relations, but rather just uses prede ned ones though
the skilled programmer may optionally de ne new properties.</p>
      <p>
        So, a given knowledge representation language becomes in fact extensible,
where an extension nds an immediate semantic and computational counterpart.
We stay within the realm of knowledge representation languages based upon
computational logic and logic programming [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], syntactically based upon some
rst-order language. Among them are Prolog, ASP, and many agent-oriented
programming languages [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. As mentioned we discuss in particular the case
of ASP, which is at present a well-known successful logic programming and
knowledge representation language paradigm. For ASP, we will show in detail
how the approach might be practically and easily implemented.
      </p>
      <p>The paper is organized as follows. We rst shortly summarize the basic
principles of the OWL language in Section 2, and we recall the concept of rei cation
(naming) of rst-order terms and atoms (Section 3). Then, we present our
approach in Sections 4-5. Later, after shortly recalling ASP (Section 6), in Section 7
we show (also by exploiting signi cant examples) how the approach can be
customized to the case of ASP. Finally, in Section 8 we discuss related work on
meta-reasoning in ASP and draw conclusions.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Background: OWL</title>
      <p>OWL is a language for the de nition of ontologies (the reader may refer to
www.w3.org/TR/2012/REC-owl2-primer for an introduction). The term ontology
has a complex history in Philosophy, and recently in Computer Science. In
Knowledge Representation, an ontology is a set of formal statements aimed to
describe some part of the world (often referred to as the \domain of interest" or
the \subject matter" of the ontology). Precise descriptions satisfy several
purposes, among which: they prevent misunderstandings in human communication
and they ensure a better software behavior, especially when di erent software
modules interact.</p>
      <p>In order to precisely describe a domain of interest, the OWL language is
based upon a vocabulary. The meanings of terms is established by stating how
each term is interrelated to the other terms (and similarly for classes,
properties, and individuals). A terminology, providing a vocabulary together with such
interrelation information constitutes an essential part of an OWL ontology.
Besides this \terminological" knowledge, usually called TBOX, an ontology might
also contain so called \assertional knowledge" (ABOX) that introduces concrete
objects of the considered domain. The TBOX part is the analogous of the set of
rules of a Prolog program, while the ABOX is the analogous of the set of facts.</p>
      <p>OWL 2 is not a programming language, rather it provides a declarative way
to describe knowledge in a logical way. For the decidable fragments of OWL,
appropriate tools (so-called reasoners ) can then be used to infer further information
from a given TBOX+ABOX description. How these inferences are realized
algorithmically depends on the speci c implementations and on the fragments of
OWL considered. Still, the correct answer to any of such question is
predetermined by the OWL formal semantics.</p>
      <p>In OWL it is possible to de ne classes of objects/individuals, membership to
classes, class inclusion, equivalence and disjointness, class hierarchies.
Concerning object properties, they correspond to binary predicates, i.e., to relations, and
are expressed concerning speci c objects which are related by each property. It is
also possible to express negative assertions, concerning individuals not enjoying
some property. It is possible to specify hierarchies of properties (e.g., to state
that some properties are sub-properties of other ones) and to de ne domain
and range of each property. Among the \Advanced Use of Properties", one can
state that certain properties are re exive or irre exive, symmetric or
asymmetric, transitive, equivalent to some other properties, or disjoint from them. It can
be stated that a property is functional, or that its inverse is functional.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Background: Naming Mechanisms</title>
      <p>A rei cation mechanism, also known as \naming relation", is a method for
representing within a rst-order language expressions of the language itself, without
resorting to higher-order features. Naming relations can be introduced in
several manners. For a discussion of di erent possibilities, with their advantages
and disadvantages, see, e.g., [20{23]. However, all of them are based upon
introducing distinguished constants, function symbols (if available) and predicates,
devised to construct names. For instance, given 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 rst-class object in rst-order settings), atom is a
distinguished predicate symbol, args a distinguished function symbol and [: : :] is a
list.</p>
      <p>More formally, let us consider a standard rst-order language L including sets
of predicate, constant and (possibly) function symbols, and a (possibly
denumerable) set of symbols of variables. 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 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 function
symbol f , a new constant (say c0) for each constant symbol c, and a denumerable
set of meta-variables, 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 de ned), so 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.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Metalogic for Properties of Relations</title>
      <p>In this paper we mainly consider 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.</p>
      <p>We will represent properties of relations in OWL style by means of metalevel
rules. To de ne such 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 it does not involve names and its
predicate is neither solve nor solve not . Distinguished predicates will allow us to
respectively extend/restrict 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 to 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 or solve not .</p>
      <p>So, metalevel rules in general allow arguments of predicates to be names of
predicates, function symbols and constants. A particular kind of metarules, that
we call metaevaluation rules, have distinguished predicates solve and solve not
in their head, and possibly also in their body, taking as argument names of
atoms.</p>
      <p>Below is a simple example of the use of solve to specify which properties a
re exive predicate meets. Namely that p(a; a) can be derived for any element
a belonging to the predicate domain; here, this is elicited from a occurring in
the extensional de nition of p. The rst rule is a metaevaluation rule, featuring
predicate solve in its head, taking as argument the name of an atom; the latter
two rules are `simple' metalevel rules not involving either solve or solve not , and
taking as arguments metalevel constants.</p>
      <p>solve(P 0(X0; X0)) : re exive(P 0); in domain(P 0; X 0):
in domain(P 0; X 0) : solve(P 0(X 0; Y 0)):
in domain(P 0; X 0) : solve(P 0(Y 0; X 0)):</p>
      <p>Our objective is to make it automatic to derive p(a; a) whenever a program
includes this de nition, a fact re exive(p0) occurs in the program, and a is in
the domain of p. Vice versa, we can de ne:</p>
      <p>solve not (P 0(X0; X0)) : irre exive(P 0):
with the aim to prevent the derivation of p(a; a) for any predicate p which have
been declared to be irre exive (i.e., for which a fact irre exive(p0) occurs in the
program).</p>
      <p>
        Following [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ], 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 is a program, we mean that it is a program/theory
in the (here unspeci ed) logic language/formalism that one wishes to consider.
      </p>
      <p>
        We start with 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 . The ground
version of program is obtained by substituting in all possible ways variables
occurring in by constants also occurring in . 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
wellestablished terminology [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], we therefore require I B , where B is the
Herbrand Base of , 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>De nition 1 Let be a program. I B is a potentially acceptable set of
atoms i for every base atom A which belongs to I, solve("A) also belongs to I.</p>
      <sec id="sec-4-1">
        <title>De nition 2 Let be a program, and I be a potentially acceptable set of atoms for . I is an acceptable set of atoms i I satis es the following axiom schemata for every base atom A:</title>
        <sec id="sec-4-1-1">
          <title>A solve("A) :A solve not ("A)</title>
          <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 of relations that have been de ned via solve and
solve not rules without modi cations to SEM for any formalism at hand. For
clarity however, it is convenient to lter away solve and solve not atoms from
acceptable sets. Thus, given a program and an acceptable set of atoms I for
, the Base version IB of I is obtained by omitting from I all atoms of the
form solve("A) and solve not ("A).</p>
          <p>Procedural semantics and the speci c naming relation that one intends to
use remain to be de ned. In fact, it is easy to see that the above-introduced
semantics is independent of the naming mechanism. For approaches based upon
(variants of) Resolution (like, e.g., Prolog) one can extend the procedure so as
to be allowed to use rules with conclusion solve("A) to resolve a goal A and,
vice versa, rules with conclusion A to resolve solve("A); if a goal G succeeds in
this way with computed answer , then solve not ("G ) should be attempted:
if it succeeds, then G should be forced to fail; otherwise, success of G can be
con rmed.
5</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Expressing OWL-Like Properties of Relations</title>
      <p>In the previous section we have shown the use of metalevel de nitions involving
solve and solve not to de ne what it means of a predicate to be re exive or, vice
versa, irre exive. These metalevel de nitions are declarative yet executable, in
that they suitably enlarge or restrict the involved predicates' extension. In this
section we show the metalevel representation of other properties of relations that
can be expressed in OWL. We concentrate in particular on properties which are
relevant and widely used. The objective is to convince the reader that most such
properties can be represented in our approach without resorting to the powerful
though complex Description Logics.</p>
      <p>Symmetry can be simply de ned as follows:
solve(P 0(X0; Y 0)) : symmetric(P 0); solve(P 0(Y 0; X0)):
symmetric(friend 0):</p>
      <p>This rule speci es in fact the meaning of symmetry for any predicate, stating
(via the predicate solve applied over a generic atom name) that p(X; Y ) can
be derived if p(Y; X) holds; notice that in this rule predicate solve occurs not
only in the head but also in the body of the rule. The fact symmetric(friend 0)
speci es that predicate friend is symmetric, via its name.</p>
      <p>So, a programmer/knowledge designer behaves very much like in OWL, save
that properties of relations must be speci ed on the names of the predicates.
Notice that di erent metaevaluation rules (with their auxiliary metalevel rules)
can be de ned and expressed in a modular way, and they naturally interact and
compose with each other.</p>
      <p>Below we consider transitivity, that can be simply expressed in the following
way:
solve(P 0(X0; Y 0)) : transitive(P 0); solve(P 0(X0; Z0)); solve(P 0(Z0; Y 0)):
This rule speci es the meaning of transitivity for any predicate, where a
fact of the form transitive(P 0) declares that the predicate p0 is transitive. The
de nition actually allows new facts to be derived. For example, if we have the
following facts:
transitive(same age0):
same age(ann; alice):
same age(alice; chris):
via the previous rule we can derive same age(ann; chris). A possible variation
is the transitive closure.</p>
      <p>Another very useful feature, that increases exibility to a great extent, is
equivalence between properties, obtained by the following de nition.</p>
      <p>solve(P 0(X0; Y 0)) : equivalent (P 0; R0); solve(R0(X0; Y 0)):</p>
      <p>This rule de nes two relations as equivalent if they have the same extension.
For example, stating that predicate friend is equivalent to predicate amico (the
latter is the translation into Italian of the former):
equivalent (friend 0; amico0):
friend (ann; alice):
symmetric(equivalent 0):
we can easily see that it becomes possible to derive amico(ann; alice). The
metameta statement symmetric(equivalent 0) allows the translation to be applied in
both ways. The concept of equivalence can be customized via other meta-rules.</p>
      <p>Focusing the attention on the concept of inheritance, we may have the
following:
solve(P 0(X0; Y 0)) : hereditary (P 0; R0);</p>
      <p>solve(R0(X0; Z0)); solve(P 0(Z0; Y 0)):
meaning that property P 0 is hereditary with respect to a relation R0 if whenever
an element of the domain of R0 has property P 0 then also all the other elements
have the same property. For example:
hereditary (polygon0; kind of 0):
polygon(quadrilateral ; four ):
kind of (square; quadrilateral ):
Where polygon(quadrilateral ; four ) indicates that a quadrilateral is a kind of
polygon that has the property of having four sides; instead, kind of (square; quadrilateral )
indicates that a square is a kind of quadrilateral. Thanks to the hereditary rule
we can derive polygon(square; four ). Other OWL properties, e.g., subclasses etc.,
can be represented in a similar way.</p>
      <p>It is important to notice that in the present setting new properties of
relations can be de ned upon need and immediately employed, in combination with
already existing ones, and meta-meta properties can be also expressed.</p>
    </sec>
    <sec id="sec-6">
      <title>Background: Answer Set Programming</title>
      <p>
        Answer Set Programming (ASP), is a well-known successful logic programming
paradigm (cf. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and the references therein). Roughly speaking, an ASP
program is a declarative Prolog-like (executable) speci cation of a problem to be
solved. Such a program may have several \models", called \answer sets" (or also
\stable models"), each one representing a possible interpretation of the
situation described by the program (and, usually, encoding a solution to the problem
at hand). ASP has been successfully applied in practice in many application
domains.
      </p>
      <p>An answer set program (or simply \program") is a nite collection of
rules of the form H L1; : : : ; Ln: where H is an atom, n 0 and each literal
Li is either an atom Ai or its default negation not Ai. The left-hand side and
the right-hand side of rules are called head and body, respectively. A rule can
be rephrased as H A1; : : : ; Am; not Am+1; : : : ; not An: where A1; : : : ; Am can
be called positive body and not Am+1; : : : ; not An can be called negative body.
Analogously to Prolog, practical programming environments often o er : as a
glyph for the symbol . A rule with empty body (n = 0) is called a unit rule, or
fact (vs. non-unit rules). A rule with empty head, of the form L1; : : : ; Ln:, is
a constraint. It states that the literals L1; : : : ; Ln cannot be simultaneously true.
A rule head can be a disjunction and a \classical negation" is provided; for lack
of space we do not consider here such improvements to the basic paradigm.</p>
      <p>A program may have several answer sets or may have no answer set (while in
many semantics for logic programming a program admits exactly one \model",
however de ned). Whenever a program has no answer sets, we say that the
program is inconsistent; so, checking for consistency means checking for the
existence of answer sets. Answer sets of , if any exists, are consistently supported
minimal classical models of the program (interpreted in the obvious way as a
rst-order theory).</p>
      <p>
        In practice, answer sets can be found via inference engines called ASP solvers
[
        <xref ref-type="bibr" rid="ref25">25</xref>
        ]. Several solvers have became available, each of them being characterized by
its own prominent valuable features. As is well-known, most of the commonly
available ASP solvers produce the grounding of the given program as a rst step,
as they are able to nd the answer sets of ground programs only.
      </p>
      <p>The ASP programming methodology can be called GCO, for \Guess &amp; Check
&amp; Optimize", where: (i) Guess implies generating potential solutions via rules
and cycles (ii) Check implies selecting admissible ones by de ning suitable
constraints; (iii) Optimize implies specifying preference criteria by exploiting weak
constraints, indicated by connective : , that select among the admissible
solutions those that satisfy such constraints at best.</p>
      <p>ASP has been equipped in time with several additional features, representable
via non-trivial ASP subprograms, and implemented directly in ASP solvers.
One of these is the so-called Cardinality Constraints of the form (that we show
for simplicity for the case of binary predicates, though it can be extended to
predicates of any arity):</p>
      <p>nfp(X; Y ) : d(X)gm : q(Y )
meaning that for every (constant value of) Y for which q(Y ) holds, every answer
set must include no less than n and no more than m (where n m) atoms of
the form p(X; Y ) where d(X) holds (of the constant value assigned to X). Given
the possible answer sets originating from the basic de nition, those that do not
meet such a constraint are discarded. Below is an example of use, stating that
every person takes residence in exactly one municipality:</p>
      <sec id="sec-6-1">
        <title>1fresidence(X ; Y ) : municipality (X )g1 : person(Y ):</title>
        <p>Cardinality constraints can be seen as special cases of aggregates, which have
the form</p>
        <p>n op [L1 = w1; : : : ; Ln = wn] m
where the Li's are literals, the wis are numerical weights, op is an operator (e.g.
sum, average, min, max) to be applied to the weights of literals that are true
in given set of atoms; in any answer set, the result of the application of the
operator must stay within the bounds. For cardinality constraints, the weight
of literals is implicitly set to 1 and the operator is implicitly set to sum.
Cardinality constraints can reproduce some of the cardinality features of OWL; in
particular they can represent the functional property of a predicate, basically
(like in the above example) by enforcing the predicate to assume only one value
by setting both n and m to 1. However, ASP has virtually no software
engineering construct beyond such constraints; in particular other properties of relations
should be speci ed, if needed, in an \ad hoc" manner, according to the skills of
a programmer.</p>
        <p>In the rest of the paper, we will discuss how to incorporate into ASP the
mechanisms for de nition and use of properties of relations that we have outlined
before. In this way, prede ned de nitions are available to every ASP user, while
the skilled one can represent her/his favorite new properties.
7</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>Properties of Relations in ASP</title>
      <p>In order to be able to represent knowledge in ASP more easily and in a more
understandable and exible way, the methodology introduced in Sections 4-5 can
be usefully employed. However, since ASP is not resolution-based, the
methodology must be applied in a di erent way. In this section, we propose in particular,
to compile a set S of metalevel and metaevaluation rules into a form that can be
seamlessly added to a given ASP program , whose rules can also undergo some
easy modi cations; we thus obtain an augmented program S where the
requirements of De nitions 1 and 2 are satis ed in the answer sets of S , which means
that properties of relations speci ed in S are properly applied. The procedure is
de ned as follows.</p>
      <p>De nition 3 Given ASP program and a set of metalevel and
metaevaluation rules S, and assuming that the metalevel constants occurring in S refer to
(are names of ) predicates and constants occurring in , we obtain a new ASP
program S from and S via the following steps (transformation S ).
(i) For every atom of the form solve (P 0(Args)) or solve(p0(Args)), where Args
denotes the set of arguments according to the cardinality of the predicate(s)
the atom refers to, such atoms must be transformed into the form solve (P 0; Args)
or solve(p0; Args) respectively. The same is done for solve not , where we
obtain solve not (P 0; Args) or solve not (p0; Args).
(ii) All metavariables are substituted with plain variables, and all metaconstants
which are names of constants with the corresponding constants.
Metaconstants which are names of predicates are kept untouched. All metarules and
solve rules thus obtained are added to S .
(iii) For every predicate p di erent from solve and solve not occurring in such
that p0 also occurs in , the following pair of rules is added to S :
p(X1; : : : ; Xn) : solve(p0; X1; : : : ; Xn);</p>
      <p>not solve not (p0; X1; : : : ; Xn): (1)
solve(p0; X1; : : : ; Xn) : p(X1; : : : ; Xn);</p>
      <p>not solve not (p0; X1; : : : ; Xn): (2)
where X1; : : : ; Xn are variables, n being the arity of predicate p.
(iv) All facts (unit rules) of are added to S . For every non-unit rule in
of the form</p>
      <p>p(X1; : : : ; Xn) : Body :
the rule is replaced in</p>
      <p>S by the modi ed version:
p(X1; : : : ; Xn) : Body ; not solve not (p0; X1; : : : ; Xn):
Remark 1. The above transformation may need to add auxiliary predicates to
ensure safety of rules, which is a technical condition required by ASP solvers
in order to make the grounding of programs easier. This aspect presents no
conceptual or practical problems and so, for the sake of simplicity, is not treated
here.</p>
      <p>We are able to prove the following:</p>
      <sec id="sec-7-1">
        <title>Theorem 1 The answer sets of</title>
        <p>S .</p>
        <p>Proof (sketch): All rules in S occur in S , though in a format suitably modi ed
so as to be compatible with ASP syntax and semantics. Apart from the modi ed
notation, the addition of rules (1) guarantees the satisfaction, in every answer
set, of the condition speci ed in De nition 1; the addition of rules (2) and of the
additional condition solve not (p0; X1; : : : ; Xn) in all the other rules enforce the
satisfaction, in every answer set, of the conditions speci ed in De nition 2.</p>
        <p>S correspond to acceptable sets of atoms for</p>
        <p>For the sake of clarity let us apply the above de nition to the previous
example (also considering symmetry). To summarize, the set S is the following:
solve(P 0(X0; X0)) : re exive(P 0); in domain(P 0; X 0):
in domain(P 0; X 0) : solve(P 0(X 0; Y 0)):
in domain(P 0; X 0) : solve(P 0(Y 0; X 0)):
solve(P 0(X0; Y 0)) : symmetric(P 0); solve(P 0(Y 0; X0)):
solve not (P 0(X0; X0)) : irre exive(P 0):
re exive(same age0):
irre exive(friend 0):
symmetric(friend 0):
Program</p>
        <p>is simply the following:
friend (george; ann):
same age(ann; alice):
From steps (i) and (ii) we obtain the following S0:
solve(P; X; X) : re exive(P ); in domain(P ; X ):
in domain(P ; X ) : solve(P ; X ; Y ):
in domain(P ; X ) : solve(P ; Y ; X ):
solve(P; X; Y ) : symmetric(P ); solve(P; Y; X):
solve not (P; X; X) : irre exive(P ):
re exive(same age0):
irre exive(friend 0):
symmetric(friend 0):
Finally, we obtain S00 by adding the following rules to S0:
same age(X ; Y ) : solve(same age0; X ; Y );</p>
        <p>not solve not (same age0; X ; Y ):
solve(same age0; X ; Y ) : same age(X ; Y );</p>
        <p>not solve not (same age0; X ; Y ):
friend (X ; Y ) : solve(friend 0; X ; Y );</p>
        <p>not solve not (friend 0; X ; Y ):
solve(friend 0; X ; Y ) : friend (X ; Y );</p>
        <p>not solve not (friend 0; X ; Y ):</p>
        <p>S is obtained by adding the rules in S00 to the given program , that in
this case does not need modi cations, as it is composed of facts only. It can
be veri ed, by running S via any ASP solver, that its answer sets bring the
desired results (to perform experiments, metaconstants of the form p0 must be
given a syntax compatible with ASP solver, for instance p1). The resulting (in
this case unique) answer set is:
fin domain(same age0; alice); in domain(friend 0; ann);
in domain(same age0; ann); in domain(friend 0; george);
symmetric(friend 0); irre exive(friend 0);
re exive(same age0); solve(friend 0; george; ann);
solve(same age0; ann; alice); solve(friend 0; ann; george);
solve(same age0; ann; ann); solve(same age0; alice; alice);
same age(ann; alice);
same age(alice; alice); same age(ann; ann);
friend (george; ann); friend (ann; george)g</p>
        <p>Let us notice explicitly that the above formulation is applicable to every
program , not just to programs composed of facts only, but to any program,
even including cycles, and thus featuring several answer sets. For example, if we
add to the above sample program the rules and facts:
friend (X ; Y ) : nice(Y ); not enemy (X ; Y ):
enemy (X ; Y ) : not friend (X ; Y ):
nice(alice):
irre exive(enemy 0):</p>
        <p>The resulting program, as it is easy to verify, has several answer sets, where
george, ann and alice are either mutual enemies or friends of alice, the only one
declared to be nice; however, due to the stated irre exivity of predicate enemy
(in addition of what already done for friend ) none of them three is either friend
or enemy of her/himself.</p>
        <p>We introduce a simpli ed version for the answer sets of
S :</p>
      </sec>
      <sec id="sec-7-2">
        <title>De nition 4 Given an ASP program , a set of metalevel and metaevalua</title>
        <p>tion rules (meta-de nitions) S and the program S obtained from the former
according to De nition 3, the Base version IB of an answer set I is obtained by
omitting from I all atoms of the form solve(p0; Args) or solve not (p0; Args).</p>
        <p>As for the modality of use of the approach, a user should write program ,
and declare the desired properties of relations to exploit (in the previous
example, facts re exive(same age0), irre exive(friend 0), and symmetric(friend 0))
that by abuse of notation might be expressed directly on predicate names, with
a pre-processor to be responsible of re-arranging the notation. A smart
programmer/knowledge engineer might enrich the prede ned set S by writing new
metalevel and metaevaluation rules, in the user-friendly form illustrated in
previous sections, where S would then be generated by a pre-processor.
Remark 2. Transformation S over program and set S of meta-de nitions
adds two new rules for each predicate p occurring in such that p0 occurs in
S. This would at worst multiply by three the size of when computing S00,
and consequently also the size of the corresponding grounded program. This is
however a pessimistic esteem, because an \ad hoc" de nition of properties such
as symmetry, transitivity, etc. for speci c predicates would in any case imply
adding at least one additional rule per property per predicate. Thus, there is
indeed an increase in size w.r.t. given program, but it is not dramatic and can
be considered as a reasonable drawback in exchange for the extra expressiveness.
Complexity remains the same, so there is no additional computational burden
due to the approach.
8</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>Related Work and Conclusions</title>
      <p>
        It is worth considering if the metaevaluation part S of given program, or more
precisely the ASP transposition S0 obtained according to De nition 3, might
be encapsulated within either a template [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] or a module [
        <xref ref-type="bibr" rid="ref8 ref9">8, 9</xref>
        ]. This can be
possible only if the speci c approach to modular/template ASP allows recursive
(direct or indirect) call of templates/modules because metalevel properties can
be combined: see, e.g., the example where a symmetric predicate is equivalent
to another one, where equivalence is itself symmetric. To the best of our
understanding, [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] would require the speci c de nition of each predicate with its
properties and their speci cation to be enclosed into a template. [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] would allow
to augment the de nition of a predicate via a module de ning the speci c
metalevel part; [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] allows instead predicates as module arguments, so there might
be a unique common de nition.
      </p>
      <p>
        The HEX framework [
        <xref ref-type="bibr" rid="ref26 ref27">26, 27</xref>
        ] allows to combine ASP with Description
Logics (or other formalisms). Clearly, external reasoners and knowledge bases are
assumed to be available. For properties of relations, their rei cation approach
would require one so-called `HEX rule' for each predicate p with arity n which
might enjoy some properties, of the form: p(T1; : : : ; Tn) : &amp;ext[p](T1; : : : ; Tn).
Then, for the external evaluation of \&amp;ext[p]", one should resort to an OWL
external ontology where to de ne the properties of p and of other predicates. The
HEX approach is certainly very useful for integrating various forms of
knowledge representation and reasoning. For properties of predicates such as those
discussed here it appears however over-dimensioned and certainly less e cient
(having to resort to an OWL reasoner) than our simple implementation.
      </p>
      <p>Moreover, in all the above-mentioned frameworks it would be required to
know in advance if some properties can be applicable to a predicate, so as to
invoke the relative module(s) or to write the related HEX rule. Instead, if S0 is
imported as a library and an associated pre-processor generates S00, metalevel
properties smoothly enlarge/restrict the extension of each predicate to which
they are applicable. Di erent properties are combined automatically with no
e ort required to the programmer.</p>
      <p>In conclusion, we have introduced a methodology based on naming and
metareasoning for enriching logic-based formalisms with the possibility of
expressing and using metalevel properties of relations similarly to what done in
the OWL ontology language. Computationally, the methodology has the
advantage of not requiring higher-order features. From the knowledge representation
point of view, it allows the introduction of both prede ned and user-de ned
properties, so it can increase the usability and exibility of virtually any knowledge
representation and reasoning architecture at very little cost for implementation,
and little burden for knowledge engineers. We have shown that the methodology
is usable in both resolution-based frameworks but also in formalisms such as
ASP which are based on a very di erent computational engine.</p>
      <p>
        Related work exists about ontologies and ASP. [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ] shows that RDF(S)
ontologies can be expressed, without loss of semantics, into Answer Set
Programming. Then, based on a previous result showing that the SPARQL query
language (a candidate W3C recommendation for querying ontologies) can be
mapped to a rule based language with stable model semantics, it shows that
e cient querying of big ontologies can be accomplished within an extension of
the well known ASP system DLV [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ]. The di erence with our work is that we
do not intend to query external ontologies, rather we show that ontological
reasoning can be accomplished within a logic program. The DLVHEX system [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ]
is a logic-programming reasoner for computing the models of so-called
HEXprograms. In this approach ASP programs are extended to become higher-order
logic programs, which accommodate meta-reasoning through higher-order atoms,
and with external atoms for software interoperability. For instance, a rule may
look like the following one, with variables ranging over predicates:
      </p>
      <p>
        C (X ) : subClassOf (D ; C ); D (X ):
Although we are not able to query external ontologies (so far, as we might adopt
for instance the method of [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ]), we are able to perform the same kind of
metareasoning within the traditional ASP semantics, which is in our opinion an added
value.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
            ,
            <given-names>P.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>van Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <string-name>
            <surname>From</surname>
            <given-names>SHIQ</given-names>
          </string-name>
          and
          <article-title>RDF to OWL: the making of a web ontology language</article-title>
          .
          <source>J. Web Sem</source>
          .
          <volume>1</volume>
          (
          <issue>1</issue>
          ) (
          <year>2003</year>
          )
          <volume>7</volume>
          {
          <fpage>26</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Antoniou</surname>
          </string-name>
          , G., van
          <string-name>
            <surname>Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Web ontology language: OWL</article-title>
          . In: Handbook on Ontologies.
          <source>International Handbooks on Information Systems</source>
          . Springer (
          <year>2009</year>
          )
          <volume>91</volume>
          {
          <fpage>110</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Baader</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calvanese</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nardi</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
            ,
            <given-names>P.F.</given-names>
          </string-name>
          :
          <article-title>The Description Logic Handbook: Theory, Implementation, and Applications</article-title>
          . Cambridge Univ. Press (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Konolige</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Reasoning by introspection</article-title>
          . In:
          <article-title>Meta-Level Architectures and Reection</article-title>
          . North-Holland (
          <year>1988</year>
          )
          <volume>61</volume>
          {
          <fpage>74</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>van Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wielinga</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bredeweg</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schreiber</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Karbach</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reinders</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Voss</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Akkermans</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , Bartsch-Sporl,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Vinkhuyzen</surname>
          </string-name>
          , E.:
          <article-title>Knowledgelevel re ection</article-title>
          . In:
          <article-title>Enhancing the Knowledge Engineering Process { Contributions from ESPRIT</article-title>
          . Elsevier
          <string-name>
            <surname>Science</surname>
          </string-name>
          (
          <year>1992</year>
          )
          <volume>175</volume>
          {
          <fpage>204</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Barklund</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dell'Acqua</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lanzarone</surname>
            ,
            <given-names>G.A.</given-names>
          </string-name>
          :
          <article-title>Re ection principles in computational logic</article-title>
          .
          <source>J. Log. Comput</source>
          .
          <volume>10</volume>
          (
          <issue>6</issue>
          ) (
          <year>2000</year>
          )
          <volume>743</volume>
          {
          <fpage>786</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Brewka</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Truszczynski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Answer set programming at a glance</article-title>
          .
          <source>Commun. ACM</source>
          <volume>54</volume>
          (
          <issue>12</issue>
          ) (
          <year>2011</year>
          )
          <volume>92</volume>
          {
          <fpage>103</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Baral</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dzifcak</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Takahashi</surname>
          </string-name>
          , H.:
          <article-title>Macros, macro calls and use of ensembles in modular answer set programming</article-title>
          .
          <source>In Proco_ f ICLP'06</source>
          , Vol.
          <volume>4079</volume>
          of LNCS., Springer (
          <year>2006</year>
          )
          <volume>376</volume>
          {
          <fpage>390</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Krennwallner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Promoting modular nonmonotonic logic programs</article-title>
          .
          <source>In ICLP'11 Tech. Comm</source>
          . Vol.
          <volume>11</volume>
          of LIPIcs,
          <string-name>
            <surname>Schloss Dagstuhl</surname>
          </string-name>
          Leibniz-Zentrum fur Informatik (
          <year>2011</year>
          )
          <volume>274</volume>
          {
          <fpage>279</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Calimeri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ianni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ielpa</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pietramala</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Santoro</surname>
          </string-name>
          , M.C.
          <article-title>: A system with template answer set programs</article-title>
          .
          <source>In: Logics in Arti cial Intelligence</source>
          , 9th European Conference,
          <string-name>
            <surname>JELIA</surname>
          </string-name>
          <year>2004</year>
          ,
          <article-title>Pr</article-title>
          . Vol.
          <volume>3229</volume>
          of LNCS., Springer (
          <year>2004</year>
          )
          <volume>693</volume>
          {
          <fpage>697</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Costantini</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Meta-reasoning: A survey</article-title>
          . In: Computational Logic:
          <article-title>Logic Programming and Beyond, Essays in Honour of Robert A. Kowalski, Part II</article-title>
          . Vol.
          <volume>2408</volume>
          of LNCS., Springer (
          <year>2002</year>
          )
          <volume>253</volume>
          {
          <fpage>288</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J.W.</given-names>
          </string-name>
          :
          <article-title>Foundations of Logic Programming</article-title>
          ,
          <source>Second Edition</source>
          . Springer (
          <year>1987</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Bowen</surname>
            ,
            <given-names>K.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kowalski</surname>
            ,
            <given-names>R.A.</given-names>
          </string-name>
          :
          <article-title>Amalgamating language and metalanguage in logic programming</article-title>
          .
          <source>In: Logic Programming</source>
          . Academic Press, London (
          <year>1982</year>
          )
          <volume>153</volume>
          {
          <fpage>172</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>Carlucci</given-names>
            <surname>Aiello</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Levi</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          :
          <article-title>The uses of metaknowledge in AI systems</article-title>
          . In:
          <article-title>MetaLevel Architectures and Re ection</article-title>
          . North-Holland (
          <year>1988</year>
          )
          <volume>243</volume>
          {
          <fpage>254</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Bonatti</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Model theoretic semantics for demo</article-title>
          .
          <source>In: Meta-Programming in Logic. LNCS 649</source>
          , Berlin, Springer (
          <year>1992</year>
          )
          <volume>220</volume>
          {
          <fpage>234</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Hill</surname>
            ,
            <given-names>P.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J.W.:</given-names>
          </string-name>
          <article-title>The Godel Programming Language</article-title>
          . The MIT Press (
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Grosof</surname>
            ,
            <given-names>B.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kifer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fodor</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          : Rulelog:
          <article-title>Highly expressive semantic rules with scalable deep reasoning</article-title>
          . In Doctoral Consortium, Challenge, Industry Track,
          <article-title>Tutorials and Posters@RuleML+RR'17 hosted by RuleML+RR'17</article-title>
          . Vol.
          <year>1875</year>
          of CEUR Workshop Pr.,
          <source>CEUR-WS.org</source>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kifer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Warren</surname>
            ,
            <given-names>D.S.:</given-names>
          </string-name>
          <article-title>HILOG: A foundation for higher-order logic programming</article-title>
          .
          <source>J. Log. Program</source>
          .
          <volume>15</volume>
          (
          <issue>3</issue>
          ) (
          <year>1993</year>
          )
          <volume>187</volume>
          {
          <fpage>230</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Bordini</surname>
            ,
            <given-names>R.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Braubach</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dastani</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>El</surname>
            Fallah-Seghrouchni,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gomez-Sanz</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leite</surname>
            , J.,
            <given-names>O</given-names>
          </string-name>
          <string-name>
            <surname>'Hare</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pokahr</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ricci</surname>
            ,
            <given-names>A.</given-names>
          </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>
          ) (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>van Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>De nable naming relations in meta-level systems</article-title>
          .
          <source>In: MetaProgramming in Logic. LNCS 649</source>
          , Berlin, Springer (
          <year>1992</year>
          )
          <volume>89</volume>
          {
          <fpage>104</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Barklund</surname>
          </string-name>
          , J.:
          <article-title>What is a meta-variable in Prolog? In: Meta-Programming in Logic Programming</article-title>
          . The MIT Press (
          <year>1989</year>
          )
          <volume>383</volume>
          {
          <fpage>98</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Hill</surname>
            ,
            <given-names>P.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J.W.:</given-names>
          </string-name>
          <article-title>Analysis of metaprograms</article-title>
          . In:
          <article-title>Meta-Programming in Logic Programming</article-title>
          , THE MIT Press (
          <year>1988</year>
          )
          <volume>23</volume>
          {
          <fpage>51</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Barklund</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <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>Lanzarone</surname>
            ,
            <given-names>G.A.</given-names>
          </string-name>
          :
          <article-title>Semantical properties of encodings in logic programming</article-title>
          .
          <source>In: Logic Programming { Proc. 1995</source>
          Intl. Symp., MIT Press (
          <year>1995</year>
          )
          <volume>288</volume>
          {
          <fpage>302</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Dix</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>A classi cation theory of semantics of normal logic programs: I. Strong properties</article-title>
          .
          <source>Fundam. Inform</source>
          .
          <volume>22</volume>
          (
          <issue>3</issue>
          ) (
          <year>1995</year>
          )
          <volume>227</volume>
          {
          <fpage>255</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25. ASP:
          <article-title>Answer set programming solvers (incomplete list) (2018) DLV: www. dlvsystem.com. WASP: www</article-title>
          .mat.unical.it/DLV2/wasp. clingo: www.potassco. org. lparse+smodels: www.tcs.hut.fi/Software/smodels.
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fink</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ianni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krennwallner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Redl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          , Schuller, P.:
          <article-title>A model building framework for answer set programming with external computations</article-title>
          .
          <source>TPLP</source>
          <volume>16</volume>
          (
          <issue>4</issue>
          ) (
          <year>2016</year>
          )
          <volume>418</volume>
          {
          <fpage>464</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaminski</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Redl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          , Schuller,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Weinzierl</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>Answer set programming with external source access</article-title>
          .
          <source>In: Reasoning Web. Semantic Interoperability on the Web - 13th Int. Summer School</source>
          <year>2017</year>
          ,
          <string-name>
            <given-names>Tutorial</given-names>
            <surname>Lectures</surname>
          </string-name>
          . Vol.
          <volume>10370</volume>
          of LNCS., Springer (
          <year>2017</year>
          )
          <volume>204</volume>
          {
          <fpage>275</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>Ianni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Martello</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Panetta</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Terracina</surname>
          </string-name>
          , G.:
          <article-title>E ciently querying RDF(S) ontologies with answer set programming</article-title>
          .
          <source>J. Log. Comput</source>
          .
          <volume>19</volume>
          (
          <issue>4</issue>
          ) (
          <year>2009</year>
          )
          <volume>671</volume>
          {
          <fpage>695</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Germano</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ianni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaminski</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Redl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          , Schuller,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Weinzierl</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>The DLVHEX system</article-title>
          .
          <source>KI</source>
          <volume>32</volume>
          (
          <issue>2-3</issue>
          ) (
          <year>2018</year>
          )
          <volume>187</volume>
          {
          <fpage>189</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>