Lecture from: 18.12.2024 | Video: Videos ETHZ

Let us briefly recap where we are. We were given a set of formulas and wanted to see if a formula is logically entailed from the set of formulas, meaning if . In the extreme case, we can also ask if is a tautology, meaning it is logically entailed from no assumptions, i.e., (or simply ). Note that the aim is to prove things with as few assumptions as possible.

We also introduced a second formalism where we syntactically derive things, denoted as , in a calculus . The idea is that syntactic derivation steps should indeed preserve logical entailment (if the premises are true, the derived formula should also be true). This property is called soundness. Conversely, we also want that if something can be logically entailed, there exists a finite sequence of derivation steps to show that we can derive it syntactically. This property is called completeness.

These concepts (soundness and completeness) are generally true for all logical calculi. Last time, we focused on propositional logic and said that instead of dealing with logical connectives like , , , , etc., we can convert our formula to Conjunctive Normal Form (CNF) and look at it as a clause set in the context of the resolution calculus.

We also observed that checking the satisfiability of a formula in CNF corresponds to the SAT problem. We are particularly interested in unsatisfiability, as it’s generally a harder problem (for satisfiability, we just need to provide a single interpretation that makes the clause set true).

The current belief is that SAT NP, but UNSAT NP (or more precisely, UNSAT is co-NP-complete), meaning there is likely no efficient proof system that can provide short, easily verifiable proofs of unsatisfiability for arbitrary CNF formulas (unless P = NP, which is considered highly unlikely). This means given a clause set, while a “yes” answer to the SAT problem can be verified efficiently, a “no” answer is, in general, believed not to be verifiable in polynomial time.

Resolution Calculus

Let be a clause set. A clause is entailed by a clause set , written , if for any interpretation that makes all clauses in true (i.e., ), must also be true (i.e., ). In other words, if every clause in evaluates to 1 under , then must also evaluate to 1 under .

We also have the property that if , then . This holds because if , then at least one literal in must be true under the interpretation . Since contains all the literals of (and possibly more), that same literal will also be present in , and therefore . This shows that adding arbitrary literals to a clause results in a weaker (or equally strong) clause, as it becomes easier to satisfy. This is referred to as weakening.

If we have , then . More generally, if for every clause , we have , then we write . This means that any interpretation that satisfies all clauses in will also satisfy all clauses in . In terms of satisfiability, this also implies that if is satisfiable, then so is . The other way around is not true in general.

Resolution Rule

Recall the resolution rule. If we are given two clauses and such that there exists a literal where and , then we can apply the resolution rule. The resolvent of and with respect to is defined as:

The resolvent can maximally have a size of . We write the application of the resolution rule as:

The resolution calculus has only this single rule, i.e., .

Lemma 6.5: Soundness

If a clause can be derived from a clause set using the resolution rule, then is logically entailed by . Formally:

This is a lemma, and we need to prove it.

It suffices to show that a single application of the resolution rule preserves entailment. Let . We want to show that . If this is true, we can extend to any sequence of resolution steps, demonstrating .

Let us now justify the first part, i.e., show that .

Let be an arbitrary interpretation such that and . Since , there exists a literal such that and , and . We can perform a case distinction on the truth value of under :

  • Case 1: : Since and , there must exist another literal such that and . Since and , it follows that . Therefore, .

  • Case 2: : Since and , there must exist another literal such that and . Since and , it follows that . Therefore, .

In both cases, . Thus, under any interpretation where and , we also have . Therefore, . Because , by transitivity .

Theorem 6.6: Completeness of Resolution

We want to show that if a clause set is unsatisfiable, then we can derive the empty clause using resolution.

Let be a clause set. Then is unsatisfiable if and only if . (Recall that denotes the empty clause).

Proof:

"": (Soundness, already proven in Lemma 6.5, but we recap the argument for clarity.) Assume . From Lemma 6.5 (soundness of the resolution rule), we know that implies . The empty clause is unsatisfiable (vacuously false), since there exists no interpretation that can make it true. Since entails an unsatisfiable clause, must also be unsatisfiable.

"": (Completeness, this is what we show by induction) Assume is unsatisfiable. We want to prove that using induction on the number of distinct propositional variables (atoms) appearing in .

  • Base Case (Induction Base): Let be the number of distinct propositional variables in .

    • If , then is either (the empty set of clauses, which is satisfiable) or (contains the empty clause). Since we assumed is unsatisfiable, must be , and trivially .

    • If , contains only one propositional variable, say . The possible clauses are , , and . The only unsatisfiable sets of clauses from those are and any set containing . If we are in a set containing , then we are already done. Otherwise, must contain both and (or clauses that can be weakened to these). Applying resolution to and yields . Thus, .

  • Induction Hypothesis (I.H.): Assume that for any unsatisfiable clause set containing at most distinct propositional variables, .

  • Inductive Step: Let be an unsatisfiable clause set containing distinct propositional variables. Let be one of these variables. We construct two new clause sets, and , as follows:

    • : From , remove all clauses containing , and remove from the remaining clauses.
    • : From , remove all clauses containing , and remove from the remaining clauses.

    Formally, and .

    Since is unsatisfiable, both and are also unsatisfiable. (If either or were satisfiable, we could extend that satisfying interpretation to satisfy by assigning the appropriate truth value to ). Furthermore, and each contain at most distinct propositional variables (since we’ve eliminated ).

    By the induction hypothesis, and .

    Now, we want to show that . Since , there exists a sequence of resolution steps starting from clauses in that derives . We can “lift” this derivation to a derivation from : Replace each clause in the derivation from with if was not a step of the derivation. The same sequence of resolution steps will now derive (instead of ) from clauses in .

    Similarly, since , we can lift a derivation of from to a derivation of from clauses in .

    Finally, we can resolve and (which we derived from ) to obtain . Therefore, .

This completes the proof by induction.

3-SAT

The 3-SAT problem is a special case of the SAT problem where each clause contains exactly three literals. A formula in 3-CNF is a conjunction of clauses, where each clause is a disjunction of three literals.

Surprisingly, 3-SAT is also NP-complete. This means that although it appears more restricted than the general SAT problem (where clauses can have any number of literals), it is equally difficult in terms of computational complexity. In other words, there is no known polynomial-time algorithm for 3-SAT (unless P = NP), and any algorithm that can solve 3-SAT in polynomial time could be adapted to solve any other problem in NP in polynomial time. This equivalence in difficulty is established by showing that any SAT instance (with arbitrary clause lengths) can be converted into a 3-SAT instance in polynomial time, such that the 3-SAT instance is satisfiable if and only if the original SAT instance is satisfiable.

NP-Completeness

A problem is NP-complete if it satisfies two conditions:

  1. It is in NP: A problem is in the class NP (Nondeterministic Polynomial time) if a proposed solution (“yes” instance) can be verified in polynomial time. This means that given a potential solution, we can check whether it’s correct in a time that grows at most polynomially with the size of the input. For example, for SAT, given an assignment of truth values to variables, we can easily check in polynomial time if that assignment satisfies all clauses.

  2. It is NP-hard: A problem is NP-hard if every problem in NP can be reduced to it in polynomial time. This means that for any problem in NP, we can find a polynomial-time algorithm that transforms an instance of that problem into an instance of the NP-hard problem, such that the answer (“yes” or “no”) is preserved. In other words, the NP-hard problem is at least as difficult as any other problem in NP.

A problem that satisfies both of these conditions is called NP-complete. NP-complete problems are, in a sense, the “hardest” problems in NP. If we could find a polynomial-time algorithm for any NP-complete problem, we would have proven that P = NP, which would imply that all problems in NP have polynomial-time solutions.

This was the last lecture…