ProbLog#Implementations
{{Short description|Probabilistic logic programming language}}
{{Infobox software
| name = ProbLog
| author = DTAI research lab (KU Leuven)
| released = {{Start date|2007|11|11}}
| 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
| website = {{URL|https://dtai.cs.kuleuven.be/problog/}}
}}
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.
Semantics
A probabilistic fact is a pair with a ground atom and the probability of being true. A rule is defined by an atom , called the head, and a finite set of literals , called the body.
ProbLog programs consist of a set of probabilistic facts and a set of rules . Using the distribution semantics, a probability distribution is defined over the two-valued well-founded models of the atoms in the program. The probability of a model is defined as where the product runs over all the literals in the model . For a query atom the distribution semantics defines a probability for the query
in which the sum runs over all the models where is true.
ProbLog supports multiple tasks:
- Probabilistic inference: calculate
- Most probable explanation: calculate the most probable model probability
- Sampling: generate samples of
- Learning from interpretations: learn the probabilities of ProbLog programs from data
= Example =
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:
0.4 :: rain(weekday).
0.9 :: rain(weekend).
0.8 :: umbrella_if_rainy(Day).
0.2 :: umbrella_if_dry(Day).
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.
Implementations
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.{{Cite web |title=cplint – AI@UNIFE |url=https://ai.unife.it/cplint/ |access-date=2023-11-13 |language=en-US}}
ProbLog variants
ProbLog has been extended or used as inspiration for several different variants, including:
- DeepProbLog extends ProbLog by allowing the probability to be parametrized by a neural network.
- DTProblog extends ProbLog with decision theory. The utility of a strategy is defined as the expected reward for its execution in the presence of probabilistic effects.
- DC-ProbLog extends ProbLog with distributional facts, meaning that instead of probabilities, a logic atom has a corresponding continuous probability distribution instead.
- aProbLog generalizes ProbLog by allowing any commutative semiring instead of just probabilities.
- ProbFOIL: given a set of ProbLog facts as a probabilistic relational database, ProbFOIL finds a set of probabilistic rules to predict the facts of one relation based on all other relations.
Related languages
Further reading
References
{{Reflist|30em|refs=
|last1 = De Raedt|first1 = Luc|last2 = Kimmig|first2 = Angelika|last3 = Toivonen|first3 = Hannu|title = ProbLog: A Probabilistic Prolog and Its Application in Link Discovery|conference = IJCAI|date = November 2007|volume = 7}}
|last1 = De Raedt|first1 = Luc|last2 = Kimmig|first2 = Angelika|title = Probabilistic (logic) programming concepts|journal = Machine Learning|date = 2015|volume = 100|number = 1|pages = 5–47| doi=10.1007/s10994-015-5494-z | s2cid=3166992 |doi-access = free}}
|last1 = Van den Broeck|first1 = Guy|last2 = Thon|first2 = Ingo|last3 = Van Otterlo|first3 = Martijn|last4=De Raedt|first4=Luc|title = DTProbLog: A decision-theoretic probabilistic Prolog|book-title = Proceedings of the AAAI Conference on Artificial Intelligence|date = 2010|volume = 24|number = 1}}
}}
Category:Probabilistic software
Category:Programming paradigms
Category:Nondeterministic programming languages
Category:Computational statistics