Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Like this presentation? Why not share!

- Predicate Logic by giki67 39788 views
- Knowledge representation and Predic... by Amey Kerkar 9021 views
- Knowledge representation in AI by Vishal Singh 16752 views
- Predicate Logic (Artificial intelli... by Vivek Garg 884 views
- Knowledge Representation in Artific... by Yasir Khan 7078 views
- Issues in knowledge representation by Sravanthi Emani 12227 views

2,755 views

Published on

Published in:
Technology

License: CC Attribution License

No Downloads

Total views

2,755

On SlideShare

0

From Embeds

0

Number of Embeds

18

Shares

0

Downloads

107

Comments

0

Likes

1

No embeds

No notes for slide

- 1. Predicate logic www.tudorgirba.com
- 2. Boolean algebra Propositional logic 0, 1 True, False boolean variables: a∈{0, 1} atomic formulas: p∈{True,False} boolean operators: ¬ ∧ ∨ logical connectives: ¬ ∧ ∨ boolean functions: 0, 1 boolean variables if a is a boolean function, then ¬a is a boolean function if a and b are boolean functions, then a∧b, a∨b, a b, a b are boolean functions propositional formulas (propositions): True and False atomic formulas if a is a propositional formula, then ¬a is a propositional formula if a and b are propositional formulas, then a∧b, a∨b, a b, a b are propositional formulas truth value of a boolean function (truth tables) truth value of a propositional formula (truth tables)
- 3. Boolean algebra Propositional logic 0, 1 True, False boolean variables: a∈{0, 1} atomic formulas: p∈{True,False} boolean operators: ¬ ∧ ∨ logical connectives: ¬ ∧ ∨ boolean functions: 0, 1 boolean variables if a is a boolean function, then ¬a is a boolean function if a and b are boolean functions, then a∧b, a∨b, a b, a b are boolean functions propositional formulas (propositions): True and False atomic formulas if a is a propositional formula, then ¬a is a propositional formula if a and b are propositional formulas, then a∧b, a∨b, a b, a b are propositional formulas truth value of a boolean function (truth tables) truth value of a propositional formula (truth tables)
- 4. The Russian spy problem There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. Moreover, every Russian must be a spy. When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. Establish that Eismann is not a Russian spy.
- 5. There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. Moreover, every Russian must be a spy. When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. Establish that Eismann is not a Russian spy.
- 6. There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. Moreover, every Russian must be a spy. When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. Establish that Eismann is not a Russian spy. X ∈ {R, G, S} (denoting Russian, German, Spy) Y ∈ {S,M,E} (denoting Stirlitz, Müller, Eismann) SE : Eismann is a Spy RS : Stirlitz is Russian
- 7. There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. (RS ∧ GM ∧ GE) ∨ (GS ∧ RM ∧ GE) ∨ (GS ∧ GM ∧ RE). (RS ¬GS) ∧ (RM ¬GM) ∧ (RE ¬GE). Moreover, every Russian must be a spy. (RS SS) ∧ (RM SM) ∧ (RE SE). When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. RS GM. Establish that Eismann is not a Russian spy. RE ∧ SE.
- 8. There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. (RS ∧ GM ∧ GE) ∨ (GS ∧ RM ∧ GE) ∨ (GS ∧ GM ∧ RE). (RS ¬GS) ∧ (RM ¬GM) ∧ (RE ¬GE). Moreover, every Russian must be a spy. (RS SS) ∧ (RM SM) ∧ (RE SE). When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. RS GM. Establish that Eismann is not a Russian spy. RE ∧ SE.
- 9. There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. (RS ∧ GM ∧ GE) ∨ (GS ∧ RM ∧ GE) ∨ (GS ∧ GM ∧ RE). (RS ¬GS) ∧ (RM ¬GM) ∧ (RE ¬GE). Moreover, every Russian must be a spy. (RS SS) ∧ (RM SM) ∧ (RE SE). When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. RS GM. Establish that Eismann is not a Russian spy. RE ∧ SE.
- 10. There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. (RS ∧ GM ∧ GE) ∨ (GS ∧ RM ∧ GE) ∨ (GS ∧ GM ∧ RE). (RS ¬GS) ∧ (RM ¬GM) ∧ (RE ¬GE). Moreover, every Russian must be a spy. (RS SS) ∧ (RM SM) ∧ (RE SE). When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. RS GM. Establish that Eismann is not a Russian spy. RE ∧ SE.
- 11. There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. (RS ∧ GM ∧ GE) ∨ (GS ∧ RM ∧ GE) ∨ (GS ∧ GM ∧ RE). (RS ¬GS) ∧ (RM ¬GM) ∧ (RE ¬GE). Moreover, every Russian must be a spy. (RS SS) ∧ (RM SM) ∧ (RE SE). When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. RS GM. Establish that Eismann is not a Russian spy. RE ∧ SE.
- 12. There are three persons: Stirlitz, Mueller, and Eismann. It is known that exactly one of them is Russian, while the other two are Germans. (RS ∧ GM ∧ GE) ∨ (GS ∧ RM ∧ GE) ∨ (GS ∧ GM ∧ RE). (RS ¬GS) ∧ (RM ¬GM) ∧ (RE ¬GE). Moreover, every Russian must be a spy. (RS SS) ∧ (RM SM) ∧ (RE SE). When Stirlitz meets Mueller in a corridor, he makes the following joke: “you know, Mueller, you are as German as I am Russian”. It is known that Stirlitz always says the truth when he is joking. RS GM. Establish that Eismann is not a Russian spy. RE ∧ SE.
- 13. computer information information computation
- 14. 2 is greater than 5
- 15. 2 is greater than 5 False
- 16. 2 is greater than 5 6 is greater than 5 False
- 17. 2 is greater than 5 6 is greater than 5 False True
- 18. 2 is greater than 5 6 is greater than 5 False True x is greater than 5
- 19. 2 is greater than 5 6 is greater than 5 False True x is greater than 5 ?
- 20. 2 is greater than 5 6 is greater than 5 False True x is greater than 5 ? predicate
- 21. x is greater than 5 2 is greater than 5 6 is greater than 5 False True predicate
- 22. x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5 False True predicate
- 23. x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5F(6) = F(2) = False True predicate
- 24. x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5F(6) = F(2) = False True for all natural numbers x, x is greater than 5 predicate
- 25. x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5F(6) = F(2) = False True for all natural numbers x, x is greater than 5 False predicate
- 26. x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5F(6) = F(2) = False True for all natural numbers x, x is greater than 5 False for some natural numbers x, x is greater than 5 predicate
- 27. True x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5F(6) = F(2) = False True for all natural numbers x, x is greater than 5 False for some natural numbers x, x is greater than 5 predicate
- 28. True x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5F(6) = F(2) = False True for all natural numbers x, x is greater than 5 False for some natural numbers x, x is greater than 5 predicate quantiﬁer
- 29. True x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5F(6) = F(2) = False True for all natural numbers x, x is greater than 5 False for some natural numbers x, x is greater than 5 predicate quantiﬁer quantiﬁer
- 30. True x is greater than 5F(x) = 2 is greater than 5 6 is greater than 5F(6) = F(2) = False True for all natural numbers x, x is greater than 5 False for some natural numbers x, x is greater than 5 predicate quantiﬁer quantiﬁer universe
- 31. Existential quantiﬁers ∃ :Universal quantiﬁer ∀ : ∀x: U(x): F(x) ∃x: U(x): F(x) ∀x:x∈N:x>5 ∃x:x∈N:x>5 for all natural numbers x, x is greater than 5 for some natural numbers x, x is greater than 5
- 32. Gottlob Frege 1848—1925 no appeal to intuition
- 33. Distributivity of ∀ ∧ ∀x: U(x): (P(x) ∧ Q(x)) Distributivity of ∃ ∨ ∃x: U(x): (P(x) ∨ Q(x)) Non-distributivity of ∀ ∨ (∀x: U(x): P(x)) ∨ (∀x: U(x): Q(x)) Non-distributivity of ∃ ∧ ∃x: U(x): (P(x) ∧ Q(x)) (∀x: U(x): P(x)) ∧ (∀ x: U(x): Q(x)) (∃x: U(x): P(x)) ∨ (∃ x: U(x): Q(x)) ∀x: U(x): (P(x) ∨ Q(x)) (∃x: U(x): P(x)) ∧ (∃x: U(x): Q(x))
- 34. Examples
- 35. ∀ i: 0≤i<N: ai=0 Examples
- 36. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero Examples
- 37. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai Examples
- 38. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing Examples
- 39. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj Examples
- 40. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing Examples
- 41. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj Examples
- 42. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal Examples
- 43. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 Examples
- 44. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a Examples
- 45. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 Examples
- 46. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero Examples
- 47. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai Examples
- 48. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai elements of array a are not monotonically increasing Examples
- 49. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai > aj Examples
- 50. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai > aj elements of array a are not monotonically increasing Examples
- 51. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai > aj elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai ≠ aj Examples
- 52. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai > aj elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai ≠ aj not all elements of array a are equal Examples
- 53. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai > aj elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai ≠ aj not all elements of array a are equal ∃ i: 0<i<N: ai > a0 Examples
- 54. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai > aj elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai ≠ aj not all elements of array a are equal ∃ i: 0<i<N: ai > a0 a0 is not the greatest element of array a Examples
- 55. ∀ i: 0≤i<N: ai=0 all elements ai of array a (of length N) are zero ∀ i: 1≤i<N: ai-1 ≤ ai elements of array a are monotonically increasing ∀ i,j: 0≤i<j<N: ai ≤ aj elements of array a are monotonically increasing ∀ i,j: 0≤i,j<N: ai = aj all elements of array a are equal ∀ i: 0<i<N: ai ≤ a0 a0 is the greatest element of array a ∃ i: 0≤i<N: ai ≠ 0 at least one element of array a (of length N) is not zero ∃ i: 1≤i<N: ai-1 > ai elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai > aj elements of array a are not monotonically increasing ∃ i,j: 0≤i<j<N: ai ≠ aj not all elements of array a are equal ∃ i: 0<i<N: ai > a0 a0 is not the greatest element of array a Examples
- 56. ¬(∃ x: U(x): F(x)) ∀ x: U(x): ¬ F(x) ¬(∀ x: U(x): F(x)) ∃ x: U(x): ¬ F(x) De Morgan’s Axiom ¬∃ : De Morgan’s Axiom ¬∀ :
- 57. Example What is the negation of the statement “Always, when he drives then he is sober.”
- 58. Example What is the negation of the statement “Always, when he drives then he is sober.” D(t): He drives at moment t.
- 59. Example What is the negation of the statement “Always, when he drives then he is sober.” D(t): He drives at moment t. S(t): He is sober at moment t.
- 60. Example What is the negation of the statement “Always, when he drives then he is sober.” D(t): He drives at moment t. S(t): He is sober at moment t. ∀t : D(t)->S(t)
- 61. Example What is the negation of the statement “Always, when he drives then he is sober.” D(t): He drives at moment t. S(t): He is sober at moment t. ∀t : D(t)->S(t) ¬(∀t :: D(t)->S(t))
- 62. Example What is the negation of the statement “Always, when he drives then he is sober.” D(t): He drives at moment t. S(t): He is sober at moment t. ∀t : D(t)->S(t) ¬(∀t :: D(t)->S(t)) ¬(∀t :: ¬D(t)∨S(t))
- 63. Example What is the negation of the statement “Always, when he drives then he is sober.” D(t): He drives at moment t. S(t): He is sober at moment t. ∀t : D(t)->S(t) ¬(∀t :: D(t)->S(t)) ¬(∀t :: ¬D(t)∨S(t)) ∃t :: ¬(¬D(t)∨S(t))
- 64. Example What is the negation of the statement “Always, when he drives then he is sober.” D(t): He drives at moment t. S(t): He is sober at moment t. ∀t : D(t)->S(t) ¬(∀t :: D(t)->S(t)) ¬(∀t :: ¬D(t)∨S(t)) ∃t :: ¬(¬D(t)∨S(t)) ∃t :: D(t)∧¬S(t))
- 65. computer information information computation
- 66. True, False are WFFs. Propositional variables are WFFs. Predicates with variables are WFFs. If A and B are WFFs, then ¬A, A∧B, A∨B, A B, A B are also WFFs. If x is a variable in universe U and A is a WFF, then ∀x:U(x):A(x) and ∃x:U(x):A(x) are also WFFs. Well formed formulas (WFF)
- 67. Bounded variables (∃j: 0<j<N: P(i,j) ∨ Q(i,j)) Free variables If a variable is not bound in a WFF then it is free. An appearance of variable is bound in a WFF if a speciﬁc value is assigned to it, or it is quantiﬁed. ∃i: 0<i<N: ( ∃i,j: 0<i,j<N: P(i,j) ∨ Q(i,j)
- 68. Bounded variables (∃j: 0<j<N: P(i,j) ∨ Q(i,j)) Free variables If a variable is not bound in a WFF then it is free. An appearance of variable is bound in a WFF if a speciﬁc value is assigned to it, or it is quantiﬁed. ∃i: 0<i<N: ( ) ∃i,j: 0<i,j<N: P(i,j) ∨ Q(i,j)
- 69. ∃x: U1(x): (∀y: U2(y): Q(x,y)) ∀y: U2(y): (∃x: U1(x): Q(x,y)) ∃x: U1(x): (∀y: U2(y): Q(x,y)) ∀y: U2(y): (∃x: U1(x): Q(x,y)) ∀y: U2(y): (∃x: U1(x): Q(x,y)) ∃x: U1(y): (∀y: U2(y): Q(x,y)) Swapping ∀ and ∃ ∀x: U1(x): (∀y: U2(y): Q(x,y)) ∀y: U2(y): (∀x: U1(x): Q(x,y)) ∃x: U1(x): (∃y: U2(y): Q(x,y)) ∃y: U2(y): (∃x: U1(x): Q(x,y)) However
- 70. ∃x: U1(x): (∀y: U2(y): Q(x,y)) ∀y: U2(y): (∃x: U1(x): Q(x,y)) ∃x: U1(x): (∀y: U2(y): Q(x,y)) ∀y: U2(y): (∃x: U1(x): Q(x,y)) ∀y: U2(y): (∃x: U1(x): Q(x,y)) ∃x: U1(y): (∀y: U2(y): Q(x,y)) Swapping ∀ and ∃ ∀x: U1(x): (∀y: U2(y): Q(x,y)) ∀y: U2(y): (∀x: U1(x): Q(x,y)) ∃x: U1(x): (∃y: U2(y): Q(x,y)) ∃y: U2(y): (∃x: U1(x): Q(x,y)) However
- 71. Example Every boy loves some girl does not imply that some girl is loved by every boy. U1 - the universe of boys. U2 - the universe of girls. Q(x,y) - boy x loves girl y. ∀y: U2(y): (∃x: U1(x): Q(x,y)) ∃x: U1(y): (∀y: U2(y): Q(x,y))
- 72. ∀x: U(x): (Q(x) ∨ P) (∀x: U(x): Q(x)) ∨ P ∀x: U(x): (Q(x) ∧ P) (∀x: U(x): Q(x)) ∧ P ∃x: U(x): (Q(x) ∨ P) (∃x: U(x): Q(x)) ∨ P ∃x: U(x): (Q(x) ∧ P) (∃x: U(x): Q(x)) ∧ P If P does not contain x as a free variable
- 73. Example Given: an array a[0..N-1] of length N≥3 Find: i, j, k such that: i is the index of the greatest element of a; j is the index of the 2nd greatest element of a; k is the index of the 3rd greatest element of a.
- 74. Example Given: an array a[0..N-1] of length N≥3 Find: i, j, k such that: i is the index of the greatest element of a; j is the index of the 2nd greatest element of a; k is the index of the 3rd greatest element of a. ∃ i,j,k: (0≤i,j,k<N)∧(i≠j)∧(i≠k)∧(j≠k): ( (ai≥aj≥ak) ∧ (∀m: (0≤m<N)∧(m≠i)∧(m≠j)∧(m≠k): ak≥am) )
- 75. Example All elements of an array a of length N are either zero or one
- 76. Example All elements of an array a of length N are either zero or one ∀i: 0≤i<N: ( ai=0 ∨ ai=1 )
- 77. Example All elements of an array a of length N are either zero or one ∀i: 0≤i<N: ( ai=0 ∨ ai=1 ) (∀i: 0≤i<N: ai=0) ∨ (∀i: 0≤i<N: ai=1) (1) (2)
- 78. Example All elements of an array a of length N are either zero or one ∀i: 0≤i<N: ( ai=0 ∨ ai=1 ) (∀i: 0≤i<N: ai=0) ∨ (∀i: 0≤i<N: ai=1) (1) (2) ambiguous
- 79. Example The elements of arrays a and b are the same (both arrays of length N).
- 80. Example The elements of arrays a and b are the same (both arrays of length N). ∀i: 0≤i<N: (ai=bi)(1)
- 81. Example The elements of arrays a and b are the same (both arrays of length N). ∀i: 0≤i<N: (ai=bi) ∀i: 1≤i<N: ((ai=ai-1) ∧ (bi=bi-1)) (1) (2)
- 82. Example The elements of arrays a and b are the same (both arrays of length N). ∀i: 0≤i<N: (ai=bi) ∀i: 1≤i<N: ((ai=ai-1) ∧ (bi=bi-1)) (1) (2) (∀i: 1≤i<N: (ai=ai-1)) ∧ (∀i: 0≤i<N: (ai=bi))(3)
- 83. Example The elements of arrays a and b are the same (both arrays of length N). ∀i: 0≤i<N: (ai=bi) ∀i: 1≤i<N: ((ai=ai-1) ∧ (bi=bi-1)) (1) (2) (∀i: 1≤i<N: (ai=ai-1)) ∧ (∀i: 0≤i<N: (ai=bi))(3) ∀i: 0≤i<N: (∃ j: 0≤j<N: (ai=bi) )(4)
- 84. Example The elements of arrays a and b are the same (both arrays of length N). ∀i: 0≤i<N: (ai=bi) ∀i: 1≤i<N: ((ai=ai-1) ∧ (bi=bi-1)) (1) (2) ambiguous (∀i: 1≤i<N: (ai=ai-1)) ∧ (∀i: 0≤i<N: (ai=bi))(3) ∀i: 0≤i<N: (∃ j: 0≤j<N: (ai=bi) )(4)
- 85. Example
- 86. They drank two cups of tea because they were warm. Example
- 87. They drank two cups of tea because they were warm. They drank two cups of tea because they were cold. Example
- 88. Go to the shop and buy bread. If they have eggs, buy 10. Example
- 89. Go to the shop and buy bread. If they have eggs, buy 10. ... Do you have eggs? Yes. Then give me 10 pieces of bread. Example
- 90. Min x: U(x): T(x) gives the “smallest value of terms T(x) for all objects x from the universe U“
- 91. Min x: U(x): T(x) gives the “smallest value of terms T(x) for all objects x from the universe U“ Min x: False: T(x) is +∞.
- 92. Min x: U(x): T(x) gives the “smallest value of terms T(x) for all objects x from the universe U“ Min x: False: T(x) is +∞. ( m = (Min i: 0≤i<N: a[i]) )
- 93. Min x: U(x): T(x) gives the “smallest value of terms T(x) for all objects x from the universe U“ Min x: False: T(x) is +∞. ( m = (Min i: 0≤i<N: a[i]) ) ((∃ i: 0≤i<N: m=a[i]) ∧ (∀ i: 0≤i<N: m≤a[i]))
- 94. Max x: U(x): T(x) gives the “greatest value of terms T(x) for all objects x from the universe U“
- 95. Max x: U(x): T(x) gives the “greatest value of terms T(x) for all objects x from the universe U“ Max x: False: T(x) is -∞.
- 96. Max x: U(x): T(x) gives the “greatest value of terms T(x) for all objects x from the universe U“ Max x: False: T(x) is -∞. Max x: U(x): T(x) = - (Min x: U(x): - T(x))
- 97. Max x: U(x): T(x) gives the “greatest value of terms T(x) for all objects x from the universe U“ Max x: False: T(x) is -∞. Max x: U(x): T(x) = - (Min x: U(x): - T(x)) Min x: U(x): T(x) = - (Max x: U(x): - T(x))
- 98. Anz x: U(x): F(x) gives the “number of all those objects x from the universe U for which F(x) holds“
- 99. Anz x: U(x): F(x) gives the “number of all those objects x from the universe U for which F(x) holds“ Anz x: False: F(x) is 0.
- 100. Anz x: U(x): F(x) gives the “number of all those objects x from the universe U for which F(x) holds“ Anz x: False: F(x) is 0. ((Anz x: U(x): F(x)) = 0) ∀x: U(x):¬F(x)
- 101. Anz x: U(x): F(x) gives the “number of all those objects x from the universe U for which F(x) holds“ Anz x: False: F(x) is 0. ((Anz x: U(x): F(x)) = 0) ∀x: U(x):¬F(x) ((Anz x: U(x): F(x)) ≥ 0) ∃x: U(x): F(x)
- 102. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. Example
- 103. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. (Anz i: 0≤i<N: ai=0) = 0 Example
- 104. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. (Anz i: 0≤i<N: ai=0) = 0 all elements ai of a are different than 0 Example
- 105. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. (Anz i: 0≤i<N: ai=0) = 0 all elements ai of a are different than 0 (Anz i: 0≤i<N: ai=x) > 0 Example
- 106. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. (Anz i: 0≤i<N: ai=0) = 0 all elements ai of a are different than 0 (Anz i: 0≤i<N: ai=x) > 0 at least one element ai has the value x (x∈N) Example
- 107. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. (Anz i: 0≤i<N: ai=0) = 0 all elements ai of a are different than 0 (Anz i: 0≤i<N: ai=x) > 0 at least one element ai has the value x (x∈N) (Anz i: 0≤i<N: ai<x) = (Anz i: 0≤i<N: ai>x) Example
- 108. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. (Anz i: 0≤i<N: ai=0) = 0 all elements ai of a are different than 0 (Anz i: 0≤i<N: ai=x) > 0 at least one element ai has the value x (x∈N) (Anz i: 0≤i<N: ai<x) = (Anz i: 0≤i<N: ai>x) x is the median value of a Example
- 109. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. (Anz i: 0≤i<N: ai=0) = 0 all elements ai of a are different than 0 (Anz i: 0≤i<N: ai=x) > 0 at least one element ai has the value x (x∈N) (Anz i: 0≤i<N: ai<x) = (Anz i: 0≤i<N: ai>x) x is the median value of a ∀x:: ( (Anz i: 0≤i<N: ai=x) = (Anz i: 0≤i<N: bi=x) ) Example
- 110. Given arrays a and b. Both arrays are of length N. The elements of both arrays are natural numbers. (Anz i: 0≤i<N: ai=0) = 0 all elements ai of a are different than 0 (Anz i: 0≤i<N: ai=x) > 0 at least one element ai has the value x (x∈N) (Anz i: 0≤i<N: ai<x) = (Anz i: 0≤i<N: ai>x) x is the median value of a ∀x:: ( (Anz i: 0≤i<N: ai=x) = (Anz i: 0≤i<N: bi=x) ) a is a permutation of b Example
- 111. computer information information computation
- 112. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/

No public clipboards found for this slide

×
### Save the most important slides with Clipping

Clipping is a handy way to collect and organize the most important slides from a presentation. You can keep your great finds in clipboards organized around topics.

Be the first to comment