<!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>Effective Datalog-like representation of procedural programs</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Software Engineering Faculty of Mathematics and Physics, Charles University Prague</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2011</year>
      </pub-date>
      <fpage>9</fpage>
      <lpage>15</lpage>
      <abstract>
        <p>Database systems are constantly extending their application area towards more general computing. However, applications that combine database access and general computing still suffer from the conceptual and technical gap between relational algebra and procedural programming. In this paper, we show that procedural programs may be effectively represented in a Datalog-like language with functions and aggregates. Such a language may then be used as a common representation for both relational and procedural part of an application.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>embedded-SQL
procedural
program
parser
database
statistics
physical
operator
metadata
library
compile time
run time
physical
operator
code
library</p>
    </sec>
    <sec id="sec-2">
      <title>Introduction</title>
      <p>The procedural part meets with its relational
elements only at run time – the procedural machine
executes the procedural code containing calls to a
database interface which in turn invokes the plan
interpreter. The interpreter schedules and dispatches calls
to procedures implementing individual physical
operators of a plan. Although the individual SQL
statements extracted from the source program often access
the same data, their plans usually interact only at the
lowest levels of physical data access; thus, they often
repeat the same operations on the same data.
bytecode
generator
relational
algebra
query rewriting
plan generator</p>
      <p>The most important reason for the separation of 1.2 Architecture
procedural and relational parts is probably the
history – the relational (SQL) query engines were usu- The architecture of the proposed system is shown at
ally implemented well before the procedural add-on Fig. 2. Instead of separating the procedural and
rewas considered and the software-engineering cost of lational part, the parser converts the source code into
reimplementing the query engine was considered too a Datalog-like intermediate representation. This
interhigh. mediate language and the conversion of procedural</p>
      <p>Nevertheless, there is another reason for the sep- code into it form the main subject of this paper. On
aration – the nature of procedural code is so distant the other hand, conversion of relational queries to
from the algebraic nature of SQL that it is very dif- Datalog is a well-known subject; thus, it is not
necesficult to create a meaningful common representation sary to describe the handling of embedded SQL
statefor the two parts. ments.</p>
      <p>
        The processing continues with rewriting step which
1.1 Goals optimizes the Datalog-like representation – this phase
corresponds to query rewriting and it may also be
inIn this paper, we suggest using a Datalog-like language fluenced by database statistics. Moreover, several
opas the common intermediate representation for proce- timization algorithms known from compiler
construcdural and relational code. This idea is natural, consid- tion like loop unrolling or variable renaming [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] have
ering the close relationship between Datalog and rela- their equivalents in the transformation of logic
protional algebra on one side and the computing power grams, so this phase covers also the optimization of
of logic programming and recursion on the other side. procedural code.
      </p>
      <p>However, there are still many obstacles in the inte- The most important feature of this architecture is
gration effort. In particular, there is a risk of loss of the ability to apply rewriting optimization step across
efficiency since the procedural code is not evaluated the boundary between procedural and relational code.
directly but transformed to logic-programming repre- For instance, repeated invocations of a SQL statement
sentation and then evaluated by a procedural hard- may be glued together, offering, for instance, the
posware. sibility to cache their partial results.</p>
      <p>In our approach, we strive to improve the efficiency The plan generator phase tries to cover the
Dataof logic-programming representation by minimizing log-like representation using a predefined set of
patthe size of the models – we show that a procedural code terns. Each pattern corresponds to a component which
can be encoded in a logic program in such a manner has several inputs and several outputs, each
correthat the size of the (minimal) model is proportional sponding to a predicate. A simplest component cover
to the execution time of the original program on the one Datalog rule – in this case, the head of the rule
same data. Thanks to this proportionality, the logic corresponds to the output and each atom of the body
program may be evaluated completely in bottom-up corresponds to an input of the component. More
somanner. phisticated components correspond to a pattern
cov</p>
      <p>Due to the focus on bottom-up evaluation, we pre- ering more than one rule, including recursively
depenfer calling our approach Datalog-like over the term dent rules.
logic programming, although we certainly must use Some of the components correspond to physical
a language stronger than Datalog to achieve gener- operators of a relational engine; for instance, a
Dataality. log rule with two body atoms may be implemented</p>
      <p>Besides function symbols which are necessary to by a hash-join operator. Other components are
implesimulate general procedural programming, our langua- mented with simple procedural code snippets – these
ge needs negation and aggregation for the emulation components ensure that the procedural parts of the
of both procedural constructs and the embedded re- source code are reverted back to procedural code. Of
lational language. Both negation and aggregation re- course, parts of the source code may be changed during
quire special handling to ensure well-defined semantics the rewriting phase; consequently, procedural source
and there are several approaches to the semantics of code may be eventually covered by relational operators
negation in Datalog and logic programming in general. and, conversely, portions of the embedded relational</p>
      <p>
        Thus, defining a particular approach to semantics statements may be converted to procedural snippets.
is a part of our effort – we reuse the concepts of lo- The implementation of physical relational
operacal stratification [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] and rule progressivity [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] that tors is boxed in procedural packages which are
contogether well reflect the nature of the original proce- nected together similarly to classical query plans. On
dural code. the other hand, the procedural snippets are so small
that individual packaging would be ineffective.
Therefore, the snippets are combined together to larger pro- 2 Background and related work
cedural code fragments by the bytecode generator.
      </p>
      <p>
        This paper deals with the design of the intermedi- Interaction of procedural and relational code was
reate representation and the translation from procedu- cognized as an important topic a long time ago;
neverral code to it. The subsequent steps – Datalog-based theless, practical applications of the results are very
rewriting and plan generator – are subject of our cur- scarce. In [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], a successful optimization of the
interacrent research. The run-time portion of the system at tion cost was shown in the case of calling
procedurallyFig. 2 was already implemented for a SPARQL com- implemented functions from relational queries. Our
piler [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] whose compile time used a relational interme- approach also applies to this case; nevertheless, we
fodiate code and an algebra-based plan generator. cused on the opposite problem – repeated calling of
relational queries from procedural code.
      </p>
      <p>
        Nested relational algebra [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] may well reflect the
embedded-SQL use of structured and relation-valued variables in
procedural a procedural program; however, the overall
computprogram ing strength of nested relational algebra is insufficient
      </p>
      <p>to express while loops. While loops may be added as
parser an additional second-order construct atop of relational</p>
      <p>
        algebra, or represented by transitive closure in
powerDatalog-like set algebra [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. In Sec. 3.3, we will show a
logicalreinptreersmeendtaiatitoen programming equivalent of nested relational algebra
together with the drawbacks of such an approach.
      </p>
      <p>Flattening nested relations is an important step
copsmhnypipsopicneaetlnt rDeawtraitliongg dsatatatibstaicsse taflolaswtotaeprndriesnsgeeffnpetrciitnnivcteipheleevcadoluersaectorioifbnoeuodrf inaneps[p1tre6od]awachlag.seTbdrheaesiagonnrdiegdiitntaiosl
library physical flatten an isolated nested-relational algebra expression
plan generator cmometpaodnaetant and it was based on the finite height of the expression
gbeynteecroadtoer library tree. Since a while loop may generate a calculation
of unlimited length, this flattening technique may not
bytecode cormupnilteimtieme comtpreoenent tboe uaspeplaiednufmorbperrioncgedtuercahlnpiqruoegr(asmees. SIencs.te3a.d4,) wanedhatdo
solve some unwanted consequences of the numbering
JIT compiler pmroaccehdiunreal csocmhepdounleenrt appDroaatcahlo.g and its extensions, besides their natural
physical applications in many areas of database theory, was
component access data already successfully used in areas related to procedural
licboradrey interface base programming.</p>
      <p>
        A language derived from logical programming was
designed for programming in distributed
environFig. 2. Proposed processing path of embedded-SQL pro- ment [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The opposite problem, generating effective
grams. procedural implementations from Datalog programs,
was studied in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. These recent publications suggest
that the potential of Datalog was not exhausted in
      </p>
      <p>
        The rest of the paper is organized as follows: In the the first decades of its life and it may experience a
reSection 2, we briefly review the related work on the vival fueled by the renewed interest in non-traditional
interaction between procedural and relational code as database architectures.
well as Datalog-related definitions important for our There were attempts to improve the expressive
poapproach. The following section uses a sample pro- wer of Datalog towards procedural programming by
cedural code to illustrate several approaches to the non-traditional extensions of its semantics [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
Extendmodelling of procedural code in Datalog style. After ing Datalog towards complex data structures known
reviewing the required extensions to Datalog in Sec- from procedural programming was described in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
tion 3.5, a particular strategy to the minimization of These powerful extensions relied on significant
intrumodel size is presented in Section 3.6. sions to the traditional Datalog semantics;
consequently, their use in an intermediate language for a
relational platform would be doubtful.
      </p>
      <p>
        Datalog with temporal features was used to model relational algebra can be simulated with plain
relasequences of data-manipulation statements [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] or in tional algebra [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], this is not the case with transitive
the analysis of procedural programs [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]. Our number- closure. Thus, representing the example code in the
ing technique shown in Sec. 3.4 is similar to temporal algebraic world requires transitive closure over nested
techniques although used for a different purpose. relational algebra, which includes expensive atomic
      </p>
      <p>
        Among the sheer number of approaches to Datalog operations like equality test over sets and it is
diffiextensions, semantics and evaluation strategies, local cult to reduce it to implementable physical operators.
and, in particular, temporal stratification [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] has mo- A natural response to the problems of algebraic
tivated our approach. In addition, we also make use of representation is switching to Datalog where the while
the progressivity [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] of rules in the scheduling strategy loop may be handled easily using recursion. However,
used in plan execution. the Algorithm 1 demonstrates several obstacles in the
Datalog approach.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Modeling procedural code in</title>
    </sec>
    <sec id="sec-4">
      <title>Datalog style</title>
      <p>3.1</p>
      <sec id="sec-4-1">
        <title>Na¨ıve approach</title>
        <sec id="sec-4-1-1">
          <title>The following rule forms a na¨ıve Datalog implementation of the loop body:</title>
          <p>state(M ′, S′) ← state(M, S), stmt3(X, M ),
stmt4(S′, S, X), stmt5(M ′, M, X).</p>
        </sec>
        <sec id="sec-4-1-2">
          <title>Algorithm 1 Example: A procedural algorithm with</title>
          <p>embedded SQL statements
Require: Relation M(A, B)
1: S := z
2: while exists(M) do
3: X := select min(A) from M
where A not in (select B from M)
4: S := f(S, X)
5: delete from M where A = X
6: end while
7: return S</p>
        </sec>
        <sec id="sec-4-1-3">
          <title>The predicates stmt3, stmt4, and stmt5 imple</title>
          <p>ment the behavior of the statements 3, 4, and 5 of
Algorithm 1. This approach creates extremely
inefficient representation because any model of this
program contains ground atoms for stmt3, stmt4, and
stmt5 representing all satisfiable variable assignments
for the statements regardless of its reachability
during an execution. In addition, statement clauses (not
shown here) violate safety rules as some of the
variables are bound only by functional symbols.
Conse</p>
          <p>
            Algorithm 1 is an example of code written in a pro- quently, this approach is not suitable for bottom-up
cedural language with SQL embedded. It consumes evaluation in Datalog style.
a relation M with schema (A, B) representing edges
of a directed graph and traverses it in a topological
ordering. In the loop, a node X is selected that has 3.2 Using function symbols for relational
no incoming edge in M . The min aggregate is neces- algebra
sary to select from multiple candidates. Later in the
loop, all outgoing edges of X are removed from M . The following, improved representation may be
deThe output of the loop is the variable S which aggre- rived from the previous one using the Magic-sets
transgates the selected values of X using the constant z formation [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ]:
and the function f (S, X) (e.g. concatenation). If the state1(M ) ← m0(M ).
graph is acyclic, the algorithm terminates after at state2(M, z) ← state1(M ).
most |M | iterations; otherwise, it eventually fails to state3(M, S) ← state2(M, S), M 6= ∅.
find any A in the statement 3 and, depending on the state3(M, S) ← state6(M, S), M 6= ∅.
subtle details of the statement semantics, either causes state4(M, S, X) ← state3(M, S),
an exception or loops indefinitely. X = πmin(A)(πAM \ πBM ).
          </p>
          <p>Modeling of a while-loop requires an extension to state5(M, S′, X) ← state4(M, S, X), S′ = f (S, X).
relational algebra and transitive closure is the most state6(M ′, S) ← state5(M, S, X),
obvious candidate. Each iteration of the loop changes M ′ = M \ σA=X M.
the state of the program – the variables M and S state7(S) ← state2(M, S), M = ∅.
– thus, there is a relation B which models the loop- state7(S) ← state6(M, S), M = ∅.
body behavior using tuples hM, S, M ′, S′i. Together The predicate statei indicate the reachability of
with the while-head condition H, the transitive clo- a particular variable assignment in the beginning of
sure L = σM′=∅(σM6=∅B)∗ models the loop. Unfortu- statement i of Algorithm 1. The relational statements
nately, it requires nested relational algebra to repre- are represented as equality statements containing
sent the relation-valued attribute M ; although nested function symbols from relational algebra. The rules
implement a state machine simulating the execution of
the original program; the model expansion and safety
problems mentioned above disappeared.</p>
          <p>The relational statements are implemented using
a non-Datalog mechanism; thus, this approach is far
from being a suitable intermediate representation for
mixed code.
3.3</p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>Nesting and unnesting relational variables</title>
        <sec id="sec-4-2-1">
          <title>In this section, the relational algebra was hoisted to</title>
          <p>
            Datalog level using the unnest predicate and the nest
aggregate. This approach is equivalent to nested
relational algebra. The predicate unnest(M, A, B)
performs the membership test hA, Bi ∈ M ; the
generalized aggregate nest(A, B) collects all hA, Bi pairs and
combine them into a set (see [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ] for exact definiton of
semantics of aggregates in Datalog):
state1(M ) ← m0(M ).
state2(M, z) ← state1(M ).
cond2(M ) ← state2(M, S), unnest(M, A, B).
state3(M, S) ← state2(M, S), cond2(M ).
state3(M, S) ← state6(M, S), cond2(M ).
cond3(M, B) ← state3(M, S), unnest(M, A, B).
state4(M, S, min(A)) ← state3(M, S),
          </p>
          <p>unnest(M, A, B), ¬cond3(M, A).
state5(M, S′, X ) ← state4(M, S, X ), S′ = f (S, X ).
state6(nest(A, B), S) ← state5(M, S, X ),</p>
          <p>unnest(M, A, B), A 6= X.
state7(S) ← state2(M, S), ¬cond2(M ).
state7(S) ← state6(M, S), ¬cond2(M ).</p>
          <p>This approach unifies the means used for
procedural and relational fragments. Nevertheless, it suffers
from the stratification required by the nest aggregate
and the need to incorporate all live variables into single
statei atom.
3.4</p>
        </sec>
      </sec>
      <sec id="sec-4-3">
        <title>Numbering iterations</title>
        <p>The following code illustrates the approach we finally
used. The argument T representing time (more
exactly, the number of iteration) was introduced to almost
all rules. It allowed dissolution of the original statei
predicates: statei(T ) indicates reachability of the
statement i at time T .</p>
        <p>m2(1, A, B) ← m0(A, B).
s2(1, z).
state2(1).
state2(T + 1) ← branch23(T ).
cond2(T ) ← state2(T ), m2(T , A, B).
branch23(T ) ← state2(T ), cond2(T ).
cond3(T , B) ← branch23(T ), m2(T , A, B).
x4(T , min(A)) ← branch23(T ),
m2(T , A, B), ¬cond3(T , A).
s2(T + 1, f (S, X )) ← branch23(T ),</p>
        <p>s2(T , S), x4(T , X ).
m2(T + 1, A, B) ← branch23(T ),</p>
        <p>m2(T , A, B), x4(T , X ), A 6= X.
branch27(T ) ← state2(T ), ¬cond2(T ).
return(S) ← branch27(T ), s2(T , S).</p>
        <sec id="sec-4-3-1">
          <title>Variable values are represented independently:</title>
          <p>xi(T , V ) determines the value V of the variable X
before entering statement i at time T . In the case of
relational-valued variable M , the relation is unnested
and its tuples are represented by individual instances
of the atom mi(T , A, B).</p>
          <p>Relational (and in general, complex-valued)
Datalog variables and terms are no longer needed – every
term is an atomic value.</p>
          <p>Note that the dissolution of statei predicates
created an opportunity for optimization: Every atomic
statement modifies only one variable; therefore, only
one clause is required for each statement, specifying
the new variable value. For a variable, it is sufficient
to have the value specified only at reference points
(for S and M , it is the beginning of the statement 2),
provided that at least one reference point lies on any
path from any definition to any usage of this variable.
In our case, the value for the reference point 2 is
specified twice because there are two control paths leading
to this point.</p>
          <p>The execution of rules implementing statements is
guarded by trigger predicates branchi,j which
signalize passing from the statement i to the statement j.
These predicates are controlled by conditions and their
negations; in our case, the predicate cond2.
3.5</p>
        </sec>
      </sec>
      <sec id="sec-4-4">
        <title>Requirements on the logic language</title>
        <p>In our example Algorithm 1, there is a loop-carried
dependence from the variable M through X to the
next M value which involves negation and
aggregation. This is reflected in the presence of negation and
aggregation in the mutual recursion between the
predicates x4 and s2. Our representation is therefore
unstratifiable; the unstratifiability is inherent to
Algorithm 1 since the length of the chain of negations
generated by the loop is unlimited. Consequently, no
stratification may exist for any Datalog-like
representation of this example.</p>
        <p>
          This forces us to use the concept of local
stratification. Note that in pure Datalog without function
symbols, local stratification is almost equivalent to
stratification [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. However, our system does use function
symbols to generate the time values T and to
implement built-in operators and functions of the
procedural language and of SQL.
3.6
        </p>
      </sec>
      <sec id="sec-4-5">
        <title>Long-range variable passing</title>
        <p>In our example Algorithm 1, each iteration of the loop
modifies each variable. However, a loop body may
contain conditional statements; thus, a variable may
become unmodified in some iterations. In this case, there
must be a mechanism to pass the unmmodified
variable value through the loop body. A simple
implementation of such mechanism is the following clause:
valueV (T + 1, X ) ← valueV (T , X ), cond(T ).</p>
        <p>For every scalar variable V and for every
iteration T , a ground atom valueV (T , X ) is present in the
model indicating the value X of the variable.
Consequently, the model is of the size Ω(τ υ) where τ is
the execution time of the procedural program and υ
is the number of variables in the program. For
nonscalar variables the cost is even larger, because the
argument X (or more arguments) encodes an
individual element of a relation or an array, therefore there
are as many ground atoms as the size of the variable.
Evaluating the complete model is thus unacceptably
costly.</p>
        <p>Fortunately, the cost of unmodified variable
passing may be lowered to O(τ log(υ)). The principle is
depicted in Fig. 3 – instead of copying the variable value
on every iteration, there are several layers of preferred
points in time and copying is performed at these
preferred points. Preferred points of layer k occur at the
distance of 2k iterations and copying is allowed either
to a point of higher preference or to a point of access
to the variable. The thick lines in Fig. 3 show how
a variable is passed when it is accessed in the three
points marked at the time axis.</p>
        <p>The number of copies done between two accesses
is O(logΔ) where Δ is the time distance between the
accesses, i.e. the length of the passing range. Since an
atomic statement may access only a limited number
of variables, the number n of passing ranges is
proportional to the execution time, i.e. n = c ∗ τ . Since the
ranges may not intersect for the same variable, their
sum across of all variables is Pin=1 Δi ≤ τ υ.
Consequently, the total cost of copying is proportional to
Xn log(Δi) ≤ n log Pin=1 Δi ≤ n log( τ υ
i=1 n n
) = τ c log
υ
c
4</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <sec id="sec-5-1">
        <title>We have proposed a promising approach to mixed pro</title>
        <p>cedural and relational code whose key element is
a novel intermediate representation based on logic
programming. With respect to the assumed bottom-up
evaluation strategy, the intermediate language falls to
the Datalog family. Special care was taken for effective
evaluation of the intermediate language – our results
show only O(log υ) degradation with respect to the
native procedural evaluation of a code with υ
variables.</p>
        <p>In this paper, we presented the principles of the
proposed language and its use for the representation
of procedural code. For the sake of clarity, we omitted
many technical details and tricks that were necessary
to achieve the reported effectiveness of the
representation.</p>
        <p>Whether our approach is viable, it can be shown
only by successful implementation of the whole
processing chain from Fig. 2. The design of the
intermediate representation was only a necessary prerequisite
before attempting the implementation.</p>
        <p>
          Our approach was motivated by the lessons learned
from the implementation of a parallel SPARQL
engine [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] for the Semantic Web. When using a relational
repository, many Semantic Web algorithms are most
easily expressed as simple procedural algorithms over
relational queries.
        </p>
        <p>Thus, using a combined relational/procedural
intermediate language may save the tedious and
errorprone work associated with reformulating such
algorithms in either purely relational (if ever possible) or
purely procedural way. In addition, the mixed
representation offers new opportunities for optimization.</p>
        <p>If successful, the new architecture may become
important for areas where database access is tightly
coupled with non-trivial computing, including the
Semantic Web, computational linguistics or some areas of
e-science.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>C.</given-names>
            <surname>Beeri</surname>
          </string-name>
          , R. Ramakrishnan:
          <article-title>On the power of magic</article-title>
          .
          <source>The Journal of Logic Programming</source>
          ,
          <volume>10</volume>
          (
          <issue>3-4</issue>
          ),
          <year>1991</year>
          ,
          <fpage>255</fpage>
          -
          <lpage>299</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>H. A.</given-names>
            <surname>Blair</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V. W.</given-names>
            <surname>Marek</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. S.</surname>
          </string-name>
          <article-title>Schlipf: The expressiveness of locally stratified programs</article-title>
          .
          <source>Annals of Mathematics and Artificial Intelligence</source>
          ,
          <volume>15</volume>
          (
          <issue>2</issue>
          ),
          <year>1995</year>
          ,
          <fpage>209</fpage>
          -
          <lpage>229</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>M. P.</given-names>
            <surname>Consens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. O.</given-names>
            <surname>Mendelzon</surname>
          </string-name>
          :
          <article-title>Low-complexity aggregation in graphlog and datalog</article-title>
          .
          <source>Theoretical Computer Science</source>
          <volume>116</volume>
          (
          <issue>1</issue>
          ),
          <year>1993</year>
          ,
          <fpage>95</fpage>
          -
          <lpage>116</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Z.</given-names>
            <surname>Falt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Bednarek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Cermak</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          <article-title>Zavoral: On parallel evaluation of sparql queries</article-title>
          .
          <source>In DBKDA 2012, The Fourth International Conference on Advances in Databases, Knowledge, and Data Applications</source>
          ,
          <year>2012</year>
          ,
          <fpage>97</fpage>
          -
          <lpage>102</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>S. C.</given-names>
            <surname>Goldstein</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          <article-title>Cruz: Meld: A logical approach to distributed and parallel programming</article-title>
          .
          <source>Technical report, DTIC Document</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>S.</given-names>
            <surname>Greco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Palopoli</surname>
          </string-name>
          , E. Spadafora:
          <article-title>Extending datalog with arrays</article-title>
          .
          <source>Data &amp; Knowledge Engineering</source>
          <volume>17</volume>
          (
          <issue>1</issue>
          ),
          <year>1995</year>
          ,
          <fpage>31</fpage>
          -
          <lpage>57</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>R.</given-names>
            <surname>Guravannavar</surname>
          </string-name>
          , S. Sudarshan:
          <article-title>Rewriting procedures for batched bindings</article-title>
          .
          <source>Proceedings of the VLDB Endowment</source>
          <volume>1</volume>
          (
          <issue>1</issue>
          ),
          <year>2008</year>
          ,
          <fpage>1107</fpage>
          -
          <lpage>1123</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>A.</given-names>
            <surname>Guzzo</surname>
          </string-name>
          ,
          <string-name>
            <surname>D.</surname>
          </string-name>
          <article-title>Sacca: Semi-inflationary datalog: A declarative database language with procedural features</article-title>
          .
          <source>Artificial Intelligence Communications</source>
          <volume>18</volume>
          (
          <issue>2</issue>
          ),
          <year>2005</year>
          ,
          <fpage>79</fpage>
          -
          <lpage>92</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>M.</given-names>
            <surname>Gyssens</surname>
          </string-name>
          ,
          <string-name>
            <surname>D. Van Gucht</surname>
          </string-name>
          :
          <article-title>The powerset algebra as a result of adding programming constructs to the nested relational algebra</article-title>
          .
          <source>ACM 17</source>
          ,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. G. Lausen, B. Lud¨ascher, W. May:
          <article-title>On active deductive databases: The Statelog approach</article-title>
          .
          <source>Transactions and Change in Logic Databases</source>
          ,
          <year>1998</year>
          ,
          <fpage>69</fpage>
          -
          <lpage>106</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>Y. A.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <surname>S. D.</surname>
          </string-name>
          <article-title>Stoller: From datalog rules to efficient programs with time and space guarantees</article-title>
          .
          <source>In Proceedings of the 5th ACM SIGPLAN International Conference on Principles and Practice of Declaritive Programming. ACM</source>
          ,
          <year>2003</year>
          ,
          <fpage>172</fpage>
          -
          <lpage>183</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>C. Nomikos</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Rondogiannis</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <article-title>Gergatsoulis: Temporal stratification tests for linear and branching-time deductive databases</article-title>
          .
          <source>Theoretical Computer Science</source>
          <volume>342</volume>
          (
          <issue>2</issue>
          ),
          <year>2005</year>
          ,
          <fpage>382</fpage>
          -
          <lpage>415</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13. L. Palopoli:
          <article-title>Testing logic programs for local stratification</article-title>
          .
          <source>Theoretical Computer Science</source>
          <volume>103</volume>
          (
          <issue>2</issue>
          ),
          <year>1992</year>
          ,
          <fpage>205</fpage>
          -
          <lpage>234</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>H. J. Schek</surname>
            ,
            <given-names>M. H.</given-names>
          </string-name>
          <string-name>
            <surname>Scholl</surname>
          </string-name>
          :
          <article-title>The relational model with relation-valued attributes</article-title>
          .
          <source>Information Systems</source>
          <volume>11</volume>
          (
          <issue>2</issue>
          ),
          <year>1986</year>
          ,
          <fpage>137</fpage>
          -
          <lpage>147</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <given-names>Y.</given-names>
            <surname>Smaragdakis</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Bravenboer: Using datalog for fast and easy program analysis</article-title>
          .
          <source>In Datalog Reloaded: First International Workshop</source>
          ,
          <year>Datalog 2010</year>
          , Oxford, UK, March
          <volume>16</volume>
          -19,
          <year>2010</year>
          .
          <source>Revised Selected Papers</source>
          , vol.
          <volume>6702</volume>
          , pp.
          <fpage>245</fpage>
          . Springer-Verlag New York Inc,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16. J. Van den Bussche:
          <article-title>Simulation of the nested relational algebra by the flat relational algebra, with an application to the complexity of evaluating powerset algebra expressions</article-title>
          .
          <source>Theoretical Computer Science</source>
          <volume>254</volume>
          (
          <issue>1-2</issue>
          ),
          <year>2001</year>
          ,
          <fpage>363</fpage>
          -
          <lpage>377</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17. E. Visser:
          <article-title>Stratego: A language for program transformation based on rewriting strategies system description of stratego 0.5</article-title>
          .
          <source>In Rewriting Techniques and Applications</source>
          , Springer,
          <year>2001</year>
          ,
          <fpage>357</fpage>
          -
          <lpage>361</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>