Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

DPLL algorithm

From Wikipedia, the free encyclopedia
Type of search algorithm
DPLL
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.
ClassBoolean satisfiability problem
Data structureBinary tree
Worst-caseperformanceO(2n){\displaystyle O(2^{n})}
Best-caseperformanceO(1){\displaystyle O(1)} (constant)
Worst-casespace complexityO(n){\displaystyle O(n)} (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.

Implementations and applications

[edit]

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 algorithm

[edit]

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:

Unit propagation
If a clause is aunit clause, i.e. it contains only a single unassigned literal, this clause can only be satisfied by assigning the necessary value to make this literal true. Thus, no choice is necessary. Unit propagation consists in removing every clause containing a unit clause's literal and in discarding the complement of a unit clause's literal from every clause containing that complement. In practice, this often leads to deterministic cascades of units, thus avoiding a large part of the naive search space.
Pure literal elimination
If apropositional variable occurs with only onepolarity in the formula, it is calledpure. A pure literal can always be assigned in a way that makes all clauses containing it true. Thus, when it is assigned in such a way, these clauses do not constrain the search anymore, and can be deleted.

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:lchoose-literal(Φ);returnDPLL {l})orDPLL {¬l});
  • "←" denotesassignment. For instance, "largestitem" means that the value oflargest changes to the value ofitem.
  • "return" terminates the algorithm and outputs the following value.

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]

Formalization

[edit]

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.A=(l1,¬l2,l3,...){\displaystyle A=(l_{1},\neg l_{2},l_{3},...)}.[6][7]

If a clause in the formulaΦ{\displaystyle \Phi } has exactly one unassigned literall{\displaystyle l} inA{\displaystyle A}, with all other literals in the clause appearing negatively, extendA{\displaystyle A} withl{\displaystyle l}.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.{l1,,ln,l}Φ¬l1,,¬lnAl,¬lAA:=Al (Propagate){\displaystyle {\frac {\begin{array}{c}\{l_{1},\dots ,l_{n},l\}\in \Phi \;\;\;\neg l_{1},\dots ,\neg l_{n}\in A\;\;\;\;\;l,\neg l\notin A\end{array}}{A:=A\;l}}{\text{ (Propagate)}}}If a literall{\displaystyle l} appears in the formulaΦ{\displaystyle \Phi } but its negation¬l{\displaystyle \neg l} does not, andl{\displaystyle l} and¬l{\displaystyle \neg l} are not inA{\displaystyle A}, extendA{\displaystyle A} withl{\displaystyle l}.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.l literal of Φ¬l not literal of Φl,¬lAA:=Al (Pure){\displaystyle {\frac {\begin{array}{c}l{\text{ literal of }}\Phi \;\;\;\neg l{\text{ not literal of }}\Phi \;\;\;\;\;l,\neg l\notin A\end{array}}{A:=A\;l}}{\text{ (Pure)}}}If a literall{\displaystyle l} is in the set of literals ofΦ{\displaystyle \Phi } and neitherl{\displaystyle l} nor¬l{\displaystyle \neg l} is inA{\displaystyle A}, then decide on the truth value ofl{\displaystyle l} and extendA{\displaystyle A} with the decision literall{\displaystyle \bullet l}.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.lLits(Φ)l,¬lAA:=Al (Decide){\displaystyle {\frac {\begin{array}{c}l\in {\text{Lits}}(\Phi )\;\;\;l,\neg l\notin A\end{array}}{A:=A\;\bullet \;l}}{\text{ (Decide)}}}If a clause{l1,,ln}{\displaystyle \{l_{1},\dots ,l_{n}\}} is inΦ{\displaystyle \Phi }, and their negations¬l1,,¬ln{\displaystyle \neg l_{1},\dots ,\neg l_{n}} are inA{\displaystyle A}, andA{\displaystyle A} can be represented asA=AlN{\displaystyle A=A'\;\bullet \;l\;N} whereN{\displaystyle \bullet \notin N}, then backtrack by settingA{\displaystyle A} toA¬l{\displaystyle A'\;\neg l}.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.{l1,,ln}Φ¬l1,,¬lnAA=AlNNA:=A¬l (Backtrack){\displaystyle {\frac {\begin{array}{c}\{l_{1},\dots ,l_{n}\}\in \Phi \;\;\;\neg l_{1},\dots ,\neg l_{n}\in A\;\;\;\;\;A=A'\;\bullet \;l\;N\;\;\;\;\;\bullet \notin N\end{array}}{A:=A'\;\neg l}}{\text{ (Backtrack)}}}If a clause{l1,,ln}{\displaystyle \{l_{1},\dots ,l_{n}\}} is inΦ{\displaystyle \Phi }, and their negations¬l1,,¬ln{\displaystyle \neg l_{1},\dots ,\neg l_{n}} are inA{\displaystyle A}, and there is no conflict marker{\displaystyle \bullet } inA{\displaystyle A}, 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.{l1,,ln}Φ¬l1,,¬lnAAFail (Fail){\displaystyle {\frac {\begin{array}{c}\{l_{1},\dots ,l_{n}\}\in \Phi \;\;\;\neg l_{1},\dots ,\neg l_{n}\in A\;\;\;\;\;\bullet \notin A\end{array}}{\text{Fail}}}{\text{ (Fail)}}}

Visualization

[edit]

Davis, Logemann, Loveland (1961) had developed this algorithm.Some properties of this original algorithm are:

  • It is based on search.
  • It is the basis for almost all modern SAT solvers.
  • Itdoes not use learning or non-chronological backtracking (introduced in 1996).

An example with visualization of a DPLL algorithm having chronological backtracking:

  • All clauses making a CNF formula
    All clauses making a CNF formula
  • Pick a variable
    Pick a variable
  • Make a decision, variable a = False (0), thus green clauses becomes True
    Make a decision, variable a = False (0), thus green clauses becomes True
  • After making several decisions, we find an implication graph that leads to a conflict.
    After making several decisions, we find animplication graph that leads to a conflict.
  • Now backtrack to immediate level and by force assign opposite value to that variable
    Now backtrack to immediate level and by force assign opposite value to that variable
  • But a forced decision still leads to another conflict
    But a forced decision still leads to another conflict
  • Backtrack to previous level and make a forced decision
    Backtrack to previous level and make a forced decision
  • Make a new decision, but it leads to a conflict
    Make a new decision, but it leads to a conflict
  • Make a forced decision, but again it leads to a conflict
    Make a forced decision, but again it leads to a conflict
  • Backtrack to previous level
    Backtrack to previous level
  • Continue in this way and the final implication graph
    Continue in this way and the final implication graph

Related algorithms

[edit]

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]

Relation to other notions

[edit]

Runs of DPLL-based algorithms on unsatisfiable instances correspond to treeresolution refutation proofs.[10]

See also

[edit]

References

[edit]

General

Specific

  1. ^abNieuwenhuis, Robert; Oliveras, Albert; Tinelli, Cesar (2004),"Abstract DPLL and Abstract DPLL Modulo Theories"(PDF),Proceedings Int. Conf. onLogic for Programming, Artificial Intelligence, and Reasoning, LPAR 2004, pp. 36–50
  2. ^zChaff website
  3. ^"Minisat website".
  4. ^The international SAT Competitions web page, sat! live
  5. ^Marques-Silva, João P. (1999). "The Impact of Branching Heuristics in Propositional Satisfiability Algorithms". In Barahona, Pedro; Alferes, José J. (eds.).Progress in Artificial Intelligence: 9th Portuguese Conference on Artificial Intelligence, EPIA '99 Évora, Portugal, September 21–24, 1999 Proceedings.LNCS. Vol. 1695. pp. 62–63.doi:10.1007/3-540-48159-1_5.ISBN 978-3-540-66548-9.
  6. ^Nieuwenhuis, Robert; Oliveras, Albert; Tinelli, Cesare (2006-11-01)."Solving SAT and SAT Modulo Theories: From an abstract Davis--Putnam--Logemann--Loveland procedure to DPLL(T)".J. ACM.53 (6):937–977.doi:10.1145/1217856.1217859.ISSN 0004-5411.
  7. ^Krstić, Sava; Goel, Amit (2007). Konev, Boris; Wolter, Frank (eds.)."Architecting Solvers for SAT Modulo Theories: Nelson-Oppen with DPLL".Frontiers of Combining Systems. Berlin, Heidelberg: Springer:1–27.doi:10.1007/978-3-540-74621-8_1.ISBN 978-3-540-74621-8.
  8. ^Stålmarck, G.; Säflund, M. (October 1990). "Modeling and Verifying Systems and Software in Propositional Logic".IFAC Proceedings Volumes.23 (6):31–36.doi:10.1016/S1474-6670(17)52173-4.
  9. ^Möhle, Sibylle; Biere, Armin (2019). "Backing Backtracking".Theory and Applications of Satisfiability Testing – SAT 2019(PDF). Lecture Notes in Computer Science. Vol. 11628. pp. 250–266.doi:10.1007/978-3-030-24258-9_18.ISBN 978-3-030-24257-2.S2CID 195755607.
  10. ^Van Beek, Peter (2006)."Backtracking search algorithms". In Rossi, Francesca; Van Beek, Peter; Walsh, Toby (eds.).Handbook of constraint programming. Elsevier. p. 122.ISBN 978-0-444-52726-4.

Further reading

[edit]
  • Malay Ganai; Aarti Gupta; Dr. Aarti Gupta (2007).SAT-based scalable formal verification solutions. Springer. pp. 23–32.ISBN 978-0-387-69166-4.
  • Gomes, Carla P.; Kautz, Henry; Sabharwal, Ashish; Selman, Bart (2008). "Satisfiability Solvers". In Van Harmelen, Frank; Lifschitz, Vladimir; Porter, Bruce (eds.).Handbook of knowledge representation. Foundations of Artificial Intelligence. Vol. 3. Elsevier. pp. 89–134.doi:10.1016/S1574-6526(07)03002-7.ISBN 978-0-444-52211-5.
Retrieved from "https://en.wikipedia.org/w/index.php?title=DPLL_algorithm&oldid=1292217523"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp