problog
ProbLog2: Probabilistic Logic Programming toolbox
What it is and what it does
ProbLog is a Python package for probabilistic logic programming that lets you write logic programs where facts can be annotated with probabilities. It solves inference problems by converting programs and queries into weighted Boolean formulas, then using algorithms from graphical models and knowledge compilation to compute answers. The package handles tasks like computing marginal probabilities given evidence and learning from partial interpretations.
You can represent knowledge bases as Prolog/Datalog facts, CSV files, SQLite tables, or Python functions. It's designed for situations where you need to encode both complex interactions between components and the inherent uncertainties in real-world data. The package is actively maintained, supports Python 3.8 through 3.12, and installs cleanly with minimal dependencies.
Use it for:
- Build probabilistic reasoning systems that combine logical rules with uncertain facts to compute outcome probabilities
- Learn probabilistic logic programs from partial interpretations or labeled examples in AI/ML workflows
- Model real-world systems with both deterministic rules and probabilistic components (e.g., sensor fusion, diagnosis)
- Perform inference over knowledge bases stored in Prolog, CSV, or SQLite with probability annotations
- Reduce probabilistic inference to weighted model counting for integration with knowledge compilation solvers
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
ProbLog is a probabilistic logic programming toolbox that combines logic programming with probability annotations to perform inference tasks like computing marginals given evidence and learning from interpretations.
Yes. ProbLog is actively maintained, has no known vulnerabilities, installs with low friction, and is licensed permissively. It fills a specific niche in probabilistic logic programming with a mature codebase (first released in 2015) and clear documentation. Install it if you need to combine logic programming with probabilistic reasoning; skip it if you're looking for general-purpose Bayesian inference or constraint solving.
Install
problog on PyPI
pip
pip install probloguv
uv add problogpoetry
poetry add problogInstalling problog
Before you install
Low install friction; ships as a pure Python wheel with only setuptools as a runtime dependency. Actively maintained with a release 149 days ago.
License in practice
Licensed under Apache License 2.0 (permissive), allowing commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
pip install problog
from problog.program import PrologString
from problog.engine import DefaultEngine
program = PrologString("""
0.5::heads.
query(heads).
""")
result = DefaultEngine().prepare(program).evaluate()
Verify before relying
- Whether the package supports Java embedding as claimed in the description excerpt
- Whether CSV and SQLite integration work out-of-the-box or require optional dependencies
- Performance characteristics for large-scale probabilistic programs
Package facts
| License | Apache Software License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — setuptools |
| Maintenance | actively maintained — 149 days since the last release |
| First released | |
| Downloads | 302,512/month — #7,821 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: problog-2.2.10-py3-none-any.whl
Keywords: prolog, probabilistic, logic
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
tensorflow-probabilityTensorFlow Probability provides probabilistic…
permissive · top 5,000 on PyPI
pyAgrum-nightlypyAgrum is a Python library for creating,…
unclear · top 15,000 on PyPI
pyjptpyjpt learns and reasons about joint…
unclear · top 15,000 on PyPI
pyro-pplPyro is a deep probabilistic programming…
permissive · top 5,000 on PyPI
pgmpypgmpy provides data structures and algorithms…
unclear · top 5,000 on PyPI
prelizPreliZ helps you specify prior distributions…
permissive · top 15,000 on PyPI
numpyroNumPyro is a probabilistic programming library…
permissive · top 15,000 on PyPI
pymc3PyMC3 is a Python package for Bayesian…
permissive · top 15,000 on PyPI
properscoringProperscoring provides strictly proper scoring…
permissive · top 15,000 on PyPI