<!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>Expressing and Supporting Eciently Greedy Algorithms as Locally Stratied Logic Programs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>CARLO ZANIOLO</string-name>
          <email>zaniolo@cs.ucla.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of California</institution>
          ,
          <addr-line>Los Angeles</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2015</year>
      </pub-date>
      <history>
        <date date-type="accepted">
          <day>5</day>
          <month>6</month>
          <year>2015</year>
        </date>
      </history>
      <abstract>
        <p>The problem of expressing and supporting classical greedy algorithms in Datalog has been the focus of many signicant research eorts that have produced very interesting solutions for particular algorithms. But we still lack a general treatment that characterizes the relationship of greedy algorithms to non-monotonic theories and leads to asymptotically optimal implementations. In this paper, we propose a general solution to this problem. Our approach begins by identifying a class of locally stratied programs that subsumes XY-stratied programs and is formally characterized using the Datalog 1S representation of numbers. Then, we propose a simple specialization of the iterated xpoint procedure that computes eciently the perfect model for these programs, achieving optimal asymptotic complexities for well-known greedy algorithms.This makes possible their ecient support in Datalog systems.</p>
      </abstract>
      <kwd-group>
        <kwd>Horn Clauses</kwd>
        <kwd>Datalog</kwd>
        <kwd>Aggregates</kwd>
        <kwd>Greedy Algorithms</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        Due to the emergence of many important application areas, we are now
experiencing a major resurgence of interest in Datalog for parallel and distributed
programming
        <xref ref-type="bibr" rid="ref1 ref13">(Hellerstein 2010; Abiteboul et al. 2011)</xref>
        <xref ref-type="bibr" rid="ref1 ref7">(Gottlob et al. 2011;
Abiteboul et al. 2011)</xref>
        . This include exploring parallel execution of recursive queries in
the MapReduce framework
        <xref ref-type="bibr" rid="ref2">(Afrati et al. 2011)</xref>
        and on multicore machines
        <xref ref-type="bibr" rid="ref23">(Yang
et al. 2015)</xref>
        , and in Data Stream Management Systems
        <xref ref-type="bibr" rid="ref24">(Zaniolo 2011)</xref>
        . The
abundance of new applications underscores the need to tackle and solve crucial Datalog
problems that have remained open for a long timstarting with algorithms that
require aggregates in recursive rules that provided the subject of much previous
work
        <xref ref-type="bibr" rid="ref10 ref14 ref17 ref18 ref21 ref26 ref9">(Zaniolo et al. 1997; Greco and Zaniolo 2001a; Mumick et al. 1990; Kolaitis
1991; Mumick and Shmueli 1995; Ross and Sagiv 1997)</xref>
        . In this context, a major
step forward was accomplished recently with the introduction of monotonic
aggregates
        <xref ref-type="bibr" rid="ref16 ref22">(Mazuran et al. 2013; Shkapsky et al. 2013)</xref>
        . Monotonic aggregates, however,
cannot address the problem of formulating and supporting eciently greedy
algorithms, a dicult challenge that provided the focus of much previous research,
including
        <xref ref-type="bibr" rid="ref10 ref11 ref8 ref9">(Greco et al. 1992; Greco and Zaniolo 1998; Greco and Zaniolo 2001b)</xref>
        .
Their work provided a stable-model characterization for specic greedy algorithms
but did not develop a general theory and ecient solutions for such programs. In
this paper, we achieve a general solution by showing that greedy algorithms can be
expressed quite naturally as locally stratied programs that are conducive to a very
ecient implementationi.e., one having the same asymptotic complexity as that
achievable using procedural languages and specialized data structures. This is a
very encouraging result, given that optimal performance is not easily achievable for
algorithms expressed in the concise and elegant formalism of declarative logic, i.e.,
without having to specify detailed operational steps and special data structures in
many pages of procedural code. Furthermore, many intractability results obtained
for locally stratied logic programs
        <xref ref-type="bibr" rid="ref19">(Palopoli 1992)</xref>
        underscore the diculty of
using them to express and support low-complexity algorithms. But in this paper we
show that there is a natural correspondence between greedy algorithm and a special
subclass of locally stratied programs, which we will call strictly stratied temporal
programs, that overcome these diculties.
      </p>
      <p>
        In the next section we recall the basic notions of local stratication, and
iterated xpoint, and then, in Section 3, we introduce a class of of programs that are
locally stratied by the temporal arguments of their predicates which subsumes
XY-stratied logic programs, and extend it by allowing more powerful logic
predicates expressing ‘ &gt;’ and ‘+’ primitives needed for greedy algorithms. In Section 4,
therefore we show that these extended programs can be expanded into equivalent
XY-stratied programs via simple rewritings dened by the arithmetic functions
they use. While this rewriting denes the formal semantics of our greedy programs,
the equivalent programs produced by the rewriting would be very inecient if
implemented with the standard approach used for XY-stratied programs in systems
such as LDL++
        <xref ref-type="bibr" rid="ref3">(Arni et al. 2003)</xref>
        and DeALS
        <xref ref-type="bibr" rid="ref22 ref23">(Shkapsky et al. 2013; Yang et al.
2015)</xref>
        . Therefore, we propose a modication of the Iterated Fixpoint computation
that solves this problem and actually achieves asymptotic optimality in the
implementation of many greedy algorithms, which are discussed in details in Section 5.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2 Local Stratication and Iterated Fixpoint Let us now recall the denition of local stratication for Datalog programs where rules have negated goals:</title>
      <p>Denition 1. A program P is locally stratied if it is possible to partition its
Herbrand base BP into a countable number of subsets, called strata, B0; B1; : : : ;
such that for every r 2 ground(P ) the stratum of the head of r is strictly higher
that the strata of its negated goals, and higher or equal to the strata of its positive
goals.</p>
      <p>
        Each locally stratied program has a unique stable model, called its perfect
model, whereby its abstract semantics has many desirable properties
        <xref ref-type="bibr" rid="ref20">(Przymusinski
1988)</xref>
        . Moreover, once the aforementioned stratication B0; B1; : : : is known for a
program P , then the Iterated Fixpoint procedure can be used to compute the perfect
model of P . The iterated xpoint can be dened using the immediate-consequence
operator for the rules in ground(P ) whose head is in stratum BK : let TK denote
the immediate consequence operator for instantiated rules belonging to the K-th
stratum. and let TK denote he inationary version to this operator dened as
TK (I) =TK (I) [ I.
      </p>
      <p>Then the iterated computation on our locally stratied program P is performed
by starting from M0 = T0"!(;) and then continuing with MK+1 = T"K!(MK ).</p>
      <p>
        While the iterated xpoint procedure seems to provide an ecient operational
semantics for computing of the perfect model for locally stratied program, in
reality this is not the case, because of a number of problems, including the fact that
the existence of local stratication for a given program represents an undecidable
question
        <xref ref-type="bibr" rid="ref19">(Palopoli 1992)</xref>
        .
      </p>
      <p>To address these problems we will introduce the notion of programs that are
locally stratied by the positive numbers that appear in a distinguished argument of
their predicates, that we call temporal argument. Thus, we propose simple syntactic
conditions that assures that (i) a local stratication exists and (ii) the actual strata
are identied quite easily. We then turn to the issue of improving the eciency
of the iterated xpoint procedure, by basically skipping over the computation of
strata that do not produce any useful result. We will thus identify simple
syntactic conditions that make this optimization possible, and we will show that greedy
algorithms are naturally expressed under this restricted syntax, producing
declarative Datalog programs that preserve the desirable complexity properties of their
procedural counterparts.</p>
      <sec id="sec-2-1">
        <title>3 Temporally Stratied Datalog 1S Programs</title>
        <p>
          Let us consider Datalog programs where the rst argument is a non-negative integer
represented by the successor notation: 0; s(0); s(1); : : : ; sn(0) described in
          <xref ref-type="bibr" rid="ref6">(Chomicki
and Imielinski 1988)</xref>
          . These are known as Datalog 1S programs, and have been
studied extensively in
          <xref ref-type="bibr" rid="ref5">(Chomicki 1990)</xref>
          , where the authors called the 1S argument the
temporal argument, a naming convention that we will also follow in this paper. For
example consider the following program:
Example 1 (A Datalog1S program dening all even positive integers. )
int(even; 0):
int(even; s(J))
:int(even; J):
        </p>
        <p>Thus the temporal argument in our int predicate is the last one, where a positive
integer n is represented by n applications of the function symbol s to zero. We will
use the short-hand sn(X) to denote the application of s to X repeated n times
s(s(: : : s(X) : : :)).</p>
        <p>Thus the Herbrand universe for the above program is fsn(0); sn(even)g where n
denotes an arbitrary non-negative integer (under the convention that s0(X) = X,
and thus s0(even) = even).</p>
        <p>Now, let P be a Datalog1S program, then the temporal layering of P is the one
obtained by assigning each atom in its Herbrand Base BP to the layer n whenever
the last argument of the atom is sn(c), with c an arbitrary constant. For instance
the temporal layering of the above program in Example 1 is as follows:
Layer
0: int(sn(0); 0);
int(sn(even); 0);
int(sn(0); even);
int(sn(even); even)
1: int(sn(0); s(0)); int(sn(even); s(0)); int(sn(0); s(even)); int(sn(even); s(even))
: : :
k: int(sn(0); sk(0)); int(sn(even); sk(0)); int(sn(0); sk(even)); int(sn(even); sk(even))
We will focus on programs that are locally stratied according to their temporal
layering:
Denition 2 A Datalog1S program P will be said to be temporally stratied if P
is locally stratied according to its temporal layering.</p>
        <p>Thus the program in Example 1 is temporally stratied. However, the program
in Example 2, below, it is not locally stratied, although it has the same Herbrand
base, and can be assigned the same temporal layering as Example 1:
Example 2 (A Temporally Layered Program that is not locally stratied )
int(even; 0):
int(even; J)
:int(even; s(J)):
The simple programs so far considered only use one predicate, but to express
powerful algorithms we need to consider programs featuring several predicates within
each given layer. For these programs, deciding whether they are locally stratied,
and determining the perfect model for those that are stratied, can be quite
challenging in general. A solution is however at hand for the large class of such problems
that satises the notion of XY-stratication discussed next.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4 XY-Stratied Programs</title>
      <p>
        Temporally stratied programs have been explored in the past. In particular,
        <xref ref-type="bibr" rid="ref25">(Zaniolo et al. 1993)</xref>
        introduced XY-stratied programs that are eciently supported in
LDL++ and DeALS
        <xref ref-type="bibr" rid="ref22">(Shkapsky et al. 2013)</xref>
        ,
        <xref ref-type="bibr" rid="ref23">(Yang et al. 2015)</xref>
        and were also used in
a number of advanced applications
        <xref ref-type="bibr" rid="ref12">(Guzzo and Sacc 2005)</xref>
        ,
        <xref ref-type="bibr" rid="ref4">(Borkar et al. 2012)</xref>
        . A
generalized version of XY-stratication, called explicitly stratied logic programs
        <xref ref-type="bibr" rid="ref15">(Lausen et al. 1998)</xref>
        , was then used to model active rules and other interesting
applications. Take for instance the transitive closure prgram for a graph:
Example 3 (Transitive Closure expressed in Datalog )
cl(X; Z)
cl(X; Z)
arc(X; Z):
cl(X; Y); arc(Y; Z):
      </p>
      <p>The dierential xpoint (a.k.a. seminaive xpoint) of this program can be
expressed by the following program, where dcl is the delta version of cl.
Example 4 (Dierential rules used in computing the transitive closure of
arc)
dcl(X; Z; 0)
dcl(X; Z; J1)
arc(X; Z):
dcl(X; Y; J); arc(Y; Z); J1 = J+1; :previous(X; Z; J):
previous(X; Z; J1)</p>
      <p>
        dcl(X; Z; J); J &lt; J1:
The above program is a Datalog 1S program expressed by a slightly dierent notation
        <xref ref-type="bibr" rid="ref5">(Chomicki 1990)</xref>
        . In fact, instead of representing the successor of integer J by s(J),
we represent it here by J+1 where +1 is a postx function symbol. Therefore,
we can easily conclude that the program above is temporally layered by the last
argument (i.e., J and J1) in our predicates. However we cannot conclude that the
resulting program is locally stratied, because the denition of ground(P ) does not
prevent us from instantiating J &lt; J1 to values where J is actually larger than J1.
This problem can be solved by a simple rewriting of the rules to explicitly dene &gt;
using the past values of dcl kept in lower strata, which we will write as hdcl (for
historical dcl).
      </p>
      <p>Example 5 (Dierential rules used in computing the transitive closure of
dcl(X; Z; 0) arc(X; Z):
dcl(X; Z; J1) dcl(X; Y; J); arc(Y; Z); J1 = J+1; :hdcl(X; Z; J):
hdcl(X; Z; J) dcl(X; Z; J):
hdcl(X; Z; J1) hdcl(X; Z; J); J1 = J+1</p>
      <p>
        The resulting program is temporally stratied, i.e., locally stratied by the
temporal layering established by the last argument of its recursive predicates. Observe
that in the program above we only have two kinds of temporal arguments: J and
J+1 = J1, i.e., a variable and its immediate successors. For these programs there
is a simple test that allows us to determine if they are locally stratied. This is the
XY-stratication test that is performed by renaming the predicates in the recursive
rules that have a temporal argument, as follows: in each rule r rename with the
sux ‘_ old’ the goals having as temporal argument J when the temporal argument
in the head of r is J1 = J + 1. The program so obtained is called the bi-state version
of the original program. Then, a program P is said to be XY-stratied when its
bi-state version is stratied. XY-stratied programs are locally stratied and their
perfect model can be eciently computed using their bi-state version
        <xref ref-type="bibr" rid="ref25">(Zaniolo et al.
1993)</xref>
        . For instance, the bi-state version of the program in Example 5 is as follows:
      </p>
    </sec>
    <sec id="sec-4">
      <title>Example 6 (The Bistate Version of Example 5 )</title>
      <p>dcl(X; Z; 0) arc(X; Z):
dcl(X; Z; J1) dcl(X; Y; J); arc(Y; Z); J1 = J+1; :hdcl_old(X; Z; J):
hdcl(X; Z; J) dcl(X; Z; J):
hdcl(X; Z; J1) hdcl_old(X; Z; J); J1 = J+1:
We have obtained a program that is stratied (e.g., with the following strata: 1:{arc},
2:{dcl_old, hdcl_old}, 3:{dcl}, 4:{ hdcl}).</p>
      <p>
        Therefore, XY-stratication provides a simple test to verify that temporally
layered programs are locally stratied and thus temporally stratied. As proven in
        <xref ref-type="bibr" rid="ref25">(Zaniolo et al. 1993)</xref>
        , the perfect model of these programs can be computed as
follows (for clarity we refer to predicates without the sux ‘_ old’ as ‘new’):
Perfect Model Computation for XY-stratied Programs:
(i) use the bistate program to derive the values for the new predicates, and
(ii) re-initializing the values of the ‘_ old’ predicates with those of the
predicates just computed, and then the values of the ‘new’ predicates.
      </p>
      <p>These steps repeated until (i) stops producing new tuples, construct the perfect
model for our XY-stratied (and therefore temporally stratied) program. This
basic procedure delivers good performance on many simple problems including the
seminaive computation of the least xpoint of Example 2, above, but a more
sophisticated approach is needed to achieve optimal performance for logic programs
expressing greedy algorithms, since these are considerably more complex.</p>
      <p>To simplify the expression, and also the compilation, of greedy algorithm, we will
introduce the notation not(: : :). Thus, Example 4 can be re-expressed as follows:</p>
      <sec id="sec-4-1">
        <title>Example 7 (Example 4 re-expressed using not( ) )</title>
        <p>dcl(X; Z; 0) arc(X; Z):
dtrcl(X; Z; J1) dcl(X; Y; J); arc(Y; Z); J1 = J+1;</p>
        <p>not(dcl(X; Z; K); K &lt; J):
In general, a program with a goal ‘ not(condition)’ should be viewed as the
shorthand of the program derived by (i) replacing ‘ not(condition)’ with :newp(SVlist),
(where SVlist denotes the variables shared between condition and the rest of the
rule), and (ii) adding the rule: newp(SVlist) condition:</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5 Greedy Algorithms</title>
      <p>Suppose now that warc(X; Z; W) describes a directed graph where W is the positive
weight of the arc from X to Z. For now, let us assume that all such weights are
integers. Then, a greedy algorithm to nd the shortest path between node pairs is
as follows:
Example 8 (A greedy algorithm to nd shortest paths between node pairs )
wtc(X; Z; W) warc(X; Z; W):
wtc(X; Z; Cz) wtc(X; Y; Cy); not(wtc(X; _; C); C &lt; Cy);</p>
      <p>warc(Y; Z; W); Cz = Cy + W:
Thus in the recursive rule, we use the not construct to nd the shortest distance
Cy from a node X to a node Y and, for each arc in warc(Y; Z; W), we add a path from
X to Z of length Cz = Cy + W. Our objective is to re-express this as an equivalent
XY-stratied program. In order to do that, we will re-write the program into the
following one, where we re-express ‘+’ using the successor logic of Datalog 1S.
Example 9 (A temporally stratied program to nd shortest paths between node pairs
)
wtc(X; Z; W)
succadd(X; Y; W; C1)
succadd(X; Y; W; C1)
wtc(X; Z; Cz)
warc(X; Z; W):
wtc(X; Y; Cy); not(wtc(X; _; C); C &lt; Cy);
warc(Y; Z; W1); W = W1 + 1; C1 = Cy + 1:
succadd(X; Y; W + 1; C); C1 = C + 1:
succadd(X; Y; 0; Cz):
Thus recursive succadd rule expresses ‘+’ by raising by 1 the value of Cy while
replacing W + 1 with W until this becomes zero: at this point the addition has been
completed, whereby Cz is the distance of Z from X. We can now expand the not(:::)
goal, and nally verify that the resulting program is XY-stratied, by the rst goals
in the second and third rule as wtc_old and succadd_old, respectively. For the
rules resulting from the expansion of not(:::) we proceed as in Example 4. Then
we obtain a bistate program which is stratied: therefore the original program in
Example 9 is XY-stratied and thus temporally stratied.</p>
      <p>A program such as that in Example 9, where the rewriting of its &lt;; +, and not
goals produce a temporally stratied programs will be called an Implicit Temporally
Stratied (ITS) program. Now, many programs expressing greedy algorithms can be
transformed into XY-stratied programs that provide a formal semantics for such
programs, since these are known to be locally stratied. The perfect model for these
programs can also be computed using the standard bistate based computation of
XY-stratied programs, but as discussed next, this computation would fail to deliver
optimal performance for the program in Example 9 and other greedy programs.</p>
      <p>The obvious problem with the standard bistate-based computation of the
program in Example 9 is that in order to derive Cz = Cy + W, we go through the
computation of the W 1 temporal strata that take us from Cy to Cz, even though
no new wtc value might be produced in step (i) and in step (ii) of the Perfect
Model Computation for XY-stratied programs discussed on page 5. In order to
bypass this sequence, we might consider jumping directly to stratum with
temporal argument Cz, but that might not be correct, since the same rule that has now
produced Cz might have previously produced a value C0z, Cy &lt; C0z &lt; Cz, which
must be considered before Cz. The solution to this problem is obvious: (1) we store
the value Cz produced by the second rule into a priority queue (PQ) and then (2)
we fetch (and remove) the least value from PQ, and use it as the next value of
the temporal argument. Needless to say, our PQ is exactly the data structure used
in Dijkstra’s shortest path algorithm and other greedy algorithms. Thus we can
achieve an optimal computation of our greedy algorithms by simply replacing the
+1 successor operation with a PQ store+fetch operation.</p>
      <p>This PQ optimization however it is is not applicable to all temporally stratied
programs and in particular to Example 1, due to the fact that the only goal in
its rules is a negated goal. To avoid this potential problem we now introduce the
notion of Strict Implicit Temporally Stratied (SITS) that assures the applicability
of the PQ optimization.</p>
      <p>Denition 3 An ITS program will be said to be strict when every rule containing
negated goals also contains some positive goal which has a temporal argument that
is than the temporal argument of every negated goal.</p>
      <p>Thus this condition excludes the program in Example 1, and also disallows the
following rule that satises the standard notion of implicit temporal stratication:
wtc(X; Z; Cz) wtc(X; Y; Cy); arc(Y; Z; W); Cz = Cy + W;</p>
      <p>not(wtc(X; _; C); C &lt; Cz):
The problem with this rule is that it oers no assurance that Cy C. A rule
like the one above is no problem for the iterated xpoint procedure that visits
every successive value of the temporal argument, but it cannot be supported in a
computation that jumps from the current temporal argument to the next temporal
value extracted from PQ. However teh strictness condition solves this problem and
maket it possible to use the following computation:</p>
    </sec>
    <sec id="sec-6">
      <title>Algorithm 1</title>
      <p>Computation of Perfect Model for SITS Programs
1: Initialize the priority queue (PQ) to empty.
2: Let M := T0"!(;)
3: Add the values of temporal arguments generated in step 2 to PQ.
4: Repeat the following three steps until PQ becomes empty:
5: Remove the least temporal argument K from (PQ) and
6: Let M := T"K!(M ).</p>
      <p>7: Add the values of the newly generated temporal arguments to PQ.</p>
      <p>Thefore, SITS programs can be computed eciently by a simple optimization of
the iterated xpoint algorithm that consists of skipping over unproductive values
of temporal arguments:</p>
    </sec>
    <sec id="sec-7">
      <title>5.1 Beyond Integers</title>
      <p>
        In our discussion so far, we have assumed that temporal arguments are positive
integers, but our treatment of greedy algorithms generalizes to the case in which
we have arbitrary positive numbers, not just integers, whereby arbitrary positive
weights can, e.g., be used as arc weights in our graphs. This conclusion follows
from the argument presented in
        <xref ref-type="bibr" rid="ref16">(Mazuran et al. 2013)</xref>
        where it was observed that
non-integers could be represented as rational numbers sharing a common very large
denominator D whereby all computations can be emulated by integer arithmetics on
their numerators. Now the standard mantissa+exponent internal representation of
real and oating-point numbers, that is used in modern hardware/rmware, does
exactly thatmodulo some round-o. For instance, for a decimal oating point.
the smallest value of exponent supported might be 95 (or smaller), whereby every
number can be viewed as the numerator over the denominator D = 1095. (For
simplicity, we have used a decimal base, but the same conclusions hold for other bases.)
Naturally, precision is limited by the fact that the mantissa is of nite length, and
thus, e.g., the operation of addition becomes a rounded-o addition. Rounded-o
addition can also be easily expressed in Datalog 1S whereby the expanded resulting
program is still XY-stratied, and the overall formal semantics remains valid. Of
course, round-o is also a concern at the operational semantics level, where it can
be addressed by the use of double precision and other techniques used when
algorithms are expressed in procedural languages. Once he/she selects single or double
precision, our user is assured an ecient excution for greedy algorithms owing to
the fact that the implementation will not step through each successive oating point
number, but jumps directly the next number in the PQ.
      </p>
      <p>
        Using oating-point numbers and real arithmetic, we can now express a
cornucopia of greedy algorithms, starting with the single-source Dijkstra algorithm shown
below.
Since, ecient Datalog implementations, such as DeALS
        <xref ref-type="bibr" rid="ref22">(Shkapsky et al. 2013)</xref>
        ,
use Hashing and other indexing techniques to achieve a constant-time computation
of the recursive rule above for each value of Y, an optimal performance can be
expected for the Dijistra’s algorithm above, and similar observations can be made
for the other greedy algorithms which which require not special data structure other
than PQ. In particular this is true for the Traveling Salesman’s Program (TSP)
discussed next, which closely emulates its procedural counterpart, thus achieving
optimal asymptotic complexity.
      </p>
    </sec>
    <sec id="sec-8">
      <title>Traveling Salesman’s Greedy Heuristics</title>
      <p>Given an undirected graph, g(X; Y; Cxy), the exit rule selects an arbitrary node X,
from which to start the search. Then, the second rule selects candidate new nodes,
using the conditions Y&lt;&gt;a, and not(tspath(_; Y; C1); C1 &lt; C) ensures that we do
not cycle back to the initial node ad previously derived nodes.</p>
      <p>Finally the third rule selects from the candidate new nodes cand(Y; C) the one
that has the shortest distance from a.</p>
      <sec id="sec-8-1">
        <title>Example 11 (Travelling Salesman’s starting at node a)</title>
        <p>tspath(a; 0) node(a):
cand(Y; C) tspath(X; Cx); g(X; Y; Cxy); Y&lt;&gt;a;</p>
        <p>
          not(tspath(Y; C1); C1 &lt; C); C = Cx + Cxy:
tspath(Y; C) cand(Y; C); not(cand(_; C1); C1 C):
Thus, this algorithm will work correctly under the assumption that there are no ties,
i.e., no two arcs departing from the same node have the same weight. In the situation
where there are ties, we can employ a construct such as choice
          <xref ref-type="bibr" rid="ref11">(Greco et al. 1992)</xref>
          ,
which models don’t care non-deterministic semantics via a special class of stable
models called choice models. Alternatively, we can fall back on the solutions used
by procedural programmers. For instance, since nodes are represented by natural
numbers, or by elements of an ordered domain, we can expand the third rule in
Example 11 as follows:
Example 12 (Extrema as tie-breaker: alternative for 3 rd rule in Example 11 )
tspath(minhYi; C)
cand(Y; C); not(cand(_; C1); C1
        </p>
        <p>C):
This program is SITS once we assume that the min aggregate is dened as follows:
mtspath(Y; C)
tspath(Y; C)
cand(Y; C); not(cand(_; C1); C1 &lt; C):
mtspath(Y; C); not(mtspath(Y; C1); C1 &lt; C):
Here the intra-layer stratication uses cand al the rst level, and mtspath at the
second level, and tspath at the top level. Thus, while the body of the second rule
eliminates the nodes having a smaller C, the aggregate in the head only retains the
rst (i.e., the smallest) Y out of those candidate nodes that share the same C.</p>
        <p>While the use of min or max aggregates could be all a user wants in most practical
applications, from a conceptual viewpoint we might regret the fact that we have
given up non-determinism, and we can only generate one TSP path rather than a
dierent one at each run. However, non-determinism can be recovered by a builtin
predicate, such a hash function h(_), that reorders its input nondeterministically.
Then our program becomes:
Example 13 (Using randomized hashing for non-determinstic TSP )
tspath(a; 0) node(a):
cand(Y; C) tspath(X; Cx); g(X; Y; Cxy);</p>
        <p>Y&lt;&gt;a; not(tspath(Y; C1); C1 &lt; C); C = Cx + Cxy:
slct(SL; C) cand(Y; C); not(cand(_; C1); C1 C);
tspath(L; C) slct(L; C); not(slct(L1; C); h(L) &gt; h(L1)):
Here the the intra-layer stratication has cand below slct which is below tspath.
Similar techniques for breaking ties can be used in Prim’s and other algorithms.</p>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>Prim’s algorithm</title>
      <p>We build a tree with nodes st(X; Cx) where C is a node and Cx is the cost of the tree
when X was produced. We start from a node a with cost 0. Then for the current level
C, we nd all the new nodes reachable from this or previous nodes. This provides
a set of candidates for which, in the third rule, we take the one that delivers the
least cost.</p>
      <p>Example 14 (Prim’s minimum cost spanning tree. )
st(a; 0):
cand(C1; Y)
st(C1; Y)
st(C; _); st(Cx; X); Cx C;
arc(X; Y; Cxy); Y &lt;&gt; a;
not(st(Cy; Y); Cy &lt; C); C1 = C + Cxy:
cand(C1; Y); not(cand(C; _); C &lt; C1):</p>
      <p>Our example assumes that no two arcs have the same weight. When this is not
the case, we will use the same tie-breaking solutions used for TSP.</p>
    </sec>
    <sec id="sec-10">
      <title>Human Encoding</title>
      <p>Human coding is a lossless data compression algorithm. The idea is to assign
variable-length codes to input characters, with lengths of the assigned codes based
on the frequencies of corresponding characters. Frequent characters are assigned
shorter codes. The variable-length prex codes are bit sequences assigned to input
characters in such a way that no code of a character is the prex of the code of
another character.</p>
      <p>The input is the list of unique characters along with their frequency of occurrences
and output is the Human tree. The basic algorithm is as follows. We start from a
set of facts, token(Char; Freq) which corresponds to the leaf nodes of the Human
tree. Then the algorithm can be expressed as follows:</p>
    </sec>
    <sec id="sec-11">
      <title>Example 15 (Human Encoding Algorithm )</title>
      <p>huf(F; X; 0; 0) token(X; F):
huf(H; nil; H1; H2)
huf(H1; _; _; _); not(huf(H11; _; _; _); H11 &lt; H1);
huf(H2; _; _; _); H1 &lt; H2; not(huf(H22; _; _; _); H22 &lt; H2);</p>
      <p>H22&lt;&gt;H1; H = H1 + H2:
For instance, say that we have three facts: token(a, 4). token(b, 5). token
(c,10). Then the rst step consists in executing the rules whose body layer is
0: these are the exit rules, since their bodies consists of facts, which are always
viewed as belonging to zero layer. This produces the following leaf nodes in our tree
(identied by the fact that their left and right subtrees are both 0).</p>
      <p>huf(4; a; 0; 0):</p>
      <p>huf(5; b; 0; 0): huf(10; c; 0; 0)
Also as a result of this step, we have that the values 4, 5, and 10 are entered into
the priority PQ. Now, the system takes the least of these values and evaluates the
rules for that layer. The rules produce nothing at layer 4, so we move to next layer,
5 where the second rule produces:</p>
      <p>huf(9; nil; 4; 5)
Thus the system has extracted two nodes with the minimum frequency from the
min heap and generated a new node whose weight is the sum of those two.</p>
      <p>At this point we have only 9 in the PQ, and where no node at level below 9 is
still free the evaluation of the second rule produces nothing, but removes 9 from
the PQ. The next value in the PQ is thus 10, and the evaluation of our rule at level
10 produces:</p>
      <p>huf(19; nil; 9; 10)
At this point, the evaluation at layer 19 produces no new value, whereby the PQ
becomes empty, and the computation terminates.</p>
    </sec>
    <sec id="sec-12">
      <title>Kruskal’s Algorithm</title>
      <p>Kruskal’s algorithm also constructs a minimum spanning tree for a connected
weighted unordered graph. Thus an edge of a graph is represented by a fact edge(A; B; W)
where A &lt; B. At each step, the algorithm selects a least-cost edge among those that
do not connect previously connected nodes. Thus, in the example below, the rst
two rules state that each node is connected to itself, starting at level 0. Then, say
that at level C we add the new edge tree(X; Y; C), connecting two nodes which,
until level C were still disconnected.</p>
      <p>Then, the last rule is executed that determines all the nodes X1 and Y1
respectively connected with X and Y. Thus, we dene
mM(X; Y; X; Y)
mM(X; Y; Y; X)</p>
      <p>X &lt; Y:
X &gt; Y:
then we see that mM(X1; Y1; S; L) it returns S and L as respectively the smaller and
larger of these two. Then we connect to S all the nodes previously connected to L,
i.e., the Ln nodes in the last rule.</p>
      <p>Example 16 (Kruskal’s Algorithm )
connt(X; X; 0)
connt(Y; Y; 0)
tree(X; Y; C)
connt(S; Ln; C)
edge(X; Y):
edge(X; Y):
tree(_; _; C); edge(X; Y; Cxy); not(connt(X; Y; C1); C1 &lt; C);
C = Clast + Cxy:
tree(X; Y; C); connt(X1; X; C); connt(Y; Y1; C);
mM(X1; Y1; S; L); connt(L; Ln; C):</p>
      <p>Unlike our previous algorithms, the performance of Kruskal’s under our
formulation cannot be guaranteed to be optimal, since connectivity is not supported by
the special union-nd data structure.</p>
    </sec>
    <sec id="sec-13">
      <title>6 Conclusion</title>
      <p>
        The non-monotonic constructs proposed in this paper introduce a simple declarative
extension for deductive databases that greatly enhances their eectiveness in a range
of applications and thus achieves the same optimal time complexity of procedural
code algorithmsassuming that these do not make use of special data structures
such as Union-Find used by Kruskal’s minimum spanning tree algorithm. In fact, we
have shown that the greedy optimizations of procedural algorithms follow directly
from the need to achieve an ecient implementation for the iterated xpoint
procedure of locally stratied programs. From a theoretical viewpoint, this reveals the
computational upside of non-monotonic semantics classes that in the past were
primarily analyzed for their intractability downside. From a practical viewpoint, these
results allow us to express and implement eciently in Datalog systems
signicant algorithms expressed in declarative logic, while achieving the same asymptotic
complexity as their procedural counterparts. Indeed, support for strict local
stratication can be easily achieved through extensions of XY-stratication, which is now
part of DeALS
        <xref ref-type="bibr" rid="ref22">(Shkapsky et al. 2013)</xref>
        ,
        <xref ref-type="bibr" rid="ref23">(Yang et al. 2015)</xref>
        . The integrated support of
monotonic aggregates in recursion, greedy algorithms, and XY-stratication
supported by our system entails a declarative expression and ecient implementation
of complex algorithms, and provides further evidence that this is indeed an age of
renaissance for Datalog and deductive databases.
      </p>
    </sec>
    <sec id="sec-14">
      <title>Acknowledgements</title>
      <p>The author would like to thank Alex Shkapsky, Mohan Yang, and the referees for
many suggested improvements.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Abiteboul</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bienvenu</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Galland</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Antoine</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>A rule-based language for web data management</article-title>
          .
          <source>In PODS. 293304.</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Afrati</surname>
            ,
            <given-names>F. N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Borkar</surname>
            ,
            <given-names>V. R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carey</surname>
            ,
            <given-names>M. J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polyzotis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Ullman</surname>
            ,
            <given-names>J. D.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>Map-reduce extensions and recursive queries</article-title>
          .
          <source>In EDBT. 18.</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Arni</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ong</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tsur</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2003</year>
          .
          <article-title>The deductive database system ldl++</article-title>
          .
          <source>TPLP 3</source>
          ,
          <issue>1</issue>
          ,
          <fpage>6194</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Borkar</surname>
            ,
            <given-names>V. R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carey</surname>
            ,
            <given-names>M. J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosen</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polyzotis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Condie</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weimer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Ramakrishnan</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>Declarative systems for large-scale machine learning</article-title>
          .
          <source>IEEE Data Eng. Bull. 35</source>
          ,
          <issue>2</issue>
          ,
          <fpage>2432</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Chomicki</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <year>1990</year>
          .
          <article-title>Polynomial time query processing in temporal deductive databases</article-title>
          .
          <source>In Proceedings of the Ninth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems. PODS '90</source>
          .
          <fpage>379391</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Chomicki</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Imielinski</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <year>1988</year>
          .
          <article-title>Temporal deductive databases and innite objects</article-title>
          .
          <source>In PODS. 6173.</source>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Orsi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Pieris</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>Ontological queries: Rewriting and optimization</article-title>
          .
          <source>In ICDE. 213.</source>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Greco</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>1998</year>
          .
          <article-title>Greedy algorithms in datalog with choice and negation</article-title>
          .
          <volume>294309</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Greco</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2001a</year>
          .
          <article-title>Greedy algorithms in datalog</article-title>
          .
          <source>TPLP 1</source>
          ,
          <issue>4</issue>
          ,
          <fpage>381407</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Greco</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2001b</year>
          .
          <article-title>Greedy algorithms in datalog</article-title>
          .
          <source>TPLP 1</source>
          ,
          <issue>4</issue>
          ,
          <fpage>381407</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Greco</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Ganguly</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <year>1992</year>
          .
          <article-title>Greedy by choice</article-title>
          .
          <source>In PODS. 105113.</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Guzzo</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Sacc</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <year>2005</year>
          .
          <article-title>Semi-inationary DATALOG: A declarative database language with procedural features</article-title>
          .
          <source>AI Commun</source>
          .
          <volume>18</volume>
          ,
          <issue>2</issue>
          ,
          <fpage>7992</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Hellerstein</surname>
            ,
            <given-names>J. M.</given-names>
          </string-name>
          <year>2010</year>
          .
          <article-title>Datalog redux: experience and conjecture</article-title>
          .
          <source>In PODS. 12.</source>
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <surname>Kolaitis</surname>
            ,
            <given-names>P. G.</given-names>
          </string-name>
          <year>1991</year>
          .
          <article-title>The expressive power of stratied logic programs</article-title>
          .
          <source>Inf. Comput</source>
          .
          <volume>90</volume>
          ,
          <fpage>5066</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Lausen</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ludscher</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>May</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          <year>1998</year>
          .
          <article-title>On active deductive databases: The statelog approach</article-title>
          .
          <source>In Transactions and Change in Logic Databases</source>
          .
          <volume>69106</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Mazuran</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Serra</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2013</year>
          .
          <article-title>A declarative extension of horn clauses, and its signicance for datalog and its applications</article-title>
          .
          <source>TPLP 13</source>
          ,
          <issue>4</issue>
          -
          <fpage>5</fpage>
          ,
          <fpage>609623</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <string-name>
            <surname>Mumick</surname>
            ,
            <given-names>I. S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pirahesh</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Ramakrishnan</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <year>1990</year>
          .
          <article-title>The magic of duplicates and aggregates</article-title>
          .
          <source>In VLDB. 264277.</source>
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <string-name>
            <surname>Mumick</surname>
            ,
            <given-names>I. S.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Shmueli</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <year>1995</year>
          .
          <article-title>How expressive is stratied aggregation?</article-title>
          <source>Annals of Mathematics and Articial Intelligence</source>
          <volume>15</volume>
          ,
          <fpage>407435</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <string-name>
            <surname>Palopoli</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <year>1992</year>
          .
          <article-title>Testing logic programs for local stratication</article-title>
          .
          <source>Theor. Comput. Sci. 103</source>
          ,
          <issue>2</issue>
          ,
          <fpage>205234</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          <string-name>
            <surname>Przymusinski</surname>
            ,
            <given-names>T. C.</given-names>
          </string-name>
          <year>1988</year>
          .
          <article-title>Perfect model semantics</article-title>
          .
          <source>In ICLP</source>
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          <string-name>
            <surname>Ross</surname>
            ,
            <given-names>K. A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Sagiv</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          <year>1997</year>
          .
          <article-title>Monotonic aggregation in deductive database</article-title>
          .
          <source>J. Comput. Syst. Sci. 54</source>
          ,
          <issue>1</issue>
          ,
          <fpage>7997</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          <string-name>
            <surname>Shkapsky</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zeng</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2013</year>
          .
          <article-title>Graph queries in a next-generation datalog system</article-title>
          .
          <source>PVLDB 6</source>
          ,
          <issue>12</issue>
          ,
          <fpage>12581261</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shkapsky</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2015</year>
          .
          <article-title>Parallel bottom-up evaluation of logic programs: Deals on shared-memory multicore machines</article-title>
          .
          <source>In ICLP</source>
          <year>2015</year>
          ,
          <string-name>
            <given-names>Cork</given-names>
            <surname>Ireland</surname>
          </string-name>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>The logic of query languages for data streams</article-title>
          .
          <source>In Logic and Databases</source>
          <year>2011</year>
          .
          <article-title>EDBT 2011 Workshops</article-title>
          .
          <volume>12</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Arni</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Ong</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          <year>1993</year>
          .
          <article-title>Negation and aggregates in recursive rules: the ldl++ approach</article-title>
          . In DOOD.
          <volume>204221</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          <string-name>
            <surname>Zaniolo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ceri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faloutsos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Snodgrass</surname>
          </string-name>
          , R. T.,
          <string-name>
            <surname>Subrahmanian</surname>
            ,
            <given-names>V. S.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Zicari</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <year>1997</year>
          .
          <article-title>Advanced Database Systems</article-title>
          . Morgan Kaufmann.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>