Misplaced Pages

DPLL

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

In logic and computer science , the Davis–Putnam–Logemann–Loveland ( DPLL ) algorithm is a complete , backtracking -based search algorithm for deciding the satisfiability of propositional logic formulae in conjunctive normal form , i.e. for solving the CNF-SAT problem.

#687312

38-410: DPLL stands for: DPLL algorithm , for solving the boolean satisfiability problem Digital phase-locked loop , an electronic feedback system that generates a signal Topics referred to by the same term [REDACTED] This disambiguation page lists articles associated with the title DPLL . If an internal link led you here, you may wish to change

76-484: A conjunction 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

114-468: A formula can be derived from its truth table . Again, consider the formula ϕ = ( ( ¬ ( p ∧ q ) ) ↔ ( ¬ r ↑ ( p ⊕ q ) ) ) {\displaystyle \phi =((\lnot (p\land q))\leftrightarrow (\lnot r\uparrow (p\oplus q)))} . The corresponding truth table is A CNF equivalent of ϕ {\displaystyle \phi }

152-1449: A formula with 2 n {\displaystyle 2^{n}} clauses: ( X 1 ∨ X 2 ∨ … ∨ X n ) ∧ ( Y 1 ∨ X 2 ∨ … ∨ X n ) ∧ ( X 1 ∨ Y 2 ∨ … ∨ X n ) ∧ ( Y 1 ∨ Y 2 ∨ … ∨ X n ) ∧ … ∧ ( Y 1 ∨ Y 2 ∨ … ∨ Y n ) . {\displaystyle (X_{1}\vee X_{2}\vee \ldots \vee X_{n})\wedge (Y_{1}\vee X_{2}\vee \ldots \vee X_{n})\wedge (X_{1}\vee Y_{2}\vee \ldots \vee X_{n})\wedge (Y_{1}\vee Y_{2}\vee \ldots \vee X_{n})\wedge \ldots \wedge (Y_{1}\vee Y_{2}\vee \ldots \vee Y_{n}).} Each clause contains either X i {\displaystyle X_{i}} or Y i {\displaystyle Y_{i}} for each i {\displaystyle i} . There exist transformations into CNF that avoid an exponential increase in size by preserving satisfiability rather than equivalence . These transformations are guaranteed to only linearly increase

190-554: A literal, which means that it can only precede a propositional variable . The following is a context-free grammar for CNF: Where Variable is any variable. All of the following formulas in the variables A , B , C , D , E {\displaystyle A,B,C,D,E} , and F {\displaystyle F} are in conjunctive normal form: The following formulas are not in conjunctive normal form: In classical logic each propositional formula can be converted to an equivalent formula that

228-867: A name for X i ∧ Y i {\displaystyle X_{i}\wedge Y_{i}} . Consider a propositional formula with n {\displaystyle n} variables, n ≥ 1 {\displaystyle n\geq 1} . There are 2 n {\displaystyle 2n} possible literals: L = { p 1 , ¬ p 1 , p 2 , ¬ p 2 , … , p n , ¬ p n } {\displaystyle L=\{p_{1},\lnot p_{1},p_{2},\lnot p_{2},\ldots ,p_{n},\lnot p_{n}\}} . L {\displaystyle L} has ( 2 2 n − 1 ) {\displaystyle (2^{2n}-1)} non-empty subsets. This

266-448: A new variable, and repeating as often as necessary. In first order logic, conjunctive normal form can be taken further to yield the clausal normal form of a logical formula, which can be then used to perform first-order resolution . In resolution-based automated theorem-proving, a CNF formula See below for an example. To convert first-order logic to CNF: Example As an example, the formula saying "Anyone who loves all animals,

304-746: A variable V {\displaystyle V} Since all propositional formulas can be converted into an equivalent formula in conjunctive normal form, proofs are often based on the assumption that all formulae are CNF. However, in some cases this conversion to CNF can lead to an exponential explosion of the formula. For example, translating the non-CNF formula ( X 1 ∧ Y 1 ) ∨ ( X 2 ∧ Y 2 ) ∨ … ∨ ( X n ∧ Y n ) {\displaystyle (X_{1}\wedge Y_{1})\vee (X_{2}\wedge Y_{2})\vee \ldots \vee (X_{n}\wedge Y_{n})} into CNF produces

342-667: Is ( ¬ p ∨ ¬ q ∨ ¬ r ) ∧ ( ¬ p ∨ ¬ q ∨ r ) ∧ ( ¬ p ∨ q ∨ r ) ∧ ( p ∨ ¬ q ∨ r ) {\displaystyle (\lnot p\lor \lnot q\lor \lnot r)\land (\lnot p\lor \lnot q\lor r)\land (\lnot p\lor q\lor r)\land (p\lor \lnot q\lor r)} Each disjunction reflects an assignment of variables for which ϕ {\displaystyle \phi } evaluates to F(alse). If in such an assignment

380-515: Is a contradiction . An important set of problems in computational complexity involves finding assignments to the variables of a Boolean formula expressed in conjunctive normal form, such that the formula is true. The k -SAT problem is the problem of finding a satisfying assignment to a Boolean formula expressed in CNF in which each disjunction contains at most k variables. 3-SAT is NP-complete (like any other k -SAT problem with k >2) while 2-SAT

418-692: Is a product of sums or an AND of ORs . In automated theorem proving, the notion " clausal normal form " is often used in a narrower sense, meaning a particular representation of a CNF formula as a set of sets of literals. A logical formula is considered to be in CNF if it is a conjunction of one or more disjunctions of one or more literals . As in disjunctive normal form (DNF), the only propositional operators in CNF are or ( ∨ {\displaystyle \vee } ), and ( ∧ {\displaystyle \wedge } ), and not ( ¬ {\displaystyle \neg } ). The not operator can only be used as part of

SECTION 10

#1732858840688

456-467: Is a conjunction of literals l i 1 ∧ l i 2 ∧ … ∧ l i n i {\displaystyle l_{i1}\land l_{i2}\land \ldots \land l_{in_{i}}} . Step 2 : Negate ¬ ϕ D N F {\displaystyle \lnot \phi _{DNF}} . Then shift ¬ {\displaystyle \lnot } inwards by applying

494-533: Is a refinement of the earlier Davis–Putnam algorithm , which is a resolution -based procedure developed by Davis and Hilary 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. The SAT problem is important both from theoretical and practical points of view. In complexity theory it

532-850: Is converted to ϕ C N F {\displaystyle \phi _{CNF}} by swapping ANDs with ORs and vice versa while negating all the literals. Remove all ¬ ¬ {\displaystyle \lnot \lnot } . Convert to CNF the propositional formula ϕ {\displaystyle \phi } . Step 1 : Convert its negation to disjunctive normal form. ¬ ϕ D N F = ( C 1 ∨ C 2 ∨ … ∨ C i ∨ … ∨ C m ) {\displaystyle \lnot \phi _{DNF}=(C_{1}\lor C_{2}\lor \ldots \lor C_{i}\lor \ldots \lor C_{m})} , where each C i {\displaystyle C_{i}}

570-485: 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 the CNF formula: In this pseudocode, unit-propagate(l, Φ) and pure-literal-assign(l, Φ) are functions that return

608-532: Is in CNF. This transformation is based on rules about logical equivalences : double negation elimination , De Morgan's laws , and the distributive law . The algorithm to compute a CNF-equivalent of a given propositional formula ϕ {\displaystyle \phi } builds upon ¬ ϕ {\displaystyle \lnot \phi } in disjunctive normal form (DNF) : step 1. Then ¬ ϕ D N F {\displaystyle \lnot \phi _{DNF}}

646-482: Is in turn loved by someone" is converted into CNF (and subsequently into clause form in the last line) as follows (highlighting replacement rule redexes in red {\displaystyle {\color {red}{\text{red}}}} ): Informally, the Skolem function g ( x ) {\displaystyle g(x)} can be thought of as yielding the person by whom x {\displaystyle x}

684-1385: Is known to have solutions in polynomial time . As a consequence, the task of converting a formula into a DNF , preserving satisfiability, is NP-hard ; dually , converting into CNF, preserving validity , is also NP-hard; hence equivalence-preserving conversion into DNF or CNF is again NP-hard. Typical problems in this case involve formulas in "3CNF": conjunctive normal form with no more than three variables per conjunct. Examples of such formulas encountered in practice can be very large, for example with 100,000 variables and 1,000,000 conjuncts. A formula in CNF can be converted into an equisatisfiable formula in " k CNF" (for k ≥3) by replacing each conjunct with more than k variables X 1 ∨ … ∨ X k ∨ … ∨ X n {\displaystyle X_{1}\vee \ldots \vee X_{k}\vee \ldots \vee X_{n}} by two conjuncts X 1 ∨ … ∨ X k − 1 ∨ Z {\displaystyle X_{1}\vee \ldots \vee X_{k-1}\vee Z} and ¬ Z ∨ X k ∨ … ∨ X n {\displaystyle \neg Z\vee X_{k}\lor \ldots \vee X_{n}} with Z

722-397: Is loved, while f ( x ) {\displaystyle f(x)} yields the animal (if any) that x {\displaystyle x} doesn't love. The 3rd last line from below then reads as " x {\displaystyle x} doesn't love the animal f ( x ) {\displaystyle f(x)} , or else x {\displaystyle x}

760-2139: Is the maximum number of disjunctions a CNF can have. All truth-functional combinations can be expressed with 2 n {\displaystyle 2^{n}} disjunctions, one for each row of the truth table. In the example below they are underlined. Example Consider a formula with two variables p {\displaystyle p} and q {\displaystyle q} . The longest possible CNF has 2 ( 2 × 2 ) − 1 = 15 {\displaystyle 2^{(2\times 2)}-1=15} disjunctions: ( ¬ p ) ∧ ( p ) ∧ ( ¬ q ) ∧ ( q ) ∧ ( ¬ p ∨ p ) ∧ ( ¬ p ∨ ¬ q ) _ ∧ ( ¬ p ∨ q ) _ ∧ ( p ∨ ¬ q ) _ ∧ ( p ∨ q ) _ ∧ ( ¬ q ∨ q ) ∧ ( ¬ p ∨ p ∨ ¬ q ) ∧ ( ¬ p ∨ p ∨ q ) ∧ ( ¬ p ∨ ¬ q ∨ q ) ∧ ( p ∨ ¬ q ∨ q ) ∧ ( ¬ p ∨ p ∨ ¬ q ∨ q ) {\displaystyle {\begin{array}{lcl}(\lnot p)\land (p)\land (\lnot q)\land (q)\land \\(\lnot p\lor p)\land {\underline {(\lnot p\lor \lnot q)}}\land {\underline {(\lnot p\lor q)}}\land {\underline {(p\lor \lnot q)}}\land {\underline {(p\lor q)}}\land (\lnot q\lor q)\land \\(\lnot p\lor p\lor \lnot q)\land (\lnot p\lor p\lor q)\land (\lnot p\lor \lnot q\lor q)\land (p\lor \lnot q\lor q)\land \\(\lnot p\lor p\lor \lnot q\lor q)\end{array}}} This formula

798-1814: The (generalized) De Morgan's equivalences until no longer possible. ϕ ↔ ¬ ¬ ϕ D N F = ¬ ( C 1 ∨ C 2 ∨ … ∨ C i ∨ … ∨ C m ) ↔ ¬ C 1 ∧ ¬ C 2 ∧ … ∧ ¬ C i ∧ … ∧ ¬ C m // (generalized) D.M. {\displaystyle {\begin{aligned}\phi &\leftrightarrow \lnot \lnot \phi _{DNF}\\&=\lnot (C_{1}\lor C_{2}\lor \ldots \lor C_{i}\lor \ldots \lor C_{m})\\&\leftrightarrow \lnot C_{1}\land \lnot C_{2}\land \ldots \land \lnot C_{i}\land \ldots \land \lnot C_{m}&&{\text{// (generalized) D.M.}}\end{aligned}}} where ¬ C i = ¬ ( l i 1 ∧ l i 2 ∧ … ∧ l i n i ) ↔ ( ¬ l i 1 ∨ ¬ l i 2 ∨ … ∨ ¬ l i n i ) // (generalized) D.M. {\displaystyle {\begin{aligned}\lnot C_{i}&=\lnot (l_{i1}\land l_{i2}\land \ldots \land l_{in_{i}})\\&\leftrightarrow (\lnot l_{i1}\lor \lnot l_{i2}\lor \ldots \lor \lnot l_{in_{i}})&&{\text{// (generalized) D.M.}}\end{aligned}}} Step 3 : Remove all double negations. Example Convert to CNF

SECTION 20

#1732858840688

836-464: The CDCL framework as of 2019. Runs of DPLL-based algorithms on unsatisfiable instances correspond to tree resolution refutation proofs. General Specific Conjunctive normal form In Boolean logic , a formula is in conjunctive normal form ( CNF ) or clausal normal form if it is a conjunction of one or more clauses , where a clause is a disjunction of literals ; otherwise put, it

874-403: 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

912-468: The branching literals. Such choice functions are also called heuristic functions or branching heuristics. 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. In 1989-1990, Stålmarck's method for formula verification

950-410: The choice of branching 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

988-495: The clauses Z i ∨ ¬ X i ∨ ¬ Y i {\displaystyle Z_{i}\vee \neg X_{i}\vee \neg Y_{i}} . With these clauses, the formula implies Z i ≡ X i ∧ Y i {\displaystyle Z_{i}\equiv X_{i}\wedge Y_{i}} ; this formula is often regarded to "define" Z i {\displaystyle Z_{i}} to be

1026-403: The first places of the competitions in 2004 and 2005. Another application that often involves DPLL is automated theorem proving or satisfiability modulo theories (SMT), which is a SAT problem in which propositional variables are replaced with formulas of another mathematical theory . The basic backtracking algorithm runs by choosing a literal, assigning a truth value to it, simplifying

1064-414: 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 the splitting 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

1102-410: 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

1140-499: The link to point directly to the intended article. Retrieved from " https://en.wikipedia.org/w/index.php?title=DPLL&oldid=932801365 " Category : Disambiguation pages Hidden categories: Short description is different from Wikidata All article disambiguation pages All disambiguation pages DPLL algorithm It was introduced in 1961 by Martin Davis , George Logemann and Donald W. Loveland and

1178-413: 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 perform non-chronological backtracking (aka backjumping ) in order to avoid reaching the same conflict again. Most state-of-the-art SAT solvers are based on

DPLL - Misplaced Pages Continue

1216-405: The new variables is true. If this variable is Z i {\displaystyle Z_{i}} , then both X i {\displaystyle X_{i}} and Y i {\displaystyle Y_{i}} are true as well. This means that every model that satisfies this formula also satisfies the original one. On the other hand, only some of the models of

1254-486: The original formula satisfy this one: since the Z i {\displaystyle Z_{i}} are not mentioned in the original formula, their values are irrelevant to satisfaction of it, which is not the case in the last formula. This means that the original formula and the result of the translation are equisatisfiable but not equivalent . An alternative translation, the Tseitin transformation , includes also

1292-3906: The propositional formula ϕ = ( ( ¬ ( p ∧ q ) ) ↔ ( ¬ r ↑ ( p ⊕ q ) ) ) {\displaystyle \phi =((\lnot (p\land q))\leftrightarrow (\lnot r\uparrow (p\oplus q)))} . The (full) DNF equivalent of its negation is ¬ ϕ D N F = ( p ∧ q ∧ r ) ∨ ( p ∧ q ∧ ¬ r ) ∨ ( p ∧ ¬ q ∧ ¬ r ) ∨ ( ¬ p ∧ q ∧ ¬ r ) {\displaystyle \lnot \phi _{DNF}=(p\land q\land r)\lor (p\land q\land \lnot r)\lor (p\land \lnot q\land \lnot r)\lor (\lnot p\land q\land \lnot r)} ϕ ↔ ¬ ¬ ϕ D N F = ¬ { ( p ∧ q ∧ r ) ∨ ( p ∧ q ∧ ¬ r ) ∨ ( p ∧ ¬ q ∧ ¬ r ) ∨ ( ¬ p ∧ q ∧ ¬ r ) } ↔ ¬ ( p ∧ q ∧ r ) _ ∧ ¬ ( p ∧ q ∧ ¬ r ) _ ∧ ¬ ( p ∧ ¬ q ∧ ¬ r ) _ ∧ ¬ ( ¬ p ∧ q ∧ ¬ r ) _ // generalized D.M.  ↔ ( ¬ p ∨ ¬ q ∨ ¬ r ) ∧ ( ¬ p ∨ ¬ q ∨ ¬ ¬ r ) ∧ ( ¬ p ∨ ¬ ¬ q ∨ ¬ ¬ r ) ∧ ( ¬ ¬ p ∨ ¬ q ∨ ¬ ¬ r ) // generalized D.M.  ( 4 × ) ↔ ( ¬ p ∨ ¬ q ∨ ¬ r ) ∧ ( ¬ p ∨ ¬ q ∨ r ) ∧ ( ¬ p ∨ q ∨ r ) ∧ ( p ∨ ¬ q ∨ r ) // remove all  ¬ ¬ = ϕ C N F {\displaystyle {\begin{aligned}\phi &\leftrightarrow \lnot \lnot \phi _{DNF}\\&=\lnot \{(p\land q\land r)\lor (p\land q\land \lnot r)\lor (p\land \lnot q\land \lnot r)\lor (\lnot p\land q\land \lnot r)\}\\&\leftrightarrow {\underline {\lnot (p\land q\land r)}}\land {\underline {\lnot (p\land q\land \lnot r)}}\land {\underline {\lnot (p\land \lnot q\land \lnot r)}}\land {\underline {\lnot (\lnot p\land q\land \lnot r)}}&&{\text{// generalized D.M. }}\\&\leftrightarrow (\lnot p\lor \lnot q\lor \lnot r)\land (\lnot p\lor \lnot q\lor \lnot \lnot r)\land (\lnot p\lor \lnot \lnot q\lor \lnot \lnot r)\land (\lnot \lnot p\lor \lnot q\lor \lnot \lnot r)&&{\text{// generalized D.M. }}(4\times )\\&\leftrightarrow (\lnot p\lor \lnot q\lor \lnot r)\land (\lnot p\lor \lnot q\lor r)\land (\lnot p\lor q\lor r)\land (p\lor \lnot q\lor r)&&{\text{// remove all }}\lnot \lnot \\&=\phi _{CNF}\end{aligned}}} A CNF equivalent of

1330-516: The result of applying unit propagation and the pure literal rule, respectively, to the literal l and the formula Φ . In other words, they replace every occurrence of l with "true" and every occurrence of not l with "false" in the formula Φ , and simplify the resulting formula. The or in the return statement is a short-circuiting operator . Φ ∧ {l} denotes the simplified result of substituting "true" for l in Φ . The algorithm terminates in one of two cases. Either

1368-989: The size of the formula, but introduce new variables. For example, the above formula can be transformed into CNF by adding variables Z 1 , … , Z n {\displaystyle Z_{1},\ldots ,Z_{n}} as follows: ( Z 1 ∨ … ∨ Z n ) ∧ ( ¬ Z 1 ∨ X 1 ) ∧ ( ¬ Z 1 ∨ Y 1 ) ∧ … ∧ ( ¬ Z n ∨ X n ) ∧ ( ¬ Z n ∨ Y n ) . {\displaystyle (Z_{1}\vee \ldots \vee Z_{n})\wedge (\neg Z_{1}\vee X_{1})\wedge (\neg Z_{1}\vee Y_{1})\wedge \ldots \wedge (\neg Z_{n}\vee X_{n})\wedge (\neg Z_{n}\vee Y_{n}).} An interpretation satisfies this formula only if at least one of

1406-483: Was presented and patented. It has found some use in industrial applications. DPLL has been extended for automated theorem proving for fragments of first-order logic by way of the DPLL(T) algorithm. 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 on unit propagation . However,

1444-466: Was the first problem proved to be NP-complete , and can appear in a broad variety of applications such as model checking , automated planning and scheduling , and diagnosis in artificial intelligence . As such, writing efficient SAT solvers has been a research topic for many years. GRASP (1996-1999) was an early implementation using DPLL. In the international SAT competitions, implementations based around DPLL such as zChaff and MiniSat were in

#687312