# 概率逻辑

概率逻辑是一类形式化框架，它将逻辑表示与概率论结合起来，使推理返回一个公式的概率或可能世界上的分布，而不是简单的真或假的判定。尼尔森（Nilsson）1986年的表述将逻辑推广，使句子的真值为0到1之间的概率，而当所有句子的概率为0或1时，概率蕴涵退化为普通的逻辑蕴涵。<sup>[1](http://ai.stanford.edu/%7Enilsson/OnlinePubs-Nils/PublishedPapers/problogic.pdf)</sup><sup> • </sup><sup>[2](https://doi.org/10.1016/0004-3702%2886%2990031-7)</sup>后来的系统计算可能世界上的单一分布，并以查询为真的那些世界的概率之和来回答查询。<sup>[3](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)</sup>ProbLog是Prolog的概率扩展，它将查询的含义定义为在随机采样的程序中该查询的成功概率。<sup>[4](https://www.cs.helsinki.fi/u/htoivone/pubs/IJCAI07-397.pdf)</sup>

| 事实 | 详情 |
|---|---|
| 推理返回什么 | 查询公式的概率：在分布语义下，即查询为真的那些可能世界的概率之和<sup>[3](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)</sup> |
| 经典极限 | 当所有句子的概率为0或1时，概率蕴涵退化为普通的逻辑蕴涵<sup>[1](http://ai.stanford.edu/%7Enilsson/OnlinePubs-Nils/PublishedPapers/problogic.pdf)</sup> |
| ProbLog语义 | 每个子句带有独立的概率，表示其属于采样程序的概率；查询即该程序中的成功概率<sup>[4](https://www.cs.helsinki.fi/u/htoivone/pubs/IJCAI07-397.pdf)</sup> |
| 复杂度 | 概率逻辑程序中的查询回答是NP难的，事实上是#P完全的<sup>[3](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)</sup>；加权模型计数一般是#P完全的，但对sd-DNNF公式是线性的<sup>[5](https://dtai.cs.kuleuven.be/tutorials/deeplog/assets/ijcai2026/deeplog-ijcai2026-slides.pdf)</sup> |
| 马尔可夫逻辑 | 一组带权一阶公式，用作马尔可夫网络的模板，每个基原子对应一个节点<sup>[6](https://dl.acm.org/doi/fullHtml/10.1145/3241978)</sup> |
| 分布语义家族 | 包括概率逻辑程序、概率霍恩溯因、PRISM、独立选择逻辑、pD、LPAD、ProbLog、P-log和CP逻辑，它们之间通过线性复杂度的变换相互联系<sup>[7](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2014.00006/full)</sup> |
| 学习系统 | PRISM、LeProbLog、LFI-ProbLog、EMBLEM和ProbLog2通过EM或梯度下降学习参数；SEM-CP逻辑、SLIPCASE和SLIPCOVER学习结构和参数<sup>[3](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)</sup> |

## 工作原理

概率逻辑系统的首要区别在于概率所处的位置。一种方法将概率直接附加到句子上；1989年IJCAI的一篇分析将另一种方法描述为将概率放在可能世界上，这适合表达信念程度的陈述，例如"翠蒂（Tweety，一只特定的鸟）会飞的概率大于0.9"。<sup>[8](https://www.ijcai.org/Proceedings/89-2/Papers/084.pdf)</sup>

**分布语义。** 大多数概率逻辑编程语言遵循分布语义：一个程序定义了正规逻辑程序（可能世界）上的分布，基查询的概率是查询为真的那些世界的概率之和。<sup>[7](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2014.00006/full)</sup>在ProbLog中，选择项由形如\( P_i :: f_i \)的概率事实表示，其中\( f_i \)的每个基实例化为真的概率为\( P_i \)，为假的概率为\( 1 - P_i \)；一个世界通过选择或拒绝每个基实例化获得，查询概率通过对世界求和得到。<sup>[9](http://mcs.unife.it/~friguzzi/chapter2.pdf)</sup>尼尔森的逻辑走了一条不同的路线，考虑分布的集合而非世界上的单一分布。<sup>[3](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)</sup>向逻辑程序中添加独立的概率事实——这一策略出现在普尔（Poole）的工作中——是一种流行的策略；第二种语义建立在正规逻辑程序的良基模型之上。<sup>[10](https://www.jair.org/index.php/jair/article/download/11085/26272/20615)</sup>

贝叶斯网络等价于分布语义下一类受限的概率逻辑程序。<sup>[3](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)</sup>与马尔可夫逻辑相比，ProbLog的有向独立选择语义不需要最大熵假设，而马尔可夫逻辑通过最大熵原理对其未归一化的加权子句进行归一化。<sup>[11](https://repository.tudelft.nl/file/File_08efee24-62ed-4732-abde-5d93da2809de?preview=1)</sup>

## 实现方式

推理在概率侧分为精确推理与近似推理（界限或采样），在逻辑侧分为前向推理与后向推理以及到合取范式（CNF）的基化。<sup>[12](https://link.springer.com/content/pdf/10.1007/s10994-015-5494-z.pdf)</sup>精确推理通常诉诸知识编译：分布语义语言的第一个方法将解释的覆盖集构建为析取范式（DNF）公式，并将其编译为二元决策图（BDD），其查询概率通过动态规划计算，复杂度与图的大小成线性关系。<sup>[7](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2014.00006/full)</sup>ProbLog的实现将Prolog推理与BDD结合，以精确计算成功概率和解释概率<sup>[13](https://ar5iv.labs.arxiv.org/html/1006.4442)</sup>；当前的ProbLog系统则编译为句子决策图（SDD），采用四步流水线：基化、重写为命题公式、知识编译，以及作为算术电路求值。<sup>[14](https://arxiv.org/html/1907.08194v2)</sup>求值是加权模型计数的一个实例，\( \mathrm{WMC}(T, \alpha) = \sum_{m \in \mathrm{models}(T)} \prod_{l \in m} \alpha(l) \)<sup>[15](https://arxiv.org/html/2402.13782)</sup>，这一归约由马克·查维拉（Mark Chavira）和阿德南·达尔维切（Adnan Darwiche）系统研究。<sup>[16](https://doi.org/10.1016/j.artint.2007.11.002)</sup>

近似方法通过迭代加深和蒙特卡洛采样计算成功概率的上界和下界，以及来自k个最可能证明的下界。<sup>[13](https://ar5iv.labs.arxiv.org/html/1006.4442)</sup>MCMC将查询的概率估计为其成立的样本比例，已被用于Church、BLOG、PRISM和ProbLog。<sup>[12](https://link.springer.com/content/pdf/10.1007/s10994-015-5494-z.pdf)</sup>

概率逻辑程序中的查询回答是NP难的，事实上是#P完全的，因为此类程序的表达力与贝叶斯网络相当<sup>[3](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)</sup>；ProbLog的成功概率归约为布尔单调DNF的概率，这是NP难的。<sup>[4](https://www.cs.helsinki.fi/u/htoivone/pubs/IJCAI07-397.pdf)</sup>用于学习的梯度来自梯度半环，其元素为元组\( (p, \partial p / \partial \theta) \)。<sup>[14](https://arxiv.org/html/1907.08194v2)</sup>在马尔可夫逻辑中，权重无法以闭式估计，但对数似然在权重上是凹的，因此，若不计推理开销，优化是高效的。<sup>[17](https://www.microsoft.com/en-us/research/wp-content/uploads/2017/05/pilp.pdf)</sup>

## 起源

逻辑与概率之间的紧密联系被德摩根（De Morgan，1847）、布尔（Boole，1854）、拉姆齐（Ramsey，1926）、德·菲内蒂（de Finetti，1937）和卡尔纳普（Carnap，1950）等人所强调。<sup>[18](https://plato.stanford.edu/ENTRIES/logic-probability/)</sup>"概率逻辑"这一术语及其1986年的形式化来自尼尔斯·J·尼尔森（Nils J. Nilsson）发表在《人工智能》（Artificial Intelligence）上的论文《概率逻辑》（"Probabilistic logic"）。<sup>[2](https://doi.org/10.1016/0004-3702%2886%2990031-7)</sup>概率逻辑编程始于20世纪90年代初<sup>[7](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2014.00006/full)</sup>；概率逻辑编程包括建模、推理和学习的框架，PRISM学习算法构成了一种内置机器学习支持的概率编程语言。<sup>[15](https://arxiv.org/html/2402.13782)</sup>PRISM归功于佐藤泰介（Taisuke Sato）和龟谷佳隆（Yoshitaka Kameya），IJCAI 1997。<sup>[19](https://dl.acm.org/doi/10.1145/3191315.3191319)</sup>

## 变体

**分布语义语言。** 该家族包括概率逻辑程序、概率霍恩溯因、PRISM、独立选择逻辑、pD、LPAD、ProbLog、P-log和CP逻辑，线性复杂度的变换可以将一种翻译为另一种。<sup>[7](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2014.00006/full)</sup>CP逻辑是一种因果概率事件的语言，是约斯特·文内肯斯（Joost Vennekens）、马克·德内克（Marc Denecker）和莫里斯·布鲁诺赫（Maurice Bruynooghe）的工作。<sup>[20](https://doi.org/10.1017/s1471068409003767)</sup>PITA系统将表格化求值和答案归并引入不确定性下的推理<sup>[21](https://doi.org/10.1017/s147106841100010x)</sup>，而由安格莉卡·基米希（Angelika Kimmig）、巴特·德蒙（Bart Demoen）、卢克·德·拉特（Luc De Raedt）、维托尔·桑托斯·科斯塔（Vítor Santos Costa）和里卡多·罗查（Ricardo Rocha）撰写的ProbLog实现论文确立了基于BDD的引擎。<sup>[22](https://doi.org/10.1017/s1471068410000566)</sup>

**加权无向形式化。** 马尔可夫逻辑网络是一组带权一阶公式，被视为构建马尔可夫网络的模板，产生一个分布，其中满足更高权重基公式的世界更可能<sup>[6](https://dl.acm.org/doi/fullHtml/10.1145/3241978)</sup>；该形式化由马修·理查森（Matthew Richardson）和佩德罗·多明戈斯（Pedro Domingos）于2006年发表在《机器学习》（Machine Learning）上<sup>[23](https://doi.org/10.1007/s10994-006-5833-1)</sup>，是开源Alchemy系统的基础。<sup>[17](https://www.microsoft.com/en-us/research/wp-content/uploads/2017/05/pilp.pdf)</sup>概率软逻辑使用类似马尔可夫逻辑的加权公式，但对变量进行连续松弛以实现高效推理。<sup>[6](https://dl.acm.org/doi/fullHtml/10.1145/3241978)</sup>

**生成式和一阶语言。** 一阶概率语言分为基于条件概率分布（CPD）的有向形式化，包括BUGS、PRISM、概率关系模型、贝叶斯逻辑程序和BLOG，以及基于权重的无向形式化，如关系马尔可夫网络和马尔可夫逻辑。<sup>[24](https://people.csail.mit.edu/milch/papers/ilp06-fopl.pdf)</sup>BLOG是为具有未知对象的模型设计的，其中不确定性延伸到存在哪些对象。<sup>[24](https://people.csail.mit.edu/milch/papers/ilp06-fopl.pdf)</sup>

## 应用

ProbLog的动机是挖掘大型生物网络，其中边带有概率标签，连接基因、蛋白质和表型等概念。<sup>[4](https://www.cs.helsinki.fi/u/htoivone/pubs/IJCAI07-397.pdf)</sup>马尔可夫逻辑已被应用于实体消解、链接预测和信息抽取<sup>[17](https://www.microsoft.com/en-us/research/wp-content/uploads/2017/05/pilp.pdf)</sup>，概率逻辑编程学习系统已被应用于生物学、医学、链接预测和文本分类。<sup>[3](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)</sup>最近，DeepProofLog报告了在神经符号基准和知识图谱推理任务上的实验。<sup>[25](https://ojs.aaai.org/index.php/AAAI/article/view/39396)</sup>

## 局限与替代方案

**基化的可扩展性。** 精确推理需要基化，编译表示可能代价高昂：知识编译在一个离线步骤中变换公式，计算代价可能很高。<sup>[11](https://repository.tudelft.nl/file/File_08efee24-62ed-4732-abde-5d93da2809de?preview=1)</sup>系统之间的扩展差距可能很大：富尔（Fuhr）的pD HySpirit实现在约10个或更多合取项时变得不可行，而ProbLog的近似可处理多达100000个合取项。<sup>[4](https://www.cs.helsinki.fi/u/htoivone/pubs/IJCAI07-397.pdf)</sup>提升推理避免了基化，但根据所引的2015年综述，概率逻辑编程实现尚未支持它<sup>[12](https://link.springer.com/content/pdf/10.1007/s10994-015-5494-z.pdf)</sup>；后来的工作，如2019年的vProbLog系统，使用Datalog技术将知识编译与非基程序上的前向推理相结合，有效消除了基化瓶颈。<sup>[26](https://ar5iv.labs.arxiv.org/html/1911.07750)</sup>在马尔可夫逻辑中，关于个体常量的证据打破了提升方法所利用的对称性。<sup>[6](https://dl.acm.org/doi/fullHtml/10.1145/3241978)</sup>PSL的满足度语义有其自身的局限：更多证据并不总是使事件更可能。<sup>[6](https://dl.acm.org/doi/fullHtml/10.1145/3241978)</sup>

**神经符号扩展。** 一个代数框架通过用半环元素标记事实并用加法和乘法替换析取和合取，统一了概率逻辑编程和神经符号逻辑编程，发表在《国际近似推理杂志》（International Journal of Approximate Reasoning）上，称为代数模型计数。<sup>[15](https://arxiv.org/html/2402.13782)</sup>DeepProbLog用神经谓词扩展了ProbLog，神经谓词是从其输入计算概率的神经网络，同时保留ProbLog的语义和推理<sup>[14](https://arxiv.org/html/1907.08194v2)</sup>；其关键思想是将神经谓词作为逻辑与神经网络之间的深度接口。<sup>[5](https://dtai.cs.kuleuven.be/tutorials/deeplog/assets/ijcai2026/deeplog-ijcai2026-slides.pdf)</sup>DeepProofLog用神经网络参数化所有推导步骤，并将消解过程映射到马尔可夫决策过程上，以进行动态规划和强化学习。<sup>[25](https://ojs.aaai.org/index.php/AAAI/article/view/39396)</sup>

## References

1. [Probabilistic Logic (Nilsson, Artificial Intelligence, 1986)](http://ai.stanford.edu/%7Enilsson/OnlinePubs-Nils/PublishedPapers/problogic.pdf)
2. [Probabilistic logic (Artificial Intelligence, 1986)](https://doi.org/10.1016/0004-3702%2886%2990031-7)
3. [A Survey of Probabilistic Logic Programming (Riguzzi & Swift)](https://ml.unife.it/wp-content/uploads/Papers/RigSwi-WFS16.pdf)
4. [ProbLog: A Probabilistic Prolog and Its Application in Link Discovery (De Raedt, Kimmig, Toivonen, IJCAI 2007)](https://www.cs.helsinki.fi/u/htoivone/pubs/IJCAI07-397.pdf)
5. [Deep Parameterized Logics as a Foundation for Neurosymbolic AI, IJCAI 2026 Tutorial slides (KU Leuven DTAI)](https://dtai.cs.kuleuven.be/tutorials/deeplog/assets/ijcai2026/deeplog-ijcai2026-slides.pdf)
6. [Markov Logic Networks (Communications of the ACM)](https://dl.acm.org/doi/fullHtml/10.1145/3241978)
7. [A History of Probabilistic Inductive Logic Programming](https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2014.00006/full)
8. [An Analysis of First-Order Logics of Probability (IJCAI 1989)](https://www.ijcai.org/Proceedings/89-2/Papers/084.pdf)
9. [Foundations of Probabilistic Logic Programming (book chapter, Riguzzi)](http://mcs.unife.it/~friguzzi/chapter2.pdf)
10. [JAIR article on probabilistic logic programming semantics](https://www.jair.org/index.php/jair/article/download/11085/26272/20615)
11. [A survey on dimensions of NeSy and StarAI systems (TU Delft repository)](https://repository.tudelft.nl/file/File_08efee24-62ed-4732-abde-5d93da2809de?preview=1)
12. [Probabilistic (Logic) Programming Concepts (Kimmig et al., Machine Learning)](https://link.springer.com/content/pdf/10.1007/s10994-015-5494-z.pdf)
13. [On the Implementation of the Probabilistic Logic Programming Language ProbLog (Kimmig et al.)](https://ar5iv.labs.arxiv.org/html/1006.4442)
14. [Neural Probabilistic Logic Programming in DeepProbLog (AIJ extended version)](https://arxiv.org/html/1907.08194v2)
15. [Semirings for Probabilistic and Neuro-Symbolic Logic Programming (IJAR 2024)](https://arxiv.org/html/2402.13782)
16. [Mark Chavira, Adnan Darwiche (2007). On probabilistic inference by weighted model counting. Artificial Intelligence.](https://doi.org/10.1016/j.artint.2007.11.002)
17. [Markov Logic (Domingos & Richardson chapter)](https://www.microsoft.com/en-us/research/wp-content/uploads/2017/05/pilp.pdf)
18. [Logic and Probability (Stanford Encyclopedia of Philosophy)](https://plato.stanford.edu/ENTRIES/logic-probability/)
19. [Declarative Logic Programming: Theory, Systems, and Applications (ACM Books)](https://dl.acm.org/doi/10.1145/3191315.3191319)
20. [JOOST VENNEKENS, MARC DENECKER, MAURICE BRUYNOOGHE (2009). CP-logic: A language of causal probabilistic events and its relation to logic programming. Theory and Practice of Logic Programming.](https://doi.org/10.1017/s1471068409003767)
21. [FABRIZIO RIGUZZI, TERRANCE SWIFT (2011). The PITA system: Tabling and answer subsumption for reasoning under uncertainty. Theory and Practice of Logic Programming.](https://doi.org/10.1017/s147106841100010x)
22. [ANGELIKA KIMMIG and colleagues (2011). On the implementation of the probabilistic logic programming language ProbLog. Theory and Practice of Logic Programming.](https://doi.org/10.1017/s1471068410000566)
23. [Matthew Richardson, Pedro Domingos (2006). Markov logic networks. Machine Learning.](https://doi.org/10.1007/s10994-006-5833-1)
24. [First-Order Probabilistic Languages: Into the Unknown (Milch et al., ILP 2006)](https://people.csail.mit.edu/milch/papers/ilp06-fopl.pdf)
25. [DeepProofLog: Efficient Proving in Deep Stochastic Logic Programs (AAAI-26)](https://ojs.aaai.org/index.php/AAAI/article/view/39396)
26. [ar5iv.labs.arxiv.org](https://ar5iv.labs.arxiv.org/html/1911.07750)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 25, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › Formal logic and foundations › Logical calculi and logical syntax › Non-classical logic

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/probabilistic-logic

English original: https://www.edgepedia.org/probabilistic-logic
