Hubbry Logo
Boolean satisfiability problemBoolean satisfiability problemMain
Open search
Boolean satisfiability problem
Community hub
Boolean satisfiability problem
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Boolean satisfiability problem
Boolean satisfiability problem
from Wikipedia

In logic and computer science, the Boolean satisfiability problem (sometimes called propositional satisfiability problem and abbreviated SATISFIABILITY, SAT or B-SAT) asks whether there exists an interpretation that satisfies a given Boolean formula. In other words, it asks whether the formula's variables can be consistently replaced by the values TRUE or FALSE to make the formula evaluate to TRUE. If this is the case, the formula is called satisfiable, else unsatisfiable. For example, the formula "a AND NOT b" is satisfiable because one can find the values a = TRUE and b = FALSE, which make (a AND NOT b) = TRUE. In contrast, "a AND NOT a" is unsatisfiable.

SAT is the first problem that was proven to be NP-complete—this is the Cook–Levin theorem. This means that all problems in the complexity class NP, which includes a wide range of natural decision and optimization problems, are at most as difficult to solve as SAT. There is no known algorithm that efficiently solves each SAT problem (where "efficiently" means "deterministically in polynomial time"). Although such an algorithm is generally believed not to exist, this belief has not been proven or disproven mathematically. Resolving the question of whether SAT has a polynomial-time algorithm would settle the P versus NP problem - one of the most important open problems in the theory of computing.[1][2]

Nevertheless, as of 2007, heuristic SAT-algorithms are able to solve problem instances involving tens of thousands of variables and formulas consisting of millions of symbols,[3] which is sufficient for many practical SAT problems from, e.g., artificial intelligence, circuit design,[4] and automatic theorem proving.

Definitions

[edit]

A propositional logic formula, also called Boolean expression, is built from variables, operators AND (conjunction, also denoted by ∧), OR (disjunction, ∨), NOT (negation, ¬), and parentheses. A formula is said to be satisfiable if it can be made TRUE by assigning appropriate logical values (i.e. TRUE, FALSE) to its variables. The Boolean satisfiability problem (SAT) is, given a formula, to check whether it is satisfiable. This decision problem is of central importance in many areas of computer science, including theoretical computer science, complexity theory,[5][6] algorithmics, cryptography[7][8] and artificial intelligence.[9][additional citation(s) needed]

Conjunctive normal form

[edit]

A literal is either a variable (in which case it is called a positive literal) or the negation of a variable (called a negative literal). A clause is a disjunction of literals (or a single literal). A clause is called a Horn clause if it contains at most one positive literal. A formula is in conjunctive normal form (CNF) if it is a conjunction of clauses (or a single clause).

For example, x1 is a positive literal, ¬x2 is a negative literal, and x1 ∨ ¬x2 is a clause. The formula (x1 ∨ ¬x2) ∧ (¬x1x2x3) ∧ ¬x1 is in conjunctive normal form; its first and third clauses are Horn clauses, but its second clause is not. The formula is satisfiable, by choosing x1 = FALSE, x2 = FALSE, and x3 arbitrarily, since (FALSE ∨ ¬FALSE) ∧ (¬FALSE ∨ FALSE ∨ x3) ∧ ¬FALSE evaluates to (FALSE ∨ TRUE) ∧ (TRUE ∨ FALSE ∨ x3) ∧ TRUE, and in turn to TRUE ∧ TRUE ∧ TRUE (i.e. to TRUE). In contrast, the CNF formula a ∧ ¬a, consisting of two clauses of one literal, is unsatisfiable, since for a=TRUE or a=FALSE it evaluates to TRUE ∧ ¬TRUE (i.e., FALSE) or FALSE ∧ ¬FALSE (i.e., again FALSE), respectively.

For some versions of the SAT problem, it is useful to define the notion of a generalized conjunctive normal form formula, viz. as a conjunction of arbitrarily many generalized clauses, the latter being of the form R(l1,...,ln) for some Boolean function R and (ordinary) literals li. Different sets of allowed Boolean functions lead to different problem versions. As an example, Rx,a,b) is a generalized clause, and Rx,a,b) ∧ R(b,y,c) ∧ R(c,dz) is a generalized conjunctive normal form. This formula is used below, with R being the ternary operator that is TRUE just when exactly one of its arguments is.

Using the laws of Boolean algebra, every propositional logic formula can be transformed into an equivalent conjunctive normal form, which may, however, be exponentially longer. For example, transforming the formula (x1y1) ∨ (x2y2) ∨ ... ∨ (xnyn) into conjunctive normal form yields

(x1 ∨ x2 ∨ … ∨ xn) ∧
(y1 ∨ x2 ∨ … ∨ xn) ∧
(x1 ∨ y2 ∨ … ∨ xn) ∧
(y1 ∨ y2 ∨ … ∨ xn) ∧ ... ∧
(x1 ∨ x2 ∨ … ∨ yn) ∧
(y1 ∨ x2 ∨ … ∨ yn) ∧
(x1 ∨ y2 ∨ … ∨ yn) ∧
(y1 ∨ y2 ∨ … ∨ yn);

while the former is a disjunction of n conjunctions of 2 variables, the latter consists of 2n clauses of n variables.

However, with use of the Tseytin transformation, we may find an equisatisfiable conjunctive normal form formula with length linear in the size of the original propositional logic formula.

Complexity

[edit]

SAT was the first problem known to be NP-complete, as proved by Stephen Cook at the University of Toronto in 1971[10] and independently by Leonid Levin at the Russian Academy of Sciences in 1973.[11] Until that time, the concept of an NP-complete problem did not even exist. The proof shows how every decision problem in the complexity class NP can be reduced to the SAT problem for CNF[a] formulas, sometimes called CNFSAT. A useful property of Cook's reduction is that it preserves the number of accepting answers. For example, deciding whether a given graph has a 3-coloring is another problem in NP; if a graph has 17 valid 3-colorings, then the SAT formula produced by the Cook–Levin reduction will have 17 satisfying assignments.

NP-completeness only refers to the run-time of the worst case instances. Many of the instances that occur in practical applications can be solved much more quickly. See §Algorithms for solving SAT below.

3-satisfiability

[edit]
The 3-SAT instance (xxy) ∧ (¬x ∨ ¬y ∨ ¬y) ∧ (¬xyy) reduced to a clique problem. The green vertices form a 3-clique and correspond to the satisfying assignment x=FALSE, y=TRUE.

Like the satisfiability problem for arbitrary formulas, determining the satisfiability of a formula in conjunctive normal form where each clause is limited to at most three literals is NP-complete also; this problem is called 3-SAT, 3CNFSAT, or 3-satisfiability. To reduce the unrestricted SAT problem to 3-SAT, transform each clause l1 ∨ ⋯ ∨ ln to a conjunction of n - 2 clauses

(l1l2x2) ∧
x2l3x3) ∧
x3l4x4) ∧ ⋯ ∧
xn−3ln−2xn−2) ∧
xn−2ln−1ln)

where x2, ⋯ , xn−2 are fresh variables not occurring elsewhere. Although the two formulas are not logically equivalent, they are equisatisfiable. The formula resulting from transforming all clauses is at most 3 times as long as its original; that is, the length growth is polynomial.[12]

3-SAT is one of Karp's 21 NP-complete problems, and it is used as a starting point for proving that other problems are also NP-hard.[b] This is done by polynomial-time reduction from 3-SAT to the other problem. An example of a problem where this method has been used is the clique problem: given a CNF formula consisting of c clauses, the corresponding graph consists of a vertex for each literal, and an edge between each two non-contradicting[c] literals from different clauses; see the picture. The graph has a c-clique if and only if the formula is satisfiable.[13]

There is a simple randomized algorithm due to Schöning (1999) that runs in time (4/3)n where n is the number of variables in the 3-SAT proposition, and succeeds with high probability to correctly decide 3-SAT.[14]

The exponential time hypothesis asserts that no algorithm can solve 3-SAT (or indeed k-SAT for any k > 2) in exp(o(n)) time (that is, fundamentally faster than exponential in n).

Selman, Mitchell, and Levesque (1996) give empirical data on the difficulty of randomly generated 3-SAT formulas, depending on their size parameters. Difficulty is measured in number recursive calls made by a DPLL algorithm. They identified a phase transition region from almost-certainly-satisfiable to almost-certainly-unsatisfiable formulas at the clauses-to-variables ratio at about 4.26.[15]

3-satisfiability can be generalized to k-satisfiability (k-SAT, also k-CNF-SAT), when formulas in CNF are considered with each clause containing up to k literals.[citation needed] However, since for any k ≥ 3, this problem can neither be easier than 3-SAT nor harder than SAT, and the latter two are NP-complete, so must be k-SAT.

Some authors restrict k-SAT to CNF formulas with exactly k literals.[citation needed] This does not lead to a different complexity class either, as each clause l1 ∨ ⋯ ∨ lj with j < k literals can be padded with fixed dummy variables to l1 ∨ ⋯ ∨ ljdj+1 ∨ ⋯ ∨ dk. After padding all clauses, 2k–1 extra clauses[d] must be appended to ensure that only d1 = ⋯ = dk = FALSE can lead to a satisfying assignment. Since k does not depend on the formula length, the extra clauses lead to a constant increase in length. For the same reason, it does not matter whether duplicate literals are allowed in clauses, as in ¬x ∨ ¬y ∨ ¬y.

Special instances of 3SAT

[edit]

Conjunctive normal form

[edit]

Conjunctive normal form (in particular with 3 literals per clause) is often considered the canonical representation for SAT formulas. As shown above, the general SAT problem reduces to 3-SAT, the problem of determining satisfiability for formulas in this form.

Linear SAT

[edit]

A 3-SAT formula is Linear SAT (LSAT) if each clause (viewed as a set of literals) intersects at most one other clause, and, moreover, if two clauses intersect, then they have exactly one literal in common. An LSAT formula can be depicted as a set of disjoint semi-closed intervals on a line. Deciding whether an LSAT formula is satisfiable is NP-complete.[16]

2-satisfiability

[edit]

SAT is easier if the number of literals in a clause is limited to at most 2, in which case the problem is called 2-SAT. This problem can be solved in polynomial time, and in fact is complete for the complexity class NL. If additionally all OR operations in literals are changed to XOR operations, then the result is called exclusive-or 2-satisfiability, which is a problem complete for the complexity class SL = L.

Horn-satisfiability

[edit]

The problem of deciding the satisfiability of a given conjunction of Horn clauses is called Horn-satisfiability, or HORN-SAT. It can be solved in polynomial time by a single step of the unit propagation algorithm, which produces the single minimal model of the set of Horn clauses (w.r.t. the set of literals assigned to TRUE). Horn-satisfiability is P-complete. It can be seen as P's version of the Boolean satisfiability problem. Also, deciding the truth of quantified Horn formulas can be done in polynomial time.[17]

Horn clauses are of interest because they are able to express implication of one variable from a set of other variables. Indeed, one such clause ¬x1 ∨ ... ∨ ¬xny can be rewritten as x1 ∧ ... ∧ xny; that is, if x1,...,xn are all TRUE, then y must be TRUE as well.

A generalization of the class of Horn formulas is that of renameable-Horn formulae, which is the set of formulas that can be placed in Horn form by replacing some variables with their respective negation. For example, (x1 ∨ ¬x2) ∧ (¬x1x2x3) ∧ ¬x1 is not a Horn formula, but can be renamed to the Horn formula (x1 ∨ ¬x2) ∧ (¬x1x2 ∨ ¬y3) ∧ ¬x1 by introducing y3 as negation of x3. In contrast, no renaming of (x1 ∨ ¬x2 ∨ ¬x3) ∧ (¬x1x2x3) ∧ ¬x1 leads to a Horn formula. Checking the existence of such a replacement can be done in linear time; therefore, the satisfiability of such formulae is in P as it can be solved by first performing this replacement and then checking the satisfiability of the resulting Horn formula.

Not 3SAT problems

[edit]

Disjunctive normal form

[edit]

SAT is trivial if the formulas are restricted to those in disjunctive normal form, that is, they are a disjunction of conjunctions of literals. Such a formula is indeed satisfiable if and only if at least one of its conjunctions is satisfiable, and a conjunction is satisfiable if and only if it does not contain both x and NOT x for some variable x. This can be checked in linear time. Furthermore, if they are restricted to being in full disjunctive normal form, in which every variable appears exactly once in every conjunction, they can be checked in constant time (each conjunction represents one satisfying assignment). But it can take exponential time and space to convert a general SAT problem to disjunctive normal form; to obtain an example, exchange "∧" and "∨" in the above exponential blow-up example for conjunctive normal forms.

Exactly-1 3-satisfiability

[edit]

Another NP-complete variant of the 3-satisfiability problem is the one-in-three 3-SAT (also known variously as 1-in-3-SAT and exactly-1 3-SAT). Given a conjunctive normal form with three literals per clause, the problem is to determine whether there exists a truth assignment to the variables so that each clause has exactly one TRUE literal (and thus exactly two FALSE literals).

Not-all-equal 3-satisfiability

[edit]

Another variant is the not-all-equal 3-satisfiability problem (also called NAE3SAT). Given a conjunctive normal form with three literals per clause, the problem is to determine if an assignment to the variables exists such that in no clause all three literals have the same truth value. This problem is NP-complete, too, even if no negation symbols are admitted, by Schaefer's dichotomy theorem.[18]

XOR-satisfiability

[edit]

Another special case is the class of problems where each clause contains XOR (i.e. exclusive or) rather than (plain) OR operators. This is in P, since an XOR-SAT formula can also be viewed as a system of linear equations mod 2, and can be solved in cubic time by Gaussian elimination.[19]

Schaefer's dichotomy theorem

[edit]

The restrictions above (CNF, 2CNF, 3CNF, Horn, XOR-SAT) bound the considered formulae to be conjunctions of subformulas; each restriction states a specific form for all subformulas: for example, only binary clauses can be subformulas in 2CNF.

Schaefer's dichotomy theorem states that, for any restriction to Boolean functions that can be used to form these subformulas, the corresponding satisfiability problem is in P or NP-complete. The membership in P of the satisfiability of 2CNF, Horn, and XOR-SAT formulae are special cases of this theorem.[18]

The following table summarizes some common variants of SAT.

Name Code 3SAT problem? Restrictions Requirements Class
3-satisfiability 3SAT Yes Each clause contains 3 literals. At least one literal must be true. NP-c
2-satisfiability 2SAT Yes Each clause contains 2 literals. At least one literal must be true. NL-c
Exactly-1 3-SAT 1-in-3-SAT No Each clause contains 3 literals. Exactly one literal must be true. NP-c
Exactly-1 Positive 3-SAT 1-in-3-SAT+ No Each clause contains 3 positive literals. Exactly one literal must be true. NP-c
Not-all-equal 3-satisfiability NAE3SAT No Each clause contains 3 literals. Either one or two literals must be true. NP-c
Not-all-equal positive 3-SAT NAE3SAT+ No Each clause contains 3 positive literals. Either one or two literals must be true. NP-c
Planar SAT PL-SAT Yes The incidence graph (clause-variable graph) is planar. At least one literal must be true. NP-c
Linear SAT LSAT Yes Each clause contains 3 literals, intersects at most one other clause, and the intersection is exactly one literal. At least one literal must be true. NP-c
Horn satisfiability HORN-SAT Yes Horn clauses (at most one positive literal). At least one literal must be true. P-c
Xor satisfiability XOR-SAT No Each clause contains XOR operations rather than OR. The XOR of all literals must be true. P

Extensions of SAT

[edit]

An extension that has gained significant popularity since 2003 is satisfiability modulo theories (SMT) that can enrich CNF formulas with linear constraints, arrays, all-different constraints, uninterpreted functions,[20] etc. Such extensions typically remain NP-complete, but very efficient solvers are now available that can handle many such kinds of constraints.

The satisfiability problem becomes more difficult if both "for all" () and "there exists" () quantifiers are allowed to bind the Boolean variables. An example of such an expression would be xyz (xyz) ∧ (¬x ∨ ¬y ∨ ¬z); it is valid, since for all values of x and y, an appropriate value of z can be found, viz. z=TRUE if both x and y are FALSE, and z=FALSE else. SAT itself (tacitly) uses only ∃ quantifiers. If only ∀ quantifiers are allowed instead, the so-called tautology problem is obtained, which is co-NP-complete. If any number of both quantifiers are allowed, the problem is called the quantified Boolean formula problem (QBF), which can be shown to be PSPACE-complete. It is widely believed that PSPACE-complete problems are strictly harder than any problem in NP, although this has not yet been proved.

Ordinary SAT asks if there is at least one variable assignment that makes the formula true. A variety of variants deal with the number of such assignments:

  • MAJ-SAT asks if at least half of all assignments make the formula TRUE. It is known to be complete for PP, a probabilistic class. Surprisingly, MAJ-kSAT is demonstrated to be in P for every finite integer k.[21]
  • #SAT, the problem of counting how many variable assignments satisfy a formula, is a counting problem, not a decision problem, and is #P-complete.
  • UNIQUE SAT[22] is the problem of determining whether a formula has exactly one assignment. It is complete for US,[23] the complexity class describing problems solvable by a non-deterministic polynomial time Turing machine that accepts when there is exactly one nondeterministic accepting path and rejects otherwise.
  • UNAMBIGUOUS-SAT is the name given to the satisfiability problem when the input formula is promised to have at most one satisfying assignment. The problem is also called USAT.[24] A solving algorithm for UNAMBIGUOUS-SAT is allowed to exhibit any behavior, including endless looping, on a formula having several satisfying assignments. Although this problem seems easier, Valiant and Vazirani have shown[25] that if there is a practical (i.e. randomized polynomial-time) algorithm to solve it, then all problems in NP can be solved just as easily.
  • MAX-SAT, the maximum satisfiability problem, is an FNP generalization of SAT. It asks for the maximum number of clauses which can be satisfied by any assignment. It has efficient approximation algorithms, but is NP-hard to solve exactly. Worse still, it is APX-complete, meaning there is no polynomial-time approximation scheme (PTAS) for this problem unless P=NP.
  • WMSAT is the problem of finding an assignment of minimum weight that satisfy a monotone Boolean formula (i.e. a formula without any negation). Weights of propositional variables are given in the input of the problem. The weight of an assignment is the sum of weights of true variables. That problem is NP-complete (see Th. 1 of[26]).

Other generalizations include satisfiability for first- and second-order logic, constraint satisfaction problems, 0-1 integer programming.

Finding a satisfying assignment

[edit]

While SAT is a decision problem, the search problem of finding a satisfying assignment reduces to SAT. That is, each algorithm which correctly answers whether an instance of SAT is solvable can be used to find a satisfying assignment. First, the question is asked on the given formula Φ. If the answer is "no", the formula is unsatisfiable. Otherwise, the question is asked on the partly instantiated formula Φ{x1=TRUE}, that is, Φ with the first variable x1 replaced by TRUE, and simplified accordingly. If the answer is "yes", then x1=TRUE, otherwise x1=FALSE. Values of other variables can be found subsequently in the same way. In total, n+1 runs of the algorithm are required, where n is the number of distinct variables in Φ.

This property is used in several theorems in complexity theory:

Algorithms for solving SAT

[edit]
Exponential complexity of SAT solving vs variable count, clause count, and formula length

Since the SAT problem is NP-complete, only algorithms with exponential worst-case complexity are known for it. In spite of this, efficient and scalable algorithms for SAT were developed during the 2000s and have contributed to dramatic advances in the ability to automatically solve problem instances involving tens of thousands of variables and millions of constraints (i.e. clauses).[3] Examples of such problems in electronic design automation (EDA) include formal equivalence checking, model checking, formal verification of pipelined microprocessors,[20] automatic test pattern generation, routing of FPGAs,[27] planning, and scheduling problems, and so on. A SAT-solving engine is also considered to be an essential component in the electronic design automation toolbox.

Major techniques used by modern SAT solvers include the Davis–Putnam–Logemann–Loveland algorithm (or DPLL), conflict-driven clause learning (CDCL), and stochastic local search algorithms such as WalkSAT. Almost all SAT solvers include time-outs, so they will terminate in reasonable time even if they cannot find a solution. Different SAT solvers will find different instances easy or hard, and some excel at proving unsatisfiability, and others at finding solutions. Recent attempts have been made to learn an instance's satisfiability using deep learning techniques.[28]

SAT solvers are developed and compared in SAT-solving contests.[29] Modern SAT solvers are also having significant impact on the fields of software verification, constraint solving in artificial intelligence, and operations research, among others.

Theoretical algorithms with increasingly better worst-case runtime guarantees have been given in the last decades, including an algorithm for clause sets of length (total literal count) ,[30][31] an algorithm for sets of clauses,[32][33] and an algorithm for 3-SAT with variables.[34] Here, the notation "" means "up to a polynomial factor", i.e. . Earlier runtime guarantees are shown in the diagram.

See also

[edit]

Notes

[edit]
[edit]

References

[edit]

Sources

[edit]

Further reading

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
The Boolean satisfiability problem (SAT) is the fundamental in computational logic and complexity theory that asks whether there exists an assignment of truth values (true or false) to the variables in a given Boolean formula such that the formula evaluates to true. Typically formulated in (CNF), where the formula is a conjunction of clauses each being a disjunction of literals (variables or their negations), SAT determines the satisfiability of such expressions, with unsatisfiability implying a contradiction in the propositional logic represented by the formula. Proven to be NP-complete by Stephen A. Cook in his 1971 paper "The Complexity of Theorem-Proving Procedures," SAT serves as the canonical example for the NP complexity class, meaning any problem in NP can be reduced to SAT in polynomial time, and it underpins the unsolved P vs. NP question central to theoretical computer science. This NP-completeness result, the first of its kind, sparked the development of the entire field of NP-completeness, influencing reductions for thousands of other problems across mathematics, optimization, and engineering. Despite its theoretical intractability—requiring exponential time in the worst case for exact solutions—modern SAT solvers employ advanced heuristics, , and branch-and-bound techniques derived from the (introduced in 1962), enabling them to resolve industrial-scale instances with millions of variables and clauses in seconds. These solvers power diverse applications, including hardware and software verification (e.g., checking circuit equivalence or bug detection), planning (e.g., automated scheduling), (e.g., constraint satisfaction in logistics), and bioinformatics (e.g., protein folding models), demonstrating a remarkable gap between worst-case theory and practical performance. Annual international SAT competitions since 2002 have accelerated progress, akin to "" for SAT solving, with empirical studies revealing that real-world instances often exhibit structure exploitable by and preprocessing techniques. Variants like 2-SAT (linear-time solvable) and 3-SAT (NP-complete even for clauses of three literals) highlight the problem's , while extensions to quantified Boolean formulas (QBF) address higher levels of the polynomial hierarchy.

Definitions and Formalism

Boolean Formulas

In propositional logic, the fundamental building blocks are propositional variables, also known as Boolean variables, which represent atomic propositions that can take one of two truth values: true (often denoted as T or 1) or false (F or 0). These variables, typically denoted by lowercase letters such as p,q,rp, q, r, do not possess internal structure and serve as placeholders for declarative statements whose truth values are to be evaluated. Propositional formulas are constructed using a set of logical connectives that combine these variables to form more complex expressions. The primary connectives include (¬\neg), conjunction (\land), disjunction (\lor), implication (\rightarrow), and biconditional (\leftrightarrow). Each connective defines a truth-functional operation, meaning the truth value of the resulting depends solely on the truth values of its components, as specified by their truth tables. The for (¬A\neg A) is:
A¬A\neg A
TF
FT
For conjunction (ABA \land B):
ABABA \land B
TTT
TFF
FTF
FFF
For disjunction (ABA \lor B):
ABABA \lor B
TTT
TFT
FTT
FFF
Implication (ABA \rightarrow B) is true unless A is true and B is false:
ABABA \rightarrow B
TTT
TFF
FTT
FFT
The biconditional (ABA \leftrightarrow B) is true when A and B have the same :
ABABA \leftrightarrow B
TTT
TFF
FTF
FFT
Propositional formulas are defined recursively, starting from atomic elements and building through combinations with connectives. Specifically, the set of formulas is the smallest set such that: (1) every propositional variable is a formula (an atom); (2) if ϕ\phi is a formula, then ¬ϕ\neg \phi is a formula; and (3) if ϕ\phi and ψ\psi are formulas, then (ϕψ)(\phi \land \psi), (ϕψ)(\phi \lor \psi), (ϕψ)(\phi \rightarrow \psi), and (ϕψ)(\phi \leftrightarrow \psi) are formulas. This recursive structure ensures that every formula can be parsed unambiguously, often represented as a where leaves are atoms or their negations, and internal nodes are connectives with their operands as subtrees. For example, consider the formula (p¬q)(¬pr)(p \lor \neg q) \land (\neg p \lor r). Its has a root node labeled \land, with left child \lor (subchildren pp and ¬q\neg q) and right child \lor (subchildren ¬p\neg p and rr). This tree representation highlights the hierarchical structure and precedence enforced by parentheses. Every corresponds to a , or , that maps assignments of s to its variables to a single , and such functions can equivalently be realized by Boolean circuits composed of gates mirroring the connectives.

Satisfiability and Models

In propositional logic, a satisfying assignment for a ϕ\phi is a function that assigns truth values (true or false) to each in ϕ\phi such that the entire evaluates to true. Any such satisfying assignment is also called a model of ϕ\phi. If no satisfying assignment exists for ϕ\phi, the is unsatisfiable, meaning it evaluates to false under every possible assignment of truth values to its variables. The satisfiability problem (SAT) is the fundamental in this context: given a ϕ\phi over a of propositional variables, determine whether there exists at least one satisfying assignment (model) for ϕ\phi. Formally, SAT asks if ϕ\phi is , with a "yes" instance admitting at least one model and a "no" instance being unsatisfiable. For a with nn distinct variables, the total number of possible assignments is 2n2^n, representing the exhaustive search to check for satisfiability. To illustrate, consider the Boolean formula ϕ=(p¬q)(¬pr)\phi = (p \lor \neg q) \land (\neg p \lor r). One satisfying assignment is p=\falsep = \false, q=\falseq = \false, r=\truer = \true: here, p¬qp \lor \neg q evaluates to \false\true=\true\false \lor \true = \true, and ¬pr\neg p \lor r evaluates to \true\true=\true\true \lor \true = \true, so ϕ\phi is \true\true=\true\true \land \true = \true. Special cases arise with tautologies and contradictions. A tautology is a formula that evaluates to true under every possible assignment, meaning every assignment is a model (e.g., p¬pp \lor \neg p). Conversely, a contradiction is a formula that evaluates to false under every assignment, having no models (e.g., p¬pp \land \neg p). These represent the extreme ends of satisfiability: universal satisfaction for tautologies and complete unsatisfiability for contradictions.

Conjunctive Normal Form

In logic, a literal is either a variable xix_i or its negation ¬xi\neg x_i. A is a disjunction (logical OR) of one or more literals, such as x1¬x2x3x_1 \lor \neg x_2 \lor x_3. A formula is in if it is a conjunction (logical AND) of one or more clauses, for example, (x1¬x2)(¬x1x3¬x4)(x_1 \lor \neg x_2) \land (\neg x_1 \lor x_3 \lor \neg x_4). This representation is the standard input format for the Boolean satisfiability problem (SAT), as it structures the formula into a product of sums that facilitates analysis of satisfying assignments. The clause width of a CNF refers to the maximum number of literals in any clause; for instance, a in 3-CNF has clauses with at most three literals each. More generally, a k-CNF restricts all clauses to have at most (or, in some contexts, exactly) kk literals, which controls the structural complexity and is central to variants like 2-SAT or 3-SAT. Any general Boolean formula can be converted to an equivalent CNF formula using a systematic process: first, eliminate non-standard connectives like implication (pq¬pqp \to q \equiv \neg p \lor q) and biconditional by replacing them with disjunctions; second, apply double negation elimination and De Morgan's laws to push negations inward to literals; finally, use the distributive law to expand any remaining conjunctions over disjunctions, yielding a conjunction of clauses. For example, the implication pqp \to q directly converts to the single clause ¬pq\neg p \lor q, which is already in CNF. However, this conversion can result in an exponential increase in formula size, as distributing over multiple terms may produce up to 2n2^n clauses for certain inputs with nn variables.

Computational Complexity

NP-Completeness

The (SAT) belongs to the NP because, given a in and a candidate assignment of truth values to its variables, one can verify whether the assignment satisfies the in polynomial time by evaluating each clause individually. The NP-hardness of SAT is established by the Cook-Levin theorem, which provides a from any problem in NP to SAT. To show this, consider an arbitrary language LNPL \in \mathrm{NP}; by definition, there exists a MM that decides LL in polynomial time, say p(n)p(n) steps on inputs of length nn. For an input string ww of length nn, the reduction constructs a ϕM,w\phi_{M,w} in CNF such that ϕM,w\phi_{M,w} is if and only if MM accepts ww. The construction encodes the possible computation paths of MM on ww using variables that represent the state of the tape, head position, and state at each of the p(n)p(n) time steps. Specifically, variables are defined for each possible symbol in each tape cell at each time step, ensuring the formula size remains polynomial in nn. Clauses in ϕM,w\phi_{M,w} enforce three key properties: (1) the initial configuration matches ww on the input tape with the head at the starting position and initial state; (2) consecutive configurations adhere to MM's transition rules, allowing changes in at most a constant number of adjacent tape cells per step; and (3) at least one computation path ends in an accepting configuration after at most p(n)p(n) steps. This encoding simulates the nondeterministic choices and verifications of MM, reducing the acceptance problem to . The Cook-Levin theorem implies that every problem in NP can be reduced to SAT in polynomial time, making SAT the first problem proven to be and providing a canonical hard problem for the class. This result, originally proven by in his 1971 paper "The Complexity of Theorem-Proving Procedures," formalized the notion of and profoundly influenced by enabling reductions from SAT to establish hardness for numerous other problems. Independently, developed a similar proof around the same time, though it was published later in the West.

k-SAT and Clause Width

The k-SAT problem is a restriction of the Boolean satisfiability problem to formulas in which every consists of exactly k literals, where each literal is a variable or its . The cases k=1 and k=2 are solvable in polynomial time. For k=1, each is a unit clause of the form (x) or (¬x), and the formula is satisfiable unless a variable and its negation both appear as clauses; this can be checked and resolved in linear time by propagating forced assignments. For k=2, 2-SAT instances can be solved in linear time via construction of an implication graph, where vertices represent literals and edges encode implications between clauses, followed by detection of strongly connected components to identify contradictions. In contrast, k-SAT is NP-complete for every fixed k ≥ 3. Since 3-SAT is NP-complete, the result for larger k follows from a from (k-1)-SAT to k-SAT, applied recursively from 3-SAT. Specifically, given a (k-1)-clause C = (1 ∨ ⋯ ∨ k-1), introduce a fresh variable y and replace C with the two k-clauses (1k1y)(1k1¬y).(\ell_1 \vee \cdots \vee \ell_{k-1} \vee y) \wedge (\ell_1 \vee \cdots \vee \ell_{k-1} \vee \neg y). This preserves satisfiability: if C is falsified, both new clauses require contradictory values for y; if C is satisfied, both hold regardless of y. Each original clause thus generates a constant number of new clauses and variables, yielding a polynomial-size k-CNF equivalent to the input. The case k=3, known as 3-SAT, is the paradigmatic hard instance of k-SAT and underpins much of the theory of . Beyond , finer-grained hardness results stem from the (ETH), which asserts that no algorithm solves n-variable 3-SAT in time 2o(n). Using sparsification techniques, ETH implies concrete lower bounds on the exponential base. Under ETH, 3-SAT cannot be solved in subexponential time 2^{o(n)}. Current best algorithms achieve O(1.307^n) time (randomized) or O(1.328^n) time (deterministic) as of 2021, highlighting the gap between theoretical lower bounds and practical algorithms. These bounds highlight that exact solving remains computationally intensive even for moderate instance sizes, influencing algorithm design and . Random instances of 3-SAT exhibit a in as a function of the clause-to-variable ratio α = m/n. Empirical investigations show that for α ≲ 4.26, uniformly random 3-CNF formulas with n variables and m = αn clauses are satisfiable with probability approaching 1 as n → ∞; for α ≳ 4.26, they are unsatisfiable with high probability. This threshold, refined through large-scale experiments, demarcates easy-to-satisfy underconstrained regimes from overconstrained unsatisfiable ones, with peak hardness near the transition due to exponentially many near-solutions.

Schaefer's Dichotomy Theorem

Schaefer's Dichotomy Theorem, established in 1978, classifies the computational complexity of generalized Boolean satisfiability problems parameterized by a finite set SS of Boolean relations, where each relation in SS is a subset of {0,1}n\{0,1\}^n for some arity nn. The problem SAT(SS) asks whether a given conjunction of relational constraints from SS (with variables ranging over Boolean values) admits a satisfying assignment. The theorem asserts that SAT(SS) is either solvable in polynomial time or is NP-complete, providing a sharp dichotomy based on structural properties of SS. This result extends the classical CNF-SAT framework by allowing arbitrary relational constraints rather than solely disjunctive clauses, yet maintains the same complexity boundary. The polynomial-time cases correspond to six specific classes of SS, each admitting an efficient recognition and solving algorithm:
  • 0-valid: Every relation in SS is satisfied by the all-false assignment (all variables set to 0).
  • 1-valid: Every relation in SS is satisfied by the all-true assignment (all variables set to 1).
  • Horn: Every relation in SS is definable by a Horn formula, meaning it corresponds to the models of a conjunction of clauses with at most one positive literal each.
  • Anti-Horn: The dual of Horn, where every relation corresponds to clauses with at most one negative literal.
  • 2-CNF: Every relation in SS has width at most 2, equivalent to implications between at most two literals, reducible to 2-SAT.
  • Affine: Every relation in SS consists of solutions to a over the GF(2), solvable via .
For instance, in the Horn class, satisfiability can be decided in linear time using unit propagation: iteratively assign values to unit clauses (those with a single literal) and remove implied literals until resolution or contradiction. These classes are closed under the operations considered in the , ensuring the dichotomy applies uniformly. If SS does not belong to any of these six classes, SAT(SS) is NP-complete. The proof constructs polynomial-time reductions from 3-SAT, using gadgets tailored to the polymorphisms or syntactic properties of relations in SS to simulate arbitrary 3-clauses; for example, if SS lacks the above structures, one can positive and negative literals to force NP-hard behavior. This hardness holds even when restricting to relations closed under complement, of variables, or identification of variables, highlighting the theorem's robustness. The theorem's framework has significant implications for problems (CSPs), as SAT(SS) is precisely the Boolean CSP over the constraint language SS. It establishes that all Boolean CSPs fall into exactly two complexity categories, inspiring subsequent dichotomies for CSPs over finite domains and influencing studies in logic and AI.

Polynomial-Time Solvable Cases

2-SAT

The problem, or 2-SAT, restricts the Boolean satisfiability problem to formulas where each clause contains exactly two literals. This case is solvable in polynomial time, distinguishing it from the NP-complete general SAT problem. A central technique for solving 2-SAT involves constructing an implication graph. Given a 2-CNF ϕ\phi with nn variables, the graph GG has 2n2n vertices, one for each literal xix_i and ¬xi\neg x_i for i=1,,ni = 1, \dots, n. For every (ab)(a \lor b) in ϕ\phi, where aa and bb are literals, add directed edges ¬ab\neg a \to b and ¬ba\neg b \to a to GG. These edges encode the logical implications required for the clause to hold: if ¬a\neg a is true, then bb must be true, and similarly for the other direction. The resulting graph has at most 2m2m edges, where mm is the number of clauses. The formula ϕ\phi is unsatisfiable if and only if there exists a variable xx such that xx and ¬x\neg x lie in the same (SCC) of GG. In this case, there are directed paths from xx to ¬x\neg x and from ¬x\neg x to xx, implying a contradiction where both xx and ¬x\neg x must be true. Conversely, if no such pair exists, ϕ\phi is satisfiable. The full algorithm proceeds as follows: first, build the implication graph GG; second, compute the SCCs of GG using a linear-time method such as Tarjan's algorithm or ; third, check each variable to see if xx and ¬x\neg x share an SCC—if any do, declare ϕ\phi unsatisfiable. If satisfiable, construct an assignment by obtaining a topological ordering of the SCCs (treating the condensation graph as a DAG). For each variable xx, set xx to true if the SCC of ¬x\neg x precedes the SCC of xx in this ordering; otherwise, set xx to false. This assignment satisfies all implications, as paths in GG respect the topological order, ensuring no clause is violated. The algorithm runs in O(n+m)O(n + m) time, matching the size of the input formula, since constructing GG is linear and SCC computation is linear in the number of vertices and edges. As established by Schaefer's dichotomy theorem, 2-CNF formulas belong to a tractable class within the classification of generalized problems, confirming their polynomial-time solvability. For example, consider the 2-CNF formula with clauses (pq)(p \lor q), (¬qr)(\neg q \lor r), and (¬p¬r)(\neg p \lor \neg r). The implication graph includes edges ¬pq\neg p \to q, ¬qp\neg q \to p, qrq \to r, ¬r¬q\neg r \to \neg q, p¬rp \to \neg r, and r¬pr \to \neg p. These form cycles such as p¬r¬qpp \to \neg r \to \neg q \to p and ¬pqr¬p\neg p \to q \to r \to \neg p, but pp and ¬p\neg p lie in different SCCs, so the formula is satisfiable. For instance, the assignment p=p = true, q=q = false, r=r = false satisfies all clauses.

Horn-SAT

A Horn consists of a conjunction of s, where each is a disjunction of literals containing at most one positive literal. For instance, the clause ¬a¬bc\neg a \vee \neg b \vee c is a , equivalent to the implication (ab)c(a \wedge b) \to c. Horn-SAT, the problem of determining for such formulas, is one of the six tractable classes identified in Schaefer's dichotomy theorem. The of a Horn can be tested efficiently using a algorithm based on unit propagation. This begins by constructing an implication graph where, for each with negative literals ¬x1,,¬xk\neg x_1, \dots, \neg x_k and positive literal yy (or no positive literal for a negative unit clause), directed edges are added from each xix_i to yy. Unit clauses, which force a variable to true, are identified and propagated: setting a variable vv to true removes all clauses containing ¬v\neg v (simplifying others by removing ¬v\neg v) and adds implications from vv to its consequences, using a queue to assignments in breadth-first order. continues until no new unit clauses arise; if an empty clause or a cycle forcing a variable both true and false appears, the formula is unsatisfiable. Otherwise, the is satisfiable, with all unforced variables set to false yielding a model. If satisfiable, this algorithm uniquely identifies the minimal model, defined as the satisfying assignment with the fewest true variables (or, equivalently, the least model under the componentwise partial order on assignments). The minimal model consists precisely of the variables forced true by , as any satisfying assignment must include these to avoid contradiction, and setting others false preserves satisfiability due to the Horn structure. The algorithm runs in linear time, O(n+m)O(n + m), where nn is the number of variables and mm the number of clauses, achieved by processing each edge and node in the implication graph at most once via the queue. Example. Consider the Horn with clauses (¬pq)(\neg p \vee q), (¬qr)(\neg q \vee r), encoding the implications pqp \to q and qrq \to r. Unit yields no initial units, so it is satisfiable with minimal model all false. Adding the unit clause (¬r)(\neg r) forces rr false, but through the reverse implications (from the graph) leads to qq false, then pp false—no contradiction. However, if instead the positive unit (r)(r) is added along with (¬r)(\neg r), it would force rr true and false, yielding unsatisfiability.

Renamable Horn-SAT and Other Tractable Classes

The Boolean satisfiability problem restricted to renamable Horn formulas is solvable in time. A CNF is renamable Horn if there exists a subset of variables whose polarities can be flipped such that the resulting is Horn, meaning every has at most one positive literal. This class generalizes Horn-SAT, extending tractability to formulas that become Horn after such a renaming. The recognition and of renamable Horn formulas can be decided in linear time. The algorithm models the renaming choice as a 2-SAT instance. For each variable xix_i, introduce a new variable fif_i indicating whether xix_i is flipped (fi=f_i = \top means flip). For every original , construct binary clauses ensuring that, after the implied renaming, the has at most one positive literal. Specifically, for each pair of literals in a that could both become positive under some renaming (i.e., both original positives not flipped or both original negatives flipped), add a 2-clause forbidding that pair from both being positive, such as (fifj)(f_i \lor f_j) or (¬fi¬fj)(\neg f_i \lor \neg f_j) depending on the literals. Solving this 2-SAT instance determines if a valid renaming exists; if so, apply the renaming to obtain a Horn , then solve it using linear-time unit as in standard Horn-SAT. This reduction leverages the polynomial-time solvability of 2-SAT via implication graphs and strongly connected components. Affine SAT, another tractable class, consists of formulas where all clauses are linear equations over the , equivalent to XOR clauses (e.g., exclusive-or of literals equal to true or false). Such a can be represented as a Ax=bA \mathbf{x} = \mathbf{b}, where AA is an m×nm \times n matrix over with rows corresponding to clauses and columns to variables, x\mathbf{x} is the variable assignment vector, and b\mathbf{b} encodes the required parity (1 for odd number of true literals, 0 for even). is determined by on the [Ab][A | \mathbf{b}], which runs in O(n3)O(n^3) time in the worst case for dense systems, or more efficiently for sparse ones. For example, the clause pqrp \oplus q \oplus r (implying an odd number of true variables) corresponds to the equation xp+xq+xr=1x_p + x_q + x_r = 1 over , and solving the full system yields a solution if consistent, or detects inconsistency via rank comparison. This approach directly computes a satisfying assignment when one exists. Schaefer's dichotomy theorem identifies additional tractable classes within its framework: 0-valid formulas, where every contains at least one negative literal (satisfied by the all-false assignment); 1-valid formulas, where every contains at least one positive literal (satisfied by the all-true assignment); and anti-Horn formulas, the dual of Horn-SAT, consisting of clauses with at most one negative literal (solvable in linear time by duality, mapping to Horn-SAT via of all variables). These classes, alongside Horn, affine, and 2-CNF, exhaust the polynomial-time solvable cases under Schaefer's closure properties for generalized SAT. Recognition for these is straightforward: verify clause types directly, with following from the respective algorithms (trivial constant assignments for 0-valid and 1-valid, provided no empty clauses).

NP-Hard Variants

Exactly-1 3-SAT

The Exactly-1 3-SAT problem, also known as 1-in-3-SAT, is a restricted variant of the Boolean satisfiability problem where the input is a 3-CNF , but a satisfying assignment must evaluate exactly one literal to true in every , imposing a constraint of precisely one true literal per . This differs from standard 3-SAT, which requires at least one true literal per without upper bounds. The problem is in NP, as a candidate assignment can be verified in time by checking each for exactly one true literal. For example, consider the clause (pqr)(p \lor q \lor r). A satisfying assignment for this clause in Exactly-1 3-SAT must set exactly one of pp, qq, or rr to true and the other two to false; assignments where zero, two, or all three are true would violate the constraint. Exactly-1 3-SAT is NP-hard, established via a from 3-SAT that introduces auxiliary variables to transform the "at least one" condition into "exactly one" by encoding mutual exclusions among literals in each original . Specifically, for a 3-SAT (xyz)(x \lor y \lor z), the reduction adds fresh variables to create a set of Exactly-1 3-SAT clauses that are satisfiable exactly one of x,y,zx, y, z (or their negations, depending on polarity) is true, ensuring no more than one can hold simultaneously. This construction preserves while enforcing the exact , and the overall transformation is linear in the input size. The positive variant of Exactly-1 3-SAT, where all literals are unnegated, models the exact cover by 3-sets (X3C) problem, an NP-complete set partitioning task where a of 3q elements must be exactly covered by disjoint 3-element from a given collection. In this correspondence, variables represent selections, and clauses ensure each element appears in exactly one selected , directly capturing partitioning constraints. Counting the number of satisfying assignments to an Exactly-1 3-SAT formula is #P-complete, even for the positive case, highlighting the added computational difficulty of beyond mere existence.

Not-All-Equal 3-SAT

The Not-All-Equal 3-SAT (NAE-3-SAT) is a constraint satisfaction problem where the input consists of a conjunction of clauses, each containing exactly three literals over a set of Boolean variables, and a clause is satisfied by a truth assignment if and only if the three literals do not all evaluate to the same truth value—that is, at least one literal is true and at least one is false. This formulation forbids both the all-true (TTT) and all-false (FFF) cases for each clause, distinguishing it from standard 3-SAT, which only requires at least one true literal per clause. A simple example illustrates the satisfaction condition: consider the clause NAE(x1,¬x2,x3x_1, \neg x_2, x_3). This clause is satisfied by any assignment where the literals do not all evaluate to true or all to false—for instance, if x1=x_1 = \top, x2=x_2 = \top (making ¬x2=\neg x_2 = \bot), and x3=x_3 = \bot, the values are ,,\top, \bot, \bot (mixed); it is unsatisfied only if all are \top or all \bot. NAE-3-SAT is NP-complete, as established in Schaefer's seminal classification of Boolean constraint satisfaction problems. Even the restricted monotone variant, where all literals are unnegated (positive), remains NP-complete; this version corresponds to ensuring diversity in assignments and can be shown NP-hard by reduction from the graph 3-coloring problem, via equivalence to 2-coloring 3-uniform hypergraphs where no hyperedge is monochromatic (variables as vertices, clauses as hyperedges, true/false as colors). In applications, NAE-3-SAT models constraint satisfaction scenarios requiring diversity or non-uniformity among variables, such as in relational databases or logic programming where clauses enforce that not all elements in a tuple share the same value. Regarding parameterized complexity, NAE-3-SAT is fixed-parameter tractable when parameterized by the treewidth of the primal or incidence graph of the formula, admitting algorithms running in time O(2O(k)n)O(2^{O(k)} n) where kk is the treewidth and nn the input size, similar to general SAT; however, it is W-hard for parameters like the solution size or number of variables in unrestricted cases.

Algorithms for Solving SAT

DPLL and Backtracking

The Davis–Putnam–Logemann–Loveland () algorithm, introduced in 1962, forms the basis for exact solvers of the Boolean satisfiability problem by combining recursive search with propositional rules to prune the search space efficiently. Developed as a machine-implemented procedure for theorem proving, it takes a in (CNF) as input and systematically explores partial truth assignments until satisfiability is determined or all possibilities are exhausted. At each step, DPLL first applies simplification techniques to the current formula under a partial assignment: unit propagation and pure literal elimination. Unit propagation identifies reduced to a single unassigned literal (a unit ) and assigns that literal the value needed to satisfy the , then propagates this assignment by substituting into all and repeating until no unit remain or an empty (contradiction) arises. Pure literal elimination detects variables that appear only positively (or only negatively) across all remaining and assigns them true (or false, respectively) to satisfy those , removing the affected from consideration. These rules provide sound inference without branching, reducing the formula's size before further decisions. If simplification yields no clauses, the formula is satisfiable under the current partial assignment, and DPLL returns a satisfying assignment by to complete it. If an empty appears, the current is unsatisfiable, prompting to the last decision point. Otherwise, DPLL selects an unassigned variable (typically using a like most frequent occurrence) and branches by recursing on two subproblems: one assigning the variable true and the other false. This continues until a satisfying assignment is found or all branches fail, proving unsatisfiability. Pruning occurs via early termination on contradictions during propagation, avoiding full exploration of doomed subtrees. In the worst case, DPLL exhibits exponential time complexity of O(2^n), where n is the number of variables, as it may need to evaluate all possible truth assignments in a binary decision tree. Despite this, the combination of inference rules and branching heuristics makes it surprisingly effective on structured instances, laying the groundwork for subsequent advancements. To illustrate, consider a small 3-SAT instance with variables p, q, r and clauses: (¬p ∨ q), (¬p ∨ r), (q ∨ r), (¬q ∨ ¬r). No initial unit clauses or pure literals exist, so select p for branching.
  • Branch p = true: Substitute to get (q), (r), (q ∨ r), (¬q ∨ ¬r). Unit propagation sets q = true (from first clause), then r = true (from second). The third clause is satisfied, but the fourth becomes (false ∨ false), yielding an empty clause—unsatisfiable. Backtrack.
  • Branch p = false: Substitute to get empty (from first two clauses, satisfied), leaving (q ∨ r), (¬q ∨ ¬r). No units or pures; select q = true: (q ∨ r) is satisfied, (¬q ∨ ¬r) becomes ¬r. Unit propagation sets r = false—no conflict, clauses empty—satisfiable with p=false, q=true, r=false.
This trace shows how propagation detects conflicts early on one branch while finding a solution on the other after limited exploration.

CDCL and Modern Solvers

The conflict-driven clause learning (CDCL) algorithm represents a significant advancement in SAT solving, extending the Davis–Putnam–Logemann–Loveland (DPLL) backtracking procedure by incorporating mechanisms to analyze search failures and learn from them. Upon encountering a conflict—where unit propagation leads to an empty clause—CDCL performs conflict analysis to identify the causes of the failure, rather than simply backtracking chronologically. This analysis leverages the implication graph, a constructed during unit propagation where nodes represent literals and edges capture implications from clauses, to trace the sequence of decisions and propagations leading to the conflict. By examining the first unique implication point (1UIP) in this graph, the algorithm derives a new "learned" clause that generalizes the conflict, preventing similar failures in future searches. These learned clauses are added to the original formula, effectively pruning the search space. The CDCL framework was first introduced in the GRASP solver in the late 1990s, marking a shift toward more efficient, learning-based exact solving. A core innovation of CDCL is non-chronological , where the solver jumps back to an earlier decision level in the search tree based on the learned , rather than the most recent decision. This is guided by the asserting literal in the learned , which identifies the decision level to resume from, allowing the solver to avoid re-exploring irrelevant branches. learning itself proceeds via repeated resolution on the implication graph: starting from the conflicting , the algorithm resolves backward along unique implication paths until reaching the 1UIP, producing a that explains the conflict succinctly. For instance, consider a simple conflict where propagations from decisions d1d_1 and d2d_2 imply contradictory literals ll and ¬l\neg l; resolution might yield a learned like (¬d1¬d2x)( \neg d_1 \lor \neg d_2 \lor x ), where xx is the asserting literal, blocking the combination of d1d_1 and d2d_2 without xx. This ensures learned s are valid implications of the original and are typically short, enhancing efficiency. Modern CDCL solvers incorporate several key components to boost performance. Variable ordering heuristics, such as the Variable State Independent Decaying Sum (VSIDS), prioritize branching on variables involved in recent conflicts by maintaining a score that decays over time but boosts on conflict participation, dynamically adapting to the formula's . Restart strategies periodically reset the search to a shallow depth, preventing stagnation in deep but unpromising branches; for example, Glucose employs a dynamic policy based on the LBD (literal block distance) metric to measure "activity" and trigger restarts when progress slows. These elements, combined with efficient structures like two-watched literals for unit propagation, enable solvers to scale dramatically. Seminal implementations include MiniSat, a lightweight, extensible CDCL solver emphasizing simplicity and speed, and Glucose, which refines learning by predicting and prioritizing high-quality clauses using metrics like LBD to minimize redundant learning. Empirically, CDCL solvers have demonstrated remarkable success on industrial benchmarks, routinely solving instances with millions of variables and clauses that were intractable a decade earlier, despite the NP-hardness of SAT. For example, in the International SAT Competitions, top CDCL solvers like Glucose have resolved problems from hardware verification and software analysis containing up to 10 million variables in seconds on commodity hardware. This performance stems from the synergistic effect of learning, heuristics, and restarts, which exploit the modular structure prevalent in real-world formulas.

Local Search and Heuristics

Local search algorithms for the Boolean satisfiability problem (SAT) represent a class of incomplete, methods that explore the of possible variable assignments by iteratively making local changes to reduce the number of unsatisfied clauses. Unlike systematic approaches, these heuristics prioritize speed over completeness, making them particularly effective for large-scale instances where exact methods may timeout. They typically start from a and perform greedy or randomized flips of variable values to improve satisfaction, often incorporating restarts to escape local optima. The algorithm, introduced in , exemplifies basic hill-climbing local search for SAT. It begins with a random truth assignment and, for a fixed number of iterations or restarts, selects a variable flip that maximizes the reduction in unsatisfied clauses; if no such improving flip exists, it chooses randomly among all possible flips. This greedy strategy aims to minimize the number of unsatisfied clauses, terminating when zero are left (indicating ) or after a predefined limit. Empirical evaluations show GSAT performs well on structured problems but can get trapped in local minima on certain random instances. WalkSAT, a refinement of developed in 1993, enhances performance by balancing greedy and random moves to better navigate rugged search landscapes. In WalkSAT, for each unsatisfied clause, a variable is selected (often the one appearing in the fewest clauses to minimize disruption), and the flip is made greedily if it satisfies the clause without increasing unsatisfied clauses elsewhere; otherwise, a flips a variable from the clause regardless of global impact. This noise injection helps escape local optima, leading to superior empirical results on random 3-SAT instances compared to pure hill-climbing. Variants like Novelty and Adaptive Novelty further tune the based on recent history to avoid repeated failures. Local search extends naturally to approximation in the maximum satisfiability (MAX-SAT) problem, where the goal is to maximize satisfied clauses rather than achieve full satisfaction. A simple randomized achieves a 3/4- ratio in expectation for general MAX-SAT, by iteratively assigning variables to satisfy the maximum weighted fraction of currently unsatisfied clauses. For MAX-3-SAT specifically, this yields the same 3/4 ratio, providing a worst-case guarantee that is tight under standard complexity assumptions. Such methods are computationally efficient and often outperform exact solvers on overconstrained instances. Hybrid approaches combine local search with complete methods like CDCL solvers to leverage their complementary strengths, using local search for quick exploration and switching to exact methods on timeouts or promising partial assignments. For instance, the SatHyS framework integrates CDCL clause learning into local search by periodically adding learned clauses to guide flips, improving solution quality on industrial benchmarks while maintaining speed. These hybrids solve more instances than either method alone, particularly on mixed structured-random problems. Despite their efficiency, local search heuristics lack completeness guarantees, potentially missing solutions on unsatisfiable or highly structured instances where systematic search succeeds. However, they excel on random k-SAT instances near the , often solving millions of variables in seconds due to their anytime nature and low overhead. Ongoing research focuses on parameter tuning and parallelization to mitigate these limitations.

Extensions and Applications

MAX-SAT and Optimization

The (MAX-SAT) extends the decision version of SAT by seeking a truth assignment to the variables of a CNF that maximizes the number of satisfied clauses, rather than requiring all clauses to be satisfied. This formulation arises naturally when modeling problems with "soft" constraints, where some violations are tolerable if they allow more overall feasibility. In the weighted variant of MAX-SAT, each clause is assigned a positive weight, and the objective is to maximize the total weight of satisfied clauses, enabling finer-grained prioritization of constraints. MAX-SAT is NP-hard, as the decision problem of whether all clauses can be satisfied reduces directly to it in polynomial time, inheriting the NP-completeness of SAT. Even the restriction to clauses of size at most two (MAX-2-SAT) remains NP-hard. Despite this hardness, MAX-SAT admits algorithms; for instance, Goemans and Williamson (1994) developed a 3/4- algorithm for unweighted MAX-SAT using relaxations and randomized rounding, guaranteeing a solution whose value is at least three-quarters of the optimal. This ratio has been improved to approximately 0.797 through refinements combining and semidefinite techniques. Exact algorithms for MAX-SAT typically employ branch-and-bound frameworks, which systematically explore the search space while pruning branches based on upper bounds on the remaining unsatisfied clauses. For approaches, iterative local search methods, building on techniques like those for decision SAT, repeatedly flip variable assignments to incrementally increase the number of satisfied clauses until a local optimum is reached. Weighted MAX-SAT can be solved approximately by relaxing the integer program to a linear program and rounding the fractional solution, achieving ratios close to 0.8 in practice for many instances. MAX-SAT finds applications in VLSI design, where it optimizes circuit layouts by maximizing satisfied timing or constraints under limits. It is also used in scheduling tasks, such as generating flight or production schedules that maximize adherence to preferences while minimizing conflicts. For example, consider a weighted MAX-SAT instance with soft clauses representing optional preferences in a scheduling problem: clauses like (x1¬x2)(x_1 \lor \neg x_2) with weight 5 (preferring task 1 before task 2) and (x3)(x_3) with weight 3 (preferring task 3 on); an optimal assignment might satisfy both for a total weight of 8, or sacrifice one for feasibility in a larger formula.

Quantified Boolean Formulas

Quantified Boolean formulas (QBFs) extend propositional formulas by incorporating universal (\forall) and existential (\exists) quantifiers over variables, allowing the expression of more complex logical dependencies. Formally, a QBF is a formula in , consisting of a sequence of quantifiers followed by a quantifier-free matrix, typically a (CNF) clause set. For instance, the formula pq(p¬q)\forall p \exists q (p \lor \neg q) asserts that for every assignment to pp, there exists an assignment to qq that satisfies the disjunction. This structure generalizes the satisfiability problem (SAT), where SAT corresponds to the special case of a QBF with only existential quantifiers (\exists-QBF). The evaluation of a QBF proceeds sequentially through the quantifiers: universal quantifiers require the subformula to hold for all possible truth values of their variables, while existential quantifiers require at least one satisfying assignment; the process alternates based on the quantifier order, modeling a two-player game between universal and existential players. The for QBFs, denoted TQBF (true quantified Boolean formulas), asks whether a given QBF evaluates to true, and it is . This complexity result, established by Stockmeyer and Meyer, holds for QBFs in prenex CNF with arbitrary quantifier alternations; the membership in follows from a recursive evaluation that uses polynomial space, while hardness is shown via reduction from other problems. The number of quantifier alternations influences the precise complexity level: zero alternations (purely existential) yield (SAT), one alternation corresponds to , and increasing alternations climb the up to Σkp\Sigma_k^p or Πkp\Pi_k^p-completeness; unbounded alternations capture full . QBFs can be solved through techniques like recursive Skolemization, which eliminates existential quantifiers by replacing them with Skolem functions dependent on preceding universal variables, thereby reducing the formula to an equisatisfiable SAT instance that can be solved recursively. Alternatively, methods progressively simplify the formula by removing quantifiers while preserving . Modern QBF solvers, such as those implementing the quantified Davis-Putnam-Loveland-Longemann (QDPLL) algorithm, adapt (CDCL) from SAT solvers but incorporate dependency schemes to respect quantifier scopes and variable dependencies, enabling efficient propagation and learning across quantifier levels. The QDPLL framework, introduced by Zhang et al., extends search with these mechanisms to handle the universal-existential game structure effectively.

Circuit SAT and Real-World Uses

Circuit-SAT, or the circuit satisfiability problem, determines whether there exists an input assignment to a given —composed of AND, OR, and NOT gates—that evaluates to true at the output. This formulation is NP-complete, serving as a foundational problem in complexity theory via the Cook-Levin theorem. Unlike the standard CNF-SAT, Circuit-SAT inputs are naturally represented as circuits, which are often more compact for describing computational structures like hardware designs. To solve Circuit-SAT using CNF-based solvers, the circuit is typically encoded into (CNF) via the Tseitin transformation. This method introduces auxiliary variables for each gate's output, adding clauses that enforce the gate's semantics—for instance, for an with inputs aa and bb and output xx, it generates clauses (¬a¬bx)(\neg a \lor \neg b \lor x), (a¬x)(a \lor \neg x), and (b¬x)(b \lor \neg x), ensuring x(ab)x \leftrightarrow (a \land b). The resulting CNF formula is equisatisfiable to the original circuit, with a size linear in the circuit's gates, though it introduces additional variables. In hardware verification, SAT solvers encoded via Circuit-SAT are pivotal for and equivalence checking. uses SAT to verify whether a hardware satisfies temporal properties by unrolling transition relations into circuits and checking for counterexamples. For equivalence checking, a miter circuit combines a reference and an by XORing corresponding outputs and feeding identical inputs; the designs are equivalent if the miter output is unsatisfiable under SAT encoding. A representative example is verifying a ripple-carry : the miter connects two circuits (e.g., a 32-bit against a golden reference), and Tseitin transformation yields a CNF instance solvable by CDCL solvers to detect discrepancies. Bounded model checking extends this to software testing, encoding program executions up to a fixed depth as circuits unrolled over time steps, then reducing to SAT via Tseitin to detect bugs like assertion violations. In AI planning, classical planning problems are modeled as circuits representing state transitions across time steps, with SAT solving finding a satisfying plan trajectory. Cryptography employs Circuit-SAT for attack modeling, such as encoding stream ciphers like Trivium or hash functions like SHA-256 as circuits to search for weak keys or collisions via SAT solvers. The evolution of SAT solvers for these applications has been propelled by international SAT competitions, initiated in 1992 in , which benchmark solvers on diverse instances and foster algorithmic innovations like improved branching heuristics. These events, held annually since , evaluate performance on real-world benchmarks, driving solvers to handle industrial-scale Circuit-SAT instances with millions of variables and clauses, such as those from hardware verification suites. Despite advances, challenges persist in scaling to ultra-large instances, where variable clustering and community structure influence solver efficiency.

References

  1. Mar 1, 2014 · The Boolean Satisfiability Problem (SAT, for short) asks whether a given Boolean formula, with Boolean gates such as AND and NOT, has some ...Missing: definition | Show results with:definition
Add your contribution
Related Hubs
User Avatar
No comments yet.