<!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>Exploiting the Full Power of Pearl's Causality in Probabilistic Logic Programming</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Kilian Rückschloß</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Felix Weitkämper</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ludwig-Maximilians-Universität München Institut für Informatik Lehrund Forschungseinheit für Programmierund Modellierungssprachen Oettingenstraße 67 D-80538 München</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>We introduce new semantics for acyclic probabilistic logic programs in terms of Pearl's functional causal models. Further, we show that our semantics is consistent with the classical distribution semantics and CP-logic. This enables us to establish all query types of functional causal models, namely probability calculus, predicting the efect of external interventions and counterfactual reasoning, within probabilistic logic programming. Finally, we briefly discuss the problems regarding knowledge representation and the structure learning task which result from the diferent semantics and query types.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Counterfactual Reasoning</kwd>
        <kwd>Functional Causal Models</kwd>
        <kwd>Causal Bayesian Networks</kwd>
        <kwd>Causal Structure Discovery</kwd>
        <kwd>Distribution Semantics</kwd>
        <kwd>CP-Logic</kwd>
        <kwd>Probabilistic Logic Programming</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Intuitively, an acyclic probabilistic logic program under Problog semantics defines
a distribution by solving a system of equations in terms of mutually independent
predefined Boolean random variables. This intuition however is currently not reflected
in the oficial distribution semantics of probabilistic logic programming. [ 1, §2.1] To
illustrate this issue we introduce a version of the sprinkler example from [2, §1.4]:</p>
      <p>Consider a road, which passes along a field with a sprinkler in it. The sprinkler is
switched on, written , by a weather sensor with probability  2 := 0.7 in
spring or summer, denoted by __. Moreover, it rains, denoted by ,
with probability  3 := 0.1 in spring or summer and with probability  4 := 0.6 in fall
or winter. If it rains or the sprinkler is on, the pavement of the road gets wet, denoted
by . And in the case where the pavement is wet we observe that the road is slippery,
denoted by .</p>
      <p>
        To model the situation above we generate mutually independent Boolean random
4. The described
variables 1-4 with  (1) = 0.5 and with  () =   for all 2 ≤  ≤
mechanism is then represented by the following system of equations:
__ := 1
 := __ ∧ 2
 := (__ ∧ 3) ∨ (¬__ ∧ 4)
 := ( ∨ )
 := 
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
Further, with the usual reading of (probabilistic) logic programs one would encode (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
into the following LPAD-program P:
u1:0.5. u2:0.7. u3:0.1. u4:0.6.
szn_spr_sum :- u1.
sprinkler :- szn_spr_sum, u2.
rain :- szn_spr_sum, u3.
rain :- \+szn_spr_sum, u4.
wet :- rain.
wet :- sprinkler.
slippery :- wet.
      </p>
      <p>
        However, neither the distribution semantics [1, §2.1] nor CP-logic [3] link the
program P to the system of equations (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ). Note for instance that these semantics do not
introduce any random variables.
      </p>
      <p>Similar to [4] the current paper uses the framework of Pearls functional causal models
[2, §1.4] to obtain a new semantics for probabilistic logic programs. As a consequence
of our new semantics we obtain an easy correspondence between probabilistic logic
programs and causal Bayesian networks. Moreover, we are able to answer counterfactual
queries with the theory discussed in [2, 1.4.4]:</p>
      <p>Let us for instance assume we observe that the sprinkler is on and that the road
is slippery. We would like to answer the query: "What is the probability of the road
being slippery if the sprinkler were of?". In order to do so we need to update the
distribution of the error terms  in our program P according to the evidence 
and  in a first step. Note that our observation may introduce new dependencies!
Hence, we encode the joint distribution of the error terms 1− 4 explicitly. To this aim
we introduce new meta error terms 1, 11, 01, ..., 1111, ..., 0001, where 01...1
encodes the event that  is true if we observe that 1 is false, 2 is true and so on,
i.e. we find
un :- \+u1,u2,...,v01...1.</p>
      <p>Further, we update the probabilities of the meta error terms according to our
observations. In particular, we recognize that it is spring or summer because the sprinkler is
observed to be on, i.e. we replace 1 : 0.5 by the fact 1. In a second step we erase the
clause with  in the head to assure that the sprinkler is of. Finally, we query
the modified program P′ for  () to obtain 0.1 for the desired probability.</p>
      <p>We are not aware of any other semantics for probabilistic logic programming, which
is able to answer counterfactual queries using Pearl’s theory of causality as we just did.
However, there also exists a notion of counterfactual query in CP-logic [5]. In a future
paper, we want to prove that these two approaches to counterfactual reasoning are
equivalent, which means that CP-logic indeed consistently generalizes Pearl’s theory
of causality. As the theory of causal structure discovery is written in the language of
causal Bayesian networks and causal models our results can also be seen as a first step
towards structure learning of probabilistic logic programs under their causal semantics.</p>
      <p>Our presentation begins with recalling Pearl’s functional causal models and the
distribution semantics in Section 2. Further, in Section 3 we define our new semantics
and show that it generalizes the distribution semantics. Moreover, we prove that our
semantics yield a notion of intervention that is consistent with the one in CP-logic. In
Section 4 we discuss how counterfactual reasoning can be realized within probabilistic
logic programming. Finally, Section 6 closes this paper with a discussion of our results.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>Before we begin with the presentation of our results, we introduce Pearl’s functional
causal models, which are the target structures for our new semantics and we recall the
classical distribution semantics for probabilistic logic programming.</p>
      <sec id="sec-2-1">
        <title>2.1. Pearl’s Functional Causal Models</title>
        <p>
          Let us recall the definition of a functional causal model from [2, §1.4.1]:
Definition 1 (Causal Model). A functional causal model or causal model ℳ on a
set of variables V is a system of equations, which consists of one equation of the form
 :=  (pa(), error())
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          )
for each variable  ∈ V. Here the parents pa() ⊆ V of  form a subset of the set of
variables V, the error term error() of  is a vector of random variables and  is a
function defining  in terms of the parents () and the error term error() of .
Example 1. The system of equations (
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) from Section 1 forms a causal model on the
set of variables V := {__, , , , } if we define
︂( 3)︂
error(__) := 1, error() := 2, error() := 4 .
        </p>
        <p>Next, we note that causal models do not only support queries about conditional and
unconditional probabilities. They come along with two other more general query types,
namely determining the efect of interventions and counterfactuals. To proceed we fix
a causal model ℳ on a set of variables V.</p>
        <p>
          Assume we are given a subset of variables X := {1, ..., } ⊆ V together with
vector of possible values x := (1, ..., ) for the variables in X. In order to model the efect
of setting the variables in X to the values specified by x we simply replace the equations
for  in ℳ by  :=  for all 1 ≤  ≤  and calculate the desired probability. The
resulting probability distribution is then denoted by  (_| do(X = x)).[2, §1.4.3]
Example 2. To predict the efect of switching the sprinkler on in the causal model (
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) we
simply replace the equation for  by  :=  .
        </p>
        <p>Finally, let E ⊆ V and let X ⊆ V be two subsets of our set of variables V. Now
suppose we observe the evidence that E = e and we ask ourselves what would have
been happened if we had set X = x. Note that in general X = x and E = e contradict
each other. To answer this query we proceed in three steps: In the abduction step
we adjust the distribution of our error terms by replacing the distribution  (error( ))
with the conditional distribution  (error( )|E = e) for all variables  ∈ V. Next, in
the action step we intervene in the resulting model according to X = x. Finally, we are
able to compute the desired probabilities from the modified model in the prediction
step. [2, 1.4.4] For an illustration of the treatment of counterfactuals we refer to the
introduction.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Causal Models and Bayesian Networks</title>
        <p>Next, we compare causal models with the widespread formalism of Bayesian networks.
Recall, that a Bayesian network consists of a directed acyclic graph  on the involved
random variables V and of the conditional probability distributions  (| pa()) for
every  ∈ V, where pa() denotes the set of parents of  in . Further, a given
distribution on V can be stored in a Bayesian network on the graph  if the Markov
condition is satisfied, i.e. if each  ∈ V is independent of its predecessors conditioned
on its parents pa(). This motivates the following definition:
Definition 2 (Acyclic &amp; Markovian Causal Models). For each causal model ℳ on V
we define the causal diagram graph(ℳ) to be the directed graph on V, which is given
by drawing an arrow  →  if and only if  ∈ pa( ). Further, we call ℳ an acyclic
causal model if its causal diagram graph(ℳ) is a directed acyclic graph. Finally, an
acyclic causal model is said to be Markovian if the error terms error() are mutually
independent for all  ∈ V.</p>
        <p>The next result from [2, §1.4.2] links Markovian causal models to the theory of
Bayesian networks:
Theorem 1. Each Markovian causal model induces a distribution, which can be
represented by Bayesian network on the associated causal digram.</p>
        <p>Example 3. For the causal diagram of the causal model in Example 1 we obtain the
following acyclic graph:</p>
        <p>__</p>
        <p>
          (
          <xref ref-type="bibr" rid="ref3">3</xref>
          )
As the error terms are mutually independent by construction we have a Markovian causal
model, i.e. the resulting distribution can be represented by Bayesian network on the graph
above.
        </p>
        <p>Theorem 1 yields a way to determine efects of interventions from a Bayesian network
structure. Assume we are given a Markovian causal model ℳ. We know that ℳ gives
rise to a Bayesian network ℬ on the causal diagram graph(ℳ). As it turns out to
calculate the efect of setting X := {1, ..., } to x := (1, ..., ) one can modify ℬ
by changing the distributions  (| pa()) to
 (| pa()) =
{︃1,  = 
0, ℎ
for all 1 ≤  ≤ .</p>
        <p>The resulting structure is called a causal Bayesian network, i.e. a causal Bayesian
network is a Bayesian network that additionally supports queries about the efect of
external interventions. [2, §1.3]</p>
        <p>To summarize we are left with the following hierarchy: Probability distributions
support the calculation of (conditional) probabilities. Causal Bayesian networks are
more general because they are also able to predict the efect of interventions. Finally,
causal models are the most general structure as they additionally provide the possibility
of counterfactual reasoning. We also would like to highlight that each of these structures
comes along with a corresponding learning problem if we want to derive a certain
model from observational data.</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.3. Probabilistic Logic Programming under the Distribution</title>
      </sec>
      <sec id="sec-2-4">
        <title>Semantics</title>
        <p>We proceed by recalling the classical semantics, the distribution semantics, of
probabilistic logic programming. As the semantics of non-ground probabilistic logic programs
is usually defined by grounding [ 6], we will focus on propositional probabilistic logic
programs. Further, note that this paper uses LPAD-notation.</p>
        <sec id="sec-2-4-1">
          <title>2.3.1. Syntax of Probabilistic Logic Programs</title>
          <p>Before we discuss the semantics of a probabilistic logic program, we need to introduce
it’s syntax. Here, we construct a (probabilistic) logic program from a propositional
alphabet P:
Definition 3 (propositional alphabet). A propositional alphabet P is a finite set of
propositions together with a subset E(P) ⊆ P of external propositions. Further, we
define I(P) := P ∖ E(P) to be the set of internal propositions.</p>
          <p>Example 4. To build the program P in Section 1 we need the alphabet P with internal
propositions I(P) := {__, , , , } and with the
external propositions E(P) := {1, 2, 3, 4}.</p>
          <p>From propositional alphabets we built literals, clauses and random facts. Random
facts are used to specify the probabilities in our model. To proceed let us fix a
propositional alphabet P.</p>
          <p>Definition 4 (Literals and Clauses).</p>
          <p>i) A literal  is an expression  or ¬ for a proposition  ∈ P. We call  a positive
literal if it is of the form  and a negative literal if it is of the form ¬.
ii) A clause  is an expression of the form ℎ ← 1, ..., , where head() := ℎ ∈ I(P)
is an internal proposition and where body() := {1, ..., } is a finite set of
literals.
iii) A random fact  is an expression of the form ( ) :  ( ), where ( ) ∈ E(P)
is an external proposition and where  ( ) ∈ [0, 1] is a number called the
probability of ( ).</p>
          <p>Example 5. In Example 4 we have that __ is a positive literal, whereas ¬__
is a negative literal. Further,  ← ¬ __, 4 is a clause and 4 : 0.6 is a
random fact.</p>
          <p>Next, we define logic programs and probabilistc logic programs as follows:
Definition 5 (Logic Programs and Probabilistic Logic Program).</p>
          <p>i) A logic program P is a finite set of clauses. We call such a program P acyclic if
there exists a level function  : P → N, which satisfies the following assertion
for each clause  ∈ P: ∀∈body() :  (head()) &gt;  (). (Here we use the
convention  (¬) =  () for every proposition  ∈ P.)
ii) A probabilistic logic program P is given by a logic program LP(P) and set Facts(P),
which consists of an unique random fact for every external proposition. We call LP(P)
the underlying logic program of P. Further, we call P acyclic if LP(P) is an
acyclic logic program.</p>
          <p>Finally, we define the dependency graph graph(P) of P to be the directed graph
on the set of internal propositions I(P), which is given by drawing an arrow  → 
if and only if there exists a clause  ∈ LP(P) with head() =  and such
that {, ¬} ∩ body() ̸= ∅.</p>
          <p>Notation 1. To reflect the closed world assumption we will omit random facts of the
form  : 0 in the set Facts(P).</p>
          <p>
            Example 6. The program P from the introduction is an acyclic probabilistic logic
program. We obtain the corresponding underlying logic program LP(P) by erasing all
random facts of the form  : _ from P. Further, the dependency graph graph(P) of P is
given by (
            <xref ref-type="bibr" rid="ref3">3</xref>
            ).
          </p>
          <p>Finally, we define formulas as usual in propositional logic:
Definition 6.
ifned by:</p>
          <p>Let Q ⊆</p>
          <p>P be a set of propositions. A Q-formula is inductively
de- Each proposition  ∈ Q is a Q-formula.
- For each formula  we have that ¬() is a Q-formula.
- For any two formulas  and  we have that ( ∧  ) is a Q-formula.
- For any two formulas  and  we have that ( ∨  ) is a Q-formula.</p>
          <p>- For any two formulas  and  we have that ( ↔  ) is a Q-formula.</p>
        </sec>
        <sec id="sec-2-4-2">
          <title>2.3.2. The Semantics of Propositions and Formulas</title>
          <p>We will use Clark translation to define the semantics of acyclic logic programs, i.e. we
define the semantics of logic programs via the semantics of propositions and formulas.
To this aim we fix a set of propositions Q ⊆ P.</p>
          <p>Definition 7.</p>
          <p>A Q-structure is a function ℳ : Q → { ,  },  ↦→ ℳ.</p>
          <p>Next, we give a meaning to every Q-formula in the usual way:
Definition 8. For a Q-structure ℳ the models relation |= is defined inductively over
the structure of a Q-formula:
- For each proposition  ∈ Q we write ℳ |=  if and only if ℳ =  .
- For each formula  we write ℳ |= ¬() if and only if not ℳ |= , i.e. if ℳ ̸|= .
- For any two formulas  and  we write ℳ |= ( ∧  ) if and only if ℳ |= 
and ℳ |=  .
- For any two formulas  and  we write ℳ |= ( ∨  ) if and only if ℳ |= 
or ℳ |=  .
- For any two formulas  and  we write ℳ |= ( ↔  ) if and only if either
ℳ |=  and ℳ |=  or ℳ ̸|=  and ℳ ̸|=  .</p>
          <p>Now we can give a semantics to acyclic logic programs.</p>
        </sec>
        <sec id="sec-2-4-3">
          <title>2.3.3. The Semantics of Acyclic Logic Programs</title>
          <p>As already mentioned we define the semantics of an acyclic logic program by using
Clark translation.</p>
          <p>Definition 9 (Clark Translation). For each logic program P we define it’s Clark
translation by
⎧⎛
⎪
⎪
P := ⎨⎜⎜ ↔
⎪⎝
⎪
⎩</p>
          <p>⋁︁
with the convention that an empty disjunction evaluates to   and that the empty
conjunction evaluates to  .</p>
          <p>
            Example 7. One key observation is that the Clark translation of the underlying logic
program LP(P) of the probabilistic logic program P in Example 6 can be obtained from
the system of equations (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ) by replaceing the ":="-sign by the "↔"-sign.
          </p>
          <p>In the next proposition we formally justify, why it is permissible to exchange the
":="-sign by the "↔"-sign.</p>
          <p>Proposition 1. Let P be an acyclic logic program.</p>
          <p>i) For each E(P)-structure ℰ there exists an unique P-structure ℳ(ℰ , P) such that ℳ(ℰ , P)
extends ℰ and such that ℳ(ℰ , P) |= P.
ii) We have that ℳ(ℰ , P) is obtained from ℰ by solving the system of equations:
⎧
⎪
⎪
ES(P) := ⎨ :=
⎪
⎪
⎩</p>
          <p>⋁︁
Proof. Let P be an acyclic logic program. First, we observe that i) trivially follows
from ii) by the definition of |=. Hence, all we need to show is that ES(P) posses an
unique solution for every E(P)-structure ℰ .</p>
          <p>Let ℰ be an E(P)-structure. As P is acyclic there exists a level function  : P → N.
Let us proceed by induction over the number  of the values of  .
n=1 In this case for every clause  ∈ P we have that body() = ∅. Hence, the
only P-structure ℳ extending ℰ and satisfying ES(P) is given by
 : P → { ,  }
 ↦→
⎧ℰ ,
⎪
⎨</p>
          <p>∈ E(P)
 ,  ∈ I(P) and  = head() for a  ∈ P .</p>
          <p>⎪⎩ , ℎ
n&gt;1 Denote by Pmax the set of all propositions  with  () = max∈P  (). Further,
denote by Pmax the set of all clauses  ∈ P with head() ∈ Pmax. Finally,
set P′ := P ∖ Pmax and set P′ := P ∖ Pmax. Now by induction hypothesis
there exists an unique P′-structure ℳ′ := ℳ(ℰ , P′) extending ℰ and
satisfying ES(P′). To conclude we observe that by acyclicity the only P-structure ℳ
extending ℰ and satisfying ES(P) is given by
ℳ : P → { ,  }
⎧ℳ′ ,
⎪
⎨
 ↦→</p>
          <p>,
⎪⎩ , ℎ
 ∈ P′
 = head() and ℳ′ |= body() for a  ∈ Pmax .</p>
          <p>Remark 1. We take the assignment ℰ ↦→ ℳ(ℰ , P) as the semantics of an acyclic logic
program P. Note that this is consistent with the standard minimal Herbrand-model
semantics. [7]
Corollary 1. Let P be an acyclic logic program. Each model of the Clarck
translation ℳ |= P is uniquely determined by it’s restriction ℳ|E(P) to the external
propositions.</p>
          <p>Proof. This is a direct consequence of Proposition 1.</p>
        </sec>
        <sec id="sec-2-4-4">
          <title>2.3.4. The Distribution Semantics of Acyclic Probabilistic Logic Programs</title>
          <p>Finally, we are in the position to give the definition of the distribution semantics for
acyclic probabilistic logic programs:
Definition 10. Let P be a probabilistic logic program. An atomic choice is a
subset C ⊆ Facts(P) of the random facts of P. To each atomic choice C we associate the
E(P)-structure
ℰ (C) :E(P) → { ,  }</p>
          <p>{︃ ,
 ↦→
 , ℎ</p>
          <p>if there exists a random fact of the form  : _ in C
and the probability
 (C) :=</p>
          <p>∏︁  ( ) · ∏︁ (1 −  ( )).
{︃ (C), if ℳ = ℳ(ℰ (C), LP(P)) for an atomic choice C
Finally, for every P-formula  we define the probability for  to hold by
 () :=</p>
          <p>∑︁
ℳ P− 
ℳ|=
 (ℳ).</p>
          <p>Remark 2. Remark 1 ensures that Definition 10 defines the distribution semantics as
in [1, 2.1.2].</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. The Functional Causal Models Semantics for</title>
    </sec>
    <sec id="sec-4">
      <title>Probabilistic Logic Programs</title>
      <p>Since we are now finished with our preparations, we proceed to the functional causal
models semantics we are heading for:
Definition 11. Let P be an acyclic probabilistic logic program. We define the functional
causal models semantics or FCM semantics of P to be the functional causal model
on the internal propositions I(P), which is given by the system of equations
⎧
⎪
⎪
FCM(P) := ⎨FCM :=
⎪
⎪
⎩</p>
      <p>⋁︁
∈LP(P)
head()=
⎛
⎝</p>
      <p>⋀︁
∈body()</p>
      <p>⎞
FCM⎠ :  ∈ I(P)
and mutually independent Boolean random variables ( )FCM for every random fact
 ∈ Facts(P) that are distributed according to  [︀ ( )FCM]︀ =  ( ). Here we
again use the convention that an empty disjunction evaluates to   and that an empty
conjunction evaluates to  .
.</p>
      <p>
        (
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
Remark 3. By construction the dependency graph graph(P) of P yields the causal
diagram graph(FCM(P)) of the associated functional causal model.
      </p>
      <p>Remark 4. The theory so far has been restricted to acyclic probabilistic logic programs,
since the Clark translation is known not to be correct for general acyclic logic programs [7].
However, potentially cyclic programs with stratified negation can also be accommodated
by cycle-breaking. This process replaces a propositional (or ground) logic program with an
equivalent acyclic logic program. There are diferent algorithms available for this task,
the current state-of-the-art being treewidth-aware cycle-breaking based on
forwardunfolding of the logic program [8].</p>
      <p>
        Example 8. As intended in the introduction the causal model (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) yields the FCM-semantics
of the program P.
      </p>
      <p>Next, we check that the FCM-semantics indeed yields a well-defined distribution.
Proposition 2. Let P be an acyclic probabilistic logic program. The FCM-semantics
assigns to each predicate  ∈ P an unique random variable FCM.</p>
      <p>Proof. Similar to Proposition 1.</p>
      <p>Our next aim is to verify that the FCM-semantics yield a consistent generalization of
the distributions semantics. For this purpose we introduce the following notation:
Notation 2. Let P be an acyclic probabilistic logic program. For each P-structure ℳ we
write</p>
      <p>PFCM(ℳ) :=  [︀{ FCM = ℳ() :  ∈ P︀}] .</p>
      <p>Note that  PFCM encodes the joint distribution of the random variables FCM. Hence, the
distribution of the random variables FCM is uniquely determined by  PFCM.</p>
      <p>With Notation 2 at hand we now proceed to the proof of the desired consistency:
Theorem 2. For each acyclic probabilistic logic program P we have that  PFCM =  P.
Proof. We have to show that  PFCM(ℳ) =  P(ℳ) for every P-structure ℳ. Denote
by ℰ the restriction of ℳ to the external alphabet E(P) and by C the unique atomic
choice with ℰ = ℰ (C). Now observe that</p>
      <p>PFCM(ℳ) =  [︀{ FCM = ℳ() for all  ∈ P︀}] = 1
=  [︀{ FCM = ℳ() :  ∈ E(P)}︀]
=  [︀{ FCM = ℰ () :  ∈ E(P)}︀]

=
= ∏︁  ( ) ·
∏︁ (1 −  ( ))   (C) =  P(ℳ).</p>
      <p>=
Corollary 2. The FCM-sematics and the distribution sematics yield the same probability
for every proposition in P.</p>
      <p>
        Proof. This follows by marginalization and equation (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ).
      </p>
      <p>Further, recall from 2.1 that functional causal models do not only provide a probability
distribution they also support two further query types, namely the prediction of the
efects of interventions and counterfactual reasoning.</p>
      <sec id="sec-4-1">
        <title>Predicting the Efect of External Interventions in FCM-semantics</title>
        <p>Let P be a probabilistic logic program and let X1, X2 ⊆ I(P) be two subsets of internal
propositions. Assume we would like to calculate the efect of setting the variables
in XFCM to   and the variables in XFCM to  . According to the discussion
1 2
in 2.1 and Definition 11 the desired distribution can be calculated from a modified
program P′, which is obtained as follows:
1.) Replace every clause  ∈ P with head() ∈ X1 by the clause head() ← .
2.) Erase every clause  ∈ P with head() ∈ X2 form P.</p>
        <p>We observe that this is the same notion of intervention, which was introduced for
CP-logic in [3, §7.5] and which is implemented in cplint [9]. As CP-logic is consistent
with the distribution semantics Theorem 2 yields the following result:
Theorem 3. The FCM-semantics consistently generalizes the notion of intervention in
CP-logic. □</p>
        <p>Next, we want to use probabilistic logic programming as a language for causal
Bayesian networks:
Definition 12. We call an acyclic probabilistic logic program P Markovian if we obtain
for every external proposition  ∈ E(P), which occurs in the body of a clause 1 that
∀2∈LP(P) : (head(1) ̸= head(2) ⇒ {, ¬} ∩ body(2) = ∅) .
Example 9. The program P in the introduction yields a Markovian probabilistic logic
program.</p>
        <p>Theorem 4 (Probabilistic Logic Programs &amp; Causal Bayesian Networks). A Markovian
probabilistic logic program P, equipped with the above notion of intervention, gives rise
to a Boolean causal Bayesian network ℬ(P) on the dependency graph graph(P) of P.
Proof. This follows directly from Definition 11, Remark 3 and Theorem 1.
Definition 13 (Bayesian networks semantics). In the situation of Theorem 4 we call
ℬ(_) the causal Bayesian network semantics for Markovian probabilistic logic
programs.</p>
        <p>Remark 5. As the causal Bayesian network semantics allows for the computation of the
efect of interventions it is a proper generalization of the distribution semantics.</p>
        <p>Next, we see that the causal Bayesian network semantics yields a proper
generalization of the distribution semantics for probabilistic logic programs.</p>
        <p>Example 10. Consider the Markovian probabilistic logic programs P1, respectively P2
below:
a :- b. b :- u. u :0.5.
b :- a. a :- u. u :0.5.</p>
        <p>It is easy to observe that P1 and P2 determine the same distribution. However, intervening
according to FCM =   leaves FCM unchanged in P1, while FCM becomes true
in P2. Hence, P1 and P2 are equivalent under the distribution semantics, whereas they
are not equivalent under the causal Bayesian network semantics.</p>
        <p>Considering Example 10, we see that from the classical LPAD-syntax it is not clear,
which knowledge a probabilistic logic program actually states! Hence, one should be
careful when using probabilistic logic programs for causal inference. In particular this
observation has tremendous consequences for the structure learning theory of such
programs:</p>
        <p>Assume we want to learn the probabilistic logic program P1 from data. If we only
claim to learn P1 under the distribution semantics, it is equally good to end up with P2.
However, if we are interested in the efect of interventions, we need to distinguish
between P1 and P2.</p>
        <p>In the theory of Bayesian networks the task of learning a causal Bayesian network is
referred to as causal structure discovery. One of our future goals is to develop a causal
structure discovery algorithm for non-ground probabilistic logic programs.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>4. Counterfactual Reasoning in Probabilistic Logic</title>
    </sec>
    <sec id="sec-6">
      <title>Programming</title>
      <p>Finally, we also want to establish counterfactual reasoning in probabilistic logic
programming. Assume that we are given an acyclic probabilistic logic program P.
Additionally, let E ⊆ I(P) and X ⊆ I(P) be two subsets of internal propositions. Now
suppose we observe the evidence EFCM = e and we ask ourselves what would have
been happened if we set XFCM = x. In particular it may be that EFCM = e and
XFCM = x contradict each other!</p>
      <p>Recalling the discussion in 2.1 and Definition 11 we proceed as follows: First, in
the abduction step, we build a modified program P′, where we need to adjust the
distribution of the external predicates 1FCM-FCM according to our observations.
Note that in general given new evidence the random variables 1FCM-FCM are no
longer mutually independent! Hence, we encode the full joint distribution of the  in
our program. To this aim we introduce 2 new meta external predicates , which
we enumerate with sequences () ∈ {0, 1} with  ≤  and  = 1. The sequence
() encodes the event that FCM is true once we observe  if  = 1 and ¬ if
 = 0. From Theorem 4 we see that the distribution on the  can be stored in the
following program P0:
v1 : p1. %u1:p1 random fact in P
v11 : p2. v11 : p2. %u2:p2 random fact in P
...
v11...1 : pn. ... v0...01 : pn. %un : pn random fact in P
u1 :- v1.
u2 :- u1,v11. u2 :- \+u1,v01.
...
un :- u1,u2,...,un-1,v11...1.
...
un :- \+u1,\+u2,...,\+un-1,v0...01.</p>
      <p>Hence, the program P′0 that results by replacing the error terms of P with the program
P0 yields the same distribution on the internal prdicates. Finally, we obtain the modified
P′ by replacing each random fact  :   in the program P′0 with the random fact
 :  (|e). We can then compute the desired probabilities by intervening according
to XFCM = x. For a detailed example of the treatment of counterfactuals we refer the
reader to the introduction. Note that there is also a notion of counterfactual reasoning
in CP-logic [5]. We verify in a future paper that these to approaches to counterfactual
reasoning in probabilistic logic programming lead to the same result.</p>
      <p>Further, like the causal Bayesian network semantics generalizes the distribution
semantics, we also find that the FCM-semantics properly generalizes the causal Bayesian
network semantics.</p>
      <p>Example 11. Consider the probabilistic logic programs P1, respectively P2 below:
u1:0.5. u2:0.5. u3:0.4.
treatment :- u1.
recovery :- u2.
recovery :- treatment, u3.
u1:0.5. u2:0.5. u3:0.7.
treatment :- u1.
recovery :- \+treatment, u2.
recovery :- treatment, u3.</p>
      <p>According to Theorem 4 both programs give rise to a causal Bayesian network on the
graph  → .</p>
      <p>Observe that in P1, there is a baseline chance of 0.5 for recovering from an illness,
and treatment gives an additional chance of 0.4 that a patient recovers from treatment
that would not otherwise have recovered. Therefore, the probability of recovery under
treatment is 0.7.</p>
      <p>In P2, the recovery rates with and without treatment have been modelled separately,
with a 0.7 recovery rate under treatment and a 0.5 rate without it.</p>
      <p>Therefore the programs P1/2 yield the same probabilities for  (),
 (|) and  (|¬). Thus they share the same causal
Bayesian network semantics and therefore the same distribution semantics.</p>
      <p>Next, let us assume we observe that treatment is false and that recovery is true. Let 
be the query: “What is the probability of recovery if treatment was true?” In both
programs P1/2 our observations imply that 2 is true. Hence, P1 answers the query  with 1.
For P2 we obtain that P′2 is equivalent to the following program:
v1:0.5. v11 : 0.7. v01:0.7.
u1 :- v1. u2. u3 :- u1,v11. u3:-\+u1,v01.
treatment :- u1.
recovery :- \+treatment, u2.
recovery :- treatment, u3.</p>
      <p>This means that P2 answers  with a probability of 0.7.</p>
      <p>Note that when modelling under the distribution semantics, one would often be tempted
to prefer P2, since separating the possible situations makes it easier to see the probabilities
of recovery of each reference class at first glance. However, when using the resulting
program for counterfactual reasoning, the FCM-semantics of P2 implies that recovery
with and without treatment are completely independent. In particular, we obtain for every
patient that recovered untreated a 0.3 probability that he would not have recovered if he
had indeed received the treatment. This would be an extraordinary claim, and usually the
interpretation encoded by P1, namely that treatment enhances any individual’s chance
of recovery, would be closer to the intended meaning.</p>
    </sec>
    <sec id="sec-7">
      <title>5. Syntactic Sugar and Non-Ground Probabilistic Logic</title>
    </sec>
    <sec id="sec-8">
      <title>Programs</title>
      <p>In probabilistic logic programming under Problog semantics, a special case of the
distribution semantics [1, §2.1.2], one introduces the following syntactic sugar:
Definition 14 (Problog Program). A Problog clause  is an expression of the form
ℎ :  ← 1, ...,  for a proposition head() := ℎ, a real number  () :=  ∈ [0, 1]
and literals body() := {1, ..., }. Further, a Problog program P is a finite set of
Problog clauses.</p>
      <p>For each Problog clause  ∈ P we add a distinct external literal () to our
alphabet. In this case the FCM-semantics of P is given by the FCM-semantics of the program
PLP(P), which is given by</p>
      <p>LP(PLP(P)) := {head() ←</p>
      <p>body() ∪ () :  ∈ P}</p>
      <p>Facts(PLP(P)) := {() :  () :  ∈ P}.</p>
      <p>Finally, we call P acyclic is PLP(P) is an acyclic probabilistic logic program.
Remark 6. An acyclic Problog program is automatically Markovian, i.e. it posses a
welldefined causal Bayesian network semantics.</p>
      <p>Example 12. The causal model in Example 1 can be defined using the following Problog
program:
szn_spr_sum:0.5.
sprinkler :0.7 :- szn_spr_sum.
rain:0.1 :- szn_spr_sum.
rain:0.6 :- \+szn_spr_sum.
wet:1 :- rain.
wet:1 :- sprinkler.
slippery :1 :- wet.</p>
      <p>Finally, non-ground probabilistic logic programs can be considered as Problog
programs built over relational alphabets. Instantiating such a non-ground program with a
given domain then yields a propositional program to which the results of this paper can
be applied. Hence, the FCM-semantics for probabilistic logic programs and all results
of this paper easily generalize to the non-ground case. In particular by Remark 6 all
non-ground programs constructed in this way possess a well-defined causal Bayesian
network semantics.</p>
    </sec>
    <sec id="sec-9">
      <title>6. Conclusion</title>
      <p>In this paper we present an interpretation of acyclic probabilistic logic programs in terms
of Pearl’s functional causal models. As a consequence we are able to establish the three
query types of functional causal models, namely probability calculus, prediction of the
efect of interventions and counterfactual reasoning in the framework of probabilistic
logic programming.</p>
      <p>Moreover, we see that each of these query types comes with its own semantics and
that it is not clear from the syntax which knowledge a given probabilistic logic program
actually states. Hence, one should be careful when using a probabilistic logic program
for causal queries.</p>
      <p>Finally, we highlight that each of those semantics yields a new structure learning task.
This brings the subject of causal structure discovery to the realm of probabilistic logic
programming. In the future we aim to develop causal structure discovery algorithms
for learning non-ground probabilistic logic programs under causal Bayesian network
and FCM-semantics.</p>
    </sec>
    <sec id="sec-10">
      <title>Acknowledgments</title>
      <p>The research leading to this publication was supported by LMUexcellent, funded by
the Federal Ministry of Education and Research (BMBF) and the Free State of Bavaria
under the Excellence Strategy of the Federal Government and the Länder.</p>
      <p>The athosr would like to thank Kailin Sun for proofreading the initial submission.
[8] T. Eiter, M. Hecher, R. Kiesel, Treewidth-aware cycle breaking for algebraic answer
set counting, in: M. Bienvenu, G. Lakemeyer, E. Erdem (Eds.), Proceedings of
the 18th International Conference on Principles of Knowledge Representation
and Reasoning, KR 2021, Online event, November 3-12, 2021, 2021, pp. 269–279.
doi:10.24963/kr.2021/26.
[9] F. Riguzzi, G. Cota, E. Bellodi, R. Zese, Causal inference in cplint,
International Journal of Approximate Reasoning 91 (2017) 216–232. doi:10.1016/
j.ijar.2017.09.007.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>F.</given-names>
            <surname>Riguzzi</surname>
          </string-name>
          ,
          <article-title>Foundations of Probabilistic Logic Programming: Languages, Semantics, Inference and Learning</article-title>
          , River Publishers,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.</given-names>
            <surname>Pearl</surname>
          </string-name>
          , Causality, 2 ed., Cambridge University Press, Cambridge, UK,
          <year>2000</year>
          . doi:
          <volume>10</volume>
          .1017/CBO9780511803161.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J.</given-names>
            <surname>Vennekens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Denecker</surname>
          </string-name>
          , M. Bruynooghe,
          <article-title>CP-logic: A Language of Causal Probabilistic Events and Its Relation to Logic Programming</article-title>
          ,
          <source>Theory Pract. Log. Program. 9</source>
          (
          <year>2009</year>
          )
          <fpage>245</fpage>
          -
          <lpage>308</lpage>
          . doi:
          <volume>10</volume>
          .1017/S1471068409003767.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>A.</given-names>
            <surname>Bochman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Lifschitz</surname>
          </string-name>
          ,
          <article-title>Pearl's causality in a logical setting</article-title>
          , in: B.
          <string-name>
            <surname>Bonet</surname>
          </string-name>
          , S. Koenig (Eds.),
          <source>Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, January 25-30</source>
          ,
          <year>2015</year>
          , Austin, Texas, USA, AAAI Press,
          <year>2015</year>
          , pp.
          <fpage>1446</fpage>
          -
          <lpage>1452</lpage>
          . doi:
          <volume>10</volume>
          .1609/aaai.v29i1.
          <fpage>9411</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>J.</given-names>
            <surname>Vennekens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Bruynooghe</surname>
          </string-name>
          , M. Denecker,
          <article-title>Embracing events in causal modelling: Interventions and counterfactuals in cp-logic</article-title>
          , in: T. Janhunen, I. Niemelä (Eds.),
          <source>Logics in Artificial Intelligence</source>
          , Springer Berlin Heidelberg, Berlin, Heidelberg,
          <year>2010</year>
          , pp.
          <fpage>313</fpage>
          -
          <lpage>325</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Vennekens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Verbaeten</surname>
          </string-name>
          ,
          <article-title>Logic Programs with Annotated Disjunctions</article-title>
          ,
          <source>Technical Report CW 368</source>
          ,
          <string-name>
            <surname>Katholieke</surname>
            <given-names>Universiteit Leuven</given-names>
          </string-name>
          , Department of Computer Science,
          <year>2003</year>
          . URL: https://www.cs.kuleuven.be/publicaties/rapporten/cw/ CW368.abs.html.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>F.</given-names>
            <surname>Fages</surname>
          </string-name>
          ,
          <article-title>Consistency of clark's completion and existence of stable models</article-title>
          .,
          <source>Meth. of Logic in CS 1</source>
          (
          <year>1994</year>
          )
          <fpage>51</fpage>
          -
          <lpage>60</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>