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!

- Propositional logic by Janet Stemwedel 2778 views
- Smart Water nella Città del Futuro ... by Servizi a rete 345 views
- Discrete Math Lecture 01: Propositi... by IT Engineering De... 602 views
- The Basics of Water Billing - Water... by Water Works of Texas 350 views
- Syntax and semantics of proposition... by Janet Stemwedel 14539 views
- Logic introduction by Abdul Qadir Memon 11375 views

391 views

Published on

This is module 2 of an introductory course that will introduce computer science and software engineering to the novice, and it is also a course that will teach even veteran computer scientists some new concepts, or explain concepts they thought they understood well. Concepts are introduced with hands on experience using object-oriented pseudo code (which can very easily be translated to C#, Java, C++, etc.) and functional programming pseudo code (which can easily be translated into F#, Erlang, Python, Haskell, etc.)

Published in:
Education

No Downloads

Total views

391

On SlideShare

0

From Embeds

0

Number of Embeds

4

Shares

0

Downloads

21

Comments

0

Likes

2

No embeds

No notes for slide

- 1. Foundations of Computer Science and Software Engineering module 2/30 WALID S. SABA
- 2. Foundations of Computer Science and Software Engineering ALBERT EINSTIEN TO THE TEACHER
- 3. Foundations of Computer Science and Software Engineering TO THE STUDENT SOCRATES
- 4. Foundations of Computer Science and Software Engineering About this Course This is an introductory course that will introduce computer science and software engineering to the novice, and it is also a course that will teach even veteran computer scientists some new concepts, or explain concepts they thought they understood well. Concepts are introduced with hands on experience using object-oriented pseudo code (which can very easily be translated to C#, Java, C++, etc.) and functional programming pseudo code (which can easily be translated into F#, Erlang, Python, Haskell, etc.) About the Author Walid Saba has 20 years of experience in information technology, where he worked at such places as the American Institutes for Research, AT&T Bell Labs, Metlife, Nortel Networks, IBM and Cognos. He has also spent 7 years in academia where he has taught computer science at Carelton University, the New Jersey Institute of Technology, the University of Windsor, and the American University of Beirut. He has published over 30 technical articles, including an award wining paper that he recieved at KI-2008 in Germany. Walid holds a PhD in Computer Science which he obtained from Carleton University in1999
- 5. MODULE 2 (1 hour) MATHEMATICAL PRILIMENARIES – LOGIC Foundations of Computer Science and Software Engineering
- 6. Introduction to Computer Science – Preliminaries
- 7. Introduction to Computer Science – Preliminaries
- 8. Introduction to Computer Science – Preliminaries
- 9. Introduction to Computer Science – Preliminaries Huh?
- 10. Propositional Logic Introduction to Computer Science – Preliminaries Logic is a system of reasoning to systematically determine the soundness (or validity) of an argument
- 11. Propositional Logic Introduction to Computer Science – Preliminaries The simplest logical system is that of “propositional logic” – which is roughly equivalent to what is also known in computer science and computer engineering as “Boolean algebra” Logic is a system of reasoning to systematically determine the soundness (or validity) of an argument
- 12. Propositional Logic Introduction to Computer Science – Preliminaries Logic is a system of reasoning to systematically determine the soundness (or validity) of an argument The simplest logical system is that of “propositional logic” – which is roughly equivalent to what is also known in computer science and computer engineering as “Boolean algebra” Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False
- 13. Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False
- 14. Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False Examples of sentences that can be assigned True or False:
- 15. Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False Examples of sentences that can be assigned True or False:
- 16. Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False Examples of sentences that can be assigned True or False:
- 17. Propositional Logic Introduction to Computer Science – Preliminaries Sentences (or declarative statements) that express or declare some proposition, are assigned the value True or False Examples of sentences that can be assigned True or False:
- 18. Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value)
- 19. Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) Everyone in France Speaks Chinese The moon is made of cheese Introduction to Computer Science – Preliminaries
- 20. Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) Everyone in France Speaks Chinese AND The moon is made of cheese Introduction to Computer Science – Preliminaries
- 21. Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) Everyone in France Speaks Chinese The moon is made of cheese Introduction to Computer Science – Preliminaries
- 22. Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) Everyone in France Speaks Chinese OR The moon is made of cheese Introduction to Computer Science – Preliminaries
- 23. Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) If Everyone in France Speaks Chinese Then The moon is made of cheese Introduction to Computer Science – Preliminaries
- 24. Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) If Everyone in France Speaks Chinese Then The moon is made of cheese Introduction to Computer Science – Preliminaries
- 25. Propositional Logic Introduction to Computer Science – Preliminaries Simple sentences (that are assigned a truth value such as True or False) can be combined into compound statements (that are also be assigned a truth value) It is NOT True that Everyone in France Speaks Chinese Introduction to Computer Science – Preliminaries
- 26. Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries
- 27. Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries
- 28. Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries
- 29. Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries
- 30. Propositional Logic Introduction to Computer Science – Preliminaries If we have two propositions (sentences, or declarative statements), p and q, then we can say: Introduction to Computer Science – Preliminaries
- 31. Propositional Logic Introduction to Computer Science – Preliminaries According to the above, we can make an infinite number of sentences, such as Introduction to Computer Science – Preliminaries
- 32. Propositional Logic Introduction to Computer Science – Preliminaries But if we know the truth values of two simple sentences, how do we determine the truth value of a compound sentence? T T F F T F T F T F F F T T F F T F T F T T T F T T F F T F T F T F F T T F T T p and q is true when both are true, and false otherwise p or q is true when either one is true, otherwise it is false if p then q is false only when p is true and q is false not p is false when p is true & true when p is false Introduction to Computer Science – Preliminaries
- 33. Propositional Logic Introduction to Computer Science – Preliminaries iff (if and only if), or as it is also called bi-directional if or equivalence Introduction to Computer Science – Preliminaries
- 34. Equivalence Introduction to Computer Science – Preliminaries Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write Introduction to Computer Science – Preliminaries
- 35. Equivalence Introduction to Computer Science – Preliminaries Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries
- 36. Equivalence Introduction to Computer Science – Preliminaries All possible truth value assignments of P and Q Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries
- 37. Equivalence Introduction to Computer Science – Preliminaries All possible truth value assignments of P and Q Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries
- 38. Equivalence Introduction to Computer Science – Preliminaries All possible truth value assignments of P and Q Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries
- 39. Equivalence Introduction to Computer Science – Preliminaries All possible truth value assignments of P and Q These two statements have the same truth value for every truth value assignment of P and Q, and thus they are equivalent Two formulas P and Q are equivalent iff (if and only if) they have the same truth value for every truth value assignment of their symbols. We write EXAMPLE Introduction to Computer Science – Preliminaries
- 40. Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment Introduction to Computer Science – Preliminaries
- 41. Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Introduction to Computer Science – Preliminaries
- 42. Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? Introduction to Computer Science – Preliminaries
- 43. Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: Introduction to Computer Science – Preliminaries
- 44. Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: saying it is not true that both p and q are true Introduction to Computer Science – Preliminaries
- 45. Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: saying it is not true that both p and q are true is exactly like saying Introduction to Computer Science – Preliminaries
- 46. Introduction to Computer Science – Preliminaries AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: saying it is not true that both p and q are true is exactly like saying either p is false or q is false Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment Introduction to Computer Science – Preliminaries
- 47. Introduction to Computer Science – Preliminaries Validity A formula is valid if it is true for every possible truth assignment of its symbols. Or, a formula is valid if it cannot be made false for any truth assignment AS A TRIVIAL EXAMPLE is a formula that is always true – cannot be false! Let us try something more interesting. Is the following a valid formula? It seems like this is a sound (valid) statement, since the formula states the following: saying it is not true that both p and q are true is exactly like saying either p is false or q is false Which seems reasonable Introduction to Computer Science – Preliminaries
- 48. Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries
- 49. Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries
- 50. Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries
- 51. Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries
- 52. Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q Introduction to Computer Science – Preliminaries
- 53. Introduction to Computer Science – Preliminaries Validity While it sounds reasonable to claim that is a valid statement, we need to systematically check if this statement is true for every truth assignment of p and q This statement is valid since it cannot be made false, or since it is true for every possible truth assignment of p and q Introduction to Computer Science – Preliminaries
- 54. Introduction to Computer Science – Preliminaries Satisfiability A formula is satisfiable if there is at least one possible truth assignment that will make it true – otherwise, we say the formula is unsatisfiable AS A TRIVIAL EXAMPLE is a formula that is satisfiable since it can be made true when p is true or when q is false Introduction to Computer Science – Preliminaries
- 55. Introduction to Computer Science – Preliminaries Satisfiability A formula is satisfiable if there is at least one possible truth assignment that will make it true – otherwise, we say the formula is unsatisfiable AS A TRIVIAL EXAMPLE is a formula that is satisfiable since it can be made true when p is true or when q is false Now, is the formula satisfiable? Introduction to Computer Science – Preliminaries
- 56. Introduction to Computer Science – Preliminaries Satisfiability A formula is satisfiable if there is at least one possible truth assignment that will make it true – otherwise, we say the formula is unsatisfiable AS A TRIVIAL EXAMPLE is a formula that is satisfiable since it can be made true when p is true or when q is false Now, is the formula satisfiable? Are there truth values for r, p and q that will make it true? Introduction to Computer Science – Preliminaries
- 57. Introduction to Computer Science – Preliminaries Satisfiability A formula is satisfiable if there is at least one possible truth assignment that will make it true – otherwise, we say the formula is unsatisfiable AS A TRIVIAL EXAMPLE is a formula that is satisfiable since it can be made true when p is true or when q is false Now, is the formula satisfiable? Are there truth values for r, p and q that will make it true? If it can be made true, in how many ways? Introduction to Computer Science – Preliminaries
- 58. Introduction to Computer Science – Preliminaries Satisfiability Introduction to Computer Science – Preliminaries
- 59. Introduction to Computer Science – Preliminaries Satisfiability This statement can be made true ... Introduction to Computer Science – Preliminaries
- 60. Introduction to Computer Science – Preliminaries Satisfiability If we have the following: Introduction to Computer Science – Preliminaries
- 61. Introduction to Computer Science – Preliminaries Satisfiability Which means we have the following: Introduction to Computer Science – Preliminaries
- 62. Introduction to Computer Science – Preliminaries Satisfiability The OR statement can be made true in three ways Introduction to Computer Science – Preliminaries
- 63. Introduction to Computer Science – Preliminaries Satisfiability So we have 3 possible ways to make our formula true (so it satisfiable in 3 ways) Introduction to Computer Science – Preliminaries
- 64. Introduction to Computer Science – Preliminaries Satisfiability So we have 3 possible ways to make our formula true (so it satisfiable in 3 ways) An alternative to this process is to make the entire truth table and select at the end the rows for which the last formula comes out to be true. For a formula with 3 symbols this might not be too much, but what if we had 6 or 10 symbols? Introduction to Computer Science – Preliminaries
- 65. Introduction to Computer Science – Preliminaries Satisfiability So we have 3 possible ways to make our formula true (so it satisfiable in 3 ways) Try it out! Plug the different truth values of the three combinations we arrived at to see if the original formula comes out to be true! Introduction to Computer Science – Preliminaries
- 66. Applications of Propositional Logic Introduction to Computer Science – Preliminaries DIGITAL REPRESENTATION OF DECIMAL DIGITS Every digit is displayed by turning some variables ON (true) and some variables OFF (false)
- 67. Applications of Propositional Logic Introduction to Computer Science – Preliminaries DIGITAL REPRESENTATION OF DECIMAL DIGITS Every digit is displayed by turning some variables ON (true) and some variables OFF (false)
- 68. Applications of Propositional Logic Introduction to Computer Science – Preliminaries DIGITAL REPRESENTATION OF DECIMAL DIGITS ? Every digit is displayed by turning some variables ON (true) and some variables OFF (false)
- 69. Limitations of Propositional Logic Introduction to Computer Science – Preliminaries Consider the following declarative sentences:
- 70. Limitations of Propositional Logic Introduction to Computer Science – Preliminaries Consider the following declarative sentences: Assuming that p and q are true (that is, assuming we agreed that p and q are true), then r should follow from p and q. In other words this statement should be a valid (always true)
- 71. Limitations of Propositional Logic Introduction to Computer Science – Preliminaries Consider the following declarative sentences: Assuming that p and q are true (that is, assuming we agreed that p and q are true), then r should follow from p and q. In other words this statement should be a valid (always true) But this statement is not valid – it is not true for all possible truth values of p, q and r
- 72. Limitations of Propositional Logic Introduction to Computer Science – Preliminaries Consider the following declarative sentences: Assuming that p and q are true (that is, assuming we agreed that p and q are true), then r should follow from p and q. In other words this statement should be a valid (always true) But this statement is not valid – it is not true for all possible truth values of p, q and r WHAT WENT WRONG?
- 73. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries It turns out that certain valid inferences cannot be made in propositional logic, and a more powerful logic is needed
- 74. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries It turns out that certain valid inferences cannot be made in propositional logic, and a more powerful logic is needed First-Order Logic (FOL), or the Predicate Calculus, as it is also called, introduces predicates, quantifiers and variables
- 75. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries It turns out that certain valid inferences cannot be made in propositional logic, and a more powerful logic is needed First-Order Logic (FOL), or the Predicate Calculus, as it is also called, introduces predicates, quantifiers and variables
- 76. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope
- 77. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope This is the scope of the variable x
- 78. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope This is the scope of the variable x This is the scope of the variable y
- 79. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope This is the scope of the variable x This is the scope of the variable y Note that the scope of y is within the scope of x
- 80. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Variables introduced by quantifiers have scope This is the scope of the variable x This is the scope of the variable y Note that the scope of y is within the scope of x Later in the course we will see that the notion of introducing and defining variables in a certain scope in programming languages is exactly the same as that in first- order logic
- 81. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Example predicates Is true if the square of x is y
- 82. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Example predicates Is true if the square of x is y Is true if x is positive
- 83. First-Order Logic (FOL) Introduction to Computer Science – Preliminaries Example predicates Is true if the square of x is y Is true if x is positive For any x and for any y, if y is the square of x, then y is positive
- 84. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inference Rules in Logic: Modus Ponens (MP) An important rule of inference in propositional logic is called modus ponens, which can be described as follows:
- 85. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries An important rule of inference in propositional logic is called modus ponens, which can be described as follows: The rule says: if p implies q, and we can establish p, therefore we can conclude q. Inference Rules in Logic: Modus Ponens (MP)
- 86. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q Inference Rules in Logic: Modus Ponens (MP)
- 87. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)
- 88. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)
- 89. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)
- 90. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)
- 91. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries The modus ponens inference rule states the following: if p implies q, and p, then q The modus ponens inference rule is a valid inference rule, since it is true for all possible truth value assignments of p and q Inference Rules in Logic: Modus Ponens (MP)
- 92. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Other Inference Rules Other basic but important inference rules include the following:
- 93. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Other Inference Rules Other basic but important inference rules include the following: If p is true, and q is true, then we can infer (p and q)
- 94. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Other Inference Rules Other basic but important inference rules include the following: If (p and q) is true, the we can infer p and we can infer q If p is true, and q is true, then we can infer (p and q)
- 95. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Other Inference Rules Other basic but important inference rules include the following: If (p and q) is true, the we can infer p and we can infer q (elimination) if (not p or q) is true, and we know p is true, then q must be true If p is true, and q is true, then we can infer (p and q)
- 96. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL Let us now re-consider this argument and use first order logic to make this inference:
- 97. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL Let us now re-consider this argument and use first order logic to make this inference: Let us introduce these predicates: True if x is a mathematician True if x is clever
- 98. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL
- 99. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL 1.
- 100. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL 1. 2.
- 101. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL 1. 2. 3.
- 102. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Inferences in FOL 1. 2. 3. 4.
- 103. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Let us see how we can use FOL in data and information representation and reasoning Suppose we want to represent the blocks world depicted graphically below, where the goal is stack all the blocks from A (at the top) to E (at the bottom) and where the rule that we should follow is that a block cannot be placed on top of another block unless it precedes it alphabetically
- 104. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – predicates to describe the domain
- 105. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – predicates to describe the domain
- 106. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning If block x is not stacked, and block x precedes y, and block y is free, then block x can be placed on top of block y Representing the domain – rules of movement
- 107. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – domain knowledge If block x precedes y, and block y precedes z, then block x precedes block y
- 108. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – describing the state of affairs
- 109. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – describing the state of affairs
- 110. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – describing the state of affairs
- 111. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries Using FOL in Representation and Reasoning Representing the domain – describing the state of affairs
- 112. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science FOL can be used to define sets and relations As an example, let us define the predicate even 0 is even (or, that 0 is even is true!) Any number is even if the one preceding it is not
- 113. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Let us test this definition
- 114. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Let us test this definition
- 115. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Let us test this definition Check using the above definition of even if even(5) comes out to be true or false
- 116. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Let us test this definition Later in the course you will see how we can write a simple function/program to test whether some input number is an even number of not
- 117. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Sets, which are unordered collections of objects, can be defined using predicates in FOL The sets A and B have the same objects. A is defined intensionally, i.e., using logical formulas, and B is defined extensionally, i.e., by actually enumerating the actual objects
- 118. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Sets, which are unordered collections of objects, can be defined using predicates in FOL The sets A and B have the same objects. A is defined intensionally, i.e., using logical formulas, and B is defined extensionally, i.e., by actually enumerating the actual objects Define the set that would contain the elements {3, 7, 9, 11} without listing the elements but using the predicate even
- 119. Introduction to Computer Science – PreliminariesIntroduction to Computer Science – Preliminaries FOL in Computing Science Sets, which are unordered collections of objects, can be defined using predicates in FOL The sets A and B have the same objects. A is defined intensionally, i.e., using logical formulas, and B is defined extensionally, i.e., by actually enumerating the actual objects Sets, relations (between sets) and functions will be the subject of the next module!
- 120. Introduction to Computer Science END OF MODULE 2 MATHEMATICAL PRILIMENARIES – SETS, RELATIONS AND FUNCTIONS Next module

No public clipboards found for this slide

Be the first to comment