In computer science, conflict-driven clause learning is an algorithm for solving the Boolean satisfiability problem. 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 and Bayardo and Schrag.
Background
Background knowledge about the following issues is needed to have a clear idea about the CDCL algorithm.
The satisfiability problem consists in finding a satisfying assignment for a given formula in conjunctive normal form. 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 as well as the second one. This examples uses three variables, and there are two possible assignments 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 applications 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)
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.
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 .
# Find the cut in the implication graph that led to the conflict
# Derive a new clause which is the negation of the assignments that led to the conflict
# Non-chronologically backtrack to the appropriate decision level, where the first-assigned variable involved in the conflict was assigned
Otherwise continue from step 1 until all variable values are assigned.
Example
A visual example of CDCL algorithm:
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 ϕ ∪ 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.
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.