g22 2390 001 logic in computer science fall 2009 lecture 2
play

G22.2390-001 Logic in Computer Science Fall 2009 Lecture 2 1 - PowerPoint PPT Presentation

G22.2390-001 Logic in Computer Science Fall 2009 Lecture 2 1 Review Last week Propositional Logic: Syntax Well-Formed Formulas ( wffs ) Induction and Recursion 2 Outline Recognizing Well-Formed Formulas Propositional


  1. Complex truth tables Truth tables can also be used to calculate all possible values of v for a given wff : We associate a column with each propositional symbol and a column with each propositional connective. There is a row for each possible truth assignment to the propositional connectives. ( A 1 ∨ ( A 2 ∧ ¬ A 3 )) A 1 A 2 A 3 T T T T T T F F T T F T T T T T T F T T T F F F T F F T T F F T F T T F F T F F F T F F T T T T F F T F F F F F F F F F F F F T 11-c

  2. Definitions If α is a wff , then a truth assignment v satisfies α if v ( α ) = T . 12

  3. Definitions If α is a wff , then a truth assignment v satisfies α if v ( α ) = T . A wff α is satisfiable if there exists some truth assignment v which satisfies α . 12-a

  4. Definitions If α is a wff , then a truth assignment v satisfies α if v ( α ) = T . A wff α is satisfiable if there exists some truth assignment v which satisfies α . Suppose Σ is a set of wffs . Then Σ tautologically implies α , Σ | = α , if every truth assignment which satisfies each formula in Σ also satisfies α . 12-b

  5. Definitions If α is a wff , then a truth assignment v satisfies α if v ( α ) = T . A wff α is satisfiable if there exists some truth assignment v which satisfies α . Suppose Σ is a set of wffs . Then Σ tautologically implies α , Σ | = α , if every truth assignment which satisfies each formula in Σ also satisfies α . Particular cases: • If ∅ | = α , then we say α is a tautology or α is valid and write | = α . 12-c

  6. Definitions If α is a wff , then a truth assignment v satisfies α if v ( α ) = T . A wff α is satisfiable if there exists some truth assignment v which satisfies α . Suppose Σ is a set of wffs . Then Σ tautologically implies α , Σ | = α , if every truth assignment which satisfies each formula in Σ also satisfies α . Particular cases: • If ∅ | = α , then we say α is a tautology or α is valid and write | = α . • If Σ is unsatisfiable , then Σ | = α for every wff α . 12-d

  7. Definitions If α is a wff , then a truth assignment v satisfies α if v ( α ) = T . A wff α is satisfiable if there exists some truth assignment v which satisfies α . Suppose Σ is a set of wffs . Then Σ tautologically implies α , Σ | = α , if every truth assignment which satisfies each formula in Σ also satisfies α . Particular cases: • If ∅ | = α , then we say α is a tautology or α is valid and write | = α . • If Σ is unsatisfiable , then Σ | = α for every wff α . • If α | = β (shorthand for { α } | = β ) and β | = α , then α and β are tautologically equivalent . 12-e

  8. Definitions If α is a wff , then a truth assignment v satisfies α if v ( α ) = T . A wff α is satisfiable if there exists some truth assignment v which satisfies α . Suppose Σ is a set of wffs . Then Σ tautologically implies α , Σ | = α , if every truth assignment which satisfies each formula in Σ also satisfies α . Particular cases: • If ∅ | = α , then we say α is a tautology or α is valid and write | = α . • If Σ is unsatisfiable , then Σ | = α for every wff α . • If α | = β (shorthand for { α } | = β ) and β | = α , then α and β are tautologically equivalent . • Σ | = α if and only if � (Σ) → α is valid. 12-f

  9. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) 13

  10. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. 13-a

  11. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) 13-b

  12. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. 13-c

  13. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. • { A, A → B } | = B • { A, ¬ A } | = ( A ∧ ¬ A ) 13-d

  14. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. • { A, A → B } | = B • { A, ¬ A } | = ( A ∧ ¬ A ) • ¬ ( A ∧ B ) is tautologically equivalent to ¬ A ∨ ¬ B 13-e

  15. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. • { A, A → B } | = B • { A, ¬ A } | = ( A ∧ ¬ A ) • ¬ ( A ∧ B ) is tautologically equivalent to ¬ A ∨ ¬ B Suppose you had an algorithm SAT which would take a wff α as input and return true if α is satisfiable and false otherwise. How would you use this algorithm to verify each of the claims made above? 13-f

  16. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. • { A, A → B } | = B ( A ∧ ( A → B ) ∧ ( ¬ B )) • { A, ¬ A } | = ( A ∧ ¬ A ) • ¬ ( A ∧ B ) is tautologically equivalent to ¬ A ∨ ¬ B Suppose you had an algorithm SAT which would take a wff α as input and return true if α is satisfiable and false otherwise. How would you use this algorithm to verify each of the claims made above? 13-g

  17. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. • { A, A → B } | = B ( A ∧ ( A → B ) ∧ ( ¬ B )) • { A, ¬ A } | = ( A ∧ ¬ A ) ( A ∧ ( ¬ A ) ∧ ¬ ( A ∧ ¬ A )) • ¬ ( A ∧ B ) is tautologically equivalent to ¬ A ∨ ¬ B Suppose you had an algorithm SAT which would take a wff α as input and return true if α is satisfiable and false otherwise. How would you use this algorithm to verify each of the claims made above? 13-h

  18. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. • { A, A → B } | = B ( A ∧ ( A → B ) ∧ ( ¬ B )) • { A, ¬ A } | = ( A ∧ ¬ A ) ( A ∧ ( ¬ A ) ∧ ¬ ( A ∧ ¬ A )) • ¬ ( A ∧ B ) is tautologically equivalent to ¬ A ∨ ¬ B ¬ ( ¬ ( A ∧ B ) ↔ ( ¬ A ∨ ¬ B )) Suppose you had an algorithm SAT which would take a wff α as input and return true if α is satisfiable and false otherwise. How would you use this algorithm to verify each of the claims made above? 13-i

  19. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. • { A, A → B } | = B ( A ∧ ( A → B ) ∧ ( ¬ B )) • { A, ¬ A } | = ( A ∧ ¬ A ) ( A ∧ ( ¬ A ) ∧ ¬ ( A ∧ ¬ A )) • ¬ ( A ∧ B ) is tautologically equivalent to ¬ A ∨ ¬ B ¬ ( ¬ ( A ∧ B ) ↔ ( ¬ A ∨ ¬ B )) Now suppose you had an algorithm CHECKVALID which returns true when α is valid and false otherwise. How would you verify the claims given this algorithm? 14

  20. Examples • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) is satisfiable, but not valid. • ( A ∨ B ) ∧ ( ¬ A ∨ ¬ B ) ∧ ( A ↔ B ) is unsatisfiable. • { A, A → B } | = B ( A ∧ ( A → B ) ∧ ( ¬ B )) • { A, ¬ A } | = ( A ∧ ¬ A ) ( A ∧ ( ¬ A ) ∧ ¬ ( A ∧ ¬ A )) • ¬ ( A ∧ B ) is tautologically equivalent to ¬ A ∨ ¬ B ¬ ( ¬ ( A ∧ B ) ↔ ( ¬ A ∨ ¬ B )) Now suppose you had an algorithm CHECKVALID which returns true when α is valid and false otherwise. How would you verify the claims given this algorithm? Satisfiability and validity are dual notions: α is unsatisfiable if and only if ¬ α is valid. 14-a

  21. Determining Satisfiability using Truth Tables An Algorithm for Satisfiability To check whether α is satisfiable, form the truth table for α . If there is a row in which T appears as the value for α , then α is satisfiable. Otherwise, α is unsatisfiable. 15

  22. Determining Satisfiability using Truth Tables An Algorithm for Satisfiability To check whether α is satisfiable, form the truth table for α . If there is a row in which T appears as the value for α , then α is satisfiable. Otherwise, α is unsatisfiable. An Algorithm for Tautological Implication To check whether { α 1 , . . . , α k } | = β , check the satisfiability of ( α 1 ∧ . . . ∧ α k ) ∧ ( ¬ β ) . If it is unsatisfiable, then { α 1 , . . . , α k } | = β , otherwise { α 1 , . . . , α k } �| = β . 15-a

  23. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) 16

  24. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C 16-a

  25. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C F F F F T T T T T 16-b

  26. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C F F F F T T T T T F F T F T T T T T 16-c

  27. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C F F F F T T T T T F F T F T T T T T F T F F T T F F F 16-d

  28. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C F F F F T T T T T F F T F T T T T T F T F F T T F F F F T T F T T T T F 16-e

  29. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C F F F F T T T T T F F T F T T T T T F T F F T T F F F F T T F T T T T F T F F F F F F T T 16-f

  30. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C F F F F T T T T T F F T F T T T T T F T F F T T F F F F T T F T T T T F T F F F F F F T T T F T F F F F T T 16-g

  31. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C F F F F T T T T T F F T F T T T T T F T F F T T F F F F T T F T T T T F T F F F F F F T T T F T F F F F T T T T F F T F F F F 16-h

  32. Determining Satisfiability using Truth Tables Example A ∧ (( B ∨ ¬ A ) ∧ ( C ∨ ¬ B )) ∧ ∨ ¬ A ) ∧ ∨ ¬ B )) A B C A (( B ( C F F F F T T T T T F F T F T T T T T F T F F T T F F F F T T F T T T T F T F F F F F F T T T F T F F F F T T T T F F T F F F F T T T T T F T T F 16-i

  33. Determining Satisfiability using Truth Tables What is the complexity of this algorithm? 17

  34. Determining Satisfiability using Truth Tables What is the complexity of this algorithm? 2 n where n is the number of propositional symbols. 17-a

  35. Determining Satisfiability using Truth Tables What is the complexity of this algorithm? 2 n where n is the number of propositional symbols. Can you think of a way to speed up these algorithms? 17-b

  36. Determining Satisfiability using Truth Tables What is the complexity of this algorithm? 2 n where n is the number of propositional symbols. Can you think of a way to speed up these algorithms? In an upcoming lecture, we will discuss some of the applications and best-known techniques for the SAT algorithm. 17-c

  37. Some tautologies Associative and Commutative laws for ∧ , ∨ , ↔ 18

  38. Some tautologies Associative and Commutative laws for ∧ , ∨ , ↔ Distributive Laws • ( A ∧ ( B ∨ C )) ↔ (( A ∧ B ) ∨ ( A ∧ C )) . • ( A ∨ ( B ∧ C )) ↔ (( A ∨ B ) ∧ ( A ∨ C )) . 18-a

  39. Some tautologies Associative and Commutative laws for ∧ , ∨ , ↔ Distributive Laws • ( A ∧ ( B ∨ C )) ↔ (( A ∧ B ) ∨ ( A ∧ C )) . • ( A ∨ ( B ∧ C )) ↔ (( A ∨ B ) ∧ ( A ∨ C )) . Negation • ¬¬ A ↔ A • ¬ ( A → B ) ↔ ( A ∧ ¬ B ) • ¬ ( A ↔ B ) ↔ (( A ∧ ¬ B ) ∨ ( ¬ A ∧ B )) 18-b

  40. Some tautologies Associative and Commutative laws for ∧ , ∨ , ↔ Distributive Laws • ( A ∧ ( B ∨ C )) ↔ (( A ∧ B ) ∨ ( A ∧ C )) . • ( A ∨ ( B ∧ C )) ↔ (( A ∨ B ) ∧ ( A ∨ C )) . Negation • ¬¬ A ↔ A • ¬ ( A → B ) ↔ ( A ∧ ¬ B ) • ¬ ( A ↔ B ) ↔ (( A ∧ ¬ B ) ∨ ( ¬ A ∧ B )) De Morgan’s Laws • ¬ ( A ∧ B ) ↔ ( ¬ A ∨ ¬ B ) • ¬ ( A ∨ B ) ↔ ( ¬ A ∧ ¬ B ) 18-c

  41. More Tautologies Implication • ( A → B ) ↔ ( ¬ A ∨ B ) 19

  42. More Tautologies Implication • ( A → B ) ↔ ( ¬ A ∨ B ) Excluded Middle • A ∨ ¬ A 19-a

  43. More Tautologies Implication • ( A → B ) ↔ ( ¬ A ∨ B ) Excluded Middle • A ∨ ¬ A Contradiction • ¬ ( A ∧ ¬ A ) 19-b

  44. More Tautologies Implication • ( A → B ) ↔ ( ¬ A ∨ B ) Excluded Middle • A ∨ ¬ A Contradiction • ¬ ( A ∧ ¬ A ) Contraposition • ( A → B ) ↔ ( ¬ B → ¬ A ) 19-c

  45. More Tautologies Implication • ( A → B ) ↔ ( ¬ A ∨ B ) Excluded Middle • A ∨ ¬ A Contradiction • ¬ ( A ∧ ¬ A ) Contraposition • ( A → B ) ↔ ( ¬ B → ¬ A ) Exportation • (( A ∧ B ) → C ) ↔ ( A → ( B → C )) 19-d

  46. Propositional Connectives We have five connectives: ¬ , ∧ , ∨ , → , ↔ . Would we gain anything by having more? Would we lose anything by having fewer? 20

  47. Propositional Connectives We have five connectives: ¬ , ∧ , ∨ , → , ↔ . Would we gain anything by having more? Would we lose anything by having fewer? Example: Ternary Majority Connective # E # ( α, β, γ ) = (# αβγ ) v ((# αβγ )) = T iff the majority of v ( α ) , v ( β ) , and v ( γ ) are T . 20-a

  48. Propositional Connectives We have five connectives: ¬ , ∧ , ∨ , → , ↔ . Would we gain anything by having more? Would we lose anything by having fewer? Example: Ternary Majority Connective # E # ( α, β, γ ) = (# αβγ ) v ((# αβγ )) = T iff the majority of v ( α ) , v ( β ) , and v ( γ ) are T . What does this new connective do for us? 20-b

  49. Propositional Connectives We have five connectives: ¬ , ∧ , ∨ , → , ↔ . Would we gain anything by having more? Would we lose anything by having fewer? Example: Ternary Majority Connective # E # ( α, β, γ ) = (# αβγ ) v ((# αβγ )) = T iff the majority of v ( α ) , v ( β ) , and v ( γ ) are T . What does this new connective do for us? Claim: The extended language obtained by allowing this new symbol has the same expressive power as the original language. 20-c

  50. Propositional Connectives We have five connectives: ¬ , ∧ , ∨ , → , ↔ . Would we gain anything by having more? Would we lose anything by having fewer? Example: Ternary Majority Connective # E # ( α, β, γ ) = (# αβγ ) v ((# αβγ )) = T iff the majority of v ( α ) , v ( β ) , and v ( γ ) are T . What does this new connective do for us? Claim: The extended language obtained by allowing this new symbol has the same expressive power as the original language. How do we show this formally? 20-d

  51. Boolean Functions For k ≥ 0 , a k -place Boolean function is a function from { F , T } k to { F , T } . A Boolean function then is anything which is a k -place Boolean function for some k . Each wff α determines a corresponding Boolean function B α . For example, if α = A 1 ∧ A 2 , then B α is a 2 -place Boolean function whose value is given by the following table. B α ( X 1 , X 2 ) X 1 X 2 T T T T F F F T F F F F 21

  52. Realizing Boolean Functions In general, suppose that α is a wff whose propositional symbols are included in A 1 , . . . , A n . We define an n -place Boolean function B n α , the Boolean function realized by α as B n α ( X 1 , . . . , X n ) = the truth value given to α when A 1 , . . . , A n are given the values X 1 , . . . , X n . 22

  53. Realizing Boolean Functions In general, suppose that α is a wff whose propositional symbols are included in A 1 , . . . , A n . We define an n -place Boolean function B n α , the Boolean function realized by α as B n α ( X 1 , . . . , X n ) = the truth value given to α when A 1 , . . . , A n are given the values X 1 , . . . , X n . In other words, B n α ( X 1 , . . . , X n ) = v ( α ) where v ( A i ) = X i . 22-a

  54. Realizing Boolean Functions In general, suppose that α is a wff whose propositional symbols are included in A 1 , . . . , A n . We define an n -place Boolean function B n α , the Boolean function realized by α as B n α ( X 1 , . . . , X n ) = the truth value given to α when A 1 , . . . , A n are given the values X 1 , . . . , X n . In other words, B n α ( X 1 , . . . , X n ) = v ( α ) where v ( A i ) = X i . Note that the function B n α is determined by both the formula α and the choice of n . In particular, α does not need to include all the symbols in A 1 , . . . , A n . 22-c

  55. Examples • I n i = B n A i • N = B 1 ¬ A 1 • K = B 2 A 1 ∧ A 2 • A = B 2 A 1 ∨ A 2 • C = B 2 A 1 → A 2 • E = B 2 A 1 ↔ A 2 23

  56. Examples • I n i = B n A i • N = B 1 ¬ A 1 • K = B 2 A 1 ∧ A 2 • A = B 2 A 1 ∨ A 2 • C = B 2 A 1 → A 2 • E = B 2 A 1 ↔ A 2 From these functions, we can construct others by composition. B 2 ¬ A 1 ∨¬ A 2 ( X 1 , X 2 ) = A ( N ( I 2 1 ( X 1 , X 2 )) , N ( I 2 2 ( X 1 , X 2 ))) 23-a

  57. Examples • I n i = B n A i • N = B 1 ¬ A 1 • K = B 2 A 1 ∧ A 2 • A = B 2 A 1 ∨ A 2 • C = B 2 A 1 → A 2 • E = B 2 A 1 ↔ A 2 From these functions, we can construct others by composition. B 2 ¬ A 1 ∨¬ A 2 ( X 1 , X 2 ) = A ( N ( I 2 1 ( X 1 , X 2 )) , N ( I 2 2 ( X 1 , X 2 ))) Claim: Every Boolean function can be obtained as a composition of I , N , K , A , C , and E . We will explain why this is true shortly. 23-b

  58. Formulas and the Boolean Functions they Realize Theorem Let α and β be wffs whose sentence symbols are among A 1 , . . . , A n . α ( � β ( � X ) for all � = β iff B n X ) ≤ B n X ∈ { F , T } n . (a) α | (b) α is tautologically equivalent to β iff B n α = B n β . = β iff the range of B n (c) | β = { T } . 24

  59. Formulas and the Boolean Functions they Realize Theorem Let α and β be wffs whose sentence symbols are among A 1 , . . . , A n . α ( � β ( � X ) for all � = β iff B n X ) ≤ B n X ∈ { F , T } n . (a) α | (b) α is tautologically equivalent to β iff B n α = B n β . = β iff the range of B n (c) | β = { T } . Proof (a) α | = β every truth assignment satisfying α also satisfies β iff for every truth assignment v , v ( α ) = T implies v ( β ) = T iff for all n -tuples � α ( � β ( � X , B n X ) = T implies B n X ) = T iff for all n -tuples � α ( � β ( � X , B n X ) ≤ B n X ) iff (b) Follows from (a) and X = Y iff X ≤ Y and Y ≤ X . ✷ (c) Follows from definition of tautology. 24-a

  60. Formulas and the Boolean Functions they Realize Theorem Let α and β be wffs whose sentence symbols are among A 1 , . . . , A n . α ( � β ( � X ) for all � = β iff B n X ) ≤ B n X ∈ { F , T } n . (a) α | (b) α is tautologically equivalent to β iff B n α = B n β . = β iff the range of B n (c) | β = { T } . Proof (a) α | = β every truth assignment satisfying α also satisfies β iff for every truth assignment v , v ( α ) = T implies v ( β ) = T iff for all n -tuples � α ( � β ( � X , B n X ) = T implies B n X ) = T iff for all n -tuples � α ( � β ( � X , B n X ) ≤ B n X ) iff (b) Follows from (a) and X = Y iff X ≤ Y and Y ≤ X . ✷ (c) Follows from definition of tautology. By shifting our focus from formulas to Boolean functions, tautologically equivalent wffs are identified. 24-b

  61. Completeness of Propositional Connectives Theorem (Post 1921) Let G be an n -place Boolean function, n ≥ 1 . There exists a wff α such that G = B n α , i.e., such that α realizes the function G . 25

  62. Completeness of Propositional Connectives Theorem (Post 1921) Let G be an n -place Boolean function, n ≥ 1 . There exists a wff α such that G = B n α , i.e., such that α realizes the function G . Proof If the range of G is just { F } , then let α = A 1 ∧ ¬ A 1 . Clearly, B n α = G . Otherwise, G = T somewhere. Suppose there are k points where G = T : G ( X 11 , X 12 , . . . , X 1 n ) = T G ( X 21 , X 22 , . . . , X 2 n ) = T . . . G ( X k 1 , X k 2 , . . . , X kn ) = T � if X ij = T A j = β ij Let ¬ A j if X ij = F β i 1 ∧ . . . ∧ β in γ i = = γ 1 ∨ γ 2 ∨ . . . ∨ γ k α Then α realizes G 25-a

  63. Completeness of Propositional Connectives Proof, continued α ( � We know that B n X ) = v ( α ) where v ( A i ) = X i . α ( � γ i ( � Since α = γ 1 ∨ γ 2 ∨ . . . ∨ γ k , it follows that B n X ) = max( B n X )) . γ i ( � X ) = T iff � But by construction, B n X = � X i 1 , . . . , X in � . α ( � X ) = T iff � Thus B n X is one of the points where G is T . ✷ 26

  64. Completeness of Propositional Connectives Proof, continued α ( � We know that B n X ) = v ( α ) where v ( A i ) = X i . α ( � γ i ( � Since α = γ 1 ∨ γ 2 ∨ . . . ∨ γ k , it follows that B n X ) = max( B n X )) . γ i ( � X ) = T iff � But by construction, B n X = � X i 1 , . . . , X in � . α ( � X ) = T iff � Thus B n X is one of the points where G is T . ✷ This shows that every Boolean function can be realized by a wff . In fact, every Boolean function can be realized by a wff which uses only the connectives {¬ , ∧ , ∨} . We say that this set of connectives is complete . The realizing formula is not unique. The formula built is in so-called disjunctive normal form (DNF). A formula is in DNF if it is a disjunction of formulas, each of which is a conjunction of literals , where a literal is either a propositional symbol or its negation. Thus, a corollary is that for every wff , there exists a tautologically equivalent wff in disjunctive normal form. 26-a

  65. Completeness of Propositional Connectives Example Let G be a 3 -place Boolean function defined as follows: G ( F , F , F ) = F G ( F , F , T ) = T G ( F , T , F ) = T G ( F , T , T ) = F G ( T , F , F ) = T G ( T , F , T ) = F G ( T , T , F ) = F G ( T , T , T ) = T 27

  66. Completeness of Propositional Connectives Example Let G be a 3 -place Boolean function defined as follows: G ( F , F , F ) = F G ( F , F , T ) = T G ( F , T , F ) = T G ( F , T , T ) = F G ( T , F , F ) = T G ( T , F , T ) = F G ( T , T , F ) = F G ( T , T , T ) = T There are four points at which G is true, so a DNF formula which realizes G is ( ¬ A 1 ∧¬ A 2 ∧ A 3 ) ∨ ( ¬ A 1 ∧ A 2 ∧¬ A 3 ) ∨ ( A 1 ∧¬ A 2 ∧¬ A 3 ) ∨ ( A 1 ∧ A 2 ∧ A 3 ) . 27-a

  67. Completeness of Propositional Connectives Example Let G be a 3 -place Boolean function defined as follows: G ( F , F , F ) = F G ( F , F , T ) = T G ( F , T , F ) = T G ( F , T , T ) = F G ( T , F , F ) = T G ( T , F , T ) = F G ( T , T , F ) = F G ( T , T , T ) = T There are four points at which G is true, so a DNF formula which realizes G is ( ¬ A 1 ∧¬ A 2 ∧ A 3 ) ∨ ( ¬ A 1 ∧ A 2 ∧¬ A 3 ) ∨ ( A 1 ∧¬ A 2 ∧¬ A 3 ) ∨ ( A 1 ∧ A 2 ∧ A 3 ) . Note that another formula which realizes G is A 1 ↔ A 2 ↔ A 3 . Thus, adding additional connectives to a complete set may allow a function to be realized more concisely. 27-b

  68. Completeness of Propositional Connectives Recall our definition of some basic Boolean functions: • I n i = B n A i • N = B 1 ¬ A 1 • K = B 2 A 1 ∧ A 2 • A = B 2 A 1 ∨ A 2 Given that {¬ , ∧ , ∨} is complete, it is not hard to see that any Boolean function can be constructed using only the Boolean functions I , N , K , and A . 28

  69. Completeness of Propositional Connectives Recall our definition of some basic Boolean functions: • I n i = B n A i • N = B 1 ¬ A 1 • K = B 2 A 1 ∧ A 2 • A = B 2 A 1 ∨ A 2 Given that {¬ , ∧ , ∨} is complete, it is not hard to see that any Boolean function can be constructed using only the Boolean functions I , N , K , and A . In fact, we can do better. It turns out that {¬ , ∧} and {¬ , ∨} are complete as well. 28-a

  70. Completeness of Propositional Connectives Recall our definition of some basic Boolean functions: • I n i = B n A i • N = B 1 ¬ A 1 • K = B 2 A 1 ∧ A 2 • A = B 2 A 1 ∨ A 2 Given that {¬ , ∧ , ∨} is complete, it is not hard to see that any Boolean function can be constructed using only the Boolean functions I , N , K , and A . In fact, we can do better. It turns out that {¬ , ∧} and {¬ , ∨} are complete as well. Why? 28-b

  71. Completeness of Propositional Connectives Recall our definition of some basic Boolean functions: • I n i = B n A i • N = B 1 ¬ A 1 • K = B 2 A 1 ∧ A 2 • A = B 2 A 1 ∨ A 2 Given that {¬ , ∧ , ∨} is complete, it is not hard to see that any Boolean function can be constructed using only the Boolean functions I , N , K , and A . In fact, we can do better. It turns out that {¬ , ∧} and {¬ , ∨} are complete as well. Why? α ∨ β ↔ ¬ ( ¬ α ∧ ¬ β ) α ∧ β ↔ ¬ ( ¬ α ∨ ¬ β ) Using these identities, the completeness can be easily proved by induction. 28-c

  72. Incompleteness of Connectives To prove that some set of connectives is incomplete, we find a property that is true of all wffs built using those connectives, but that is not true for some Boolean function. 29

  73. Incompleteness of Connectives To prove that some set of connectives is incomplete, we find a property that is true of all wffs built using those connectives, but that is not true for some Boolean function. Example {∧ , →} is not complete. 29-a

  74. Incompleteness of Connectives To prove that some set of connectives is incomplete, we find a property that is true of all wffs built using those connectives, but that is not true for some Boolean function. Example {∧ , →} is not complete. Proof Let α be a wff which uses only these connectives, and let v be a truth assignment such that v ( A i ) = T for all A i . We prove by induction that v ( α ) = T . 29-b

  75. Incompleteness of Connectives To prove that some set of connectives is incomplete, we find a property that is true of all wffs built using those connectives, but that is not true for some Boolean function. Example {∧ , →} is not complete. Proof Let α be a wff which uses only these connectives, and let v be a truth assignment such that v ( A i ) = T for all A i . We prove by induction that v ( α ) = T . Base Case v ( A i ) = v ( A i ) = T . 29-c

  76. Incompleteness of Connectives To prove that some set of connectives is incomplete, we find a property that is true of all wffs built using those connectives, but that is not true for some Boolean function. Example {∧ , →} is not complete. Proof Let α be a wff which uses only these connectives, and let v be a truth assignment such that v ( A i ) = T for all A i . We prove by induction that v ( α ) = T . Base Case v ( A i ) = v ( A i ) = T . Inductive Case v ( β ∧ γ ) = min( v ( β ) , v ( γ )) = min( T , T ) = T v ( β → γ ) = max( T − v ( α ) , v ( β )) = max( F , T ) = T 29-d

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