<!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>Advances in Analyzing Coroutines by Abstract Conjunctive Partial Deduction</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Vincent Nys</string-name>
        </contrib>
      </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 current work describes a technique for the analysis of coroutining in Logic Programs. This provides greater insight into the execution of Logic Programs and yields a transformation from programs with nonstandard execution rules to programs with the standard execution rule of Prolog. A technique known as Compiling Control, or CC for short, was used to study these issues 30 years ago, but it lacked the tools to formalize a complete procedure. Abstract Conjunctive Partial Deduction, introduced by Leuschel, provides an appropriate setting to rede ne Compiling Control for simple examples. For more elaborate examples, we extend Leuschel's framework with a new operator. Preliminary experiments with the new operator show that a wide range of programs can be analyzed, opening up possibilities for further analysis as well as program optimization.</p>
      </abstract>
      <kwd-group>
        <kwd>Vincent Nys</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        Since Kowalski's famous equation \Algorithm = Logic + Control"
        <xref ref-type="bibr" rid="ref6">(Kowalski 1979)</xref>
        , much
research has been done into separating the logic of a program from its control. Ideally, logic
programs should be written in a purely declarative style. The control ow aspect would be
speci ed separately to obtain an e cient execution. To this end, many Logic Programming
systems, such as SWI Prolog
        <xref ref-type="bibr" rid="ref14">(Wielemaker et al. 2012)</xref>
        , Ciao
        <xref ref-type="bibr" rid="ref3">(Bueno et al. 1997)</xref>
        and Godel
        <xref ref-type="bibr" rid="ref5 ref9">(Hill and Lloyd 1994)</xref>
        support delay statements. Delay statements allow the programmer
to override the default resolution strategy and specify which atoms should be resolved in
particular program contexts, e.g. as soon as a program variable becomes ground. The use
of delay statements causes atoms to behave as coroutines, in that their execution may
be suspended and then later resumed, enabling intricate forms of data communication
between atoms. However, the use of separate control ow statements brings with it runtime
overhead. It also prevents the use of program analysis and program optimization techniques
developed for logic programs under a left-to-right execution rule.
      </p>
      <p>
        A technique known as Compiling Control
        <xref ref-type="bibr" rid="ref2">(Bruynooghe et al. 1989)</xref>
        allows for the
separation of logic and control, while avoiding the drawbacks of delay statements. The technique
takes a source program, P , and synthesizes a program P 0, so that computation with P 0
under left-to-right execution mimics the computation with P under a non-standard
selection rule. To do this, Compiling Control (CC) consists of two phases: an analysis phase
and a synthesis phase. The analysis phase analyzes the computations of a program for a
given query pattern under a (non-standard) selection rule. The query pattern is expressed
in terms of a combination of type, mode and aliasing information. The analysis results in
what is called a \trace tree", which is a nite upper part of a symbolic execution tree that
one can construct for the given query pattern, selection rule and program. In the synthesis
phase, a nite number of clauses, the resolvents, are generated. Each clause synthesizes
the computation in some branch of the trace tree and all computations in the trace tree
have been synthesized by some clause. The technique was implemented, formalized and
proven correct, under certain fairly technical conditions.
      </p>
      <p>Despite this, CC is a rather ad hoc approach. The connection between symbolic values
and values in a concrete program was never made explicit. Furthermore, program-speci c
proofs were required to show that the trace tree represented all possible concrete
computations. The aim of this research is to reformulate CC in a way that allows for a rigorous
analysis of its correctness and completeness. Since the original work on CC, several
important advances in program analysis and transformation have been made:
General frameworks for Abstract Interpretation in Logic Programming were developed.
Abstract Interpretation can formalize the notion of a \symbolic computation" used in
CC. Notably, it de nes an abstraction function and a concretization function to relate
abstract program executions to concrete executions.</p>
      <p>
        Partial Deduction of Logic Programs was developed. Partial Deduction seems
particularly close to CC, in that it builds a nite number of nite execution trees from a
partially instantiated input. Like CC, it also synthesizes new programs from these nite
execution trees which respect the semantics of the source program. The correctness
and completeness of partial deduction were formally proven by Lloyd and
Shepherdson
        <xref ref-type="bibr" rid="ref8">(Lloyd and Shepherdson 1991)</xref>
        . However, standard Partial Deduction assumes the
roots of its execution trees to be atoms, while coroutines are more e ectively analyzed
together.
      </p>
      <p>Conjunctive Partial Deduction lifts the restriction that execution trees must start from
atoms. This allows it to analyze conjunctions, preserving interactions which cannot be
captured by Partial Deduction.</p>
      <p>
        Abstract Conjunctive Partial Deduction
        <xref ref-type="bibr" rid="ref7">(Leuschel 2004)</xref>
        , or ACPD for short, brings
the features of the above techniques together. It provides an extension of (Conjunctive)
Partial Deduction in which the analysis is based on Abstract Interpretation, rather
than on concrete evaluation.
      </p>
      <p>Our aim is to recast CC as a form of Abstract Conjunctive Partial Deduction. Such
a reformulation has two major advantages: First, it provides a framework in which the
execution of coroutining Logic Programs can be better understood. Second, it enables a
transformation to from programs with delay statements to pure logic programs, allowing
for additional analysis and optimization. We show that, for simple examples, recasting the
approach is possible. For more complex examples, an extension to ACPD is required to
overcome one of the restrictions in its original formulation.</p>
    </sec>
    <sec id="sec-2">
      <title>2 Related work</title>
      <p>
        The CC-transformation raised challenges for a number of researchers and a range of
competing transformation and synthesis techniques. A rst reformulation of the
CCtransformation was proposed in the context of the \programs-as-proofs" paradigm, in
        <xref ref-type="bibr" rid="ref15">(Wiggins 1990)</xref>
        . It was shown that CC-transformations, to a limited extent, could be
formalized in a proof-theoretic program synthesis context.
      </p>
      <p>
        In
        <xref ref-type="bibr" rid="ref1">(Boulanger et al. 1993)</xref>
        , the CC-transformation was revisited on the basis of a
combination of Abstract Interpretation and constraint processing. This improved the
formalization of the technique, but it did not clarify the relation with Partial Deduction.
      </p>
      <p>
        The seminal survey paper on Unfold/Fold transformation,
        <xref ref-type="bibr" rid="ref5 ref9">(Pettorossi and Proietti
1994)</xref>
        , showed that basic CC-transformations are well in the scope of Unfold/Fold
transformation. In later works (e.g.
        <xref ref-type="bibr" rid="ref10">(Pettorossi and Proietti 2002)</xref>
        ), the same authors introduced
list-introduction into the Unfold/Fold framework, whose function is very similar to that of
the multi abstraction in our approach. Also related to our work are
        <xref ref-type="bibr" rid="ref11">(Puebla et al. 1997)</xref>
        ,
providing alternative transformations to improve the e ciency of dynamic scheduling,
      </p>
      <p>
        Advances in Analyzing Coroutines by Abstract Conjunctive Partial Deduction 3
and
        <xref ref-type="bibr" rid="ref12">(Vidal 2011)</xref>
        and
        <xref ref-type="bibr" rid="ref13">(Vidal 2012)</xref>
        , which also provide a hybrid form of partial deduction,
combining abstract and concrete levels.
      </p>
      <p>In order to illustrate the use of ACPD for the analysis of coroutines, we require a few
conventions, as well as an abstract domain.</p>
    </sec>
    <sec id="sec-3">
      <title>3 Concepts</title>
      <sec id="sec-3-1">
        <title>3.1 Conventions</title>
        <p>Given a program P , F unP and P redP respectively denote the sets of all functors and
predicate symbols in the language underlying P . T ermP will denote the set of all terms
belonging to the concrete domain. AtomP denotes the set of all atoms which can be
constructed from P redP and T ermP . We refer to the set of conjunctions of atoms from
AtomP as ConAtomP .</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2 Abstract Domain</title>
        <p>The abstract domain consists of two types of new constant symbols: ai and gj, i 2 N0
and j 2 N0. The basic intuition for the symbols ai is that they represent any term of the
concrete language. The symbols gj denote any ground term in the concrete language.</p>
        <p>The subscripts i and j in ai and gj are used to represent aliasing. If an abstract term,
abstract atom or abstract conjunction of atoms contains ai or gj several times (with the
same subscript), the denoted concrete terms, atoms or conjunctions of atoms contain the
same term in all positions corresponding to those respectively occupied by ai and gj. If
an abstract term contains subterms ak and gk, where k is some element of N0, this has no
particular meaning: aliasing can only be speci ed between abstract symbols of the same
type. For instance, the abstract conjunction perm(g1; a1); ord(a1) denotes the concrete
conjunctions fperm(t1; t2); ord(t2)jt1; t2 2 T ermP ; t1 is groundg.</p>
        <p>Based on these two types of abstract constants, there is a set of abstract terms AT ermP ,
consisting of terms which can be constructed from the abstract constants and F unP .
AAtomP will denote the set of abstract atoms, being the atoms which can be constructed
from AT ermP and P redP . Finally, AConAtomP denotes the set of conjunctions of
elements of AAtomP .</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4 Examples</title>
      <p>The complete formalization of our approach requires a sizeable set of abstract operations
and is outside the scope of this paper. Because the e ects of these operations can be readily
understood, we will simply illustrate the analysis using two examples. The rst of these,
permutation sort, ts within Leuschel's original framework. The second, sameleaves, does
not. However, an extension to Leuschel's framework makes it possible to deal with a larger
class of programs to which sameleaves belongs.</p>
      <sec id="sec-4-1">
        <title>4.1 Permutation sort</title>
        <p>Listing 1 contains a Prolog implementation of permutation sort. It de nes the sorting
operation as a random permutation, followed by a test to see whether the result is ordered.
Assume an initial sort=2 query in which the rst argument is ground. The program then
generates a complete permutation of the ground argument and subsequently checks if the
sort(X,Y) :- perm(X,Y), ord(Y).
perm([],[]).
perm([X|Y],[U|V]) :- del(U,[X|Y],W),perm(W,V).
del(X,[X|Y],Y).
del(X,[Y|U],[Y|V]) :- del(X,U,V).
ord([]).
ord([X]).
ord([X,Y|Z]) :- X =&lt; Y, ord([Y|Z]).</p>
        <p>a1 = g1
ord(g1)
Listing 1: Prolog implementation of permutation sort</p>
        <p>sort(g1; a1)
perm(g1; a1); ord(a1)
g1 = [g2jg3]</p>
        <p>a1 = [a2ja3]
del(a2; [g2jg3]; a4); perm(a4; a3); ord([a2ja3])
result is ordered. A more e cient approach | though still not e cient in an absolute
sense | is to interleave the generation of the permutation with the check for ordering.
Each time an element is added to the permutation, it can be compared to its predecessor
(if any). If the check fails, there is no point in completing the permutation.</p>
        <p>ACPD requires a top-level abstract atom (or conjunction) to start the transformation.
Let sort(g; a1) be this atom. As in standard partial deduction, we initialize a set of analyzed
roots A as the singleton set of the top-level query, i.e. fsort(g; a1)g.</p>
        <p>Next, we construct a nite number of nite, ACPD derivation trees for abstract
(conjunctions of) atoms. The construction of these trees relies on operations for abstract
uni cation and abstract resolution.</p>
        <p>To specify the control ow, we assume an \oracle" which decides on the selection rule
applied in the abstract derivation trees. This oracle has three functions:
to decide whether an obtained goal should be unfolded further, or whether it should
be kept residual (to be split and added to A).</p>
        <p>perm(g1; a1); ord([g2ja1])
to decide which atom of the current goal should be selected for unfolding.
to decide whether to \fully evaluate" a selected atom.</p>
        <p>The third type of decision is not commonly supported in partial deduction. What it
means is that we decide not to transform a certain predicate of the original program, but
merely keep its original de nition in the transformed program.</p>
        <p>
          In our setting, however, we want to know the e ect that solving the atom has on the
remainder of the goal. Therefore, we assume that a full abstract interpretation over our
abstract domain computes the abstract bindings that solving the atom results in. These are
applied to the remainder of the goal. In
          <xref ref-type="bibr" rid="ref12">(Vidal 2011)</xref>
          , a similar functionality is integrated
in a hybrid approach to conjunctive partial deduction.
        </p>
        <p>In Figures 1 through 3, in each goal, the atom selected for abstract unfolding is
underlined. If an atom is underlined twice, this expresses that the atom was selected for full
abstract interpretation.</p>
        <p>Both unfolding and full abstract evaluation may create bindings. These are indicated
next to the branches of the derivation trees.</p>
        <p>A goal with no underlined atom indicates that the oracle selects no atom and decides
to keep the conjunction residual. After the construction of the tree in Figure 1, ACPD
adds the abstract conjunction perm(g5; a3); ord([g4ja3]) to A. ACPD starts a new tree for
(a renaming of) this atom. This tree is shown in Figure 2.</p>
        <p>The tree looks similar to the one in Figure 1 without its root. The main di erence is
that, in the residual leaf of the second tree, the ord atom now has a list argument with
two g elements. This pattern does not yet exist in the current A and is therefore added to
A. A third abstract tree is computed for perm(g1; a1); ord([g2; g3ja1]), shown in Figure 3.</p>
        <p>In Figure 3, the leaf perm(g1; a1); ord([g3ja1]) is a renaming of perm(g1; a1); ord([g2ja1]),
which is already contained in A. Therefore, ACPD terminates the analysis, concluding A
covers all possible roots for A = fsort(g1; a1); ^(perm(g1; a1); ord([g2ja1])); ^(perm(g1; a1);
ord([g2; g3ja1]))g.</p>
        <p>In concrete conjunctive partial deduction, the analysis phase would now be completed.
In ACPD, however, we need an additional step. In the abstract derivation trees, we have
not collected the concrete bindings that unfolding would produce. These are required to
generate the resolvents. Therefore, we need an additional step, constructing essentially the
same three trees again by resolving the same clauses, but now using concrete terms and
concrete uni cation.
We only show one of these concrete derivation trees in Figure 4.</p>
        <p>4.2 Sameleaves
sameleaves(T1,T2) :- collect(T1,T1L),collect(T2,T2L),eq(T1L,T2L).
eq([],[]).
eq([H|T1],[H|T2]) :- eq(T1,T2).
collect(node(X),[X]).
collect(tree(L,R),C) :- collect(L,CL), collect(R,CR), append(CL,CR,C).
append([],L,L).
append([H|T],L,[H|TR]) :- append(T,L,TR).</p>
        <p>Listing 2: Prolog implementation of Sameleaves</p>
        <p>Listing 2 shows a program which cannot be analyzed using the technique outlined above.
Assume a top-level query of the form sameleaves(g1; g2). Trying to analyze this program
in the same way as the permutation sort program leads to an in nite derivation. This
is due to the fact that trees may be nested to an arbitrary depth. Adding each newly
derived conjunction to A would prevent the procedure from nding a xpoint for A. We
could solve this by cutting the goal into two smaller conjunctions and adding these to A.
However, all these atoms behave as generators or testers and depend on each other. By
splitting the conjunction, we would no longer be able to analyze the coroutining behaviour.</p>
        <p>One of the restrictions imposed by ACPD is that for any abstract conjunction of atoms,
acon 2 AConAtomP , there exists a concrete conjunction, con 2 ConAtomP , such that any
instantiation of acon is also an instance of con. In practice, this means that an abstract
conjunction is not allowed to represent a set of concrete conjunctions whose elements
have a distinct number of conjuncts. However, in order to solve the problem observed
in our example, we need the ability to represent conjunctions with a growing number
of atoms by an abstract conjunct. Therefore, we need to extend ACPD. We introduce a
new abstraction, multi, which makes it possible to represent growing conjunctions with a
repeating internal structure.</p>
        <p>To specify the relationship of an abstracted set of conjunctions with the surrounding
context, as well as its internal structure, we introduce the \parameterized renaming".
The parameterized renaming of a conjunction C is obtained by replacing every aj or gk
occurring in C by its respective parameterized naming, aId;i;j or gId;i;k. Here, Id is a
unique identi er for the multi abstraction with which the renaming will be associated, as
several multi abstractions may be needed to complete the analysis. The i is symbolic and
is used to specify data shared between abstracted conjunctions. Finally, j and k ful ll the
same function as an aliasing index, but within the local scope of a multi abstraction.</p>
        <p>The multi abstraction is then de ned as a construct of the form multi(p(C); F irst;
Consecutive; Last), where:
p(C) is the parameterized conjunction for some C 2 AConAtomP .</p>
        <p>F irst is a conjunction of equalities aId;1;j = bj and gId;1;k, where bj and bk occur
outside the abstraction and all left-hand sides of the equalities are distinct.
Consecutive is a conjunction of equalities aId;i+1;j = aId;i;j0 and gId;i+1;k = gId;i;k0 ,
where all left-hand sides of the equalities are distinct.</p>
        <p>Last is a conjunction of equalities aId;L;j = bj and gId;L;k = bk, where bj and bk occur
outside the abstraction occurs and all left-hand sides of the equalities are distinct.</p>
        <p>Inside this abstraction, the parameterized renaming p(C) represents an arbitrary
number of renamings of C. The bindings are used to specify how speci c conjunctions captured
Advances in Analyzing Coroutines by Abstract Conjunctive Partial Deduction 7
by the abstraction are bound to their surrounding environment. Speci cally, the F irst
bindings indicate how information is shared between the environment and the rst
conjunction captured. The subscript \1" used in this set of equalities is a reminder that these
equalities pertain to the rst captured conjunction. The Consecutive bindings indicate
which values are shared between consecutive conjunctions captured by the abstraction.
Because the abstraction represents a linear structure, we can relate values in some
conjunction i to those in its successor, i + 1. The Last bindings are similar to the F irst
bindings, but pertain to the last rather than the rst captured conjunction. The subscript
\L" is also a reminder of the conjunction to which these bindings apply.</p>
        <p>The problem of a growing recursion is illustrated in Figure 5 and generalization using
the multi abstraction is shown in Figure 6. Because the subconjunction collect(g3; a3);
collect(g4; a4); append(a3; a4; a5) obeys a pattern common to all growing conjunctions,
the recursion can be detected algorithmically. After generalization, the leaf of Figure
6 is added to A in the standard way. The left branch of Figure 7 demonstrates how
further unfolding followed by generalization can lead back to a renaming of this state.
The rst branch to the right shows how the bindings pass information between the multi
abstraction and its environment: When a3 is bound to [g4jg5] in the environment (with
g5 the most speci c abstraction of the empty list), it also becomes bound in the F irst
bindings. The second level of branching shows how the multi abstraction is unfolded:
In the rst case, it represents a single conjunction to which both the F irst and Last
bindings are applied. In the second, it represents a larger conjunction whose rst abstracted
subconjunction is moved outside the abstraction. The current F irst bindings are applied
to this subconjunction and new F irst bindings are then computed based on the current
Consecutive bindings.</p>
        <p>The complete analysis of sameleaves is considerably longer and involves some interesting
patterns of computation. However, the operations shown are enough nd a xpoint for A
and complete the analysis.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5 Current status</title>
      <p>
        We rst presented an earlier version of this research at LOPSTR 2014 and a corresponding
paper was published in
        <xref ref-type="bibr" rid="ref4">(De Schreye et al. 2014)</xref>
        . An extended journal paper was submitted
at the end of June, 2015. The latter version contains the formalizations for most of the
operations illustrated by example in this paper. It details an earlier variant of the multi
abstraction discussed here, which could not yet represent the growing sequence of atoms
found in the sameleaves program. The variant discussed here can do this, because it
abstracts linearly growing sequences of abstract conjunctions, rather than linearly growing
sequences of atoms. We conjecture that the abstraction is now general enough to deal with
any growing sequence of abstract atoms under an instantiation-based computation rule.
      </p>
      <p>We have applied the technique to analyze a range of well-known \toy" problems, notably
the permutation sort, graph coloring, prime generator, N-queens and sameleaves example.
A manually synthesized standard Prolog program based on this analysis is available for the
rst four problems. Such a synthesis can also be performed for the sameleaves program.
The reason it has not yet been written is simply because the analysis is quite long.</p>
      <p>To demonstrate that the approach can be automated, we have developed an
implementation which performs the complete analysis phase. It requires the user to specify the
decisions made by the oracle: For the selection rule, it uses delay declarations. For the
calls which require a full evaluation, it requires the user to map an atom to be solved onto
an output atom. Also, the analyzer requires the user to specify which conjunctions should
be generalized into a multi abstraction. This is done using a grammar of conjunctions,
with each conjunction produced by the grammar a possible instantiation of the multi
abstraction. With this information, the analyzer is capable of performing the complete
analysis phase for any example we have found, including the sameleaves program.</p>
      <p>Advances in Analyzing Coroutines by Abstract Conjunctive Partial Deduction 9</p>
    </sec>
    <sec id="sec-6">
      <title>6 Future work</title>
      <p>First and foremost, we want to investigate the generality of the multi abstraction. No
examples which give rise to nested multi abstractions have been examined yet. These are
certain to occur in complex, real-world programs. Likewise, use of the multi abstraction to
represent disjunctions as well as conjunctions is a worthwhile avenue for future research.
Eventually, we hope to formally characterize the class of programs which can be analyzed
using our approach.</p>
      <p>We also plan to re-examine ACPD as formulated by Leuschel, in order to fully integrate
the multi abstraction. In this way, we hope to retain all correctness results of ACPD for
the analysis and compilation of coroutines in full generality.</p>
      <p>Improvements to the implementation can also be made. We hope to integrate the current
prototype with an existing system for abstract interpretation. This should free the user
from the need to specify the e ects of a full evaluation of abstract atoms. Similarly, we
would like to investigate how the grammatical description of growing conjunctions can be
derived automatically. With both improvements, the entire analysis and synthesis could be
done algorithmically using only the program source code and delay statements. We believe
this will open up interesting new paths for further program analysis and optimization.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Boulanger</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bruynooghe</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>De Schreye</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <year>1993</year>
          .
          <article-title>Compiling control revisited: A new approach based upon abstract interpretation for constraint logic programs</article-title>
          .
          <source>In LPE</source>
          .
          <volume>39</volume>
          {
          <fpage>51</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Bruynooghe</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Schreye</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Krekels</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <year>1989</year>
          .
          <article-title>Compiling control</article-title>
          .
          <source>The Journal of Logic Programming</source>
          <volume>6</volume>
          ,
          <issue>1</issue>
          , 135{
          <fpage>162</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Bueno</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cabeza</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Carro</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hermenegildo</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lopez-Garc</surname>
            <given-names>a</given-names>
          </string-name>
          , P., and
          <string-name>
            <surname>Puebla</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <year>1997</year>
          .
          <article-title>The ciao prolog system</article-title>
          .
          <source>Reference Manual. The Ciao System Documentation Series{TR CLIP3/97.1</source>
          , School of Computer Science, Technical University of Madrid (UPM)
          <volume>95</volume>
          ,
          <fpage>96</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>De Schreye</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nys</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Nicholson</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Analysing and compiling coroutines with abstract conjunctive partial deduction</article-title>
          .
          <source>In Logic-Based Program Synthesis and Transformation</source>
          . Springer,
          <volume>21</volume>
          {
          <fpage>38</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Hill</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J. W.</given-names>
          </string-name>
          <year>1994</year>
          .
          <article-title>The Godel programming language</article-title>
          . MIT press.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Kowalski</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <year>1979</year>
          .
          <article-title>Algorithm=logic+ control</article-title>
          .
          <source>Communications of the ACM 22</source>
          ,
          <issue>7</issue>
          , 424{
          <fpage>436</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Leuschel</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2004</year>
          .
          <article-title>A framework for the integration of partial evaluation and abstract interpretation of logic programs</article-title>
          .
          <source>ACM Transactions on Programming Languages and Systems (TOPLAS) 26</source>
          ,
          <issue>3</issue>
          , 413{
          <fpage>463</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J. W.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Shepherdson</surname>
            ,
            <given-names>J. C.</given-names>
          </string-name>
          <year>1991</year>
          .
          <article-title>Partial evaluation in logic programming</article-title>
          .
          <source>The Journal of Logic Programming</source>
          <volume>11</volume>
          ,
          <issue>3</issue>
          , 217{
          <fpage>242</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Pettorossi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Proietti</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>1994</year>
          .
          <article-title>Transformation of logic programs: Foundations and techniques</article-title>
          .
          <source>The Journal of Logic Programming</source>
          <volume>19</volume>
          ,
          <issue>261</issue>
          {
          <fpage>320</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Pettorossi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Proietti</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2002</year>
          .
          <article-title>The list introduction strategy for the derivation of logic programs</article-title>
          .
          <source>Formal aspects of computing 13</source>
          ,
          <fpage>3</fpage>
          -
          <lpage>5</lpage>
          ,
          <issue>233</issue>
          {
          <fpage>251</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Puebla</surname>
            , G., de la Banda,
            <given-names>M. J. G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Marriott</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Stuckey</surname>
            ,
            <given-names>P. J.</given-names>
          </string-name>
          <year>1997</year>
          .
          <article-title>Optimization of logic programs with dynamic scheduling</article-title>
          .
          <source>In ICLP</source>
          . Vol.
          <volume>97</volume>
          . 93{
          <fpage>107</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Vidal</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <year>2011</year>
          .
          <article-title>A hybrid approach to conjunctive partial evaluation of logic programs</article-title>
          .
          <source>In Logic-Based Program Synthesis and Transformation</source>
          , M. Alpuente,
          <source>Ed. Lecture Notes in Computer Science</source>
          , vol.
          <volume>6564</volume>
          . Springer Berlin Heidelberg,
          <volume>200</volume>
          {
          <fpage>214</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Vidal</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>Annotation of logic programs for independent and-parallelism by partial evaluation</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>12</volume>
          ,
          <fpage>4</fpage>
          -
          <lpage>5</lpage>
          ,
          <issue>583</issue>
          {
          <fpage>600</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <surname>Wielemaker</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schrijvers</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Triska</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Lager</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>Swi-prolog</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>12</volume>
          ,
          <fpage>1</fpage>
          -
          <lpage>2</lpage>
          ,
          <issue>67</issue>
          {
          <fpage>96</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Wiggins</surname>
            ,
            <given-names>G. A.</given-names>
          </string-name>
          <year>1990</year>
          .
          <article-title>The improvement of prolog program e ciency by compiling control: A proof-theoretic view</article-title>
          .
          <source>Department of Arti cial Intelligence</source>
          , University of Edinburgh.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>