1 / 22

Advanced Topics in Propositional Logic

Language, Proof and Logic. Advanced Topics in Propositional Logic. Chapter 17. 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} .

matt
Télécharger la présentation

Advanced Topics in Propositional Logic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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. Truth assignments and truth tables

  3. 17.1.b Truth assignments and truth tables 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.

  4. 17.2.a • FT --- the portion of F that only contains the rules for ,,,,,. • The Completeness Theorem for FT: • 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 FT: Completeness for propositional logic Every formally consistent set of sentences is tt-satisfiable.

  5. 17.2.b Thus, we want to prove the following theorem: Completeness for propositional logic 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.

  6. 17.2.c Completeness for propositional logic 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Siff 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.

  7. 17.2.d Completeness for propositional logic 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.

  8. 17.2.e Completeness for propositional logic 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).

  9. 17.2.f Completeness for propositional logic Proposition 6: Every formally consistent set  of sentences can be expanded to a formally consistent, formally complete set. Proof: p. 492. Let A1,A2,... be the list of all atoms, alphabetically. Go through these, and whenever you encounter Aisuch that neither it nor its negation is derivable from , add Ai 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 Aiwhich made the set inconsistent. If adding Aito a set makes the set inconsistent, then, by Lemma 2, the set derives the negation of Ai, in which case, however, we would not have added Ai.

  10. 17.2.g Completeness for propositional logic 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.

  11. 17.3.a A Horn Sentence is a conjunction of sentences, where each conjunct has one of the following three forms, with Ai, B being atomic: (1) B (2) A1…An  B (3) A1…An   Horn Sentences (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)   database goal

  12. 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 involve 2n 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. Horn Sentences

  13. 17.3.c • Suppose we have a Horn sentence S whose atoms are A1,…, An. The satisfaction algorithm for S goes as follows: • 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. • If there is a conjunct of the form Ai, assign T to Ai, i.e., write T in the reference column under Ai. Repeat this as long as possible. • If there is a conjunct of the form (B1…Bk)A where you have assigned T to each of B1,…,Bk, then assign T to A. Repeat this as long as possible. • If there is a conjunct of the form (B1…Bk)where you have assigned T to each of B1,…,Bk, declareSunsatisfiable. 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) Horn Sentences unsatisfiable T T T T satisfiable T T F F Theorem: This algorithm is correct: is classifies as satisfiable exactly the satisfiable Horn sentences.

  14. 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 P1 ,…, Pn iff the set {P1 ,…, Pn , S} is not satisfiable – that is to say, the conjunction of its elements is not satisfiable. Resolution

  15. 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. Resolution

  16. 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 C1 and C2 are clauses: C1 = { Small(a), Cube(a), BackOf(b,a) } C2 = { 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. Resolution

  17. 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 the 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′. Resolution

  18. 17.4.e • The Resolution Method: • 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 • Call the set of all these clauses S. The aim now is to show (or fail to show) that S is unsatisfiable. • 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. Resolution

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

  20. 17.4.g Definition: A clause R is a resolvent of clauses C1 and C2 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 } □ Resolution

  21. 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 } Resolution

  22. 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. Resolution

More Related