Lecture from: 16.12.2024 | Video: Videos ETHZ
Example: Syntactic Derivation vs. Semantic Entailment
Lets recap the relationship between syntactic derivation () and semantic entailment (), focusing on how to determine if a given derivation is sound.
Soundness asks whether a syntactically correct derivation using a set of rules () also implies a semantically valid entailment. In simpler terms:
If we can derive from using the rules of our system (), does it logically follow that entails ()?
We’ll explore this through examples, analyzing whether the given derivations are sound.
Example 1:
Derivation:
Question: Is this derivation sound? Does hold?
Answer: Yes, this derivation is sound.
Reasoning: The left-hand side of the entailment, , represents a contradiction. There is no interpretation that can make both and true simultaneously. Since the premise is always false, the implication holds vacuously. In other words, a contradiction logically entails anything.
Example 2:
Derivation:
Question: Is this derivation sound? Does hold?
Answer: No, this derivation is not sound.
Reasoning: We need to find a counterexample – an interpretation where is true, but is false.
Counterexample: Let and . Then , but . Therefore, .
Example 3:
Derivation:
Question: Is this derivation sound? Does hold? In other words, is a tautology?
Answer: No, this derivation is not sound.
Reasoning: We need to find a counterexample where is false.
Counterexample: Let and . Then , and consequently, . Therefore, is not a tautology.
Example 4:
Derivation:
Question: Is this derivation sound? Does hold?
Answer: Yes, this derivation is sound.
Reasoning: Let’s consider an arbitrary interpretation where both and are true. If , then either or (or both). Since , we know . Therefore, if both premises are true, it must be the case that . If , then , regardless of the truth value of . Thus, under any interpretation where the premises are true, the conclusion is also true.
General Approach
To determine the soundness of a derivation , we need to check if holds. This involves:
- Understanding the Rules: Knowing the derivation rules () used in the syntactic derivation.
- Considering Interpretations: Analyzing whether there exists any interpretation where all formulas in are true, but is false.
- Constructing Counterexamples: If such an interpretation exists, we’ve found a counterexample, and the derivation is not sound.
- Demonstrating Entailment: If no such interpretation exists, the derivation is sound, and we need to demonstrate why holds, usually by considering the truth conditions of the formulas involved.
Example: Proving with a Logic Calculus
Let’s consider a logic calculus with the following derivation rules:
- R1:
- R2:
- R3:
We are given that these rules are sound.
Goal: Show that is derivable using these rules, where .
Note: We already know that holds (a contradiction entails anything). Our task here is to demonstrate this derivation syntactically using the given rules.
Derivation
Since the final goal is to derive , and R1 is the only rule that can directly derive a formula that is not an implication, our final step will likely involve R1.
Let’s work backward, aiming to use R3 and R2 to construct the necessary premises for R1.
-
(1)
- This is an instance of R3, with and .
-
(2)
- This is an instance of R2, with and .
-
(3)
- From (2) and the premise , we can derive using R1.
-
(4)
- From (1) and (3), we can derive using R1.
-
(5)
- This is an instance of R2, with and .
-
(6)
- From (5) and the premise , we can derive using R1.
-
(7)
- From (4) and (6), we can derive using R1.
Final Step:
Since we have derived using the premises and the rules , we can conclude:
Derived Rule:
This derivation demonstrates that we could add a new rule to our calculus:
- R4:
This rule would be sound, as we’ve shown that it can be derived from the existing sound rules R1, R2, and R3.
Sequent Calculus: An Alternative to Hilbert Calculi
The calculi we’ve examined so far, where we derive new formulas from existing ones using syntactic rules, are known as Hilbert-style calculi. There are other types of calculi, including sequent calculi.
Note: We won’t delve into the details of sequent calculi or natural deduction in this course, but it’s important to be aware that alternative formalisms for logical reasoning exist. They offer different perspectives and can be more convenient for certain types of proofs or applications.
Key Difference
Instead of manipulating sets of formulas, sequent calculi operate on sequents. A sequent is a pair , where and are sets of formulas. The intuitive reading of a sequent is that the conjunction of the formulas in entails the disjunction of the formulas in . We could write this as .
Derivation Rules
Derivation rules in a sequent calculus transform sequents into other sequents:
A rule of this form can be read as follows:
If all sequents are given for , then we can derive the sequent .
This notation is similar to the notation from before, but now and themselves are sets of formulas.
Correctness
The correctness of such a rule means that if the premise sequents are valid (i.e., the conjunction of formulas on the left-hand side entails the disjunction of formulas on the right-hand side), then the conclusion sequent must also be valid.
Natural Deduction
One example of a sequent calculus is natural deduction. Natural deduction systems aim to mimic the way humans reason naturally, often using introduction and elimination rules for each logical connective.
Resolution Calculus for Propositional Logic
We’ll now explore the resolution calculus, a proof system specifically designed for formulas in Conjunctive Normal Form (CNF). Recall that a formula in CNF is a conjunction of clauses, where each clause is a disjunction of literals.
Visualizing CNF
Example:
The formula in CNF can be represented as a set of clauses:
Clause Sets and Satisfiability
Technically, a clause set represents an equivalence class of formulas, as the order of clauses and literals within a clause doesn’t affect the formula’s meaning.
We can check the satisfiability of a clause set by finding an interpretation that makes all clauses true. For example, in the clause set above, the interpretation , , satisfies all clauses.
The SAT Problem
The SAT problem asks whether a given formula in CNF (or equivalently, a clause set) is satisfiable. This problem is NP-complete, meaning it’s considered computationally difficult to solve in general.
Proving Unsatisfiability
While finding a satisfying interpretation demonstrates satisfiability, proving unsatisfiability is generally much harder. There is no known efficient proof system that can provide short, easily verifiable proofs of unsatisfiability for arbitrary CNF formulas (unless , which is considered unlikely). This is analogous to the difficulty of proving primality versus proving compositeness by simply finding a factor.
Why Focus on Unsatisfiability?
Proving unsatisfiability is a powerful technique because it makes a statement about all possible interpretations. It asserts that no interpretation can satisfy the formula. This is a much stronger claim than demonstrating satisfiability, which only requires finding a single satisfying interpretation.
Connection to Tautologies
To check if a formula is a tautology, we can negate it (), convert it to CNF, and then check for unsatisfiability. If in CNF is unsatisfiable, then is a tautology. This is because a formula is a tautology if and only if its negation is unsatisfiable.
The Resolution Rule
The resolution calculus for propositional logic in CNF has a single inference rule, called the resolution rule.
Rule Definition
The resolution rule states that from two clauses containing a complementary literal (one containing and the other containing ), we can derive a new clause called the resolvent.
More formally:
Let and be two clauses, and let be a literal such that and . Then the resolvent of and with respect to is:
We write this as:
Example:
Consider the clauses and . We can resolve these clauses on the literal , obtaining the resolvent:
Important: The resolution rule eliminates only one complementary pair of literals at a time.
Resolution and Unsatisfiability
The resolution calculus is particularly useful for proving the unsatisfiability of a clause set.
Empty Clause and Unsatisfiability
- If we can derive the empty clause (denoted by or ) from a clause set using the resolution rule, then the original clause set is unsatisfiable.
- An empty set of clauses is always satisfiable (it imposes no constraints) and is a tautology. An empty clause is always false and is hence unsatisfiable.
Why the Empty Clause Implies Unsatisfiability
The empty clause represents a contradiction. It’s a disjunction with no literals, meaning it cannot be satisfied by any interpretation. If we can derive the empty clause, it means the original set of clauses logically entails a contradiction, and therefore, it must be unsatisfiable. This is because the resolution rule preserves satisfiability, meaning if the resolvent is satisfiable, then the clauses from which is derived are also satisfiable, which is a contradiction, since the empty clause is not satisfiable.
In the next lecture, we will prove the soundness and completeness of the resolution calculus, demonstrating that it’s a correct and complete proof system for propositional logic in CNF.
Examples of Resolution
Example 1: Continuing the Previous Example
Let’s continue with the clause set from our previous example:
We can apply the resolution rule as follows:
- Resolve and on to get .
- Resolve and on to get .
The derivation is visualized below:
Example 2: Logical Consequence
Let’s revisit the example from the beginning of the chapter:
Formulas:
Question: Is a logical consequence of this set of formulas?
Approach:
- Convert to CNF: We’ll convert each formula to CNF.
- Negate the Goal: Since we want to show that the formulas entail , we’ll add to our clause set.
- Apply Resolution: We’ll apply the resolution rule repeatedly, attempting to derive the empty clause. If we succeed, it means the original set of formulas, together with , is unsatisfiable, implying that the original formulas entail .
Conversion to CNF:
-
- Clauses:
-
- Clause:
-
- Clause:
-
- Clause:
-
- Clause:
-
- Clauses:
-
(Negated goal)
- Clause:
Clause Set:
Now we can apply the resolution rule to this clause set, attempting to derive the empty clause. If we succeed, we’ve proven that the original formulas entail .
Let’s apply the resolution rule.
Derivation:
Conclusion:
Since we derived the empty clause, we have shown that the set of formulas is unsatisfiable. This means that the original set of formulas, together with the negation of , leads to a contradiction. Therefore, the original formulas do entail .
Limitations of Resolution
While resolution is a powerful technique, it has limitations:
- Combinatorial Explosion: The number of possible clauses that can be formed from atomic formulas is exponential (roughly , considering that each literal can be positive, negative, absent or present both as a positive and negative). In the worst case, we might need to explore all possible resolvents before deriving the empty clause or determining that it’s not derivable.
- Efficiency: While resolution is complete (it will always find the empty clause if the formula is unsatisfiable), there’s no guarantee of efficiency. Finding a short resolution proof can be challenging. It is not guaranteed that there exists an efficient derivation, and finding an efficient derivation is even more difficult.
Open Questions:
Whether there exist more efficient, general-purpose methods for proving unsatisfiability remains a major open question in computer science. The potential existence of such methods is closely tied to the P versus NP problem.
Despite its limitations, resolution remains a fundamental technique in automated theorem proving and has practical applications in areas like software verification and artificial intelligence. It provides a systematic way to reason about propositional logic formulas in CNF and to determine their satisfiability or unsatisfiability.