<p>Probabilistic Logic Programming (PLP), usually adopts the Distribution Semantics (DS) (see the paper ''A Statistical Learning Method for Logic Programs with Distribution Semantics'' by T. Sato). More recently, ProbLog introduced the notation <span class="math-container">$\Pi::f$</span> to denote probabilistic facts: the atom <span class="math-container">$f$</span> is true with probability <span class="math-container">$\Pi$</span>.
Under the DS, a choice value for every probabilistic facts defines a <em>world</em>.
If a program has <span class="math-container">$n$</span> probabilistic facts, there are <span class="math-container">$2^n$</span> worlds.
The probability of a world <span class="math-container">$w$</span> is computed as
<span class="math-container">$$
P(w) = \prod_{i \mid f_i = \top} \Pi_i \cdot \prod_{i \mid f_i = \bot} (1 - \Pi_i)
$$</span>
<span class="math-container">$f_i = \top$</span> states that the probabilistic fact <span class="math-container">$f_i$</span> is considered true in the world <span class="math-container">$w$</span> while <span class="math-container">$f_i = \bot$</span> that it is considered false.
The probability of a query <span class="math-container">$q$</span>, which can be a conjunction of ground atoms, is computed as the sum of the probabilities of the worlds where the query is true, so
<span class="math-container">$$
P(q) = \sum_{w \models q} P(w).
$$</span>
The main concept is that the probability is computed by considering worlds.</p>
<p>Differently, Stochastic Logic Programs (SLP) (see the works of Muggleton and Cussens, for example) consider clauses with an attached probability and the probability distribution is defined over refutations of goals, rather than worlds.
Probabilistic clauses are of the form
<span class="math-container">$$
\Pi : C :- b.
$$</span>
where <span class="math-container">$C:- b$</span> is a definite clause.
There are two types of SLPs: pure, where every clause is a probabilistic clause, and impure, where only some of the clauses are probabilistic.
Consider a pure SLP and the program obtained by removing the probability in front of the clauses.
Every derivation for a query <span class="math-container">$q$</span> is assigned to a real value given by the product of the values of its steps (i.e., the probability of the clauses that unifies at any given step).
The probability of a successful derivation for a query <span class="math-container">$q$</span> is its label divided by the sum of the labels of all successful derivations.</p>
<p>Overall, the main difference is that the DS defines a probability distribution over worlds while SLPs define a probability distribution over refutations (i.e., paths in the SLD derivations).</p>

CC BY-SA 4.0
2023-07-06T13:22:13.323Z
Thanks! Are the paths in the SLD derivation, where the comparison of SLPs to random walks comes from?
Pav
CC BY-SA 4.0
2023-07-07T06:08:27.957Z
Yes, I think so
damianodamiano
CC BY-SA 4.0
2023-07-06T08:42:12.333Z
2023-07-06T08:42:12.333Z
damianodamiano
<p>I'm reading the paper <a href="https://ojs.aaai.org/index.php/AAAI/article/view/21248" rel="nofollow noreferrer">DeepStochLog: Neural Stochastic Logic Programming</a>. The authors differentiate between <strong>Probabilistic Logic Programming (PLP)</strong> and <strong>Stochastic Logic Programming (SLP)</strong>, but I can't seem to understand what the difference is.</p>
<p>They briefly explain the difference by saying:</p>
<blockquote>
<p>The more popular PLPs (De Raedt and Kimmig 2015) are based on a possible worlds semantics (i.e. the distribution semantics (Sato 1995)), which extends probabilistic graphical models, while the SLPs (Muggleton 1996, 2000; Cussens 2001) are based on stochastic grammars. The difference can also be described as a random graph vs a random walk model.</p>
</blockquote>
<p>I think I understand possible world semantics. But what is the difference to using stochastic grammars? And how does this relate to the random graph vs random walk comparison?</p>

<lo.logic><logic-programming><stochastic-process><probabilistic-automata>
Probabilistic Logic Programming vs Stochastic Logic Programming
Pav
# Probabilistic Logic Programming vs Stochastic Logic Programming

(Asked by: username_0 on 2023-06-30)

I'm reading the paper [DeepStochLog: Neural Stochastic Logic Programming](https://ojs.aaai.org/index.php/AAAI/article/view/21248). The authors differentiate between **Probabilistic Logic Programming (PLP)** and **Stochastic Logic Programming (SLP)**, but I can't seem to understand what the difference is.

They briefly explain the difference by saying:

> The more popular PLPs (De Raedt and Kimmig 2015) are based on a possible worlds semantics (i.e. the distribution semantics (Sato 1995)), which extends probabilistic graphical models, while the SLPs (Muggleton 1996, 2000; Cussens 2001) are based on stochastic grammars. The difference can also be described as a random graph vs a random walk model.

I think I understand possible world semantics. But what is the difference to using stochastic grammars? And how does this relate to the random graph vs random walk comparison?

**Tags:** lo.logic, logic-programming, stochastic-process, probabilistic-automata


---

## 1 answers

### Answer by username_1 on 2023-07-06. Score: 0 | Accepted answer

Probabilistic Logic Programming (PLP), usually adopts the Distribution Semantics (DS) (see the paper ''A Statistical Learning Method for Logic Programs with Distribution Semantics'' by T. Sato). More recently, ProbLog introduced the notation $\Pi::f$ to denote probabilistic facts: the atom $f$ is true with probability $\Pi$.
Under the DS, a choice value for every probabilistic facts defines a *world*.
If a program has $n$ probabilistic facts, there are $2^n$ worlds.
The probability of a world $w$ is computed as
$$
P(w) = \prod\_{i \mid f\_i = \top} \Pi\_i \cdot \prod\_{i \mid f\_i = \bot} (1 - \Pi\_i)
$$
$f\_i = \top$ states that the probabilistic fact $f\_i$ is considered true in the world $w$ while $f\_i = \bot$ that it is considered false.
The probability of a query $q$, which can be a conjunction of ground atoms, is computed as the sum of the probabilities of the worlds where the query is true, so
$$
P(q) = \sum\_{w \models q} P(w).
$$
The main concept is that the probability is computed by considering worlds.

Differently, Stochastic Logic Programs (SLP) (see the works of Muggleton and Cussens, for example) consider clauses with an attached probability and the probability distribution is defined over refutations of goals, rather than worlds.
Probabilistic clauses are of the form
$$
\Pi : C :- b.
$$
where $C:- b$ is a definite clause.
There are two types of SLPs: pure, where every clause is a probabilistic clause, and impure, where only some of the clauses are probabilistic.
Consider a pure SLP and the program obtained by removing the probability in front of the clauses.
Every derivation for a query $q$ is assigned to a real value given by the product of the values of its steps (i.e., the probability of the clauses that unifies at any given step).
The probability of a successful derivation for a query $q$ is its label divided by the sum of the labels of all successful derivations.

Overall, the main difference is that the DS defines a probability distribution over worlds while SLPs define a probability distribution over refutations (i.e., paths in the SLD derivations).

> **Comments:**
> **username_0**: Thanks! Are the paths in the SLD derivation, where the comparison of SLPs to random walks comes from?  
> **username_1**: Yes, I think so  

---

