Tractable classes of satisfiability problems

We now discuss two special cases of satisfiability problems that can be solved in polynomial time, Horn SAT and 2-SAT. These problems define subclasses of general CNF formulas which satisfy some specific structure. By restricting the expressive power of the language, these subclasses of problems become easier to solve. The algorithms for solving these problems are essentially based on unit propagation.

Horn SAT

We begin with the relevant definitions for a Horn formula:

Lemma: Let be a set of unsatisfiable clauses. Then contains at least one positive clause and one negative clause.

Proof: Suppose that the formula contains no positive clause. Then every clause contains at least one negative literal. We can satisfy the formula with a truth assignment that assigns false to all of the variables.

Theorem: Let be a set of Horn clauses. Let be the set of clauses obtained by running unit propagation on . Then is satisfiable if and only if the empty clause does not belong to .

Proof (): If the empty clause belongs to , then cannot be satisfiable because unit propagation is sound.

Proof (): If is horn, then is also horn. Assume is unsatisfiable. By Lemma 1, contains at least 1 positive clause and 1 negative clause. A clause that is both positive and horn must either be a unit clause or an empty clause. We cannot derive a unit clause since we’ve run unit propagation until a fixed point, so there must exist an empty clause.

2-SAT

A formula is in k-CNF if it is in CNF and each clause has at most k literals. For example, the formula is in 2-CNF while is not in 2-CNF. The following algorithm can be used to determine the satisfiability of a 2-CNF formula in polynomial time.

  1. while is not empty do:
    1. if then
      1. if then return unsatisfiable
  2. Return satisfiable

Lemma: If is a 2-CNF formula in which the literal occurs, then either:

  1. UP contains the empty clause , so .
  2. UP is a proper subset of .

Proof: For each clause, we consider one of the three cases.

  1. If the clause contains , then the clause is satisfied.
  2. If the clause contains , then this clause becomes a unit clause and unit propagation is triggered.
  3. Otherwise, the clause remains unchanged.

Proof of correctness (): If the algorithm returns satisfiable, the formula is satisfiable since the algorithm relies on unit propagation and branching.

Proof of correctness (): Consider the formula at the beginning of the iteration in which we return unsatisfiable. Since is a 2-CNF formula, (meaning the set of clauses in is always a subset of the clauses in ), so if is unsatisfiable, then is unsatisfiable. We know that both and are unsatisfiable. This implies that is unsatisfiable, so is unsatisfiable.

Tractable classes of satisfiability problems - Volodymyr Kuleshov