lecture slides for mat 60556 part ii propositional logic
play

Lecture Slides for MAT-60556 PART II: Propositional logic, - PowerPoint PPT Presentation

Lecture Slides for MAT-60556 PART II: Propositional logic, deduction and other topics Henri Hansen September 11, 2014 1 Questions to ponder & review What do completeness and soundness mean in logic? Is it correct to say that a


  1. Lecture Slides for MAT-60556 PART II: Propositional logic, deduction and other topics Henri Hansen September 11, 2014 1

  2. Questions to ponder & review • What do completeness and soundness mean in logic? • Is it correct to say that a valid propositional formula is uninformative? • Is it correct to say that an unsatisfiable formula is trivial? 2

  3. Deductive proofs? • Let U = { A 1 , . . . , A n } . We have already shown that U | = A if and only if A 1 ∧ · · · ∧ A n → A is valid • Tableaux method could be used to show this valid- ity, but what if the set of axioms is infinite? • A decision procedure may not give any information about the relationship between axioms and theo- rems • We may be interested in the intermediate steps (lemmas) 3

  4. Deductive systems • A deductive system is a set of formulas called ax- ioms and a set of rules of inference • A proof in a deductive system is a sequence of for- mulas, A 1 , . . . , A n such that for each i , A i is either an axiom or inferred from a subset of A 1 , . . . A i − 1 . • Given a proof S = A 1 , . . . , A n , A n is a theorem and S is a proof of A n . • If a formula A has a proof, we say A is provable in the given system, denoted ⊢ A 4

  5. Genzen System G • An axiom of G is a set of literals U that contains a complementary pair • Rules of inference are similar to the α and β -rules of tableux, but they are ”‘reversed”’ (i.e., α in G is a β in tableaux, and vice versa) 1. If { α 1 , α 2 } ⊆ U 1 , then ( U 1 \{ α 1 , α 2 } ) ∪{ α } can be inferred 2. If { β 1 } ⊆ U 1 and { β 2 } ⊆ U 2 , then we can be infer ( U 1 \ { β 1 } ∪ U 2 \ { β 2 } ) ∪ { β } 5

  6. Genzen System (cont.) • The proofs in G can be thought of as ”upside down tableaux” • I.e., a closed tableaux that shows φ is UNSAT cor- responds to a proof of ¬ φ in G 1. axioms correspond to closed leaves (with literals negated) 2. Every node has a formula that is a negation of the corresponding formula in the tableaux 3. The ”‘theorem”’ is the negation of the root of the tableau 6

  7. Hilbert System H • The axioms of H (with the letters denoting arbitrary formulas) are 1. ⊢ ( A → ( B → A )) 2. ⊢ ( A → ( B → C )) → (( A → B ) → ( A → C )) 3. ⊢ ( ¬ B → ¬ A ) → ( A → B ) • The rule of inference of H is modus ponens 1. ( ⊢ A, ⊢ A → B ) ⇒ ⊢ B 7

  8. Hilbert System (cont.) • Proofs in H tend to be complicated, so we may wish to have additional rules, called derived rules • An example of a derived rule is the deduction rule , which says that ( U ∪ { A } ⊢ B ) ⇒ U ⊢ ( A → B ) • This is proven by induction over the length of the proof for U ∪ { A } ⊢ B , to show that the proof can always be transformed into a proof of U ⊢ ( A → B ) • Other important derived rules in H can be found in the book, such as the contrapositive rule, transitiv- ity rule, etc. 8

  9. Hilbert System (cont. II) • H is sound and complete, i.e., ⊢ A if and only if | = A • Soundness (only if) is proven by structural induc- tion, i.e., by showing that modus ponens preserves validity • Completeness is proven by transforming a closed tableau for ¬ A first into a proof of A in G and then showing that every proof in G can be transformed into a proof in H 9

  10. Proof of A → A in H 1. ⊢ ( A → (( A → A ) → A )) → (( A → ( A → A ) → ( A → A )) (axiom 2) 2. ⊢ A → (( A → A ) → A ) (axiom 1) 3. ⊢ ( A → ( A → A )) → ( A → A ) (MP 1, 2) 4. ⊢ A → ( A → A ) (axiom 1) 5. ⊢ A → A (MP 3, 4) 10

  11. Proving derived rules for H • Let us prove the deduction rule, i.e.: ( U ∪ { A } ⊢ B ) ⇒ U ⊢ ( A → B ) – This is done on the induction on the length of ( U ∪ { A } ⊢ B ) (which we call ”‘the proof”’) – For n = 1, B is proved in one step, so B must be an element of U ∪ { A } , an axiom, or a previously proved theorem – If B = A then ⊢ A → A by the previous theorem – Otherwise U ⊢ B is an axiom or theorem, U ⊢ B → ( A → B ) by axiom 1, and U ⊢ A → B by modus ponens 11

  12. • if n > 1, the last step of the proof is either one-step inference of B or the use of modus ponens. In the first case, it is equivalent to n = 1 • If MP is used, there must be a formula C such that U ∪ { A } ⊢ C and U ∪ { A } ⊢ C → B have been proven before B • By inductive hypothesis, U ⊢ A → C and U ⊢ A → ( C → B ). • We can then construct a proof of U ⊢ A → B : 1. U ⊢ A → C (inductive hypothesis)

  13. 2. U ⊢ A → ( C → B ) (inductive hypothesis) 3. U ⊢ ( A → ( C → B )) → (( A → C ) → ( A → B )) (axiom 2) 4. U ⊢ ( A → C ) → ( A → B ) (MP 2, 3) 5. U ⊢ A → B (MP 1, 4)

  14. Consistency • A set of formulas U is inconsistent if there exists a formula A such that U ⊢ A and U ⊢ ¬ A • U is inconsistent if and only if U ⊢ A for every for- mula A • U is consistent if and only if there exists some for- mula A such that U �⊢ A • U ⊢ A if and only if U ∪ {¬ A } is inconsistent 12

  15. Strong completenes and Compactness • A set of formulas S = { A 1 , . . . } is unsatisfiable if and only if some tableau for S closes • Let U be a countable set of formulas and A an arbitrary formula. If U | = A , then U ⊢ A • If S is a countable set of formulas such that every finite subset of S is satisfiable, then S is satisfiable • These (infinitary) properties of propositional logic will become important with first order logic 13

  16. Conjuctive normal form • A formula is in conjunctive normal form iff it is a conjunction of a disjunction of literals. • For example ( p ∨ ¬ q ∨ r ) ∧ ( ¬ p ∨ q ∨ r ) is CNF • Every formula in propositional logic can be given in CNF. This can be proven by giving rules that transform other operators to ∧ and ∨ , and then showing that these can be arranged into CNF • Conjunctive normal form is perhaps the most com- mon normal form; others exist 14

  17. Clausal form 1. A clause is a set of literals, considered as a disjunc- tion. A unit clause is a single literal, and the empty clause is the empty set of literals, denoted � . If the clause contains a literal and its negation it is trivial 2. A formula in clausal form is given as a set of clauses, and the formula is considered to be the conjunction of its clauses, and the empty set of clauses is de- noted ∅ • Every formula in propositional logic can be trans- formed into clausal form (like CNF) 15

  18. Clausal form notation • We denote a clause as a concatenation of literals so that an overbar denotes negation. For example p ¯ qr is a clause for ( p ∨ ¬ q ∨ r ) • The clausal form for a formula is given as a set of such clauses. For instance { p ¯ qr, ¯ pqr } • if l is a literal, we denote its complement with l c , i.e., if l = p then l c = ¯ p and vice versa • we generalize the concept of interpretation to clauses in the natural way 16

  19. Resolution • Resolution is a refutation procedure used to check if a clausal formula is unsatisfiable • The resolution rule: Let C 1 and C 2 be clauses such that l ∈ C 1 and l c ∈ C 2 . We say that C 1 and C 2 are clashing clauses , and they clash on l, l c . • The resolvent of clauses C 1 and C 2 that clash on l amd l c is the clause ( C 1 \ { l } ) ∪ ( C 2 \ { l c } ) • If two clauses clash on more than one literal, their resolvent is a trivial clause! 17

  20. Resolution (cont.) • The resolvent is satisfiable iff the parent clauses are satisfiable • Resolution algorithm for a set of clauses S : 1. Find clashing clauses { C 1 , C 2 } ⊆ S and compute their resolvent C 2. Discard C if trivial, otherwise add it to S (DO not remove C 1 and C 2 !!) 3. Terminate if C = � or no more clashing clauses, otherwise goto 1 18

  21. Example of resolution • Consider the formula ( p ∨ q ) ∧ ( p ∨ r ) ∧ ( q ∨ r ) ∧ ( ¬ p ∨ q ) ∧ ( ¬ r ∨ ¬ p ) ∧ ( r ∨ ¬ p ) • In clausal form, this is { pq, pr, qr, ¯ pq, ¯ r ¯ p, ¯ pr } • Resolution: 1. pq and ¯ pq clash on p , the resolvent is q : { pq, pr, qr, ¯ pr, q } pq, ¯ r ¯ p, ¯ 19

  22. 2. q and ¯ p ¯ q resolve into p , { pq, pr, qr, ¯ pq, ¯ r ¯ p, ¯ pr, q, p } 3. p and ¯ pr resolve into r , { pq, pr, qr, ¯ pq, ¯ r ¯ p, ¯ pr, q, p, r } 4. r and ¯ r ¯ p resolve into ¯ p , { pq, pr, qr, ¯ pq, ¯ r ¯ p, ¯ pr, q, p, r, ¯ p } 5. p and ¯ p resolve into � , so the formula is unsat.

  23. Resolution (cont. II) • We can think of the resolution algorithm as pro- ducing an “upside down” tree: The root is the last resolvent • Given two clashing clauses resolved, they are the children and the resolvent is the parent • The derivation of � from a set of clauses proves that the set is not satisfiable • Soundness and completeness are a bit hard to prove 20

  24. Binary Decision Diagrams • We make the distinction here: a formula is a tree, but the semantics (i.e., the meaning) of the formula is a boolean function • Binary decision diagram, or BDD, is data structure for representing the semantics of a formula • A formula is represented by a directed graph and an algorithm is used for reducing the graph • A formula is valid iff the BDD represents trivial T and unsatisfiable iff the BDD represents trivial F 21

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend