# DPLL算法

DPLL算法（Davis–Putnam–Logemann–Loveland）是一种完备的回溯搜索过程，用于判定合取范式（CNF）形式的布尔公式是否可满足，并在可满足时给出一个满足赋值。该算法发表于1960至1962年间Martin Davis与Hilary Putnam的论文，以及Davis、Logemann与Loveland的论文中，后来成为几乎所有现代SAT求解器与答案集编程求解器的核心，冲突驱动子句学习（CDCL）求解器即建立在其之上。<sup>[1](https://www.kipuhub.com/en/article/dpll-cdcl/)</sup><sup> • </sup><sup>[2](https://www.cambridge.org/core/journals/theory-and-practice-of-logic-programming/article/preface/60BF5956A25C6E531BD0C5B0438CD6D5)</sup>

| 关键事实 | 详情 |
|---|---|
| 起源 | 由Davis、Logemann与Loveland在实现1960年Davis–Putnam过程时设计；发表于1960–1962年<sup>[1](https://www.kipuhub.com/en/article/dpll-cdcl/)</sup><sup> • </sup><sup>[3](https://www.researchgate.net/publication/2526276_Resolution_versus_Search_Two_Strategies_for_SAT)</sup> |
| 方法 | 在变量赋值上进行回溯搜索，配合单元传播与纯文字消去<sup>[4](https://logical.stanford.edu/logicprogramming/chapters/chapter_15.html)</sup> |
| 最坏情况复杂度 | 关于变量数\( n \)为\( \mathcal{O}(2^{n}) \)<sup>[5](https://cca.informatik.uni-freiburg.de/sat/ss23/03/)</sup> |
| 证明系统强度 | 与树状归结多项式等价<sup>[6](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SAT.2026.30)</sup> |
| 现代后裔 | CDCL求解器增加了子句学习与非时序回溯；DPLL(T)将该方案扩展到可满足性模理论<sup>[7](https://www.mdpi.com/1999-4893/15/12/479)</sup><sup> • </sup><sup>[8](https://arxiv.org/abs/2307.10266)</sup> |
| 运行时间分布 | 在实际问题上，大部分运行时间花在单元传播上<sup>[9](https://www.scs.cmu.edu/afs/cs/project/jair/pub/volume21/dixon04a-html/node3.html)</sup> |

## 起源

Davis与Putnam于1960年提出了一种基于归结的量词理论过程。1962年，Davis、Logemann与Loveland提出了文献中所谓的一处轻微语法修改：用分裂规则取代归结规则，以避免指数级的内存爆炸。这一改动将算法转变为回溯方案，此后关于命题可满足性的大部分工作引用的都是这个回溯版本，在SAT社区中称为DP或DPLL，而原始版本则被称为DP-归结或方向性归结。<sup>[3](https://www.researchgate.net/publication/2526276_Resolution_versus_Search_Two_Strategies_for_SAT)</sup>五十年后，该算法已成为所有SAT求解器与答案集编程求解器的核心。<sup>[2](https://www.cambridge.org/core/journals/theory-and-practice-of-logic-programming/article/preface/60BF5956A25C6E531BD0C5B0438CD6D5)</sup>

## 算法工作原理

DPLL从空的局部真值赋值出发，对某个未赋值变量递归地尝试真与假两个分支，并用两条演绎规则剪枝搜索。<sup>[4](https://logical.stanford.edu/logicprogramming/chapters/chapter_15.html)</sup>

**单元传播。** 当在当前局部赋值下化简后，某个子句只剩下一个未赋值的文字时，该文字的值就被迫确定：单元子句\( p \)意味着每个满足扩展都必须将\( p \)置为真，因此将\( p \)赋为假的分支被忽略。传播会级联进行，因为每次强制赋值都会进一步化简公式，并可能产生新的单元子句。<sup>[4](https://logical.stanford.edu/logicprogramming/chapters/chapter_15.html)</sup>

**纯文字消去。** 如果文字\( q \)出现在剩余未满足的子句中，而其否定\( \neg q \)不出现，则将\( q \)置为真保持可满足性，但可能丢弃某些满足赋值。<sup>[9](https://www.scs.cmu.edu/afs/cs/project/jair/pub/volume21/dixon04a-html/node3.html)</sup><sup> • </sup><sup>[17](https://wackb.gricad-pages.univ-grenoble-alpes.fr/inf402/Poly-inf432.pdf)</sup>实践中，该规则通常不纳入DPLL或单元传播的实现，因为代价相对较高：必须持续维护并检查极性计数，而且许多分支启发式使该规则变得不必要。它可以作为预处理廉价地应用一次。<sup>[9](https://www.scs.cmu.edu/afs/cs/project/jair/pub/volume21/dixon04a-html/node3.html)</sup><sup> • </sup><sup>[10](https://cs.stackexchange.com/questions/150557/what-are-efficient-approaches-to-implement-unit-propagation-in-dpll-based-sat-so)</sup>

当某个分支被证伪时，搜索按时间顺序回溯，最坏情况时间复杂度为\( \mathcal{O}(2^{n}) \)，其中\( n \)为变量数。<sup>[5](https://cca.informatik.uni-freiburg.de/sat/ss23/03/)</sup>剪枝在实践中很重要：一个从零实现的DPLL大约一秒即可求解一个随机的100变量3-SAT实例，而暴力法需要\( 2^{100} \)次检查。<sup>[11](https://github.com/MohammadHossinzehi/sat-solver)</sup>

## 实现：单元传播作为内层循环

当DPLL在实际问题上运行时，大部分运行时间花在单元传播上，而在传播内部，大部分精力用于识别未被满足且至多含一个未赋值文字的子句。历代的实现方案改进了这一内层循环：扫描所有子句；将注意力限制在包含新被证伪文字的子句上；维护每个子句已满足与未绑定文字的数量；最后是Moskewicz等人（2001）以及Zhang与Stickel（2000）的监视文字方案。在监视文字方案下，每个子句指定两个被监视的文字；只要两者都未赋值或已满足，该子句就不可能传播，因此只有当某个被监视文字被置为假时，才会详细检查该子句。<sup>[9](https://www.scs.cmu.edu/afs/cs/project/jair/pub/volume21/dixon04a-html/node3.html)</sup>

## 从DPLL到CDCL

现代求解器用冲突驱动子句学习扩展DPLL：当搜索遇到冲突时，求解器生成一个冲突子句（学习子句），使其能够剪除搜索空间，这种技术被描述为从失败中学习。CDCL还增加了非时序回溯，实际求解器又在其上叠加了VSIDS（变量状态独立衰减和）活跃度评分、重启与子句数据库管理。<sup>[12](https://thakur.cs.ucdavis.edu/assets/pubs/thakur_PHD14.pdf)</sup><sup> • </sup><sup>[1](https://www.kipuhub.com/en/article/dpll-cdcl/)</sup>如今，DPLL与子句学习的结合被称为CDCL算法，它是处理实际非随机生成实例的主流算法。<sup>[7](https://www.mdpi.com/1999-4893/15/12/479)</sup>

一项2026年的基准测试在相同的子句数据库与监视文字传播下比较了两种搜索策略，展示了子句学习如何改变搜索树。在鸽巢公式上，随着规模增长，CDCL相较DPLL削减决策数的效果愈发显著，但在实际耗时上并不总是获胜：

| 实例 | 变量数 | DPLL决策数 | CDCL决策数 | 实际耗时胜者 |
|---|---|---|---|---|
| php_6_5 | 30 | 453 | 196 | CDCL，决策数约为DPLL的1/2.3 |
| php_7_6 | 42 | 3,769 | 744 | CDCL，决策数约为DPLL的1/5.1 |
| php_8_7 | 56 | 37,029 | 3,590 | CDCL，决策数约为DPLL的1/10.3；DPLL更快，0.93秒对1.83秒 |

在56变量实例上，子句学习将搜索树缩小了10.3倍，却在实际耗时上落败，1.83秒对0.93秒，原因是CDCL实现中每次决策的额外开销更高。<sup>[13](https://forwards-newsletter.beehiiv.com/p/the-forward-pass-weekly-sat-solvers-measured)</sup>

## 理论极限与困难性

DPLL与归结密切相关：它与树状归结多项式等价，因此树状归结的下界意味着DPLL运行时间的下界。鸽巢公式可证明不可满足，且以基于归结的搜索难以处理而闻名；不可满足的Tseitin公式出于同样的原因，对基于DPLL的求解器必然困难。<sup>[6](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SAT.2026.30)</sup><sup> • </sup><sup>[14](https://www.sciencedirect.com/science/article/pii/S030439752600486X)</sup>2026年，Sahil Samar、Marc Vinyals与Vijay Ganesh的一项结果证明了一个指数级分离：一种使用VSIDS启发式变体的确定性CDCL配置可在关于\( n \)的多项式时间内求解排序原理（OP）CNF公式，而树状归结对OP公式具有指数级证明规模下界，因此该CDCL配置在这些实例上比任何DPLL配置都快指数级。<sup>[6](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SAT.2026.30)</sup>

实例类型在经验上也很重要。诸如WalkSAT之类的随机局部搜索求解器在随机生成的可满足公式上表现出色，而基于DPLL的求解器，尤其是CDCL，往往在结构化SAT实例上表现更好。随机3-SAT的平均难度在相变附近达到峰值，即子句与变量的比值约为4.26。<sup>[14](https://www.sciencedirect.com/science/article/pii/S030439752600486X)</sup><sup> • </sup><sup>[11](https://github.com/MohammadHossinzehi/sat-solver)</sup><sup> • </sup><sup>[13](https://forwards-newsletter.beehiiv.com/p/the-forward-pass-weekly-sat-solvers-measured)</sup>

## 扩展与应用

DPLL方案沿两条主线推广。用约束传播取代单元传播，可将其扩展到赋值不限于0/1的约束满足问题，这一思想可追溯到Waltz 1975年的域过滤概念。<sup>[2](https://www.cambridge.org/core/journals/theory-and-practice-of-logic-programming/article/preface/60BF5956A25C6E531BD0C5B0438CD6D5)</sup>在可满足性模理论中，DPLL(T)架构将DPLL搜索与理论求解器耦合；例如，NeuralSAT系统将DPLL(T)改造用于验证深度神经网络。<sup>[8](https://arxiv.org/abs/2307.10266)</sup>

建立在DPLL类过程之上的SAT求解的实际应用包括有界模型检验、硬件电路等价性检验以及测试与验证。<sup>[15](https://www.csa.iisc.ac.in/~deepakd/logic-2021/dpll.pdf)</sup>基于SAT的方法也用于AI规划，其中目标代价的对称性或非对称性等问题结构会影响DPLL证明长度。<sup>[16](https://arxiv.org/abs/cs/0701184)</sup>在工程之外，Linux包管理器中的依赖解析就是一个SAT问题，一些发行版在底层使用MiniSat——一个源自DPLL的CDCL求解器。<sup>[1](https://www.kipuhub.com/en/article/dpll-cdcl/)</sup>

## References

1. [DPLL and CDCL – The Algorithms Inside Every SAT Solver, KipuHub](https://www.kipuhub.com/en/article/dpll-cdcl/)
2. [Agostino Dovier, Preface, Theory and Practice of Logic Programming 17(4), 2017, Cambridge Core](https://www.cambridge.org/core/journals/theory-and-practice-of-logic-programming/article/preface/60BF5956A25C6E531BD0C5B0438CD6D5)
3. [Irina Rish and Rina Dechter, Resolution versus Search: Two Strategies for SAT](https://www.researchgate.net/publication/2526276_Resolution_versus_Search_Two_Strategies_for_SAT)
4. [Chapter 15 – Constraints, Logic Programming (Stanford)](https://logical.stanford.edu/logicprogramming/chapters/chapter_15.html)
5. [Lecture 03, SAT course, University of Freiburg](https://cca.informatik.uni-freiburg.de/sat/ss23/03/)
6. [Sahil Samar, Marc Vinyals, and Vijay Ganesh, An Exponential Separation Between Deterministic CDCL and DPLL Solvers, SAT 2026, LIPIcs vol. 377](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SAT.2026.30)
7. [An Experimental Survey of Extended Resolution Effects for SAT Solvers on the Pigeonhole Principle, Algorithms 15(12):479, MDPI](https://www.mdpi.com/1999-4893/15/12/479)
8. [A DPLL(T) Framework for Verifying Deep Neural Networks, arXiv:2307.10266](https://arxiv.org/abs/2307.10266)
9. [Matt Ginsberg, Unit Propagation: The Inner Loop, JAIR volume 21 (2004)](https://www.scs.cmu.edu/afs/cs/project/jair/pub/volume21/dixon04a-html/node3.html)
10. [What are efficient approaches to implement unit propagation in DPLL-based SAT solvers? Computer Science Stack Exchange](https://cs.stackexchange.com/questions/150557/what-are-efficient-approaches-to-implement-unit-propagation-in-dpll-based-sat-so)
11. [From-scratch DPLL SAT solver in Python, GitHub (MohammadHossinzehi/sat-solver)](https://github.com/MohammadHossinzehi/sat-solver)
12. [A Distributed SAT Solver (thesis chapter), UC Davis](https://thakur.cs.ucdavis.edu/assets/pubs/thakur_PHD14.pdf)
13. [The Forward Pass Weekly: SAT solvers, measured](https://forwards-newsletter.beehiiv.com/p/the-forward-pass-weekly-sat-solvers-measured)
14. [Separation between WalkSAT and DPLL, Theoretical Computer Science, ScienceDirect](https://www.sciencedirect.com/science/article/pii/S030439752600486X)
15. [DPLL Satisfiability Algorithm, course notes, Indian Institute of Science](https://www.csa.iisc.ac.in/~deepakd/logic-2021/dpll.pdf)
16. [Structure and Problem Hardness: Goal Asymmetry and DPLL Proofs in SAT-Based Planning, arXiv:cs/0701184](https://arxiv.org/abs/cs/0701184)
17. [wackb.gricad-pages.univ-grenoble-alpes.fr](https://wackb.gricad-pages.univ-grenoble-alpes.fr/inf402/Poly-inf432.pdf)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › Formal logic and foundations › Logical calculi and logical syntax › Propositional logic › CNF satisfiability algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/dpll-algorithm

English original: https://www.edgepedia.org/dpll-algorithm
