logic
play

Logic Charles L Dodgson 1832 - 1898 It s so easy even - PowerPoint PPT Presentation

IIT Bombay :: Autumn 2020 :: CS 207 :: Discrete Structures :: Manoj Prabhakaran Logic Charles L Dodgson 1832 - 1898 It s so easy even Quantifiers computers can do it! Predicates & Propositions Winged(x) Flies(x) Pink(x) x


  1. IIT Bombay :: Autumn 2020 :: CS 207 :: Discrete Structures :: Manoj Prabhakaran Logic Charles L Dodgson 
 1832 - 1898 It’ s so easy even Quantifiers computers can do it!

  2. Predicates & Propositions Winged(x) Flies(x) Pink(x) x Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE A predicate is a column in this table A proposition like Winged(Alice) refers to a single cell. Can build more complex propositions using propositional calculus (formulas) Next: Propositions involving quantifiers.

  3. Quantified Propositions (First-Order) Predicate Calculus Winged(x) Flies(x) Pink(x) x Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE ∈ AIW Flamingo TRUE TRUE TRUE All characters in AIW are winged. (False!) ∀ x Winged(x) For every character x in AIW, Winged(x) holds Some character in AIW is winged. (True) ∃ x Winged(x) There exists a character x in AIW, such that Winged(x) holds

  4. Quantified Propositions (First-Order) Predicate Calculus Winged(x) Flies(x) Pink(x) x Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE ∀ x Winged(x) Quantifiers: To what “extent” does a predicate evaluate to TRUE in the domain of discourse Universal quantifier, ∀ ∃ x Winged(x) Existential quantifier, ∃

  5. Quantified Propositions (First-Order) Predicate Calculus Winged(x) Flies(x) Pink(x) x Alice FALSE FALSE FALSE Jabberwock TRUE TRUE FALSE Flamingo TRUE TRUE TRUE Could write ∀ x Winged(x) as: Winged(Alice) ∧ Winged(J’wock) ∧ Winged(Flamingo) And ∃ x Winged(x) as: Winged(Alice) ∨ Winged(J’wock) ∨ Winged(Flamingo) But need to list the entire domain (works only if finite)

  6. Examples Winged(x) → Winged(x) Flies(x) Pink(x) Winged(x) ↔ Flies(x) Pink(x) → Flies(x) x ¬Flies(x) TRUE Alice FALSE FALSE FALSE TRUE TRUE Jabberwock TRUE TRUE FALSE TRUE TRUE FALSE TRUE Flamingo TRUE TRUE TRUE FALSE TRUE is True ∀ x Winged(x) ↔ Flies(x) ∃ x Winged(x) → ¬Flies(x) is True ∀ x Pink(x) → Flies(x) is True

  7. Quantified Propositions (First-Order) Predicate Calculus Winged(x) Flies(x) Pink(x) ¬Winged(x) x Alice FALSE FALSE FALSE TRUE Jabberwock TRUE TRUE FALSE FALSE Flamingo TRUE TRUE TRUE FALSE ∀ x Winged(x) is False Not everyone is winged Same as saying, there is someone who is not winged ¬( W(a) ∧ W(j) ∧ W(f) ) i.e., ∃ x ¬Winged(x) is True ≡ ¬ ( ∀ x W(x) ) ≡ ∃ x ¬W(x) ¬W(a) ∨ ¬W(j) ∨ ¬W(f)

  8. Predicates, again A predicate can be defined over any number of elements from the domain e.g., Likes(x,y): “x likes y” x,y Likes(x,y) Alice, Alice TRUE Alice, Jabberwock FALSE Alice, Flamingo TRUE Jabberwock, Alice FALSE Jabberwock, Jabberwock TRUE Jabberwock, Flamingo FALSE Flamingo, Alice FALSE Flamingo, Jabberwock FALSE Flamingo, Flamingo TRUE

  9. Two quantifiers x,y Likes(x,y) Alice, Alice TRUE Alice, Jabberwock FALSE Alice, Flamingo TRUE Jabberwock, Alice FALSE Jabberwock, Jabberwock TRUE Jabberwock, Flamingo FALSE Flamingo, Alice FALSE Flamingo, Jabberwock FALSE Flamingo, Flamingo TRUE And we can quantify all the variables of a predicate e.g. ∀ x,y Likes(x,y) Everyone likes everyone False!

  10. Two quantifiers x,y Likes(x,y) Alice, Alice TRUE Alice, Jabberwock FALSE Alice, Flamingo TRUE Jabberwock, Alice FALSE Jabberwock, Jabberwock TRUE Jabberwock, Flamingo FALSE Flamingo, Alice FALSE Flamingo, Jabberwock FALSE Flamingo, Flamingo TRUE ∀ x ∃ y Likes(x,y) Order of Everyone likes someone (True) quantifiers is ∃ y ∀ x Likes(x,y) important! Someone is liked by everyone (False)

  11. Two quantifiers ∃ y Likes(x,y) x y Likes(x,y) i.e., LikesSomeone(x) Alice TRUE Alice TRUE Jabberwock FALSE Flamingo TRUE Alice FALSE Jabberwock TRUE Jabberwock TRUE Flamingo FALSE Alice FALSE Flamingo Jabberwock FALSE TRUE Flamingo TRUE ∀ x ∃ y Likes(x,y) Everyone likes someone ∀ x LikesSomeone(x) True

  12. Moving the Quantifiers ∀ x ∀ y P(x,y) ≡ ∀ y ∀ x P(x,y) for all pairs (x,y), P(x,y) holds ∃ x ∃ y P(x,y) ≡ ∃ y ∃ x P(x,y) for some pair (x,y), P(x,y) holds Below R is a proposition not involving x ∀ x P(x) ∨ R ≡ ( ∀ x P(x) ) ∨ R R evaluates to True or False (indep of x) Scope of x extends to When R is True, both equivalent (to True) the end: ∀ x (P(x) ∨ R) Also, when R is False, both equivalent i.e., if domain is {a 1 ,…,a N } Hence both equivalent (P(a 1 ) ∨ R) ∧ … ∧ (P(a N ) ∨ R)

  13. Moving the Quantifiers ∀ x ∀ y P(x,y) ≡ ∀ y ∀ x P(x,y) for all pairs (x,y), P(x,y) holds ∃ x ∃ y P(x,y) ≡ ∃ y ∃ x P(x,y) for some pair (x,y), P(x,y) holds Below R is a proposition not involving x ∀ x P(x) ∨ R ≡ ( ∀ x P(x) ) ∨ R ∃ x P(x) ∨ R ≡ ( ∃ x P(x) ) ∨ R ∀ x P(x) ∧ R ≡ ( ∀ x P(x) ) ∧ R ∃ x P(x) ∧ R ≡ ( ∃ x P(x) ) ∧ R ∀ x R → P(x) ≡ R → ( ∀ x P(x) ) ∃ x R → P(x) ≡ R → ( ∃ x P(x) ) ∀ x P(x) → R ≡ ( ∃ x P(x)) → R ∃ x P(x) → R ≡ ( ∀ x P(x)) → R ∀ x ¬P(x) ∨ R ≡ ( ∀ x ¬P(x)) ∨ R ≡ ¬ ( ∃ x P(x)) ∨ R

  14. Moving the Quantifiers ∀ x ∀ y P(x,y) ≡ ∀ y ∀ x P(x,y) for all pairs (x,y), P(x,y) holds ∃ x ∃ y P(x,y) ≡ ∃ y ∃ x P(x,y) for some pair (x,y), P(x,y) holds Below R is a proposition not involving x ∀ x P(x) ∨ R ≡ ( ∀ x P(x) ) ∨ R ∃ x P(x) ∨ R ≡ ( ∃ x P(x) ) ∨ R ∀ x P(x) ∧ R ≡ ( ∀ x P(x) ) ∧ R ∃ x P(x) ∧ R ≡ ( ∃ x P(x) ) ∧ R ∀ x R → P(x) ≡ R → ( ∀ x P(x) ) ∃ x R → P(x) ≡ R → ( ∃ x P(x) ) ∀ x P(x) → R ≡ ( ∃ x P(x)) → R ∃ x P(x) → R ≡ ( ∀ x P(x)) → R ( ∀ x P(x)) ∧ ( ∀ x Q(x)) ≡ ∀ x (P(x) ∧ Q(x)) P Q ( ∃ x P(x)) ∨ ( ∃ x Q(x)) ≡ ∃ x (P(x) ∨ Q(x)) ( ∀ x P(x)) ∨ ( ∀ x Q(x)) ≡ ( ∀ x P(x)) ⋁ ( ∀ y Q(y)) ≡ ∀ x ( P(x) ⋁ ( ∀ y Q(y)) ) ≡ ∀ x ( ∀ y (P(x) ⋁ Q(y)) ) ≡ ∀ x ∀ y (P(x) ⋁ Q(y))

  15. Moving the Quantifiers ∀ x ∀ y P(x,y) ≡ ∀ y ∀ x P(x,y) for all pairs (x,y), P(x,y) holds ∃ x ∃ y P(x,y) ≡ ∃ y ∃ x P(x,y) for some pair (x,y), P(x,y) holds Below R is a proposition not involving x ∀ x P(x) ∨ R ≡ ( ∀ x P(x) ) ∨ R ∃ x P(x) ∨ R ≡ ( ∃ x P(x) ) ∨ R ∀ x P(x) ∧ R ≡ ( ∀ x P(x) ) ∧ R ∃ x P(x) ∧ R ≡ ( ∃ x P(x) ) ∧ R ∀ x R → P(x) ≡ R → ( ∀ x P(x) ) ∃ x R → P(x) ≡ R → ( ∃ x P(x) ) ∀ x P(x) → R ≡ ( ∃ x P(x)) → R ∃ x P(x) → R ≡ ( ∀ x P(x)) → R ( ∀ x P(x)) ∧ ( ∀ x Q(x)) ≡ ∀ x (P(x) ∧ Q(x)) ( ∃ x P(x)) ∨ ( ∃ x Q(x)) ≡ ∃ x (P(x) ∨ Q(x)) ( ∀ x P(x)) ∨ ( ∀ x Q(x)) ≡ ∀ x ∀ y P(x) ⋁ Q(y) ( ∃ x P(x)) ⋀ ( ∃ x Q(x)) ≡ ∃ x ∃ y P(x) ⋀ Q(y) ¬( ∃ x P(x)) ≡ ∀ x ¬P(x) ¬( ∀ x P(x)) ≡ ∃ x ¬P(x) ∄ x P(x)

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