1.1 CompSci 102© Michael Frank Today’s topics Propositional equivalencesPropositional equivalences Predicate logicPredicate logic Reading: Sections 1.2-1.3Reading:

Slides:



Advertisements
Similar presentations
CS 285- Discrete Mathematics
Advertisements

© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Propositions and Connectives Conditionals and Bi-conditionals Quantifiers.
2009/91 Predicates and Quantifiers (§1.3) In the sentence “x is greater than 3”: The phrase “x” denotes the subject - the object or entity that the sentence.
1 Predicate Logic Rosen 6 th ed., § Predicate Logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Module #1 - Logic 5/16/2015Michael Frank / Kees van Deemter1 Predicate Logic Rosen 5 th ed., §§ (but much extended) ~135 slides, ~5 lectures.
Discrete Mathematics Math 6A Instructor: M. Welling.
Logic Truth Tables, Propositions, Implications. Statements Logic is the tool for reasoning about the truth or falsity of statements. –Propositional logic.
Predicates and Quantifiers
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
Logical Equivalence & Predicate Logic
Module #1 - Logic Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk.
資訊科學數學 6 : Predicates, Quantifiers & Mathematical Induction 陳光琦助理教授 (Kuang-Chi Chen)
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
MATH 213 A – Discrete Mathematics for Computer Science Dr. (Mr.) Bancroft.
CSM6120 Introduction to Intelligent Systems
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
1 Propositional Logic Rosen 5 th ed., § Foundations of Logic: Overview Propositional logic:Propositional logic: –Basic definitions. –Equivalence.
1 Logic Logic is a discipline that studies the principles and methods used in correct reasoning It includes: A formal language for expressing statements.
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Module #1 - Logic Module #1: The Fundamentals of Logic Rosen, §§
Review I Rosen , 3.1 Know your definitions!
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/92 Module.
1.1 CompSci 102© Michael Frank Today’s topics Boolean algebra previewBoolean algebra preview Propositional equivalencesPropositional equivalences Predicate.
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
1 Sections 1.3 and 1.4 Predicates & Quantifiers. 2 Propositional Functions In a mathematical assertion, such as x < 3, there are two parts: –the subject,
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Chapter 1: The Foundations: Logic and Proofs
Discrete Mathematics CS 2610 August 22, Agenda Last class Propositional logic Logical equivalences This week Predicate logic & rules of inference.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
CSci 2011 Recap ^Propositional operation summary not andorconditionalBi-conditional pq ppqqpqpqpqpqpqpqpqpq TTFFTTTT TFFTFTFF FTTFFTTF FFTTFFTT.
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Spring 2003CMSC Discrete Structures1 Let’s get started with... Logic !
3/6/20161 Let’s get started with... Logic !. 3/6/20162 Logic Crucial for mathematical reasoningCrucial for mathematical reasoning Used for designing electronic.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Module #1 - Logic 2016/7/91 Module #1: Logic (Textbook: §1.1~1.4) Dr. Chih-Wei Yi Department of Computer Science National Chiao Tung University.
Logic I 권태경 To do so, it should include a language to express statements, a notation to simplify expressions. Logic Mathematical Logic.
Chapter 7. Propositional and Predicate Logic
Discrete Math - Module #1 - Logic
The Foundations: Logic and Proofs
CSE15 Discrete Mathematics 01/23/17
6/20/2018 Arab Open University Faculty of Computer Studies M131 - Discrete Mathematics 6/20/2018.
COT 3100, Spr Applications of Discrete Structures
Proposition & Predicates
Mathematics for Computing
Propositional Calculus: Boolean Algebra and Simplification
Propositional Equivalences
Information Technology Department
Propositional Equivalence (§1.2)
CSI 2101 / Predicate logic (§ ):
Discrete Math - Module #1 - Logic
Propositional Equivalences
Discrete Mathematics and its Applications
CSE 311 Foundations of Computing I
A Brief Summary for Exam 1
Predicate Logic (§1.3) Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities. Propositional.
Week #2 – 4/6 September 2002 Prof. Marie desJardins
Lecture 2: Propositional Equivalences
Discrete Mathematics CMP-200 Propositional Equivalences, Predicates & Quantifiers, Negating Quantified Statements Abdul Hameed
Cs Discrete Mathematics
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Discrete Structures Prepositional Logic 2
Presentation transcript:

1.1 CompSci 102© Michael Frank Today’s topics Propositional equivalencesPropositional equivalences Predicate logicPredicate logic Reading: Sections Reading: Sections

1.2 CompSci 102© Michael Frank Propositional Equivalence (§1.2) Two syntactically (i.e., textually) different compound propositions may be the semantically identical (i.e., have the same meaning). We call them equivalent. Learn: Various equivalence rules or laws.Various equivalence rules or laws. How to prove equivalences using symbolic derivations.How to prove equivalences using symbolic derivations. Topic #1.1 – Propositional Logic: Equivalences

1.3 CompSci 102© Michael Frank Tautologies and Contradictions A tautology is a compound proposition that is true no matter what the truth values of its atomic propositions are! Ex. p   p [What is its truth table?] A contradiction is a compound proposition that is false no matter what! Ex. p   p [Truth table?] Other compound props. are contingencies. Topic #1.1 – Propositional Logic: Equivalences

1.4 CompSci 102© Michael Frank Logical Equivalence Compound proposition p is logically equivalent to compound proposition q, written p  q, IFF the compound proposition p  q is a tautology. Compound propositions p and q are logically equivalent to each other IFF p and q contain the same truth values as each other in all rows of their truth tables. Topic #1.1 – Propositional Logic: Equivalences

1.5 CompSci 102© Michael Frank Ex. Prove that p  q   (  p   q). Proving Equivalence via Truth Tables F T T T T T T T T T F F F F F F F F T T Topic #1.1 – Propositional Logic: Equivalences

1.6 CompSci 102© Michael Frank Equivalence Laws These are similar to the arithmetic identities you may have learned in algebra, but for propositional equivalences instead.These are similar to the arithmetic identities you may have learned in algebra, but for propositional equivalences instead. They provide a pattern or template that can be used to match all or part of a much more complicated proposition and to find an equivalence for it.They provide a pattern or template that can be used to match all or part of a much more complicated proposition and to find an equivalence for it. Topic #1.1 – Propositional Logic: Equivalences

1.7 CompSci 102© Michael Frank Equivalence Laws - Examples Identity: p  T  p p  F  pIdentity: p  T  p p  F  p Domination: p  T  T p  F  FDomination: p  T  T p  F  F Idempotent: p  p  p p  p  pIdempotent: p  p  p p  p  p Double negation:  p  pDouble negation:  p  p Commutative: p  q  q  p p  q  q  pCommutative: p  q  q  p p  q  q  p Associative: (p  q)  r  p  (q  r) (p  q)  r  p  (q  r)Associative: (p  q)  r  p  (q  r) (p  q)  r  p  (q  r) Topic #1.1 – Propositional Logic: Equivalences

1.8 CompSci 102© Michael Frank More Equivalence Laws Distributive: p  (q  r)  (p  q)  (p  r) p  (q  r)  (p  q)  (p  r)Distributive: p  (q  r)  (p  q)  (p  r) p  (q  r)  (p  q)  (p  r) De Morgan’s:  (p  q)   p   q  (p  q)   p   qDe Morgan’s:  (p  q)   p   q  (p  q)   p   q Trivial tautology/contradiction: p   p  T p   p  FTrivial tautology/contradiction: p   p  T p   p  F Topic #1.1 – Propositional Logic: Equivalences Augustus De Morgan ( )

1.9 CompSci 102© Michael Frank Defining Operators via Equivalences Using equivalences, we can define operators in terms of other operators. Exclusive or: p  q  (p  q)  (p  q) p  q  (p  q)  (q  p)Exclusive or: p  q  (p  q)  (p  q) p  q  (p  q)  (q  p) Implies: p  q   p  qImplies: p  q   p  q Biconditional: p  q  (p  q)  (q  p) p  q   (p  q)Biconditional: p  q  (p  q)  (q  p) p  q   (p  q) Topic #1.1 – Propositional Logic: Equivalences

1.10 CompSci 102© Michael Frank An Example Problem Check using a symbolic derivation whether (p   q)  (p  r)   p  q   r.Check using a symbolic derivation whether (p   q)  (p  r)   p  q   r. (p   q)  (p  r) [Expand definition of  ]   (p   q)  (p  r)[Expand defn. of  ]   (p   q)  (p  r)[Expand defn. of  ]   (p   q)  ((p  r)   (p  r)) [DeMorgan’s Law] [DeMorgan’s Law]  (  p  q)  ((p  r)   (p  r)) cont. cont. Topic #1.1 – Propositional Logic: Equivalences

1.11 CompSci 102© Michael Frank Example Continued... (  p  q)  ((p  r)   (p  r))  [  commutes]  (q   p)  ((p  r)   (p  r)) [  associative]  q  (  p  ((p  r)   (p  r))) [distrib.  over  ]  q  (((  p  (p  r))  (  p   (p  r))) [assoc.]  q  (((  p  p)  r)  (  p   (p  r))) [trivail taut.]  q  ((T  r)  (  p   (p  r))) [domination]  q  (T  (  p   (p  r))) [identity]  q  (  p   (p  r))  cont. Topic #1.1 – Propositional Logic: Equivalences

1.12 CompSci 102© Michael Frank End of Long Example q  (  p   (p  r)) [DeMorgan’s]  q  (  p  (  p   r)) [Assoc.]  q  ((  p   p)   r) [Idempotent]  q  (  p   r) [Assoc.]  (q   p)   r [Commut.]   p  q   r Q.E.D. (quod erat demonstrandum) or  Topic #1.1 – Propositional Logic: Equivalences

1.13 CompSci 102© Michael Frank Review: Propositional Logic (§§ ) Atomic propositions: p, q, r, …Atomic propositions: p, q, r, … Boolean operators:      Boolean operators:         q)  rCompound propositions: s :  (p   q)  r Equivalences:p  q   (p  q)Equivalences: p  q   (p  q) Proving equivalences using:Proving equivalences using: –Truth tables. –Symbolic derivations. p  q  r … Topic #1 – Propositional Logic

1.14 CompSci 102© Michael Frank Predicate Logic (§1.3) Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities.Predicate logic is an extension of propositional logic that permits concisely reasoning about whole classes of entities. Propositional logic (recall) treats simple propositions (sentences) as atomic entities.Propositional logic (recall) treats simple propositions (sentences) as atomic entities. In contrast, predicate logic distinguishes the subject of a sentence from its predicate.In contrast, predicate logic distinguishes the subject of a sentence from its predicate. –Remember these English grammar terms? Topic #3 – Predicate Logic

1.15 CompSci 102© Michael Frank Practical Applications of Predicate Logic It is the basis for clearly expressed formal specifications for any complex system.It is the basis for clearly expressed formal specifications for any complex system. It is basis for automatic theorem provers and many other Artificial Intelligence systems.It is basis for automatic theorem provers and many other Artificial Intelligence systems. –E.g. automatic program verification systems. Predicate-logic like statements are supported by some of the more sophisticated database query engines and container class librariesPredicate-logic like statements are supported by some of the more sophisticated database query engines and container class libraries –these are types of programming tools. Topic #3 – Predicate Logic

1.16 CompSci 102© Michael Frank Subjects and Predicates In the sentence “The dog is sleeping”:In the sentence “The dog is sleeping”: –The phrase “the dog” denotes the subject - the object or entity that the sentence is about. –The phrase “is sleeping” denotes the predicate- a property that is true of the subject. In predicate logic, a predicate is modeled as a function P(·) from objects to propositions.In predicate logic, a predicate is modeled as a function P(·) from objects to propositions. –P(x) = “x is sleeping” (where x is any object). Topic #3 – Predicate Logic

1.17 CompSci 102© Michael Frank More About Predicates Convention: Lowercase variables x, y, z... denote objects/entities; uppercase variables P, Q, R… denote propositional functions (predicates).Convention: Lowercase variables x, y, z... denote objects/entities; uppercase variables P, Q, R… denote propositional functions (predicates). Keep in mind that the result of applying a predicate P to an object x is the proposition P(x). But the predicate P itself (e.g. P=“is sleeping”) is not a proposition (not a complete sentence).Keep in mind that the result of applying a predicate P to an object x is the proposition P(x). But the predicate P itself (e.g. P=“is sleeping”) is not a proposition (not a complete sentence). –E.g. if P(x) = “x is a prime number”, P(3) is the proposition “3 is a prime number.” Topic #3 – Predicate Logic

1.18 CompSci 102© Michael Frank Propositional Functions Predicate logic generalizes the grammatical notion of a predicate to also include propositional functions of any number of arguments, each of which may take any grammatical role that a noun can take.Predicate logic generalizes the grammatical notion of a predicate to also include propositional functions of any number of arguments, each of which may take any grammatical role that a noun can take. –E.g. let P(x,y,z) = “x gave y the grade z”, then if x=“Mike”, y=“Mary”, z=“A”, then P(x,y,z) = “Mike gave Mary the grade A.” Topic #3 – Predicate Logic

1.19 CompSci 102© Michael Frank Universes of Discourse (U.D.s) The power of distinguishing objects from predicates is that it lets you state things about many objects at once.The power of distinguishing objects from predicates is that it lets you state things about many objects at once. E.g., let P(x)=“x+1>x”. We can then say, “For any number x, P(x) is true” instead of (0+1>0)  (1+1>1)  (2+1>2) ...E.g., let P(x)=“x+1>x”. We can then say, “For any number x, P(x) is true” instead of (0+1>0)  (1+1>1)  (2+1>2) ... The collection of values that a variable x can take is called x’s universe of discourse.The collection of values that a variable x can take is called x’s universe of discourse. Topic #3 – Predicate Logic

1.20 CompSci 102© Michael Frank Quantifier Expressions Quantifiers provide a notation that allows us to quantify (count) how many objects in the univ. of disc. satisfy a given predicate.Quantifiers provide a notation that allows us to quantify (count) how many objects in the univ. of disc. satisfy a given predicate. “  ” is the FOR  LL or universal quantifier.  x P(x) means for all x in the u.d., P holds.“  ” is the FOR  LL or universal quantifier.  x P(x) means for all x in the u.d., P holds. “  ” is the  XISTS or existential quantifier.  x P(x) means there exists an x in the u.d. (that is, 1 or more) such that P(x) is true.“  ” is the  XISTS or existential quantifier.  x P(x) means there exists an x in the u.d. (that is, 1 or more) such that P(x) is true. Topic #3 – Predicate Logic

1.21 CompSci 102© Michael Frank The Universal Quantifier  Example: Let the u.d. of x be parking spaces at Duke. Let P(x) be the predicate “x is full.” Then the universal quantification of P(x),  x P(x), is the proposition:Example: Let the u.d. of x be parking spaces at Duke. Let P(x) be the predicate “x is full.” Then the universal quantification of P(x),  x P(x), is the proposition: –“All parking spaces at Duke are full.” –i.e., “Every parking space at Duke is full.” –i.e., “For each parking space at Duke, that space is full.” Topic #3 – Predicate Logic

1.22 CompSci 102© Michael Frank The Existential Quantifier  Example: Let the u.d. of x be parking spaces at Duke. Let P(x) be the predicate “x is full.” Then the existential quantification of P(x),  x P(x), is the proposition:Example: Let the u.d. of x be parking spaces at Duke. Let P(x) be the predicate “x is full.” Then the existential quantification of P(x),  x P(x), is the proposition: –“Some parking space at Duke is full.” –“There is a parking space at Duke that is full.” –“At least one parking space at Duke is full.” Topic #3 – Predicate Logic

1.23 CompSci 102© Michael Frank Free and Bound Variables An expression like P(x) is said to have a free variable x (meaning, x is undefined).An expression like P(x) is said to have a free variable x (meaning, x is undefined). A quantifier (either  or  ) operates on an expression having one or more free variables, and binds one or more of those variables, to produce an expression having one or more bound variables.A quantifier (either  or  ) operates on an expression having one or more free variables, and binds one or more of those variables, to produce an expression having one or more bound variables. Topic #3 – Predicate Logic

1.24 CompSci 102© Michael Frank Example of Binding P(x,y) has 2 free variables, x and y.P(x,y) has 2 free variables, x and y.  x P(x,y) has 1 free variable, and one bound variable. [Which is which?]  x P(x,y) has 1 free variable, and one bound variable. [Which is which?] “P(x), where x=3” is another way to bind x.“P(x), where x=3” is another way to bind x. An expression with zero free variables is a bona-fide (actual) proposition.An expression with zero free variables is a bona-fide (actual) proposition. An expression with one or more free variables is still only a predicate: e.g. let Q(y) =  x P(x,y)An expression with one or more free variables is still only a predicate: e.g. let Q(y) =  x P(x,y) Topic #3 – Predicate Logic

1.25 CompSci 102© Michael Frank Nesting of Quantifiers Example: Let the u.d. of x & y be people. Let L(x,y)=“x likes y” (a predicate w. 2 f.v.’s) Then  y L(x,y) = “There is someone whom x likes.” (A predicate w. 1 free variable, x) Then  x (  y L(x,y)) = “Everyone has someone whom they like.” (A __________ with ___ free variables.) Topic #3 – Predicate Logic

1.26 CompSci 102© Michael Frank Quantifier Exercise If R(x,y)=“x relies upon y,” express the following in unambiguous English:  x(  y R(x,y))=  y(  x R(x,y))=  x(  y R(x,y))=  y(  x R(x,y))=  x(  y R(x,y))= Everyone has someone to rely on. There’s a poor overburdened soul whom everyone relies upon (including himself)! There’s some needy person who relies upon everybody (including himself). Everyone has someone who relies upon them. Everyone relies upon everybody, (including themselves)! Topic #3 – Predicate Logic