Английская Википедия:Conflict-driven clause learning
Шаблон:Short description 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. The main difference between CDCL and DPLL is that CDCL's backjumping is non-chronological.
Conflict-driven clause learning was proposed by Marques-Silva and Karem A. Sakallah (1996, 1999)[1][2] and Bayardo and Schrag (1997).[3]
Background
Boolean satisfiability problem
Шаблон:Main 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:[4]
- <math>(\lnot A \lor \lnot C) \land (B \lor C)</math>
where A,B,C are Boolean variables, <math>\lnot A</math>, <math>\lnot C</math>, <math>B</math>, and <math>C</math> are literals, and <math>\lnot A \lor \lnot C</math> and <math>B \lor C</math> are clauses.
A satisfying assignment for this formula is e.g.:
- <math>A = \mathrm{False}, B = \mathrm{False} , C = \mathrm{True}</math>
since it makes the first clause true (since <math>\lnot A</math> is true) as well as the second one (since <math>C</math> 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 <math> 2^3 = 8 </math> 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)
Шаблон:Main 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 <math> A = \mathrm{False} </math> and <math> B = \mathrm{False}</math> we must have <math> C = \mathrm{True}</math> in order for the clause <math> (A \lor B \lor C )</math> to be true.
The iterated application of the unit clause rule is referred to as unit propagation or Boolean constraint propagation (BCP).
Resolution
Шаблон:Main Consider two clauses <math> (A \lor B \lor C )</math> and <math> (\neg C \lor D \lor \neg E)</math>. The clause <math>(A \lor B \lor D \lor \neg E)</math>, obtained by merging the two clauses and removing both <math>\neg C</math> and <math>C</math>, is called the resolvent of the two clauses.
Algorithm
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
- 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 ("back jump") 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:[4]
-
At first pick a branching variable, namely x1. A yellow circle means an arbitrary decision.
-
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 an implication graph.
-
Arbitrarily pick another branching variable, x3.
-
Apply unit propagation and find the new implication graph.
-
Here the variables x8 and x12 are forced to be 0 and 1, respectively.
-
Pick another branching variable, x2.
-
Find implication graph.
-
Pick another branching variable, x7.
-
Find implication graph.
-
Found a conflict!
-
Find the cut that led to this conflict. From the cut, find a conflicting condition.
-
Take the negation of this condition and make it a clause.
-
Add the conflict clause to the problem.
-
Non-chronological back jump to appropriate decision level, which in this case is the second highest decision level of the literals in the learned clause.
-
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 affects neither soundness nor 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.[5]
Applications
The main application of CDCL algorithm is in different SAT solvers including:
- MiniSAT
- Zchaff SAT
- Z3
- Glucose[6]
- 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 Davis–Putnam algorithm and DPLL algorithm. The DP algorithm uses resolution refutation and it has potential memory access problem.Шаблон:Citation needed 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.
-
DPLL: no learning and chronological backtracking.
-
CDCL: conflict-driven clause learning and non – chronological backtracking.
Works cited
References
- Шаблон:Cite journal
- Шаблон:Cite journal
- Шаблон:Cite book
- Шаблон:Cite book
- Presentation – "SAT-Solving: From Davis-Putnam to Zchaff and Beyond" by Lintao Zhang. (Several pictures are taken from his presentation)
- ↑ Шаблон:Cite book
- ↑ Шаблон:Cite journal
- ↑ Шаблон:Cite book
- ↑ 4,0 4,1 In the pictures below, "<math>+</math>" is used to denote "or", multiplication to denote "and", and a postfix "<math>'</math>" to denote "not".
- ↑ Шаблон:Cite book
- ↑ Шаблон:Cite web