After 5 fruitless attempts(red), choosing the variable assignmenta=1,b=1 leads, after unit propagation(bottom), to success(green): the top leftCNF formula is satisfiable. | |
| Class | Boolean satisfiability problem |
|---|---|
| Data structure | Binary tree |
| Worst-caseperformance | |
| Best-caseperformance | (constant) |
| Worst-casespace complexity | (basic algorithm) |
Inlogic andcomputer science, theDavis–Putnam–Logemann–Loveland (DPLL)algorithm is acomplete,backtracking-basedsearch algorithm fordeciding the satisfiability ofpropositional logic formulae inconjunctive normal form, i.e. for solving theCNF-SAT problem.
It was introduced in 1961 byMartin Davis,George Logemann andDonald W. Loveland and is a refinement of the earlierDavis–Putnam algorithm, which is aresolution-based procedure developed by Davis andHilary Putnam in 1960. Especially in older publications, the Davis–Logemann–Loveland algorithm is often referred to as the "Davis–Putnam method" or the "DP algorithm". Other common names that maintain the distinction are DLL and DPLL.
TheSAT problem is important both from theoretical and practical points of view. Incomplexity theory it was the first problem proved to beNP-complete, and can appear in a broad variety of applications such asmodel checking,automated planning and scheduling, anddiagnosis in artificial intelligence.
As such, writing efficientSAT solvers has been a research topic for many years.GRASP (1996-1999) was an early implementation using DPLL.[1] In the international SAT competitions, implementations based around DPLL such aszChaff[2] and MiniSat[3] were in the first places of the competitions in 2004 and 2005.[4]
Another application that often involves DPLL isautomated theorem proving orsatisfiability modulo theories (SMT), which is a SAT problem in whichpropositional variables are replaced with formulas of anothermathematical theory.
The basic backtracking algorithm runs by choosing a literal, assigning atruth value to it, simplifying the formula and then recursively checking if the simplified formula is satisfiable; if this is the case, the original formula is satisfiable; otherwise, the same recursive check is done assuming the opposite truth value. This is known as thesplitting rule, as it splits the problem into two simpler sub-problems. The simplification step essentially removes all clauses that become true under the assignment from the formula, and all literals that become false from the remaining clauses.
The DPLL algorithm enhances over the backtracking algorithm by the eager use of the following rules at each step:
Unsatisfiability of a given partial assignment is detected if one clause becomes empty, i.e. if all its variables have been assigned in a way that makes the corresponding literals false. Satisfiability of the formula is detected either when all variables are assigned without generating the empty clause, or, in modern implementations, if all clauses are satisfied. Unsatisfiability of the complete formula can only be detected after exhaustive search.
The DPLL algorithm can be summarized in the following pseudocode, where Φ is theCNF formula:
Algorithm DPLL Input: A set of clauses Φ. Output: A truth value indicating whether Φ is satisfiable.
functionDPLL(Φ) // unit propagation:while there is a unit clause {l} in Φdo Φ ←unit-propagate(l, Φ); // pure literal elimination:while there is a literall that occurs pure in Φdo Φ ←pure-literal-assign(l, Φ); // stopping conditions:if Φ is emptythenreturn true;if Φ contains an empty clausethenreturn false; // DPLL procedure:l ←choose-literal(Φ);returnDPLL(Φ∧ {l})orDPLL(Φ∧ {¬l});In this pseudocode,unit-propagate(l, Φ) andpure-literal-assign(l, Φ) are functions that return the result of applying unit propagation and the pure literal rule, respectively, to the literall and the formulaΦ. In other words, they replace every occurrence ofl with "true" and every occurrence ofnot l with "false" in the formulaΦ, and simplify the resulting formula. Theor in thereturn statement is ashort-circuiting operator.Φ∧ {l} denotes the simplified result of substituting "true" forl inΦ.
The algorithm terminates in one of two cases. Either the CNF formulaΦ is empty, i.e., it contains no clause. Then it is satisfied by any assignment, as all its clauses are vacuously true. Otherwise, when the formula contains an empty clause, the clause is vacuously false because a disjunction requires at least one member that is true for the overall set to be true. In this case, the existence of such a clause implies that the formula (evaluated as aconjunction of all clauses) cannot evaluate to true and must be unsatisfiable.
The pseudocode DPLL function only returns whether the final assignment satisfies the formula or not. In a real implementation, the partial satisfying assignment typically is also returned on success; this can be derived by keeping track of branching literals and of the literal assignments made during unit propagation and pure literal elimination.
The Davis–Logemann–Loveland algorithm depends on the choice ofbranching literal, which is the literal considered in the backtracking step. As a result, this is not exactly an algorithm, but rather a family of algorithms, one for each possible way of choosing the branching literal. Efficiency is strongly affected by the choice of the branching literal: there exist instances for which the running time is constant or exponential depending on the choice of the branching literals. Such choice functions are also calledheuristic functions or branching heuristics.[5]
Thesequent calculus-similar notation can be used to formalize many rewriting algorithms, including DPLL. The following are the 5 rules a DPLL solver can apply in order to either find or fail to find a satisfying assignment, i.e..[6][7]
If a clause in the formula has exactly one unassigned literal in, with all other literals in the clause appearing negatively, extend with.This rule represents the idea a currently false clause with only one unset variable left forces that variable to be set in such a way as to make the entire clause true, otherwise the formula will not be satisfied.If a literal appears in the formula but its negation does not, and and are not in, extend with.This rule represents the idea that if a variable appears only purely positively or purely negatively in a formula, all the instances can be set to true or false to make their corresponding clauses true.If a literal is in the set of literals of and neither nor is in, then decide on the truth value of and extend with the decision literal.This rule represents the idea that if you aren't forced to do an assignment, you must choose a variable to assign and make note which assignment was a choice so you can go back if the choice didn't result in a satisfying assignment.If a clause is in, and their negations are in, and can be represented as where, then backtrack by setting to.This rule represents the idea that if you reach a contradiction in trying to find a valid assignment, you need to go back to where you previously did a decision between two assignments and pick the other one.If a clause is in, and their negations are in, and there is no conflict marker in, then the DPLL algorithm fails.This rule represents the idea that if you reach a contradiction but there wasn't anything you could have done differently on the way there, the formula is unsatisfiable.
Davis, Logemann, Loveland (1961) had developed this algorithm.Some properties of this original algorithm are:
An example with visualization of a DPLL algorithm having chronological backtracking:
Since 1986, (Reduced ordered)binary decision diagrams have also been used for SAT solving.[citation needed]
In 1989-1990,Stålmarck's method for formula verification was presented and patented. It has found some use in industrial applications.[8]
DPLL has been extended forautomated theorem proving for fragments offirst-order logic by way of theDPLL(T) algorithm.[1]
In the 2010-2019 decade, work on improving the algorithm has found better policies for choosing the branching literals and new data structures to make the algorithm faster, especially the part onunit propagation. However, the main improvement has been a more powerful algorithm,Conflict-Driven Clause Learning (CDCL), which is similar to DPLL but after reaching a conflict "learns" the root causes (assignments to variables) of the conflict, and uses this information to performnon-chronological backtracking (akabackjumping) in order to avoid reaching the same conflict again. Most state-of-the-art SAT solvers are based on the CDCL framework as of 2019.[9]
Runs of DPLL-based algorithms on unsatisfiable instances correspond to treeresolution refutation proofs.[10]
General
Specific