<!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>
      <journal-title-group>
        <journal-title>Workshop on Probabilistic Logic Programming
$ damiano.azzolini@unife.it (D. Azzolini); fabrizio.riguzzi@unife.it (F. Riguzzi); evelina.lamma@unife.it
(E. Lamma)</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Semantics for Hybrid Probabilistic Logic Programs with Function Symbols: Technical Summary</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Damiano Azzolini</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabrizio Riguzzi</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Evelina Lamma</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dipartimento di Ingegneria - University of Ferrara</institution>
          ,
          <addr-line>Via Saragat 1, 44122, Ferrara</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dipartimento di Matematica e Informatica - University of Ferrara</institution>
          ,
          <addr-line>Via Machiavelli 30, 44121, Ferrara</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Dipartimento di Scienze dell'Ambiente e della Prevenzione - University of Ferrara Via Borsari 46</institution>
          ,
          <addr-line>44121, Ferrara</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2022</year>
      </pub-date>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0002</lpage>
      <abstract>
        <p>Hybrid probabilistic logic programs extends probabilistic logic programs by adding the possibility to manage continuous random variables. Despite the maturity of the field, a semantics that unifies discrete and continuous random variables and function symbols was still missing. In this paper, we summarize the main concepts behind a new proposed semantics for hybrid probabilistic logic programs with function symbols.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Probabilistic Logic Programming</kwd>
        <kwd>Hybrid Programs</kwd>
        <kwd>Semantics</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        1. Contribution
This paper is a technical summary of [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Probabilistic Logic Programming [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] extends Logic
Programming with probabilistic facts, i.e., logical atoms with an associated probability. These
are usually indicated with the syntax [3]:
Π ::

where  is an atom and Π ∈]0, 1]. Intuitively,  is true with probability Π and false with
probability 1 − Π . To illustrate probabilistic logic programs, let us start with a simple example:
Example 1. Card single round.
1/3 :: spades(X).
1/2 :: clubs(X).
pick(0,spades) :- spades(0).
pick(0,clubs) :- \+ spades(0), clubs(0).
      </p>
      <p>pick(0,hearts) :- \+ spades(0), \+ clubs(0).</p>
      <p>This program describes a game of card with only 1 round (identified with 0) and 3 cards. A player
draws a card that can be either of spades, clubs, or hearts. These have all the same probability.
Note that, to describe three possible cards we only need 2 (probabilistic) facts, since the third can
be represented with the negation of the other two (see line 5). The predicate pick/2 describes the
three possible outcomes.</p>
      <p>The probability of a query asked on the program of Example 1 is easy to compute. For
example, the probability of pick(0,hearts) is (1 − 1/3) · (1 − 1/2) = 1/3. However, we
can make the program more interesting by adding multiple rounds. To do this, we introduce a
function symbol s/1 to the program of Example 1.</p>
      <p>Example 2. Cards with multiple rounds. We extend Example 1 by considering multiple rounds.
We introduce the function symbol s/1 to indicate a round and with s(X) we indicate the round
after the round X. So, starting from 0 (first round), we have s(0) for the second round, s(s(0))
for the third round and so on. We introduce an additional rule: the game stops when the player
picks a card of hearts. The program thus became:</p>
      <p>A possible question could be: “what is the probability that the player picks at least one time
spades?” This probability can be computed by asking the query ___.</p>
      <p>To compute the probability of the query ___ from Example 2, we need to
consider pairwise incompatible covering set of explanations [4]. If we replace spades with 1
and clubs with 2 and we use 0 and 1 to indicate respectively not selected and selected, we get
a pairwise incompatible covering set of explanations  = { 0,  1, . . .} with
 0 = {(1, {/0}, 1)}
 1 = {(1, {/0}, 0), (2, {/0}, 1), (1, {/(0)}, 1)}</p>
      <p>. . .
  = {(1, {/0}, 0), (2, {/0}, 1), . . . , (1, {/− 1(0)}, 0),</p>
      <p>(2, {/− 1(0)}, 1), (1, {/(0)}, 1)}
. . .</p>
      <p>From here, we can compute the probability of the query  = ___ as
 () =
1 1 (︂ 2 1 )︂
3 + 3 · 3 · 2
since we have a sum of a geometric series.</p>
      <p>We can even further extend the previous example by also considering continuous random
variables. To represent these, we use the syntax</p>
      <p>: 
where  is an atom and  is a special atom that denotes its probability density.
Example 3. Cards multiple rounds and continuous random variables. We extend Example 2 by
adding another rule: the player still draws a card but, in addition, he/she need to spin a wheel. If
the axis of the wheel is between 0 and 180 degrees the game stops. This scenario can be encoded
with:</p>
      <p>In line 1 we have a continuous probabilistic fact angle/2 where its argument X follows a
uniform distribution between 0 and 360.</p>
      <p>We may be still interested in computing the probability of the query ___
from Example 3. Diferently from Example 2, we now need to consider a mutually disjoint
covering set of worlds . First, we partition the random variables in two sets: a countable set
X of continuous random variables (identified by 0, (0), . . . , where each element has a range
[0, 360]) and a countable set Y of discrete random variables (where each element can be true or
false). The set  = 0 ∪ 1 . . . is such that:
0 = {(X, Y) | X = (0, 1, . . .), Y = (0, 0, 1, 1, . . .),</p>
      <p>0 ∈]180, 360], 0 = 1}
1 = {(X, Y) | X = (0, 1, . . .), Y = (0, 0, 1, 1, . . .),</p>
      <p>0 ∈]180, 360], 0 = 0, 0 = 1, 1 ∈]180, 360], 1 = 1}
. . .</p>
      <p>In other words: for 0, spades was selected at round 0 (0 = 1) and the wheel (0) in the same
round was in the range ]180, 360]; for 1, spades was not selected at round 0 (0 = 0), clubs
was selected at round 0 (0 = 1), the wheel (0) was in the range ]180, 360] at round 0, spades
was selected at round (0) (1 = 1) and the wheel (1) was in the range ]180, 360] at round
(0), and so on.</p>
      <p>The probability for each  can be computed by multiplying the discrete and continuous
components. For 0 (the process is similar for all the  ∈ ) we have:
 (0) =
=</p>
      <p>Y({(0, 0, 1, 1, . . .) | 0 = 1})  X
where 13 is the contribution of the discrete random variable (spades) and 3610 is the
contribution of the continuous one (angle). By considering all the values obtained for all the ,
we get 13 · 21 · ∑︀∞=0( 23 · 12 · 21 ) = 16 · ∑︀∞=0( 16 ) = 16 · 56 = 15 as probability for the query
at_least_once_spades.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], we prove that this semantics is well defined, i.e., it assigns a probability value to queries
for a large class of programs. However, as discussed in [5], these programs must met some
requirements, mainly needed to ensure the existence of the sets of discrete and continuous
random variables. These requirements are: 1) the set of random variables must be countable; 2)
clauses with the same head but diferent bodies must be mutually exclusive; 3) the value of a
continuous random variable must be used only as a parameter for another distribution, and not
as a variable for another term; 4) clauses must be range restricted (every variable in the head
also appears in a positive literal in the body): this ensures that answers to queries are ground
instantiations of it. For a more in-depth discussion see [5].
[3] L. De Raedt, A. Kimmig, H. Toivonen, Problog: A probabilistic prolog and its application in
link discovery, in: M. M. Veloso (Ed.), IJCAI, 2007, pp. 2462–2467.
[4] F. Riguzzi, The distribution semantics for normal programs with function symbols,
International Journal of Approzimate Reasoning 77 (2016) 1–19. doi:10.1016/j.ijar.2016.05.
005.
[5] D. Azzolini, F. Riguzzi, Syntactic requirements for well-defined hybrid probabilistic logic
programs, in: A. Formisano, Y. A. Liu, B. Bogaerts, A. Brik, V. Dahl, C. Dodaro, P. Fodor,
G. L. Pozzato, J. Vennekens, N.-F. Zhou (Eds.), Proceedings 37th International Conference on
Logic Programming (Technical Communications), Open Publishing Association, Waterloo,
Australia, 2021, pp. 14–26. doi:10.4204/EPTCS.345.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>D.</given-names>
            <surname>Azzolini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Riguzzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Lamma</surname>
          </string-name>
          ,
          <article-title>A semantics for hybrid probabilistic logic programs with function symbols</article-title>
          ,
          <source>Artificial Intelligence</source>
          <volume>294</volume>
          (
          <year>2021</year>
          )
          <article-title>103452</article-title>
          . doi:
          <volume>10</volume>
          .1016/j.artint.
          <year>2021</year>
          .
          <volume>103452</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <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, Gistrup, Denmark,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>