--- id: problog version: "2.2.10" license: Apache Software License license_treatment: permissive maintenance: active --- # problog — ProbLog2: Probabilistic Logic Programming toolbox License: permissive · Maintenance: active · Downloads: 302.5K/mo ## 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 above — 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 pip install problog uv add problog poetry add problog ## Installing 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: unspecified - Install friction: low - Maintenance: active - Downloads: 302.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags probabilistic logic programming, prolog with probabilities, weighted model counting, probabilistic inference, logic program uncertainty, bayesian logic programming, knowledge compilation, logic-programming, probabilistic-inference, knowledge-representation [View on SkillFed](https://skillfed.io/packages/problog) · [View on PyPI](https://pypi.org/project/problog/)