Predicate Calculus lecture 1 Section 1.3 Limitation of Propositional Logic Consider the following reasoning All cats have tails Gouchi is a cat Therefore, Gouchi has tail. MSU/CSE 260 Fall 2009 1 MSU/CSE 260 Fall 2009 2 Outline Introduction Predicates Propositional functions Quantifiers Universal quantification Existential quantification Translating sentences into logical expressions Binding variables Negations Introduction Remember that the statement x+1 = 3 is NOT a proposition. Why? Can we produce a proposition from it? The statement x plus 1 equals 3 has two parts, namely, the variable x which is the subject of the statement, and the property plus one equals 3 which is the predicate. Grammatically, a predicate is the part of the sentence that says something about the subject. MSU/CSE 260 Fall 2009 3 MSU/CSE 260 Fall 2009 4
Introduction. If P denotes the predicate plus 1 equals 3, then the proposition x plus 1 equals 3 can be denoted by P(x). P(x) is called a propositional function with variable x. Once a value is assigned to x, then P(x) becomes a proposition it has a truth value. What is the truth value of P(1), P(2), etc? Universe of discourse Let Q(x, y) denote x = y 4 What is truth value of Q(1, 2), Q(1, 5), etc? Find all values of x, y which make Q(x, y) true. We need to specify the Universe of Discourse which is the domain of consideration. In general, P(x 1, x 2,, x n ) is the value of the propositional function P at n tuple (x 1, x 2,, x n ) We do indeed use n tuples in relational data bases: Major(A123456789, CSE), DeansList(A987654321, SS09) MSU/CSE 260 Fall 2009 5 MSU/CSE 260 Fall 2009 6 Propositional Functions How can we turn a propositional function into a proposition? Assigning values to its variables Using quantifiers. Universal quantifier Existential quantifier Quantifiers: Universal Definition: The universal quantification of P(x), denoted by x P(x), is the proposition: every x in the universe of discourse has property P. is called the universal quantifier, and x P(x) is read as. For all x P(x), or For every x P(x). Every integer can be factored into a (unique) set of prime factors. All cats have tails. All humans have rights. MSU/CSE 260 Fall 2009 7 MSU/CSE 260 Fall 2009 8
Example Let s consider the proposition Every student in this class has studied calculus. Let P(x) denote x has studied calculus x P(x), where the universe of discourse consists of the students in this class. Here is another way of stating the same thing but using a different universe of discourse Let P(x) denote x has studied calculus Let S(x) is the proposition x is in this class and the universe of discourse is the set of all students. x (S(x) P(x)) The Universal Quantifier Note that when the universe of discourse is finite, then x P(x) P(x 1 ) P(x 2 ) P(x n ) where x 1, x 2,, x n are values in the universe of discourse. Note again that x P(x) is a proposition and is thus either true or false. MSU/CSE 260 Fall 2009 9 MSU/CSE 260 Fall 2009 10 Quantifiers: The existential Definition: The existential quantification of P(x), denoted by x P(x), is the proposition: One or more x in the universe of discourse has property P. is called the existential quantifier, and it is read as: There exists an x such that P(x), or There is at least one x such that P(x), or For some x P(x). Examples Let P(x) denote x > 3. What is the truth value of x P(x), where the universe of discourse is the set of real numbers? Solution: x P(x) is true; since x > 3 is true, for instance, when x = 4. What if we change the universe of discourse to the set of negative numbers? There exists an integer larger than 1000. There exists a prime larger than 1000. MSU/CSE 260 Fall 2009 11 MSU/CSE 260 Fall 2009 12
The Existential Quantifier Quantifiers summary Note that when the universe of discourse is finite, then x P(x) P(x 1 ) P(x 2 ) P(x n ) where x 1, x 2,, x n are values in the universe of discourse. Note again that x P(x) is a proposition. Proposition x P(x) When True? When P(x) is true for every x. When False? When there is an x for which P(x) is false. x P(x) When there is an x for which P(x) is true. When P(x) is false for every x. MSU/CSE 260 Fall 2009 13 MSU/CSE 260 Fall 2009 14 Interesting proposition The universe of discourse is the set of all positive integers N. English: Every even integer (greater than 2) is the sum of two primes. 10 = 3+7; 44 = 3 +41; n m k ( (n>2) (n = m+k ) ) This has never been proved or disproved! Written in terms of functions we have n m k ( (GT(n,2)) (EQ( n, SUM(m, k ) )) In Class Exercise Let the predicates F(x) denote x is a genius Let the universe of discourse be MSU students. Give English interpretations for each of the following propositions: x P(x) x P(x) xp(x) xp(x) For each formula above, give a different predicate logic formulas with the same meaning (Hint: start with the last two). MSU/CSE 260 Fall 2009 15 MSU/CSE 260 Fall 2009 16
Binding Variables Consider a propositional function P(x) A variable x is said to be bound when: a value is assigned to x, or a quantifier is used on x, Otherwise, x is said to be free. When we have more than one variable in a propositional function, the order of the quantifiers is important (unless the quantifiers are of the same type). Free and Bound Variables When all the variables of a propositional function are bound then it becomes a proposition. Let P(x, y) denote x < y. In x P(x, y), variable x is bound but y is free, and x P(x, y) is not yet a proposition. x P(x, 2) is now a proposition; all the variables are bound now. x y P(x, y) is also a proposition, all the variables are bound now. Note that once a variable is bound using a quantifier, it cannot be given a value. For example, x P(3, y) does not make sense. MSU/CSE 260 Fall 2009 17 MSU/CSE 260 Fall 2009 18 Scope of the Quantifiers The scope of a quantifier ( or ) is the part of the expression that it applies to. In x (S(x) P(x)), the scope of is S(x) P(x). In ( x P(x)) Q(x), the scope of is P(x). This latter expression is the same as ( yp(y)) Q(x). MSU/CSE 260 Fall 2009 19