Conflict-Driven Clause Learning
In computer science, Conflict-Driven Clause Learning (CDCL) is an algorithm for solving the Boolean satisfiability problem (SAT). Given a Boolean formula, the SAT problem asks for an assignment of variables so that the entire formula evaluates to true. The internal workings of CDCL SAT solvers were inspired by DPLL solvers.
Conflict-Driven Clause Learning was proposed by Marques-Silva and Sakallah (1996,[1] 1999 [2]) and Bayardo and Schrag (1997 [3])
Contents
Background
Background knowledge about the following issues is needed to have a clear idea about the CDCL algorithm.
Boolean satisfiability problem
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
The satisfiability problem consists in finding a satisfying assignment for a given formula in conjunctive normal form (CNF).
An example of such a formula is:
or, using a common notation:
where A,B,C are Boolean variables, ,
,
, and
are literals, and
and
are clauses.
A satisfying assignment for this formula is e.g.:
since it makes the first clause true (since is true) as well as the second one (since
is true).
This examples uses three variables (A, B, C), and there are two possible assignments (True and False) for each of them. So one has possibilities. In this small example, one can use brute-force search to try all possible assignments and check if they satisfy the formula. But in realistic appilcations with millions of variables and clauses brute force search is impractical. The responsibility of a SAT solver is to find a satisfying assignment efficiently and quickly by applying different heuristics for complex CNF formulas.
Unit clause rule (unit propagation)
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
If an unsatisfied clause has all but one of its literals or variables evaluated at False, then the free literal must be True in order for the clause to be True. For example, if the below unsatisfied clause is evaluated with and
we must have
in order for the clause
to be true.
Boolean constraint propagation (BCP)
The iterated application of the unit clause rule is referred to as unit propagation or Boolean constraint propagation (BCP).
Resolution
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
Consider two clauses and
. The clause
, obtained by merging the two clauses and removing both
and
, is called the resolvent of the two clauses.
DP algorithm
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
The DP algorithm has been introduced by Davis and Putnam in 1960. Informally, the algorithm iteratively performs the following steps until no more variables are left in the formula:
- Select a variable
and add all non-tautological resolvents upon
(a resolvent is non-tautological if it does not contain
and
for some variable
).
- Remove all original clauses that contain
.
See more details here DP Algorithm
DPLL algorithm
<templatestyles src="Module:Hatnote/styles.css"></templatestyles>
Davis, Putnam, Logemann, Loveland (1962) had developed this algorithm. Some properties of this algorithms are:
-
-
-
-
- It is based on search.
- It is the basis for almost all modern SAT solvers.
- It uses learning and chronological back tracking (1996).
-
-
-
See more details here DPLL algorithm. An example with visualization of DPLL algorithm having chronological back tracking:
-
After several decision making, we find an implication graph that leads to a conflict.
CDCL (Conflict-Driven Clause Learning)
The main difference between CDCL and DPLL is that CDCL's back jumping is non-chronological.
Conflict-Driven Clause Learning works as follows.
-
-
-
-
- Select a variable and assign True or False. This is called decision state. Remember the assignment.
- Apply Boolean constraint propagation (Unit propagation).
- Build the implication graph.
- If there is any conflict then analyze the conflict and non-chronologically backtrack ("back jump") to the appropriate decision level.[clarification needed]
- Otherwise continue from step 1 until all variable values are assigned.
-
-
-
Example
A visual example of CDCL algorithm:
-
Cdcl1.png
At first pick a branching variable, viz. x1. A yellow circle means an arbitrary decision.
-
Cdcl2.png
Now apply unit propagation, which yields that x4 must be 1 (i.e. True). A gray circle means a forced variable assignment during unit propagation. The resulting graph is called implication graph.
-
Cdcl3.png
Arbitrarily pick another branching variable, x3.
-
Cdcl4.png
Apply unit propagation and find the new implication graph.
-
Cdcl5.png
Here the variable x8 and x12 are forced to be 0 and 1, respectively.
-
Cdcl6.png
Pick another branching variable, x2.
-
Cdcl7.png
Find implication graph.
-
Cdcl8.png
Pick another branching variable, x7.
-
Cdcl9.png
Find implication graph.
-
Cdcl10.png
Found a conflict!
-
Cdcl11.png
Find the cut that led to this conflict. From the cut, find a conflicting condition.
-
Cdcl12.png
Take the negation of this condition and make it a clause.
-
Cdcl13.png
Add the conflict clause to the problem.
-
Cdcl14.png
Non-chronological back jump to appropriate decision level.
-
Cdcl15.png
Back jump and set variable values accordingly.
Completeness
DPLL is a sound and complete algorithm for SAT. CDCL SAT solvers implement DPLL, but can learn new clauses and backtrack non-chronologically. Clause learning with conflict analysis does not affect soundness or completeness. Conflict analysis identifies new clauses using the resolution operation. Therefore, each learnt clause can be inferred from the original clauses and other learnt clauses by a sequence of resolution steps. If cN is the new learnt clause, then ϕ is satisfiable if and only if ϕ ∪ {cN} is also satisfiable. Moreover, the modified backtracking step also does not affect soundness or completeness, since backtracking information is obtained from each new learnt clause.[4]
Applications
The main application of CDCL algorithm is in different SAT solvers including:
-
-
-
-
- MiniSAT
- Zchaff SAT
- Z3
- ManySAT etc.
-
-
-
The CDCL algorithm has made SAT solvers so powerful that they are being used effectively in several real world application areas like AI planning, bioinformatics, software test pattern generation, software package dependencies, hardware and software model checking, and cryptography.
Related algorithms
Related algorithms to CDCL are the DP and DPLL algorithm described before. The DP algorithm uses resolution refutation and it has potential memory access problem. Whereas the DPLL algorithm is OK for randomly generated instances, it is bad for instances generated in practical applications. CDCL is a more powerful approach to solve such problems in that applying CDCL provides less state space search in comparison to DPLL.
-
CompareCdcl dpll1.png
DPLL: no learning and chronological backtracking.
-
CompareCdcl dpll2.png
CDCL: conflict-driven clause learning and non - chronological backtracking.
References
![]() |
Wikimedia Commons has media related to Conflict-driven clause learning algorithm. |
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Presentation – "SAT-Solving: From Davis-Putnam to Zchaff and Beyond" by Lintao Zhang. (Several pictures are taken from his presentation)
Other material
Besides CDCL there are other approaches which are used to speed up SAT solvers. Some of them are: