ProbLog | |
Author: | DTAI research lab (KU Leuven) |
Latest Release Version: | 2.1 |
Programming Language: | Python |
Operating System: | Linux, Mac OS X, Microsoft Windows |
Genre: | Probabilistic logic |
License: | Apache License, Version 2.0 |
ProbLog is a probabilistic logic programming language that extends Prolog with probabilities. It minimally extends Prolog by adding the notion of a probabilistic fact, which combines the idea of logical atoms and random variables. Similarly to Prolog, ProbLog can query an atom. While Prolog returns the truth value of the queried atom, ProbLog returns the probability of it being true.
A probabilistic fact is a pair
(p,a)
a
p\in[0,1]
a
h
n
\{b1,b2,...,bn\}
l{F}
l{R}
M
q
q
ProbLog supports multiple tasks:
P(q)
maxMP(M)
q
ProbLog can for example be used to calculate the probability of getting wet given the probabilities for rain and the probabilities that someone brings an umbrella as follows:
umbrella(Day) :- rain(Day), umbrella_if_rainy(Day).umbrella(Day) :- \+rain(Day), umbrella_if_dry(Day).wet(Day) :- rain(Day), \+umbrella(Day).
query(\+wet(weekend)).
The last rule before the query states that someone gets wet if it rains and no umbrella was brought. When ProbLog is asked to solve the "probabilistic inference" task, the query asks for the probability to stay dry on a weekend day. When solving the "most probable explanation" task, ProbLog will return the most likely reason for staying dry, i.e. because it is not raining or because the person has an umbrella.
The ProbLog language has been implemented as a YAP Prolog library (ProbLog 1). and as a stand-alone Python framework (ProbLog 2)The source code of ProbLog 2 is licensed under Apache License, Version 2.0 and available on GitHub. The ProbLog language has also been implemented as part of the cplint probabilistic logic programming package for SWI-Prolog, YAP and XSB.[1]
ProbLog has been extended or used as inspiration for several different variants, including: