Definition
Satisfiability Problem
The SAT problem is a decision problem that, for a given formula , checks whether there exists a interpretation such that .
Tractable Classes
Horn Formulas
Solving Horn formulas is a tractable problem.
Krom Formula
Solving Krom formulas is a tractable problem.
Reductions
Reduction to CSP
The SAT problem can be reduced to a constraint satisfaction problem by translating Boolean variables into CSP variables and clauses into constraints.
Variables: Let be a Boolean formula with variables . The CSP instance uses exactly these variables as its variable set .
Domain: Each variable ranges over the domain , where represents and represents .
Constraints: For every clause of , add one constraint whose scope consists of the variables occurring in . Its relation contains exactly those tuples in that satisfy the clause. Hence the only excluded tuples are those that make all literals in the clause false.
Encoding a Clause as a Constraint
The clause
is encoded by a ternary constraint on whose relation is
The only forbidden tuple is , since it is the unique assignment for which , , and , making as well.
Correctness: A Boolean assignment satisfies if and only if the corresponding CSP assignment satisfies every constraint. Therefore the constructed CSP instance is satisfiable exactly when the original SAT instance is satisfiable.
Example
Logic Olympiad Puzzle
There were three finalists: Louis, Rene, and Johannes.
We use Boolean variables to denote a person and their placing.
person 1 2 3 Louis Rene Johannes Isaac reported that Louis won the olympiad, while Rene was second:
Albert reported that Johannes won the olympiad, while Louis was second:
Neither report was completely correct, and each report had one true and one false statement:
The hidden constraints are that exactly one contestant is first, exactly one is second, exactly one is third, and each contestant takes exactly one place. This yields a SAT instance with a unique model:
Hence, Johannes won, Rene was second, and Louis came third.
Unit Propagation
Definition
Link to originalUnit Propagation
Let be a set of clauses. Unit propagation is the repeated application of the following transformation.
If contains a unit clause, that is, a clause consisting of a single literal , then:
The process continues until no unit clause remains. At that point one of three situations holds:
- is empty: every clause was satisfied, so the original set is satisfiable.
- contains the empty clause : a contradiction was derived, so the original set is unsatisfiable.
- contains non-unit clauses only: no further simplification is possible without choosing a literal to branch on.
Intuitively, must be true, so every clause containing is already satisfied and can be discarded, while is false and can be deleted from every clause that contains it.