<!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>Probabilistic Inference in SWI-Prolog</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Fabrizio Riguzzi</string-name>
          <email>fabrizio.riguzzi@unife.it</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jan Wielemaker</string-name>
          <email>j.wielemaker@cs.vu.nl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Riccardo Zese</string-name>
          <email>riccardo.zese@unife.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centrum Wiskunde &amp; Informatica</institution>
          ,
          <addr-line>Amsterdam</addr-line>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dipartimento di Ingegneria</institution>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Dipartimento di Matematica e Informatica</institution>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>University of Ferrara</institution>
          ,
          <addr-line>Ferrara</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Probabilistic Logic Programming (PLP) emerged as one of the most prominent approaches to cope with real-world domains. The distribution semantics is one of most used in PLP, as it is followed by many languages, such as Independent Choice Logic, PRISM, pD, Logic Programs with Annotated Disjunctions (LPADs) and ProbLog. A possible system that allows performing inference on LPADs is PITA, which transforms the input LPAD into a Prolog program containing calls to library predicates for handling Binary Decision Diagrams (BDDs). In particular, BDDs are used to compactly encode explanations for goals and e ciently compute their probability. However, PITA needs modedirected tabling (also called tabling with answer subsumption), which has been implemented in SWI-Prolog only recently. This paper shows how SWI-Prolog has been extended to include correct answer subsumption and how the PITA transformation has been changed to use SWI-Prolog implementation.</p>
      </abstract>
      <kwd-group>
        <kwd>Probabilistic Logic Programming</kwd>
        <kwd>Tabling</kwd>
        <kwd>Answer Subsumption</kwd>
        <kwd>Logic Programs with Annotated Disjunctions</kwd>
        <kwd>Program Transformation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Probabilistic Programming (PP) [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] allows users to de ne complex probabilistic
models and perform inference and learning on them. In fact, many real-world
domains can only be represented e ectively by exploiting uncertainty. To model
complex domains containing many uncertain relationships among their entities,
Probabilistic Logic Programming (PLP) [
        <xref ref-type="bibr" rid="ref16 ref8">8,16</xref>
        ] has emerged among the PP
proposals as one of the most prominent approaches to cope with such relationships.
      </p>
      <p>
        In PLP, the distribution semantics [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] is at the basis of many languages.
Examples of languages that follow the distribution semantics are Independent
Choice Logic [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], PRISM [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ], Logic Programs with Annotated Disjunctions
(LPADs) [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ] and ProbLog [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. All these languages have the same expressive
power as a theory in one language can be translated into another [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. LPADs
o er a general syntax as the constructs of all the other languages can be directly
encoded in this language.
      </p>
      <p>
        The PITA algorithm (for \Probabilistic Inference with Tabling and Answer
subsumption"), presented in [
        <xref ref-type="bibr" rid="ref18 ref19 ref20">18,19,20</xref>
        ], takes as input an LPAD and builds
Binary Decision Diagrams (BDDs) for every subgoal encountered during the
derivation of the query. The use of BDDs is due to the fact that they allow an e cient
computation of the probability of the query. Speci cally, PITA transforms the
input LPAD into a normal logic program in which the subgoals have an extra
argument storing a BDD that represents the explanations for their answers. As its
name implies, PITA uses tabling with answer subsumption to store explanations
for a goal.
      </p>
      <p>Tabling is a logic programming technique for saving time and ensuring
termination for programs without function symbols. With tabling, the Prolog
interpreter keeps a store of the subgoals encountered in a derivation together with
answers to these subgoals. The stored answers are then retrieved in successive
calls of the subgoals, to avoid their re-computation and in nite loops.</p>
      <p>
        PITA is also used in machine learning systems: EMBLEM [
        <xref ref-type="bibr" rid="ref3 ref4">4,3</xref>
        ] and
SLIPCOVER [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], performing respectively parameter and structure learning, use PITA
for computing the probability of examples.
      </p>
      <p>
        Initially, PITA was implemented in the XSB and YAP systems, which allow
the use of answer subsumption. We decided to port it to SWI-Prolog in order to
exploit the SWISH framework for developing web applications [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ]. This allowed
us to develop cplint on SWISH [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], a web application for probabilistic logic
programming available at http://cplint.eu.
      </p>
      <p>The porting of PITA to the SWI-Prolog system led to the extension of its
tabling implementation to feature answer subsumption as well. With answer
subsumption, or mode-directed tabling, the answers for a goal are aggregated
when the individual answers are not needed.</p>
      <p>In this paper, we discuss the extension implemented in SWI-Prolog's tabling
and present how we modi ed PITA to cope with the new SWI-Prolog
implementation of mode-directed tabling.</p>
      <p>The paper is organized as follows. Section 2 brie y introduces PLP and
in particular the LPAD language. Section 3 discusses tabling in SWI-Prolog,
while Section 4 illustrates the implementation of answer subsumption. Section 5
presents the PITA algorithm and transformation, and Section 6 its adaptation
to SWI-Prolog. Finally, Section 7 concludes the paper.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Probabilistic Logic Programming</title>
      <p>
        PLP languages under the distribution semantics [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] have been used to represent
a wide variety of domains [
        <xref ref-type="bibr" rid="ref1 ref17 ref2">1,2,17</xref>
        ]. A program in a language adopting the
distribution semantics de nes a probability distribution over normal logic programs
called worlds. Each normal program is assumed to have a total well-founded
model [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ]. Then, the distribution is extended to queries and the probability of
a query is obtained by marginalizing the joint distribution of the query and the
programs.
      </p>
      <p>
        Logic Programs with Annotated Disjunctions (LPADs) [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ] have the most
general syntax among PLP languages under the distribution semantics.
      </p>
      <p>In LPADs, heads of clauses are disjunctions in which each atom is annotated
with a probability. An LPAD T is a nite set of clauses: T = fC1; : : : ; Cng.
Each clause Ci takes the form: hi1 : i1; : : : ; hivi : ivi : bi1; : : : ; biui , where
hi1; : : : ; hivi are logical atoms, bi1; : : : ; biui are logical literals and
i1; : : : ; ivi are real numbers in the interval [0; 1] that sum to 1. bi1; : : : ; biui
is indicated with body(Ci). Note that if vi = 1 the clause corresponds to a
non-disjunctive clause. We also allow clauses where Pvki=1 ik &lt; 1: in this case
the head of the annotated disjunctive clause implicitly contains an extra atom
null that does not appear in the body of any clause and whose annotation is
1 Pvki=1 ik. We denote by ground(T ) the grounding of an LPAD T .</p>
      <p>
        We present here the semantics of LPADs for the case of no function symbols,
for the case of function symbols see [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
      </p>
      <p>
        Each grounding Ci j of a clause Ci corresponds to a random variable Xij
with values f1; : : : ; vig, i.e., it indicates which head literal is chosen. The random
variables Xij are independent of each other. An atomic choice [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] is a triple
(Ci; j ; k) where Ci 2 T , j is a substitution that grounds Ci and k 2 f1; : : : ; vig
identi es one of the head atoms. In practice (Ci; j ; k) corresponds to an
assignment Xij = k.
      </p>
      <p>A selection is a set of atomic choices that, for each clause Ci j in ground(T ),
contains an atomic choice (Ci; j ; k). A selection identi es a normal logic
program l de ned as l = f(hik : body(Ci)) j j(Ci; j ; k) 2 g. l is called a world
of T . Since the random variables associated to ground clauses are independent,
we can assign a probability to instances: P (l ) = Q(Ci; j;k)2 ik.</p>
      <p>We consider only sound LPADs where, for each selection , the well-founded
model of the program l chosen by is two-valued. We write l j= q to mean
that the query q is true in the well-founded model of the program l . Since the
well-founded model of each world is two-valued, q can only be true or false in l .</p>
      <p>We denote the set of all instances by LT . Let P (l) be the distribution over
instances. The probability of a query q given an instance l is P (qjl) = 1 if l j= q
and 0 otherwise. The probability of a query q is given by</p>
      <p>P (q) = X P (q; l) = X P (qjl)P (l) =
l2LT
l2LT</p>
      <p>X
l2LT :lj=q</p>
      <p>P (l)
(1)
Example 1. The following LPAD models the appearance of medical symptoms
as a consequence of disease. A person may sneeze if he has the u or if he has
hay fever:</p>
      <p>C1 = strong sneezing(X) : 0:3 ; moderate sneezing(X) : 0:5</p>
      <p>u(X):
C2 = strong sneezing(X) : 0:2 ; moderate sneezing(X) : 0:6</p>
      <p>hay fever (X):
C3 = u(bob):</p>
      <p>C4 = hay fever (bob):
Here clauses C1 and C2 have three alternatives in the head of which the one
associated to atom null is left implicit. This program has 9 worlds, the query
strong sneezing(bob) is true in 5 of them, and P (strong sneezing(bob)) = 0:3
0:2 + 0:3 0:6 + 0:3 0:2 + 0:2 0:5 + 0:2 0:2 = 0:44.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Tabling</title>
      <p>Tabling is a logic programming technique for saving time and ensuring
termination for programs without function symbols.</p>
      <p>
        With tabling, the Prolog interpreter keeps a store of the subgoals encountered
in a derivation together with answers to these subgoals. If one of the subgoals
is encountered again, its answers are retrieved from the store rather than
recomputing them. Tabling is implemented in the Prolog systems XSB [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ], YAP
[
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] and SWI-Prolog [
        <xref ref-type="bibr" rid="ref30">30</xref>
        ].
      </p>
      <p>
        Tabling is implemented in SWI-Prolog using delimited control [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
Delimited control [
        <xref ref-type="bibr" rid="ref11 ref6">6,11</xref>
        ] was originally introduced in functional programming and
is based on two operators, implemented in SWI-Prolog with the predicates
reset(Goal,Cont,Term1) and shift(Term2). The rst executes the goal in
Goal and uni es the other two arguments on the basis of the results of calls to
shift/1 during the execution of the goal. If Goal calls shift/1, the execution
of the goal is interrupted, the rest of its code up to the nearest call to reset/3,
called delimited continuation, is represented as a Prolog term and uni ed with
Cont in reset/3, while the value Term2 in shift/1 is uni ed with Term1 in
reset/3. Finally, the execution restarts from the code just after the call to
reset/3.
      </p>
      <p>
        Example 2. We report here the example shown in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Consider the following
program:
p :- reset(q,Cont,Term1),
writeln(Term1),
writeln(Cont),
writeln('end').
q :- writeln('before shift'),
shift('return value'),
writeln('after shift').
shift/1 instantiates Cont with the writeln('after shift') goal and Term1
with the term 'return value' in reset/3. The output of this program is:
?- p.
before shift
return value
[$cont$(785488,[])]
end
As one can see, when entering in q the execution is interrupted by the call to
shift/1. The continuation in this case is not called, therefore what follows the
call to shift/1 is not executed.
      </p>
      <p>If we modify p by replacing writeln(Cont) with call(Cont), then the input
would be
?- p.
before shift
after shift
end
In this case, continuation is called and, therefore, the goal writeln('after shift')
is executed.</p>
      <p>Predicates are declared as tabled using the table/1 directive. Tabled
predicates are transformed in order to collect answers. This transformation makes
use of the table/2 predicate, which retrieves the table data structure containing
the answers to the tabled predicate.</p>
      <p>Example 3. The program on the left is transformed in that shown on the right
:- table p/2.
p(X,Y) :- p(X,Z), e(Z,Y).
p(X,Y) :- e(X,Y).</p>
      <p>p(X,Y) :- table(p(X,Y),p_aux(X,Y)).
! p_aux(X,Y) :- p(X,Z), e(Z,Y).</p>
      <p>p_aux(X,Y) :- e(X,Y).</p>
      <p>When a tabled predicate is called, the execution enters in a delimited answer
computation starting the reset phase. If this phase succeeds normally, the
answer is added to the table of the tabled predicate. If the tabled predicate calls a
predicate that is tabled as well, then the computation enters in the shift phase
without producing an answer and the rst predicate is suspended, capturing the
reminder in Cont. At this point the so-called completion phase starts,
collecting all the possible continuation, to nd answers for the tabled predicate in the
reset phase.</p>
      <p>A call to a tabled predicate can be either a leader or a follower: a leader
has only non-tabled ancestors in the call graph, while a follower has a tabled
ancestor in the call graph. The leader and the followers that are his descendants
make up a scheduling component. completion is performed on one component
at a time.</p>
      <p>Each component is associated to a global worklist, i.e., a queue of tables.
There is a table for each subgoal for the tabled predicates, called call variants,
mapping it to a data structure containing its answers, in the form of an answer
trie.</p>
      <p>Each table is also associated to a local worklist that is a dequeue containing
answers and dependencies. A dependency is a triple formed by a source, a
continuation and a target. If collecting answers for a tabled call p requires the answers
for a tabled call q (q may be p itself), then p is the target and q is the source. A
dependency indicates that, given an answer for the source call q, we can obtain
an answer for the target call p by resuming the suspended continuation. The
continuation's answer is then uni ed with p.</p>
      <p>During the completion phase, tables from the global worklist are extracted
one at a time and the local worklist of the considered table is used to nd all the
answers for the corresponding tabled call. During the reset phase, each time
an answer is found for a call p, it is added to the list of answers in the table
for p and to the left of the dequeue of the local worklist of subgoals calling p,
while each time the execution enters in the shift phase a new dependency for
p is added to the right of its worklist. Then, pairs (answer, dependency) are
extracted from the dequeue of the local worklist to try to nd new answers.
Note that the answer in the pair is an answer for the source predicate. Pairs
are created by associating an answer to the dependency that is immediately to
its right in the dequeue. After the combination, the answer and the dependency
just combined are swapped, moving the answer to the right of the dependency,
meaning that their pair have been already tested. Then, answer and dependency
from the pair are combined using values in answer to instantiate variables in
source, continuation and, eventually, in target, and the predicate in continuation
is called to nd new answers for the target, i.e., instantiate all the remaining
free variables in target. The new answer for target is then added to the answers
list in its table and to the left of the dequeue of the local worklists where the
predicate is the source of some dependencies. The completion phase stops when
all the answers in all the local worklists are on the left of all the dependencies,
meaning that all the combinations have been tested and no more answers can
be found.</p>
      <p>Note that in the real implementation there are some minor di erences with
this description due to performance reasons. For example, answers and
dependencies in local worklists are considered in homogeneous batches instead of one at
a time and the combination of the two batches is performed by means of
Cartesian product. Moreover, the batches containing answers contain also answers
for predicates di erent from that in source, however, during the combination if
answer and dependency do not match then their combination is discarded.</p>
      <p>When all the answers for the subogoal in the reset phase are found, they are
returned by table/2 one at a time to continue the computation of the query.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Mode-Directed Tabling and Answer Subsumption</title>
      <p>As seen in the previous section, plain tabling creates an answer table per call
variant and guarantees termination if the created data structures are nite. For
example, this allows us to prove whether a graph connects the nodes A and B
while the graph is undirected or cyclic. However, it does not allow us to return
the path between A and B because an in nite number of such paths can be
constructed by going back and forth or following cycles. This limitation also
blocks us from obtaining all proofs for a logical theory.</p>
      <p>
        The above problem is resolved using tabling with answer subsumption, also
called mode-directed tabling [
        <xref ref-type="bibr" rid="ref24 ref26">24,26</xref>
        ]. In mode-directed tabling, a subset of the
predicate arguments de nes the call variant while answers for the remaining
arguments are aggregated. A classical aggregation is, following the example above,
computing the minimum or shortest path. As the minimum can be considered
to subsume higher values this technique is also called Answer Subsumption.
      </p>
      <p>To facilitate PITA, we extended SWI-Prolog's original tabling
implementation with mode-directed tabling. The speci cation was inherited from XSB,
B-Prolog and YAP and includes the most generic aggregation function called
lattice that allows a user de ned predicate to determine the subsumer for the
aggregated answer so far and a new answer. The implementation is straight
forward. The modi ed table/1 directive is used to determine the term that is used
for call variant detection and compile a combined aggregation predicate that is
called for each answer that is added to the table. The answer table has been
extended such that each answer in the answer trie can be assigned an
aggregated value. The above mentioned generated predicate is called on each answer
to maintain the aggregated answer.</p>
      <p>Note that tabling does not guarantee a particular order in which suspended
computations are resumed and thus requires the aggregation function to produce
the correct result regardless of the order.</p>
      <p>Furthermore, if one mode-directed tabled goal is the follower of another as
in the example below where, given the goal p(A), p/1 is the leader and s/1 the
follower we get incorrect results because s/1 may succeed multiple times with
partial answers.
:- table
p(lattice(or/3)),
s(lattice(or/3)).
or(A,B,A-B).
p(A) :- s(A).
s(1).
s(2).</p>
      <p>In the initial implementation of mode-directed tabling in SWI-Prolog, the query
p(A) succeeded with answer A = 1-2-(1-2) instead of the desired A = (1-2).</p>
      <p>
        This has been highlighted in [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] that showed that many implementations of
mode-directed tabling produce unsound results. The authors of [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] thus de ne
a formal semantics for mode-directed tabling that allows the evaluation of the
soundness of implementations. For the program above, the semantics returns
A = (1-2).
      </p>
      <p>
        In the semantics, aggregation is a post-processing step. Real systems
aggregate intermediate results during resolution for e ciency and to avoid loops.
The authors of [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] discuss conditions for this greedy strategy to be sound with
respect to the theoretical semantics.
      </p>
      <p>
        In order to make SWI-Prolog sound, we modi ed its tabling
implementation by creating a new component for every fresh mode-directed tabled goal we
encounter. This component is completed before execution of the parent
component is resumed with the complete aggregated result. This ensures soundness
with respect to the theoretical semantics of [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ], provided that within the
subcomponent we do not encounter a variant of a tabled goal that was started before
the subcomponent but has not yet been completed.
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>PITA</title>
      <p>
        The PITA system [
        <xref ref-type="bibr" rid="ref18 ref19 ref20">18,19,20</xref>
        ] applies a program transformation to an LPAD to
create a normal program that contains calls for manipulating BDDs. In the
implementation, these calls provide a Prolog interface to the CUDD4 [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ] C
library and use the following predicates5
{ init, end : for allocation and deallocation of a BDD manager, a data structure
used to keep track of the memory for storing BDD nodes;
{ zero(-BDD), one(-BDD), not(+BDDI, -BDDO), and(+BDD1, +BDD2,
      </p>
      <p>BDDO), or(+BDD1, +BDD2, -BDDO): Boolean operations between BDDs;
{ add var(+N Val,+Probs,-Var): addition of a new multi-valued variable with</p>
      <p>N Val values and parameters Probs;
{ equality(+Var,+Value,-BDD): BDD represents Var=Value, i.e. that the
random variable Var is assigned Value in the BDD;
{ ret prob(+BDD,-P): returns the probability of the formula encoded by BDD.
As said above, add var(+N Val,+Probs,-Var) adds a new random variable
associated to a new instantiation of a rule with N Val head atoms and parameters
list Probs. The auxiliary predicate get_var_n/4 is used to wrap add_var/3
and avoid adding a new variable when one already exists for an instantiation.
As shown below, a new fact var(R,S,Var) is asserted each time a new random
variable is created, where R is an identi er for the LPAD clause, S is a list of
constants, one for each variable of the clause, and Var is an integer that identi es
the random variable associated with clause R under a particular grounding. The
auxiliary predicate has the following de nition
get_var_n(R,S,Probs,Var):(var(R,S,Var) -&gt;</p>
      <p>true
;
).</p>
      <p>length(Probs,L),
add_var(L,Probs,Var),
assert(var(R,S,Var))
where Probs is a list of oats that stores the parameters in the head of rule R.
R, S and Probs are input arguments while Var is an output argument. assert/1
is a builtin Prolog predicate that adds its argument to the program, allowing its
dynamic extension.</p>
      <p>The PITA transformation applies to atoms, literals, conjunction of literals
and clauses. The transformation for an atom a and a variable D, P IT A(a; D),
is a with the variable D added as the last argument. The transformation for a
negative literal b = not a, P IT A(b; D), is the expression</p>
      <p>(P IT A(a; DN ) ! not(DN; D); one(D))
which is an if-then-else construct in Prolog: if P IT A(a; DN ) evaluates to true,
then not(DN; D) is called, otherwise one(D) is called.
4 http://vlsi.colorado.edu/~fabio/
5 BDDs are represented in CUDD as pointers to their root node.</p>
      <p>Example 5 (Example 1 Cont.). If we associate the random variables X11 with
(C1; fX=bobg; 1), X12 with (C1; fX=bobg; 2), X13 with (C1; fX=bobg; 3) X21 with
(C2; fX=bobg; 1), X22 with (C2; fX=bobg; 2) and X23 with (C2; fX=bobg; 3), the
BDD corresponding with the set LT for query strong sneezing(bob) is shown in
Figure 1. The probability of the query is computed by following the BDD and
C11
X21
1
n1
n2
0
computing the probability of each node</p>
      <p>Prob(n2) = 0:2 1 + 0:8 0 = 0:2</p>
      <p>Prob(n1) = 0:3 1 + 0:7 0:2 = 0:44
so P (strong sneezing(bob)) = Prob(n1) = 0:44 as shown in Example 1.
6</p>
    </sec>
    <sec id="sec-6">
      <title>Extension of PITA for SWI-Prolog</title>
      <p>PITA in SWI-Prolog adds the library predicate:
{ and check(+D1,+D2,-DO) fails if one of the input arguments is the BDD
representing the Boolean constant 0, otherwise it succeeds returning the
conjunction of the input arguments.</p>
      <p>The tabling implementation in SWI-Prolog doesn't handle cut thus the
if-thenelse construct cannot be used to implement negation. In SWI-Prolog the
transformation for a negative literal b = not a, P IT A(b; DN ) is the conjunction
P IT A(a; D); not(D; DN ). A conjunction of literals b1; : : : ; bm becomes:
P IT A(b1; : : : ; bm; D) = one(DD0);</p>
      <p>P IT A(b1; D1); and check(DD0; D1; DD1); : : : ;</p>
      <p>P IT A(bm; Dm); and check(DDm 1; Dm; D):
Clauses are then transformed as in PITA for XSB. Moreover, for each predicate
p=n, an extra clause of the form
p(X1; : : : ; Xn; D)</p>
      <p>nonvar(X1); : : : ; nonvar(Xn); zero(D):
is added to the program, where nonvar=1 is an extra-logical predicate that
succeeds if its argument is not a variable. We call these zero clauses.</p>
      <p>Such a transformation is used in combination with answer subsumption. Each
predicate is tabled and answer subsumption is applied to the BDD argument
added by the PITA transformation, de ning as lattice the or/3 predicate. This
combines every BDD, which corresponds to a di erent explanation for the call
variant of the predicate, in order to compute a nal BDD representing the set
of all the explanations. If the goal fails, the only BDD returned is the one
representing the 0 constant, which leads to the fail of and check/3, otherwise, the
zero BDD is disjoint with other BDDs, maintaining unchanged their truth value.</p>
      <p>In this way, negative literals b = not a are handled by rst collecting the
BDD representing all the explanations for a by means of answer subsumption.
The nal BDD is then negated to nd the BDD for b.
7</p>
    </sec>
    <sec id="sec-7">
      <title>Conclusion</title>
      <p>
        In this paper we presented an extension of the tabling system of SWI-Prolog
for including sound answer subsumption. Moreover, we presented an extension
of the PITA transformation, which takes an LPAD program and translates it
into a normal program using the tabling implementation of SWI-Prolog.
Possible future directions for improving the tabling implementation are sharing tables
between threads, incremental tabling, handling negation, improving space and
time performance. We will also extend PITA to handle other reasoning types,
such as inference and learning for probabilistic abductive logic programs,
extending [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. In addition, we plan to make a comparison with XSB in terms of
performance.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Alberti</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bellodi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cota</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zese</surname>
          </string-name>
          , R.: cplint on SWISH:
          <article-title>Probabilistic logical inference with a web browser</article-title>
          .
          <source>Intell. Artif</source>
          .
          <volume>11</volume>
          (
          <issue>1</issue>
          ),
          <volume>47</volume>
          {
          <fpage>64</fpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Alberti</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cota</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zese</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Probabilistic logical inference on the web</article-title>
          . In: Adorni,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Cagnoni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Gori</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Maratea</surname>
          </string-name>
          , M. (eds.)
          <source>AI*IA 2016. LNCS</source>
          , vol.
          <volume>10037</volume>
          , pp.
          <volume>351</volume>
          {
          <fpage>363</fpage>
          . Springer International Publishing (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Bellodi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Experimentation of an expectation maximization algorithm for probabilistic logic programs</article-title>
          .
          <source>Intell. Artif</source>
          .
          <volume>8</volume>
          (
          <issue>1</issue>
          ),
          <volume>3</volume>
          {
          <fpage>18</fpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Bellodi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Expectation maximization over binary decision diagrams for probabilistic logic programs</article-title>
          .
          <source>Intell. Data Anal</source>
          .
          <volume>17</volume>
          (
          <issue>2</issue>
          ),
          <volume>343</volume>
          {
          <fpage>363</fpage>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Bellodi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Structure learning of probabilistic logic programs by searching the clause space</article-title>
          .
          <source>Theor. Pract. Log. Prog</source>
          .
          <volume>15</volume>
          (
          <issue>2</issue>
          ),
          <volume>169</volume>
          {
          <fpage>212</fpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Danvy</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Filinski</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Abstracting control</article-title>
          .
          <source>In: LISP and Functional Programming</source>
          . pp.
          <volume>151</volume>
          {
          <issue>160</issue>
          (
          <year>1990</year>
          ), http://doi.acm.
          <source>org/10</source>
          .1145/91556.91622
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>De Raedt</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Demoen</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fierens</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gutmann</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Janssens</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kimmig</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Landwehr</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mantadelis</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meert</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rocha</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Santos</given-names>
            <surname>Costa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Thon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            ,
            <surname>Vennekens</surname>
          </string-name>
          , J.:
          <article-title>Towards digesting the alphabet-soup of statistical relational learning</article-title>
          .
          <source>In: NIPS 2008 Workshop on Probabilistic Programming</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>De Raedt</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Frasconi</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kersting</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Muggleton</surname>
          </string-name>
          , S. (eds.):
          <article-title>Probabilistic Inductive Logic Programming</article-title>
          ,
          <source>LNCS</source>
          , vol.
          <volume>4911</volume>
          . Springer (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>De Raedt</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kimmig</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Toivonen</surname>
          </string-name>
          , H.:
          <article-title>ProbLog: A probabilistic Prolog and its application in link discovery</article-title>
          . In: Veloso,
          <string-name>
            <surname>M.M. (ed.) IJCAI</surname>
          </string-name>
          <year>2007</year>
          . vol.
          <volume>7</volume>
          , pp.
          <volume>2462</volume>
          {
          <fpage>2467</fpage>
          . AAAI Press/IJCAI (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Desouter</surname>
            , B., van Dooren,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schrijvers</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Tabling as a library with delimited control</article-title>
          .
          <source>Theor. Pract. Log. Prog</source>
          .
          <volume>15</volume>
          (
          <issue>4-5</issue>
          ),
          <volume>419</volume>
          {
          <fpage>433</fpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Felleisen</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>The theory and practice of rst-class prompts</article-title>
          . In: Ferrante,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Mager</surname>
          </string-name>
          , P. (eds.)
          <source>Conference Record of the Fifteenth Annual ACM Symposium on Principles of Programming Languages</source>
          , San Diego, California, USA, January
          <volume>10</volume>
          -
          <issue>13</issue>
          ,
          <year>1988</year>
          . pp.
          <volume>180</volume>
          {
          <fpage>190</fpage>
          . ACM Press (
          <year>1988</year>
          ), http://doi.acm.
          <source>org/10</source>
          .1145/73560.73576
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Kakas</surname>
            ,
            <given-names>A.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Abductive concept learning</article-title>
          .
          <source>New Generat. Comput</source>
          .
          <volume>18</volume>
          (
          <issue>3</issue>
          ),
          <volume>243</volume>
          {
          <fpage>294</fpage>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Pfe</surname>
            <given-names>er</given-names>
          </string-name>
          , A.:
          <article-title>Practical Probabilistic Programming</article-title>
          .
          <source>Manning Publications</source>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Poole</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>The Independent Choice Logic for modelling multiple agents under uncertainty</article-title>
          .
          <source>Artif. Intell</source>
          .
          <volume>94</volume>
          ,
          <issue>7</issue>
          {
          <fpage>56</fpage>
          (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>The distribution semantics for normal programs with function symbols</article-title>
          .
          <source>Int. J. Approx. Reason</source>
          .
          <volume>77</volume>
          ,
          <issue>1</issue>
          { 19 (
          <year>October 2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Foundations of Probabilistic Logic Programming</article-title>
          . River Publishers (
          <year>2018</year>
          ), to appear
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bellodi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lamma</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zese</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cota</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Probabilistic logic programming on the web</article-title>
          .
          <source>Softw</source>
          .-Pract. Exper.
          <volume>46</volume>
          (
          <issue>10</issue>
          ),
          <volume>1381</volume>
          {
          <volume>1396</volume>
          (10
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Swift</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Tabling and answer subsumption for reasoning on logic programs with annotated disjunctions</article-title>
          .
          <source>In: ICLP TC</source>
          <year>2010</year>
          .
          <article-title>LIPIcs</article-title>
          , vol.
          <volume>7</volume>
          , pp.
          <volume>162</volume>
          {
          <fpage>171</fpage>
          .
          <string-name>
            <surname>Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik</surname>
          </string-name>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Swift</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>The PITA system: Tabling and answer subsumption for reasoning under uncertainty</article-title>
          .
          <source>Theor. Pract. Log. Prog</source>
          .
          <volume>11</volume>
          (
          <issue>4</issue>
          {5),
          <volume>433</volume>
          {
          <fpage>449</fpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Swift</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Well-de nedness and e cient inference for probabilistic logic programming under the distribution semantics</article-title>
          .
          <source>Theor. Pract. Log. Prog</source>
          .
          <volume>13</volume>
          (
          <issue>2</issue>
          ),
          <volume>279</volume>
          {
          <fpage>302</fpage>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <given-names>Santos</given-names>
            <surname>Costa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Rocha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Damas</surname>
          </string-name>
          ,
          <string-name>
            <surname>L.</surname>
          </string-name>
          :
          <article-title>The YAP Prolog system</article-title>
          .
          <source>Theor. Pract. Log. Prog</source>
          .
          <volume>12</volume>
          (
          <issue>1-2</issue>
          ),
          <volume>5</volume>
          {
          <fpage>34</fpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Sato</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>A statistical learning method for logic programs with distribution semantics</article-title>
          . In: Sterling,
          <string-name>
            <surname>L. (ed.) ICLP</surname>
          </string-name>
          <year>1995</year>
          . pp.
          <volume>715</volume>
          {
          <fpage>729</fpage>
          . MIT Press (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Somenzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>CUDD: CU Decision Diagram Package Release 3.0.0</article-title>
          . University of Colorado (
          <year>2015</year>
          ), http://vlsi.colorado.edu/~fabio/CUDD/cudd.pdf
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Swift</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Warren</surname>
            ,
            <given-names>D.S.</given-names>
          </string-name>
          : XSB:
          <article-title>Extending prolog with tabled logic programming</article-title>
          .
          <source>Theor. Pract. Log. Prog</source>
          .
          <volume>12</volume>
          (
          <issue>1-2</issue>
          ),
          <volume>157</volume>
          {
          <fpage>187</fpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>Van Gelder</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ross</surname>
            ,
            <given-names>K.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schlipf</surname>
            ,
            <given-names>J.S.:</given-names>
          </string-name>
          <article-title>The well-founded semantics for general logic programs</article-title>
          .
          <source>J. ACM</source>
          <volume>38</volume>
          (
          <issue>3</issue>
          ),
          <volume>620</volume>
          {
          <fpage>650</fpage>
          (
          <year>1991</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <surname>Vandenbroucke</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pirog</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Desouter</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schrijvers</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Tabling with sound answer subsumption</article-title>
          .
          <source>Theor. Pract. Log. Prog</source>
          .
          <volume>16</volume>
          (
          <issue>5-6</issue>
          ),
          <volume>933</volume>
          {
          <fpage>949</fpage>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <surname>Vennekens</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verbaeten</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bruynooghe</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Logic Programs With Annotated Disjunctions</article-title>
          .
          <source>In: ICLP 2004. LNCS</source>
          , vol.
          <volume>3132</volume>
          , pp.
          <volume>431</volume>
          {
          <fpage>445</fpage>
          . Springer (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>Vennekens</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verbaeten</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bruynooghe</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Logic programs with annotated disjunctions</article-title>
          . In: Demoen,
          <string-name>
            <given-names>B.</given-names>
            ,
            <surname>Lifschitz</surname>
          </string-name>
          , V. (eds.)
          <article-title>ICLP 2004</article-title>
          .
          <article-title>LNCS</article-title>
          , vol.
          <volume>3131</volume>
          , pp.
          <volume>431</volume>
          {
          <fpage>445</fpage>
          . Springer (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <surname>Wielemaker</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lager</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Riguzzi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>SWISH: SWI-Prolog for sharing</article-title>
          . In: Ellmauthaler,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Schulz</surname>
          </string-name>
          , C. (eds.) International Workshop on User-Oriented
          <source>Logic Programming (IULP</source>
          <year>2015</year>
          )
          <article-title>(</article-title>
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          30.
          <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>
          ,
          <string-name>
            <surname>Lager</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <string-name>
            <surname>SWI-Prolog</surname>
          </string-name>
          .
          <source>Theor. Pract. Log. Prog</source>
          .
          <volume>12</volume>
          (
          <issue>1-2</issue>
          ),
          <volume>67</volume>
          {
          <fpage>96</fpage>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>