<!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>Evaluating Answer Set Programming with Non-Convex Recursive Aggregates</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mario Alviano</string-name>
          <email>alviano@mat.unical.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Mathematics and Computer Science, University of Calabria</institution>
          ,
          <addr-line>87036 Rende (CS)</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Aggregation functions are widely used in answer set programming (ASP) for representing and reasoning on knowledge involving sets of objects collectively. These sets may also depend recursively on the results of the aggregation functions, even if so far the support for such recursive aggregations was quite limited in ASP systems. In fact, recursion over aggregates was restricted to convex aggregates, i.e., aggregates that may have only one transition from false to true, and one from true to false, in this specific order. Recently, such a restriction has been overcome, so that the user can finally use non-convex recursive aggregates in ASP programs, either on purpose or accidentally. A preliminary evaluation of ASP programs with non-convex recursive aggregates is reported in this paper.</p>
      </abstract>
      <kwd-group>
        <kwd>answer set programming</kwd>
        <kwd>aggregation functions</kwd>
        <kwd>non-convex recursive aggregates</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Answer set programming (ASP) is a declarative language for knowledge
representation and reasoning [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. ASP programs are sets of disjunctive logic rules, possibly using
default negation under stable model semantics [
        <xref ref-type="bibr" rid="ref21 ref22">21, 22</xref>
        ]. Several constructs were added
to the original, basic language in order to ease the representation of practical
knowledge. Of particular interest are aggregate functions [
        <xref ref-type="bibr" rid="ref14 ref17 ref23 ref27 ref32 ref5">5, 14, 17, 23, 27, 32</xref>
        ], which allow
for expressing properties on sets of atoms declaratively. In fact, in many ASP programs
functional dependencies are enforced by means of COUNT aggregates, or equivalently
using SUM aggregates; for example, a rule of the following form:
      </p>
      <p>⊥ ← R0(X ), SUM[1, Y : R(X , Y , Z)] ≤ 1
constrains relation R to satisfy the functional dependency X → Y , where X ∪ Y ∪ Z
is the set of attributes of R, and R0 is the projection of R on X . Aggregate functions are
also commonly used in ASP to constrain a nondeterministic guess. For example, in the
knapsack problem the total weight of the selected items must not exceed a given limit,
which can be modeled by the following rule:</p>
      <p>⊥ ← SUM[W, O : object (O, W, C ), in (O)] ≤ limit .</p>
      <p>
        Mainstream ASP solvers [
        <xref ref-type="bibr" rid="ref15 ref20">15, 20</xref>
        ] almost agree on the semantics of aggregates [
        <xref ref-type="bibr" rid="ref14 ref17">14,
17</xref>
        ], here referred to as F-stable model semantics, even if several valid alternatives were
also considered in the literature [
        <xref ref-type="bibr" rid="ref23 ref30 ref31 ref33">23, 30, 31, 33</xref>
        ]. It is interesting to observe that F-stable
model semantics was proposed more than a decade ago, providing a reasonable
semantics for aggregates also in the recursive case. Indeed, it is based on an extension of
the original program reduct, and on a minimality check of the stable model candidate
resembling the disjunctive case. Despite this, for many years the implementation of
Fstable model semantics was incomplete, and recursion over aggregates was restricted to
convex aggregates [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ], the largest class of aggregates for which the common
reasoning tasks still belong to the first level of the polynomial hierarchy in the normal case
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. In fact, convex aggregates may have only one transition from false to true, and one
from true to false, in this specific order, a property that guarantees tractability of model
checking in the normal case.
      </p>
      <p>
        However, non-convex aggregations may arise in several contexts while modeling
complex knowledge [
        <xref ref-type="bibr" rid="ref1 ref11 ref13">1, 11, 13</xref>
        ], and there are also minimalistic examples that are easily
encoded in ASP using recursive non-convex aggregates, while alternative encodings
not using aggregates are not so obvious. One of such examples is provided by the Σ2P
complete problem called Generalized Subset Sum [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In this problem, two vectors u
and v of integers as well as an integer b are given, and the task is to decide whether the
formula ∃x∀y(ux + vy 6= b) is true, where x and y are vectors of binary variables of
the same length as u and v, respectively. For example, for u = [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ], v = [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ], and
b = 5, the task is to decide whether the following formula is true: ∃x1x2∀y1y2(1 · x1 +
2 · x2 + 2 · y1 + 3 · y2 6= 5). Any natural encoding of such an instance would include
an aggregate of the form SUM[1 : x1, 2 : x2, 2 : y1, 3 : y2] 6= 5. Luckily, a complete
implementation of F-stable model semantics for common aggregation functions has
been achieved this year by means of a translation combining disjunction and saturation
in order to eliminate non-convexity from aggregates [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        The aim of this paper is to evaluate a few problems that can be encoded in ASP using
recursive non-convex aggregates. The tested programs are processed by the rewritings
presented in [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which are implemented in a prototype system written in Python that
uses GRINGO and CLASP. In a nutshell, aggregates are represented by specific standard
atoms, so that the grounding phase can be delegated to GRINGO [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ], and the numeric
output of GRINGO is then processed to properly encode aggregates for the subsequent
stable model search performed by CLASP [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. The focus of the paper is on programs
using SUM aggregates, even if the tested system also supports several other common
aggregation functions such as COUNT, AVG, MIN, MAX, EVEN, and ODD.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <p>Let V be a set of propositional atoms including ⊥. A propositional literal is an atom
possibly preceded by one or more occurrences of the negation as failure symbol ∼. An
aggregate literal, or simply aggregate, is of the following form:</p>
      <p>SUM[w1 : l1, . . . , wn : ln]
b
(1)
where n ≥ 0, b, w1, . . . , wn are integers, l1, . . . , ln are propositional literals, and ∈
{&lt;, ≤, ≥, &gt;, =, 6=}. (Note that [w1 : l1, . . . , wn : ln] is a multiset.) A literal is either a
propositional literal, or an aggregate. A rule r is of the following form:
p1 ∨ · · · ∨ pm ← l1 ∧ · · · ∧ ln
(2)
where m ≥ 1, n ≥ 0, p1, . . . , pm are propositional atoms, and l1, . . . , ln are
literals. The set {p1, . . . , pm} \ {⊥} is referred to as head, denoted by H(r), and the set
{l1, . . . , ln} is called body, denoted by B(r). A program Π is a finite set of rules. The
set of propositional atoms (different from ⊥) occurring in a program Π is denoted by
At (Π), and the set of aggregates occurring in Π is denoted by Ag (Π).
y2 ← unequal
⊥ ← ∼unequal
Example 1. Consider the following program Π1:
x1 ← ∼∼x1 x2 ← ∼∼x2 y1 ← unequal
unequal ← SUM[1 : x1, 2 : x2, 2 : y1, 3 : y2] 6= 5
As will be clarified after defining the notion of a stable model,Π1 encodes the instance
of Generalized Subset Sum introduced in Section 1.</p>
      <p>An interpretation I is a set of propositional atoms such that ⊥ ∈/ I. Relation |= is
inductively defined as follows:
– for p ∈ V, I |= p if p ∈ I;
– I |= ∼l if I 6|= l;
– I |= SUM[w1 : l1, . . . , wn : ln] b if Pi∈[1..n],I|=li wi b;
– for a rule r, I |= B(r) if I |= l for all l ∈ B(r), and I |= r if H(r) ∩ I 6= ∅ when</p>
      <p>I |= B(r);
– for a program Π, I |= Π if I |= r for all r ∈ Π.</p>
      <p>For any expression π, if I |= π, we say that I is a model of π, I satisfies π, or π is
true in I. In the following, &gt; will be a shorthand for ∼⊥, i.e., &gt; is a literal true in all
interpretations.</p>
      <p>The reduct of a program Π with respect to an interpretation I is obtained by
removing rules with false bodies and by fixing the interpretation of all negative literals. More
formally, the following function F (I, ·) is inductively defined:
– for p ∈ V, F (I, p) := p;
– F (I, ∼l) := &gt; if I 6|= l, and F (I, ∼l) := ⊥ otherwise;
– F (I, SUM[w1 : l1, . . . , wn : ln] b) := SUM[w1 : F (I, l1), . . . , wn : F (I, ln)] b;
– for a rule r of the form (2), F (I, r) := p1 ∨ · · · ∨ pm ← F (I, l1) ∧ · · · ∧ F (I, ln);
– for a program Π, F (I, Π) := {F (I, r) | r ∈ Π, I |= B(r)}.</p>
      <p>Program F (I, Π) is the reduct of Π with respect to I. An interpretation I is a stable
model of a program Π if I |= Π and there is no J ⊂ I such that J |= F (I, Π). Let
SM (Π) denote the set of stable models of Π.</p>
      <p>Example 2. Continuing with Example 1, the models of Π1, restricted to the atoms in
At (Π1), are X, X ∪ {x1}, X ∪ {x2}, and X ∪ {x1, x2}, where X = {unequal , y1, y2}.
Of these, only X ∪ {x1} is a stable model. Indeed, the reduct F (X ∪ {x1}, Π1) is
x1 ← &gt; y1 ← unequal y2 ← unequal
unequal ← SUM[1 : x1, 2 : x2, 2 : y1, 3 : y2] 6= 5
and no strict subset of X ∪ {x1} is a model of the above program. On the other hand,
the reduct F (X ∪ {x2}, Π1) is
x2 ← &gt; y1 ← unequal y2 ← unequal
unequal ← SUM[1 : x1, 2 : x2, 2 : y1, 3 : y2] 6= 5
and {x2, y2} is a model of the above program. Similarly, it can be checked that X and
X ∪ {x1, x2} are not stable models of Π1.</p>
      <p>An aggregate A is convex (in program reducts) if J |= F (I, A) and L |= F (I, A)
implies K |= F (I, A), for all J ⊆ K ⊆ L ⊆ I ⊆ V. If A is convex then I |= A
and J |= F (I, A) implies K |= F (I, A), for all J ⊆ K ⊆ I. Note that aggregate
SUM[1 : x1, 2 : x2, 2 : y1, 3 : y2] 6= 5 from Example 1 is non-convex.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Non-Convex Aggregates Elimination</title>
      <p>
        ASP solvers can only process sums of the form (1) in which all numbers are
nonnegative integers, and the comparison operator is ≥. This is due to the numeric format
encoding the propositional program produced by the grounder. However, thanks to the
rewritings proposed by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], all sums can be rewritten in the form accepted by current
ASP solvers. Following [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], strong equivalences can be used to restrict sums in the
input program to only two forms, which are essentially (1) with ∈ {≥, 6=}. These
first rewritings are given by means of strong equivalences [
        <xref ref-type="bibr" rid="ref16 ref25 ref34">16, 25, 34</xref>
        ].
Definition 1. Let π := l1 ∧ · · · ∧ ln be a conjunction of literals, for some n ≥ 1.
A pair (J, I) of interpretations such that J ⊆ I is an SE-model of π if I |= π and
J |= F (I, l1) ∧ · · · ∧ F (I, ln). Two conjunctions π, π0 are strongly equivalent, denoted
by π ≡SE π0, if they have the same SE-models.
      </p>
      <p>Strong equivalence means that replacing π by π0 preserves the stable models of any
logic program.</p>
      <p>Proposition 1 (Lifschitz et al. 2001; Turner 2003; Ferraris 2005). Let π, π0 be two
conjunctions of literals such that π ≡SE π0. Let Π be a program, and Π0 be the
program obtained from Π by replacing any occurrence of π by π0. It holds that Π ≡V Π0.</p>
      <p>The following strong equivalences can be proven by showing equivalence with
respect to models, and by noting that ∼ is neither introduced nor eliminated:
(E1) SUM[w1 : l1, . . . , wn : ln] &gt; b ≡SE SUM[w1 : l1, . . . , wn : ln] ≥ b + 1;
(E2) SUM[w1 : l1, . . . , wn : ln] ≤ b ≡SE SUM[−w1 : l1, . . . , −wn : ln] ≥ −b;
(E3) SUM[w1 : l1, . . . , wn : ln] &lt; b ≡SE SUM[w1 : l1, . . . , wn : ln] ≤ b − 1;
(E4) SUM[w1 : l1, . . . , wn : ln] = b ≡SE SUM[w1 : l1, . . . , wn : ln] ≤ b ∧</p>
      <p>SUM[w1 : l1, . . . , wn : ln] ≥ b.</p>
      <p>For example, (E1) and (E3) are easy to obtain because b is integer by assumption.
Similarly, (E4) is immediate by the semantics introduced in Section 2. For (E2), instead, the
following equivalences can be observed:
(i) I |= SUM[w1 : l1, . . . , wn : ln] ≤ b;
(ii) Pi∈[1..n], I|=li wi ≤ b;
(iii) Pi∈[1..n], I|=li −wi ≥ −b;
(iv) I |= SUM[−w1 : l1, . . . , −wn : ln] ≥ −b;
where (iii) above is obtained by multiplying both sides of the inequality (ii) by −1, and
the equivalence of (i) and (ii), and of (iii) and (iv), is immediate by the semantics of
sums. It is important to observe that the application of (E1)–(E4), from the last to the
first, to a programΠ gives an equivalent program pre(Π) whose aggregates are sums
with comparison operators ≥ and 6=.</p>
      <p>Theorem 1. Let Π be a program. It holds that Π ≡V pre(Π).</p>
      <p>After this preprocessing, the structure of the input program is further simplified
by eliminating non-convex aggregates. To ease the presentation, and without loss of
generality, hereinafter aggregates are assumed to be of the following form:
SUM[ − w1 : p1, . . . , −wj : pj ,
− wj+1 : ∼lj+1, . . . , −wk : ∼lk,
wk+1 : pk+1, . . . , wm : pm,
wm+1 : ∼lm+1, . . . , wn : ∼ln]
b
(3)
(4)
(5)
(6)
(7)
where n ≥ m ≥ k ≥ j ≥ 0, w1, . . . , wn are positive integers, each pi is a propositional
atom, each li is a propositional literal, ∈ {≥, 6=}, and b is an integer. Intuitively,
aggregated elements of (3) are partitioned in four sets, namely positive literals with
negative weights, negative literals with negative weights, positive literals with positive
weights, and negative literals with positive weights.</p>
      <p>
        Let Π be a program whose aggregates are of the form (3). Program rew (Π) is
obtained from Π by replacing each occurrence of an aggregate of the form (3) by a
fresh, hidden propositional atom aux [
        <xref ref-type="bibr" rid="ref10 ref24">10, 24</xref>
        ]. Moreover, if is ≥, then the following
rule is added:
aux ← SUM[w1 : p1F , . . . , wj : pjF ,
wj+1 : ∼∼lj+1, . . . , wk : ∼∼lk,
wk+1 : pk+1, . . . , wm : pm,
wm+1 : ∼lm+1, . . . , wn : ∼ln] ≥ b + w1 + · · · + wk
where each piF is a fresh, hidden atom associated with the falsity of pi, for all i ∈ [1..j],
and the following rules are also added to rew (Π):
piF ← ∼pi
piF ← aux
pi ∨ piF ← ∼∼aux
      </p>
      <p>Similarly, if</p>
      <p>is 6=, then the following rules are added to rew (Π):
aux ← SUM[w1 : p1, . . . , wj : pj ,
wj+1 : ∼∼lj+1, . . . , wk : ∼∼lk,
wm+1 : ∼lm+1, . . . , wn : ∼ln] ≥ b + 1 + w1 + · · · + wk
wj+1 : ∼lj+1, . . . , wk : ∼lk,
wk+1 : pkF+1, . . . , wm : pFm,
wm+1 : ∼∼lm+1, . . . , wn : ∼∼ln] ≥ −b + 1 + wk+1 + · · · + wn
together with rules (5)–(7) for each new piF . Intuitively, any atom of the form piF
introduced by the rewriting must be true whenever pi is false, but also when aux is true,
so to implement what is usually referred to as saturation in the literature. Rules (5) and
(6) encode such an intuition. Moreover, rule (7) guarantees that at least one between pi
and piF belongs to any model of reducts obtained from interpretations containing aux .
It is interesting to observe that when aux belongs to I the satisfaction of the associated
aggregate can be tested according to all subsets of I in the reduct F (Π, I).</p>
      <p>The intuition behind (4) is that an interpretation I satisfies an aggregate of the form
(3) such that is ≥ if and only if the following inequality is satisfied:
j k
X −wi · I(pi) + X −wi · I(∼li) +
m</p>
      <p>X wi · I(pi) +
i=1
i=j+1
i=k+1
n</p>
      <p>X
i=m+1
wi · I(∼li) ≥ b (10)
where I(l) = 1 if I |= l, and I(l) = 0 otherwise, for all literals l. Moreover, inequality
(10) is satisfied if and only if the following inequality is satisfied:</p>
      <p>j
X −wi · I(pi) +
i=1
k
X −wi · I(∼li) +
m
X wi · I(pi) +
i=k+1
i=j+1</p>
      <p>n
+ X
i=m+1
wi · I(∼li) + w1 + · · · + wk ≥ b +
k
X wi
i=1
and by distributivity (11) is equivalent to the following inequality:</p>
      <p>j
X wi · (1 − I(pi)) +
i=1
k
X wi · (1 − I(∼li)) +
i=j+1
m
+ X wi · I(pi) +
i=k+1
n</p>
      <p>X
i=m+1
wi · I(∼li) ≥ b +
k
X wi.
i=1
Note that 1−I(l) = I(∼l) for all literals l, and piF is associated with the falsity of pi, for
all i ∈ [1..j]. It is important to observe that negation was not used for positive literals
(8)
(9)
(11)
(12)
in order to avoid oversimplifications in program reducts. Indeed, as already explained,
for all i ∈ [1..j], atom piF will be derived true whenever pi is false, but also when the
aggregate is true.</p>
      <p>The intuition behind (8)–(9) is similar. Essentially, an aggregate SUM(S) 6= b of
the form (3) is true if and only if either SUM(S) ≥ b + 1 or SUM(S) ≤ b − 1 is true,
and (E2) is applied to the second aggregate in order to use the previously explained
rewriting. Let rew ∗ denote the composition rew ◦ pre.</p>
      <p>Example 3. Consider again program Π1 from Example 1. Its rewriting rew ∗(Π1) is as
follows:</p>
      <p>x1 ← ∼∼x1
unequal ← aux
xF</p>
      <p>1 ← ∼x1
xF</p>
      <p>2 ← ∼x2
yF
1 ← ∼y1
yF
2 ← ∼y2
x2 ← ∼∼x2 y1 ← unequal y2 ← unequal ⊥ ← ∼unequal
aux ← SUM[1 : x1F ; 2 : x2F ; 2 : y1F ; 3 : y2F ] ≥ 4
aux ← SUM[1 : x1; 2 : x2; 2 : y1; 3 : y2] ≥ 6
x1F ← aux x1 ∨ x1F ← ∼∼aux
x2F ← aux x2 ∨ x2F ← ∼∼aux
y1F ← aux y1 ∨ y1F ← ∼∼aux
y2F ← aux y2 ∨ y2F ← ∼∼aux
The only stable model of rew ∗(Π1) is {x1, unequal , y1, y2, aux , x1F , x2F , y1F , y2F }.</p>
      <p>
        Correctness of the rewriting can be established by slightly adapting the proof by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
Theorem 2 (Correctness). Let Π be a program. It holds that Π ≡At(Π) rew ∗(Π).
      </p>
    </sec>
    <sec id="sec-4">
      <title>4 Implementation</title>
      <p>
        The rewritings introduced in Section 3 have been implemented in a prototype
system written in Python and available at the following URL: http://alviano.net/
software/f-stable-models/. The prototype accepts an input language whose
syntax is almost conformant to ASP Core 2.0 [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. It is a first-order language, meaning
that propositional atoms are replaced by first-order atoms made of a predicate and a list
or terms, where each term is an object constant, an object variable, or a composed term
obtained by combining a function symbol with other terms. As usual in ASP, all
variables are universally quantified, so that the propositional semantics given in Section 2
can be used after a grounding phase that replaces variables by constants in all possible
ways.
      </p>
      <p>The only exception to the ASP Core 2.0 format is that sums have to be encoded
using the standard predicates f sum and f set . Moreover, only positive literals can
occur in aggregation sets. In more detail, a sum of the form SUM[w1 : p1, . . . , wn :
pn] b, where n ≥ 0, b, w1, . . . , wn are integers, p1, . . . , pn are (first-order) atoms, and
∈ {&lt;, ≤, ≥, &gt;, =, 6=} is encoded by the following first-order atom:</p>
      <p>f sum(id , μ( ), b)
where μ( ) equals "&lt;", "&lt;=", "&gt;=", "&gt;", "=", or "!=", and id is an identified for
the aggregation set, encoded by the following rules:
f set (id , w1, p1) ← p1</p>
      <p>f set (id , wn, pn) ← pn
· · ·
where a body pi (i ∈ [1..n]) can be omitted if pi has no variables. (It is also possible
to extend a body of the above rules in order to further constrain the aggregation set;
for example, arithmetic expressions can be used to restrict the selection of atoms in the
aggregation sets.)
Example 4. Program Π1 from Example 1 is encoded as follows:
x1 : − not not x1.
x2 : − not not x2.
y1 : − unequal.
y2 : − unequal.
: − not unequal.</p>
      <p>unequal : − f sum(uneq, "!=", 5).
f set(uneq, 1, x1).
f set(uneq, 2, x2).
f set(uneq, 2, y1).</p>
      <p>f set(uneq, 3, y2).
where not encodes the negation as failure symbol ∼, and rules with empty head are
integrity constraints, i.e., rules whose head is equivalent to ⊥.</p>
      <p>Alternatively, instances of Generalized Subset Sum can be specified by means of
facts involving predicates exists, all , and bound . For example, the instance above is
encoded by the following facts:
exists(x1, 1).
exists(x2, 2).</p>
      <p>all(y1, 2).
all(y2, 3).</p>
      <p>bound(5).</p>
      <p>A program encoding the Generalized Subset Sum problem for instances encoded by
these predicates is the following:
true(X, C) : − exists(X, C), not not true(X, C).
true(X, C) : − all(X, C), unequal.
: − not unequal.
unequal : − f sum(uneq, "!=", B), bound(B).</p>
      <p>f set(uneq, C, true(X, C)) : − true(X, C).
where X , C , and B are object variables.</p>
      <p>Given a program encoded as described above, the prototype obtains its propositional
version by means of the grounder GRINGO. During the grounding phase, instances of
predicate f sum are considered external, i.e., they are assigned the truth value
undefined in order to prevent their elimination. These instances and those of predicate f set
are identified and mapped in data structures of the prototype, so to have an internal
representation of all sums occurring in the propositional program. The rewritings presented
in Section 3 are then applied to these sums in order to eliminate any non-convexity. The
new sums, and any additional rule introduced by the rewriting process, are added to
the propositional program. Finally, the propositional program is printed to the standard
output using the numeric format of GRINGO, so that CLASP can be used for computing
its F-stable models, which eventually coincide with the F-stable models of the original
program because additional atoms are hidden.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Experiment</title>
      <p>The implemented rewritings were tested on a few domains that can be encoded
using recursive sums. One of them is the Generalized Subset Sum problem presented in
the introduction, which is of particular relevance in this experiment because its
natural encoding in ASP requires a recursive non-convex sum. In fact, an ASP encoding
for this problem that does not rely on recursive sums is not available, and therefore
in this case the performance of the prototype was compared with an SMT
encoding fed into Z3. The other two problems considered in this experiment are
k-CliqueColoring and 2-QBF, Σ2p-complete problems whose natural encodings in ASP do not
rely on recursive sums. In these two cases, an alternative encoding using recursive sums
can be obtained, even if usually paying an overhead on the running time. The aim of
the experiment for these two problems is to evaluate such an overhead. All tested
instances are available at the following URL: http://archives.alviano.net/
publications/2015/RCRA2015-experiment.zip.</p>
      <p>The experiment was run on an Intel Xeon CPU 2.4 GHz with 16 GB of RAM. CPU
and memory usage were limited to 900 seconds and 15 GB, respectively. GRINGO,
CLASP, and Z3 were tested with their default settings. Their performances were
measured by PYRUNLIM (http://alviano.net/software/pyrunlim/). The
results are reported in Table 1, where each row reports the number of instances and, for
each tested ASP encoding, the number of solved instances, the average execution time
and the average memory consumption. Data for Z3 are not reported in the table because
it was run only on Generalized Subset Sum, discussed below.</p>
      <p>
        Generalized Subset Sum [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Two vectors u and v of integers as well as an integer b are
given, and the task is to decide whether the formula ∃x∀y(ux+vy 6= b) is true, where x
and y are vectors of binary variables of the same length as u and v, respectively. For an
instance such that u = u1, . . . , um (m ≥ 1) and v = v1, . . . , vn (n ≥ 1) the following
ASP encoding was tested (actually, its non-propositional version):
xi ← ∼∼xi ∀i ∈ [1..m]
yi ← unequal ∀i ∈ [1..n]
⊥ ← ∼unequal
unequal ← SUM[u1 : x1, . . . , um : xm, v1 : y1, . . . , vn : yn] 6= b
      </p>
      <p>As for Z3, the following SMT encoding was tested:
∀y1 · · · ∀yn( ite(x1, u1, 0) + · · · + ite(xm, um, 0) +</p>
      <p>
        ite(y1, v1, 0) + · · · + ite(yn, vn, 0) 6= b)
where x1, . . . , xm and y1, . . . , yn are Boolean constants and variables, respectively, and
ite(φ, t1, t2) is an if-then-else expression, i.e., its interpretation is t1 if φ is true, and t2
otherwise. As reported in the table, the ASP encoding leads to an excellent performance
in many cases, with 38 solved instances and an average execution time of around 1.1
seconds. The performance achieved within the SMT encoding is instead less attractive,
with only 14 solved instances and an average execution time of around 34.7 seconds.
The tested ASP solver is also more efficient in memory, using 44 MB on average, while
148 MB are used by Z3 to solve the SMT instances. The reason of such different
performances is that SMT is a more expressive language, allowing arbitrary alternations of
quantifies, while in ASP at most one alternation can be simulated by means of
saturation techniques. It turns out that ASP solvers can implement more optimized algorithms
for problems on the second level of the polynomial hierarchy.
k-Clique-Coloring [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ]. Given a graph G = (V, E) with n nodes, and an integer k ≥ 2,
is possible to assign k colors to vertices in V such that each maximal clique K of G
contains two vertices of different colors? The tested encoding using non-convex sums
is reported below (again, its non-propositional version was actually tested).
xc ← ∼∼xc
⊥ ← SUM[1 : x1, . . . , 1 : xk] 6= 1.
⊥ ← ∼saturate
inx ∨ out x ←
inx ← saturate
out x ← saturate
saturate ← inx, iny
saturate ← inx, iny, xc, yd
saturate ← out x, SUM[n : saturate,
− 1 : iny1 , . . . , −1 : inyn−1 ,
1 : inz1 , . . . , 1 : inzj ] ≥ 0
∀x ∈ V, ∀c ∈ [1..k]
∀x ∈ V
∀x ∈ V
∀x ∈ V
∀x ∈ V
∀x, y ∈ V, x 6= y, (x, y) ∈/ E
∀x, y ∈ V, ∀c, d ∈ [1..k], c 6= d
∀x ∈ V, where
{y1, . . . , yn−1} = V \ {x},
{z1, . . . , zj } = {z | (x, z) ∈ E}
Intuitively, a color is assigned to each vertex, and the saturation is activated whenever
one of the following conditions is verified:
– the guessed K contains two non-adjacent nodes, i.e., K is not a clique;
– the guessed K contains two nodes with different colors;
– there is a vertex x ∈ V \ K such that x is adjacent to all vertices in K, i.e., K is
not a maximal clique.
      </p>
      <p>The alternative encoding not using recursive sums is obtained by replacing the last rule
above with the following rule:
saturate ← out x, out y1 , . . . , out yj</p>
      <p>∀x ∈ V
where {y1, . . . , yj } = {y ∈ V \ {x} | (x, y) ∈/ E}. Intuitively, in this case the third
condition leading to saturate is the following:
– there is a vertex x ∈ V \ K such that all vertices in V that are not adjacent to x do
not belong to K, i.e., K is not a maximal clique.</p>
      <p>
        For this problem, both encodings lead to solve all tested instances, which are the graphs
submitted to the 4th ASP Competition [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for the Graph Coloring problem. However,
the overhead due to the use of recursive non-convex aggregates slows the computation
down by a factor of 8, and also the memory consumption is around 4 times higher.
2-QBF. Given a 2-DNF ∃x∀yφ, is the formula valid? The tested encoding not using
sums is the following:
x ← ∼∼x
⊥ ← ∼saturate
yT ∨ yF ←
yT ← saturate
yF ← saturate
saturate ← μ(l1), . . . , μ(ln)
∀x ∈ x
∀y ∈ y
∀y ∈ y
∀y ∈ y
∀l1 ∧ · · · ∧ ln ∈ φ, n ≥ 1
where μ(x) = x and μ(¬x) = ∼x for all x ∈ x, and μ(y) = yT and μ(¬y) = yF for
all y ∈ y. An equivalent encoding using non-convex sums can be obtained by replacing
all rules with yT or yF in the head with the following rules:
yT
yF
← SUM[1 : saturate, −1 : yF ] ≥ 0
← SUM[1 : saturate, −1 : yT ] ≥ 0
∀y ∈ y
∀y ∈ y
The tested instances are all the 2-QBF instances in the QBF Gallery 2014 (http:
//qbf.satisfiability.org/gallery/results.html). Also in this case
there is an overhead due to the unnatural use of non-convex sums. It impacts
significantly on the Application Track, where the difference in terms of solved instances is 6.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Related Work</title>
      <p>
        F-stable model semantics [
        <xref ref-type="bibr" rid="ref14 ref17">14, 17</xref>
        ] is implemented by widely-used ASP solvers [
        <xref ref-type="bibr" rid="ref15 ref20">15, 20</xref>
        ].
The original definition in [
        <xref ref-type="bibr" rid="ref14 ref17">14, 17</xref>
        ] is slightly different than the one provided in
Section 2. In fact, propositional formulas can be arbitrarily nested in [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], while a more
constrained structure is assumed in this paper in order to achieve an efficient
implementation. On the other hand, double negation is not permitted in [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], even if it can be
simulated by means of auxiliary atoms: a rule p ← ∼∼p can be equivalently encoded
by using a fresh atom pF and the following subprogram: {p ← ∼pF , pF ← ∼p}.
Similarly, negated literals cannot occur in the aggregates considered by [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] but again
can must be encoded by means of auxiliary atoms. Another difference with [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] is on
negated aggregates, which are not permitted by the language considered in this paper
because [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] and [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] actually assign different semantics to programs with negated
aggregates. As a final remark, the reduct of [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] does not remove negated literals from
satisfied bodies, which however are necessarily true in all counter-models because
double negation is not allowed.
      </p>
      <p>
        Techniques to rewrite logic programs with aggregates into equivalent programs with
simpler aggregates were investigated in the literature right from the beginning [
        <xref ref-type="bibr" rid="ref32">32</xref>
        ]. In
particular, rewritings into LPARSE-like programs, which differ from those presented in
this paper, were considered in [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ]. As a general comment, since disjunction is not
considered in [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ], all aggregates causing a jump from the first to the second level of
the polynomial hierarchy are excluded a priori. This is the case for aggregates of the
form SUM(S) 6= b, AVG(S) 6= b, and COUNT(S) 6= b, as first noted by [
        <xref ref-type="bibr" rid="ref33">33</xref>
        ], but also for
comparators other than 6= when negative weights are involved. In fact, in [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] negative
weights are eliminated by a rewriting similar to the one in (4), but negated literals
are introduced instead of auxiliary atoms, which may lead to unintuitive results [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ].
A different rewriting was presented by [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], whose output are programs with nested
expressions, a construct that is not supported by current ASP systems. Other relevant
rewriting techniques were proposed in [
        <xref ref-type="bibr" rid="ref7 ref8">8, 7</xref>
        ], and proved to be quite efficient in practice.
However, these rewritings produce aggregate-free programs preserving F-stable models
only in the stratified case, or if recursion is limited to convex aggregates. On the other
hand, it is interesting to observe that the rewritings of [
        <xref ref-type="bibr" rid="ref7 ref8">8, 7</xref>
        ] are applicable to the output
of the rewritings presented in this paper in order to completely eliminate aggregates,
thus preserving F-stable models in general.
      </p>
      <p>
        Several other stable model semantics were proposed for interpreting logic programs
with aggregates. Many of these semantics rely on stability checks that are not based
on minimality [
        <xref ref-type="bibr" rid="ref30 ref31 ref33">30, 31, 33</xref>
        ], and therefore the rewritings presented by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and recalled
in Section 3 cannot be used for these semantics. A more recent proposal is based on
a stability check that essentially eliminates aggregates from program reducts [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ], and
therefore the rewritings by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] cannot help also in this case. Finally, there are other ASP
constructs that are semantically close to aggregates, such as DL [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] and HEX [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]
atoms, for interacting with external knowledge bases possibly expressed in different
languages; as these constructs cannot be compactly reduced to sums in general, the
rewritings by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] do not apply to these languages as well.
7
      </p>
    </sec>
    <sec id="sec-7">
      <title>Conclusion</title>
      <p>
        ASP takes advantage of several constructs to ease the representation of complex
knowledge. Aggregation functions are among the most commonly used constructs in ASP
specifications. The rewritings proposed by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] provide a concrete simplification of the
structure of aggregations in input programs, so to improve the efficiency of low-level
reasoners. Such rewritings are implemented in a prototype system, presented in this
paper, which reported a reasonable performance on benchmarks for which more
tailored encodings using disjunction in rule heads exist. More relevant, when such an
aggregate-free encoding is unknown or untuitive, for example in the Generalized
Subset Sum problem, the rewritings implemented in the prototype are particularly useful.
Indeed, in this specific benchmark ASP solving significantly outperforms an alternative
encoding in the more expressive language of SMT.
      </p>
      <p>
        It must be remarked that this is only a preliminary evaluation of recursive
nonconvex aggregates in ASP. For the future, we plan to collect more encodings for
problems that can be easily represented by using recursive non-convex aggregates, so to
obtain a more suitable test suite for evaluating the efficiency of ASP solvers in
presence of aggregations of this kind. Moreover, we will investigate alternative mappings
of common aggregation functions into sums, with the aim of simplifying some of the
rewritings by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. In particular, concerning ODD and EVEN, the rewritings by [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] are
quadratic in size, and hence an interesting question to answer is whether there exist
alternative rewritings of these aggregations whose sizes remain linear.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Abseher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bliem</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Charwat</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dusberger</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Woltran</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Computing secure sets in graphs using answer set programming</article-title>
          .
          <source>In: Inclezan</source>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Maratea</surname>
          </string-name>
          , M. (eds.)
          <source>Seventh International Workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP</source>
          <year>2014</year>
          )
          <article-title>(</article-title>
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Alviano</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Calimeri</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Charwat</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dao-Tran</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dodaro</surname>
            ,
            <given-names>C.</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>Kronegger</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Oetsch</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pfandler</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , P u¨hrer, J.,
          <string-name>
            <surname>Redl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ricca</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schneider</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schwengerer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Spendier</surname>
            ,
            <given-names>L.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wallner</surname>
            ,
            <given-names>J.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xiao</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>The fourth answer set programming competition: Preliminary report</article-title>
          . In: Cabalar,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Son</surname>
          </string-name>
          , T.C. (eds.) LPNMR. pp.
          <fpage>42</fpage>
          -
          <lpage>53</lpage>
          . LNCS (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Alviano</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faber</surname>
            ,
            <given-names>W.:</given-names>
          </string-name>
          <article-title>The complexity boundary of answer set programming with generalized atoms under the FLP semantics</article-title>
          . In: Cabalar,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Son</surname>
          </string-name>
          , T.C. (eds.)
          <source>Logic Programming and Nonmonotonic Reasoning</source>
          , 12th International Conference, LPNMR 2013, Corunna, Spain,
          <source>September 15-19</source>
          ,
          <year>2013</year>
          .
          <source>Proceedings. Lecture Notes in Computer Science</source>
          , vol.
          <volume>8148</volume>
          , pp.
          <fpage>67</fpage>
          -
          <lpage>72</lpage>
          . Springer (
          <year>2013</year>
          ), http://dx.doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -40564-
          <issue>8</issue>
          _
          <fpage>7</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Alviano</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faber</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gebser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Rewriting recursive aggregates in answer set programming: back to monotonicity</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          (
          <year>2015</year>
          ), to appear
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Bartholomew</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meng</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>First-order semantics of aggregates in answer set programming via modified circumscription</article-title>
          .
          <source>In: Logical Formalizations of Commonsense Reasoning, Papers from the 2011 AAAI Spring Symposium</source>
          ,
          <source>Technical Report SS-11-06</source>
          , Stanford, California, USA, March
          <volume>21</volume>
          -23,
          <year>2011</year>
          . AAAI (
          <year>2011</year>
          ), http://www.aaai.org/ ocs/index.php/SSS/SSS11/paper/view/2472
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Berman</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Karpinski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Larmore</surname>
            ,
            <given-names>L.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Plandowski</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rytter</surname>
          </string-name>
          , W.:
          <article-title>On the complexity of pattern matching for highly compressed two-dimensional texts</article-title>
          .
          <source>J. Comput. Syst. Sci</source>
          .
          <volume>65</volume>
          (
          <issue>2</issue>
          ),
          <fpage>332</fpage>
          -
          <lpage>350</lpage>
          (
          <year>2002</year>
          ), http://dx.doi.org/10.1006/jcss.
          <year>2002</year>
          .1852
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Bomanson</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gebser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Janhunen</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Improving the normalization of weight rules in answer set programs</article-title>
          . In: Ferme´,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Leite</surname>
          </string-name>
          ,
          <string-name>
            <surname>J</surname>
          </string-name>
          . (eds.)
          <source>JELIA</source>
          <year>2014</year>
          , Funchal, Madeira, Portugal,
          <source>September 24-26</source>
          ,
          <year>2014</year>
          .
          <source>Proceedings. Lecture Notes in Computer Science</source>
          , vol.
          <volume>8761</volume>
          , pp.
          <fpage>166</fpage>
          -
          <lpage>180</lpage>
          . Springer (
          <year>2014</year>
          ), http://dx.doi.org/10.1007/ 978-3-
          <fpage>319</fpage>
          -11558-0_
          <fpage>12</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Bomanson</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Janhunen</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Normalizing cardinality rules using merging and sorting constructions</article-title>
          .
          <source>Lecture Notes in Computer Science</source>
          , vol.
          <volume>8148</volume>
          , pp.
          <fpage>187</fpage>
          -
          <lpage>199</lpage>
          . Springer (
          <year>2013</year>
          ), http://dx.doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -40564-8_
          <fpage>19</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <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>
          ),
          <fpage>92</fpage>
          -
          <lpage>103</lpage>
          (
          <year>2011</year>
          ), http://doi.acm.
          <source>org/10</source>
          .1145/2043174. 2043195
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tompits</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Woltran</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>On solution correspondences in answer set programming</article-title>
          . In: Kaelbling,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Saffiotti</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of the Nineteenth International Joint Conference on Artificial Intelligence (IJCAI'05)</source>
          . pp.
          <fpage>97</fpage>
          -
          <lpage>102</lpage>
          . Professional Book Center (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <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>Krennwallner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Redl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Conflict-driven ASP solving with external sources</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>12</volume>
          (
          <issue>4-5</issue>
          ),
          <fpage>659</fpage>
          -
          <lpage>679</lpage>
          (
          <year>2012</year>
          ), http:// dx.doi.org/10.1017/S1471068412000233
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <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>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>Efficient hex-program evaluation based on unfounded sets</article-title>
          .
          <source>J. Artif. Intell. Res. (JAIR) 49</source>
          ,
          <fpage>269</fpage>
          -
          <lpage>321</lpage>
          (
          <year>2014</year>
          ), http://dx. doi.org/10.1613/jair.4175
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ianni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lukasiewicz</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schindlauer</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tompits</surname>
          </string-name>
          , H.:
          <article-title>Combining answer set programming with description logics for the semantic web</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>172</volume>
          (
          <issue>12</issue>
          -
          <fpage>13</fpage>
          ),
          <fpage>1495</fpage>
          -
          <lpage>1539</lpage>
          (
          <year>2008</year>
          ), http://dx.doi.org/10.1016/j.artint.
          <year>2008</year>
          .
          <volume>04</volume>
          .002
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Faber</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pfeifer</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leone</surname>
          </string-name>
          , N.:
          <article-title>Semantics and complexity of recursive aggregates in answer set programming</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>175</volume>
          (
          <issue>1</issue>
          ),
          <fpage>278</fpage>
          -
          <lpage>298</lpage>
          (
          <year>2011</year>
          ), http://dx.doi.org/10. 1016/j.artint.
          <year>2010</year>
          .
          <volume>04</volume>
          .002
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Faber</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pfeifer</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leone</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dell'Armi</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ielpa</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Design and implementation of aggregate functions in the DLV system</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>8</volume>
          (
          <issue>5-6</issue>
          ),
          <fpage>545</fpage>
          -
          <lpage>580</lpage>
          (
          <year>2008</year>
          ), http://dx.doi.org/10.1017/S1471068408003323
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Ferraris</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Answer sets for propositional theories</article-title>
          . In: Baral,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Greco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Leone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            ,
            <surname>Terracina</surname>
          </string-name>
          ,
          <string-name>
            <surname>G</surname>
          </string-name>
          . (eds.)
          <source>Proceedings of the Eighth International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR'05). Lecture Notes in Artificial Intelligence</source>
          , vol.
          <volume>3662</volume>
          , pp.
          <fpage>119</fpage>
          -
          <lpage>131</lpage>
          . Springer-Verlag (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Ferraris</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Logic programs with propositional connectives and aggregates</article-title>
          .
          <source>ACM Trans. Comput. Log</source>
          .
          <volume>12</volume>
          (
          <issue>4</issue>
          ),
          <volume>25</volume>
          (
          <year>2011</year>
          ), http://doi.acm.
          <source>org/10</source>
          .1145/1970398. 1970401
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Ferraris</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lifschitz</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Weight constraints as nested expressions</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>5</volume>
          (
          <issue>1-2</issue>
          ),
          <fpage>45</fpage>
          -
          <lpage>74</lpage>
          (
          <year>2005</year>
          ), http://dx.doi.org/10.1017/ S1471068403001923
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Gebser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaminski</surname>
            , R., K o¨nig,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schaub</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Advances in gringo series 3</article-title>
          . In: Delgrande,
          <string-name>
            <given-names>J.P.</given-names>
            ,
            <surname>Faber</surname>
          </string-name>
          , W. (eds.)
          <source>LPNMR</source>
          <year>2011</year>
          , Vancouver, Canada, May
          <volume>16</volume>
          -19,
          <year>2011</year>
          .
          <source>Proceedings. Lecture Notes in Computer Science</source>
          , vol.
          <volume>6645</volume>
          , pp.
          <fpage>345</fpage>
          -
          <lpage>351</lpage>
          . Springer (
          <year>2011</year>
          ), http:// dx.doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -20895-9_
          <fpage>39</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Gebser</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaufmann</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schaub</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Conflict-driven answer set solving: From theory to practice</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>187</volume>
          ,
          <fpage>52</fpage>
          -
          <lpage>89</lpage>
          (
          <year>2012</year>
          ), http://dx.doi.org/10.1016/j. artint.
          <year>2012</year>
          .
          <volume>04</volume>
          .001
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lifschitz</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>The stable model semantics for logic programming</article-title>
          . In: Kowalski,
          <string-name>
            <given-names>R.A.</given-names>
            ,
            <surname>Bowen</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.A</surname>
          </string-name>
          . (eds.)
          <article-title>Logic Programming</article-title>
          ,
          <source>Proceedings of the Fifth International Conference and Symposium</source>
          , Seattle, Washington,
          <source>August 15-19</source>
          ,
          <year>1988</year>
          (
          <article-title>2 Volumes)</article-title>
          . pp.
          <fpage>1070</fpage>
          -
          <lpage>1080</lpage>
          . MIT Press (
          <year>1988</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lifschitz</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Classical negation in logic programs</article-title>
          and disjunctive databases.
          <source>New Generation Comput</source>
          .
          <volume>9</volume>
          (
          <issue>3</issue>
          /4),
          <fpage>365</fpage>
          -
          <lpage>386</lpage>
          (
          <year>1991</year>
          ), http://dx.doi.org/10.1007/ BF03037169
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Gelfond</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhang</surname>
          </string-name>
          , Y.:
          <article-title>Vicious circle principle and logic programs with aggregates</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>14</volume>
          (
          <issue>4-5</issue>
          ),
          <fpage>587</fpage>
          -
          <lpage>601</lpage>
          (
          <year>2014</year>
          ), http://dx.doi.org/ 10.1017/S1471068414000222
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Janhunen</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , Niemela¨,
          <string-name>
            <surname>I.</surname>
          </string-name>
          :
          <article-title>Applying visible strong equivalence in answer-set program transformations</article-title>
          . In: Erdem,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Lierler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Pearce</surname>
          </string-name>
          ,
          <string-name>
            <surname>D</surname>
          </string-name>
          . (eds.)
          <source>Correct Reasoning: Essays on Logic-Based AI in Honour of Vladimir Lifschitz. Lecture Notes in Computer Science</source>
          , vol.
          <volume>7265</volume>
          , pp.
          <fpage>363</fpage>
          -
          <lpage>379</lpage>
          . Springer-Verlag (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>Lifschitz</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pearce</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valverde</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Strongly equivalent logic programs</article-title>
          .
          <source>ACM Transactions on Computational Logic</source>
          <volume>2</volume>
          (
          <issue>4</issue>
          ),
          <fpage>526</fpage>
          -
          <lpage>541</lpage>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>You</surname>
          </string-name>
          , J.:
          <article-title>Relating weight constraint and aggregate programs: Semantics and representation</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>13</volume>
          (
          <issue>1</issue>
          ),
          <fpage>1</fpage>
          -
          <lpage>31</lpage>
          (
          <year>2013</year>
          ), http://dx. doi.org/10.1017/S147106841100038X
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pontelli</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Son</surname>
            ,
            <given-names>T.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Truszczynski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Logic programs with abstract constraint atoms: The role of computations</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>174</volume>
          (
          <issue>3-4</issue>
          ),
          <fpage>295</fpage>
          -
          <lpage>315</lpage>
          (
          <year>2010</year>
          ), http://dx. doi.org/10.1016/j.artint.
          <year>2009</year>
          .
          <volume>11</volume>
          .016
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Truszczynski</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Properties and applications of programs with monotone and convex constraints</article-title>
          .
          <source>J. Artif. Intell. Res. (JAIR) 27</source>
          ,
          <fpage>299</fpage>
          -
          <lpage>334</lpage>
          (
          <year>2006</year>
          ), http://dx.doi.org/ 10.1613/jair.2009
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <surname>Marx</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Complexity of clique coloring and related problems</article-title>
          .
          <source>Theor. Comput. Sci</source>
          .
          <volume>412</volume>
          (
          <issue>29</issue>
          ),
          <fpage>3487</fpage>
          -
          <lpage>3500</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          30.
          <string-name>
            <surname>Pelov</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Denecker</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bruynooghe</surname>
          </string-name>
          , M.:
          <article-title>Well-founded and stable semantics of logic programs with aggregates</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>7</volume>
          (
          <issue>3</issue>
          ),
          <fpage>301</fpage>
          -
          <lpage>353</lpage>
          (
          <year>2007</year>
          ), http://dx.doi.org/10.1017/S1471068406002973
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          31.
          <string-name>
            <surname>Shen</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <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>Redl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krennwallner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Deng</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>FLP answer set semantics without circular justifications for general logic programs</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>213</volume>
          ,
          <fpage>1</fpage>
          -
          <lpage>41</lpage>
          (
          <year>2014</year>
          ), http://dx.doi.org/10.1016/j.artint.
          <year>2014</year>
          .
          <volume>05</volume>
          .001
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          32.
          <string-name>
            <surname>Simons</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , Niemela¨,
          <string-name>
            <given-names>I.</given-names>
            ,
            <surname>Soininen</surname>
          </string-name>
          ,
          <string-name>
            <surname>T.</surname>
          </string-name>
          :
          <article-title>Extending and implementing the stable model semantics</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>138</volume>
          (
          <issue>1-2</issue>
          ),
          <fpage>181</fpage>
          -
          <lpage>234</lpage>
          (
          <year>2002</year>
          ), http://dx.doi.org/10.1016/ S0004-
          <volume>3702</volume>
          (
          <issue>02</issue>
          )
          <fpage>00187</fpage>
          -X
        </mixed-citation>
      </ref>
      <ref id="ref33">
        <mixed-citation>
          33.
          <string-name>
            <surname>Son</surname>
            ,
            <given-names>T.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pontelli</surname>
          </string-name>
          , E.:
          <article-title>A constructive semantic characterization of aggregates in answer set programming</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>7</volume>
          (
          <issue>3</issue>
          ),
          <fpage>355</fpage>
          -
          <lpage>375</lpage>
          (
          <year>2007</year>
          ), http: //dx.doi.org/10.1017/S1471068406002936
        </mixed-citation>
      </ref>
      <ref id="ref34">
        <mixed-citation>
          34.
          <string-name>
            <surname>Turner</surname>
          </string-name>
          , H.:
          <article-title>Strong equivalence made easy: nested expressions and weight constraints</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>3</volume>
          (
          <issue>4-5</issue>
          ),
          <fpage>609</fpage>
          -
          <lpage>622</lpage>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>