Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.

Similar presentations


Presentation on theme: "Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic."— Presentation transcript:

1

2 Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic

3 Truth assignments and truth tables 17.1.a A truth assignment for a first-order language is a function h from the set of all atomic sentences of the language into the set {T,F}. Intuitively, such an h represents one row of the reference columns of a large truth table. Every assignment h extends to a function h defined for all (propositional) sentences by: 1. h(Q) = h(Q) if Q is atomic; 2. h(Q  R) = T iff h(Q)=T and h(R)=T; 3. h(Q  R) = T iff h(Q)=T or h(R)=T, or both; 4. h(Q  R)=T iff h(Q)=F or h(R)=T, or both; 5. h(Q  R)=T iff h(Q)=h(R). Such an h can be thought of as a single full row of a combined truth table for all sentences.

4 Truth assignments and truth tables 17.1.b A sentence S is a tautology iff, for every truth assignment h, h(S)=T, i.e. every truth assignment makes S true. More generally, S is a tautological consequence of a set  of sentences iff every truth assignment that makes all the sentences in  true also makes S true. A sentence S is tt-satisfiable iff there is a truth assignment h s.t. h(S)=T, i.e. there is a truth assignment that makes S true. Similarly, a set  of sentences tt-satisfiable iff there is a truth assignment that makes all the sentences in  true. Proposition 1. The sentence S is a tautological consequence of the set  of sentences iff the set  {  S} is not tt-satisfiable.

5 Completeness for propositional logic 17.2.a F T --- the portion of F that only contains the rules for , , , , , . The Completeness Theorem for F T : If a sentence S is a tautological consequence of a set  of sentences, then  - T S. We say that a set  of sentences is formally inconsistent iff   - T . Lemma 2.  - T S iff  {  S} is formally inconsistent. Proof: easy, p.487. Combining Lemma 2, Proposition 1 and applying contraposition, the above completeness theorem is equivalent to the following: An Equivalent Formulation of the Completeness Theorem for F T : Every formally consistent set of sentences is tt-satisfiable.

6 Completeness for propositional logic 17.2.b Thus, we want to prove the following theorem: Theorem: Every formally consistent set of sentences is tt-satisfiable. We say that a set  of sentences is formally complete iff, for every sentence S,  - T S or  - T  S. Proof outline for the Theorem: First we show that the Theorem holds for formally consistent sets of sentences that are also formally complete (Proposition 4). Next we show that every formally consistent set of sentences can be expanded to a formally consistent and complete set (Proposition 6). Now, the Theorem is an immediate consequence of the above two Propositions.

7 Completeness for propositional logic 17.2.c Lemma 3: Let  be a formally consistent, formally complete set of sentences, and let R and S be any sentences of the language. Then: 1.  - T (R  S) iff  - T R and  - T S. 2.  - T (R  S) iff  - T R or  - T S. 3.  - T  S iff not  - T S. 4.  - T (R  S) iff not  - T R, or  - T S. 5.  - T (R  S) iff both  - T R and  - T S, or neither  - T R nor  - T S. Proof: p. 489.

8 Completeness for propositional logic 17.2.d Proposition 4: Every formally consistent, formally complete set  of sentences is tt-satisfiable. Proof: p. 491. It goes like this: Assume  is as above. For each atomic A, define h(A)=T iff  - T A. Then, by induction on the complexity of sentences, prove that, for every sentence S, h(S)=T iff  - T S. Lemma 3 will be used here. The above means that h makes every sentence of  true. So,  is tt-satisfiable.

9 Completeness for propositional logic 17.2.e Lemma 5: A set  of sentences is formally complete iff, for every atomic sentence A,  - T A or  - T  A. Proof: p. 491-2. The direction from left to right is trivial. For the other direction, assume  settles/decides every atomic sentence. We proceed by induction on sentences, where the above assumption serves as a basis of induction. For the inductive step for A  B, assume (inductive hypothesis) that  settles both A and B. The cases with other connectives are similar. If  derives either A or B, then, by  Intro, we get a proof of A  B. Otherwise, by the inductive hypothesis,  derives both  A and  B. From this, one can easily find (proof by contradiction) that  - T  (A  B).

10 Completeness for propositional logic 17.2.f Proposition 6: Every formally consistent set  of sentences can be expanded to a formally consistent, formally complete set. Proof: p. 492. Let A 1,A 2,... be the list of all atoms, alphabetically. Go through these, and whenever you encounter A i such that neither it nor its negation is derivable from , add A i to . In view of Lemma 5, you will end up with a formally complete set. To see that the same set is also formally consistent, suppose, for a contradiction, that it is not. Consider the step of adding an A i which made the set inconsistent. If adding A i to a set makes the set inconsistent, then, by Lemma 2, the set derives the negation of A i, in which case, however, we would not have added A i.

11 Completeness for propositional logic 17.2.g Compactness Theorem for Propositional Logic: Let  be any set of sentences of propositional logic. If every finite subset of  is tt-satisfiable, then so is  itself. Proof: We prove the contrapositive of the claim. Assume  is not tt-satisfiable. Then, by the Completeness Theorem,  is formally inconsistent, i.e. it derives . Obviously then some finite subset  of  derives . By the Soundness Theorem,  is not tt-satisfiable. Thus, there is a finite subset of  that is not tt-satisfiable.

12 Horn Sentences 17.3.a A Horn Sentence is a conjunction of sentences, where each conjunct has one of the following three forms, with A i, B being atomic: (1) B (2) A 1  …  A n  B (3) A 1  …  A n   (n≥1;  is an always-false sentence) E.g., the conjunction of the following sentences is a Horn sentence: Even(a) Odd(b) Even(a)  Odd(b)  Odd(a+b) Odd(a+b)   databasegoal

13 Horn Sentences 17.3.b Why are Horn sentences special? Using the truth table method, we can check if a sentence is satisfiable. However, this method of checking arbitrary formulas for satisfiability which involves n atomic sentences, will have to involve 2 n computations corresponding to rows in the sentence’s truth table – this is computationally very expensive! But for Horn sentences, we have an efficient algorithm for testing satisfiability. This algorithm is efficient because, in fact, it restricts attention to a single row of a sentence’s truth table.

14 Horn Sentences 17.3.c Suppose we have a Horn sentence S whose atoms are A 1,…, A n. The satisfaction algorithm for S goes as follows: 1.Start out as though you were going to build a truth table, by listing all the atomic sentences in in a row, followed by S. But do not write T or F beneath any of them yet. 2.If there is a conjunct of the form A i, assign T to A i, i.e., write T in the reference column under A i. Repeat this as long as possible. 3.If there is a conjunct of the form (B 1  …  B k )  A where you have assigned T to each of B 1,…,B k, then assign T to A. Repeat this as long as possible. 4.If there is a conjunct of the form (B 1  …  B k )  where you have assigned T to each of B 1,…,B k, declare S unsatisfiable. Otherwise declare it satisfiable.  A  B  C  D  A  (A  B)  (A  B  C)  (A  B  C  D)  (D  )  A  B  C  D  A  (A  B)  (A  B  C  D)  (D  ) Theorem: This algorithm is correct: it classifies as satisfiable exactly the satisfiable Horn sentences. TTTT unsatisfiable TT satisfiable FF

15 Resolution 17.4.a People are generally good at figuring out when one sentence is a tautological consequence of another. But what about computer programs? We need a reliable and efficient algorithm for determining when one sentence is a tautological consequence of another (think about when you use Taut Con in Fitch, it determines the answer pretty quickly! It uses an algorithm that is reasonably efficient in average case.) Recall that S is a tautological consequence of premises P 1,…, P n iff the set {P 1,…, P n,  S} is not satisfiable – that is to say, the conjunction of its elements is not satisfiable.

16 Resolution 17.4.b The resolution method is a method that can be applied to arbitrary sentences in CNF. It is not, in general, as efficient as the Horn sentence algorithm, but is, in general, much more efficient than the brute force method of checking truth tables. Its advantages include that it extends to first-order logic.

17 Resolution 17.4.c The basic notion in resolution is that of a set of clauses. A clause is any finite set of literals. For example, the following sets C 1 and C 2 are clauses: C 1 = {  Small(a), Cube(a), BackOf(b,a) } C 2 = { Small(a), Cube(b) } The special notation □ is used for the empty clause. A truth assignment is considered to satisfy a clause iff it makes at least one of its literals true. Note that, hence, the empty clause can not be satisfied. A non-empty set S of clauses is said to be satisfied by the truth assignment h provided each clause in S is satisfied by h. This is equivalent to saying that the CNF sentence formed by conjoining the disjunctions formed from clauses of S is satisfied by h.

18 Resolution 17.4.d The goal of logicians’ work on the resolution method has been to find as efficient algorithm as possible that will determine whether a set of clauses is satisfiable. An insight of the theory: in trying to show that a particular set S is not satisfiable, it is often easier to show that a larger set S′ derived from the set S is not satisfiable. As long as the method of getting S′ from S insures that the two sets are satisfied by the same assignments, we can work with the larger set S′.

19 Resolution 17.4.e The Resolution Method: 1.Start with a set T of sentences in CNF which you hope to show is not satisfiable. Transform each of these sentences into a set of clauses: replace disjunctions of literals by clauses made up of the same literals replace the conjunction by the set of those clauses 2.Call the set of all these clauses S. The aim now is to show (or fail to show) that S is unsatisfiable. 2.To show that S is unsatisfiable, systematically add clauses to the set in such a way that the resulting set is satisfied by the same assignments as the old set (the added clauses are called resolvents of the old clauses.) If you get a set of clauses which contains □ (and so cannot be satisfied), then you know that the original set S could not be satisfied.

20 Resolution 17.4.f Example: Let C 1, C 2, and C 3 be the following clauses: C 1 = { Home(max), Home(claire) } C 2 = {  Home(claire) } C 3 = {  Home(max) } Note that in order for an assignment to satisfy both C 1 and C 2, it must satisfy the clause C 4 = { Home(max) } Thus we can put the resolvent C 4 into our set of clauses. But note that {C 1, C 2, C 3, C 4 } cannot be satisfied, as C 3 and C 4 are in conflict. So the original set is not satisfiable.

21 Resolution 17.4.g Definition: A clause R is a resolvent of clauses C 1 and C 2 if there is an atomic sentence in one of the clauses whose negation is in the other clause, and if R is the set of all the other literals in either clause. Examples (A, B, C, and D are atomic): { A, D} {  A } { D } { B, C } {  B,  D } { C,  D } { D } {  D } □

22 Resolution 17.4.h Theorem (Soundness and Completeness of resolution): A set S of clauses is unsatisfiable iff one arrives at □ by successive resolutions. Here’s an example which illustrates the resolution method. Suppose S is the following sentence in CNF:  A  (B  C  B)  (  C   D)  (A  D)  (  B   D) Applying Step 1, we convert the sentence S to the following clauses: {  A }, { B, C }, {  C,  D }, { A, D }, {  B,  D }

23 Resolution 17.4.i Successive applications of Step 2 is illustrated as follows: { B, C } {  C,  D } { A, D } {  A } { B,  D } {  B,  D } { D } {  D } □ Since this set of clauses resolves to the empty clause, we know that the original set of sentences, in this case, the sentence S, is not satisfiable. A figure like the one above is sometimes called a proof by resolution.


Download ppt "Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic."

Similar presentations


Ads by Google