Predicate Calculus Discussion #14 Chapter 2, Section 1 1/20.

Slides:



Advertisements
Similar presentations
Nested Quantifiers Needed to express statements with multiple variables Example 1: “x+y = y+x for all real numbers”  x  y(x+y = y+x) where the domains.
Advertisements

Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
1 Predicate Logic Rosen 6 th ed., § Predicate Logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
RMIT University; Taylor's College This is a story about four people named Everybody, Somebody, Anybody and Nobody. There was an important job to be done.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
1 Predicates and quantifiers Chapter 8 Formal Specification using Z.
1 Predicates and Quantifiers CS 202, Spring 2007 Epp, Sections 2.1 and 2.2 Aaron Bloomfield.
Section 1.3: Predicates and Quantifiers
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Predicates and Quantifiers
Chapter 1: The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Discussion #141/20 Discussion #14 Predicate Calculus.
 Predicate: A sentence that contains a finite number of variables and becomes a statement when values are substituted for the variables. ◦ Domain: the.
1st-order Predicate Logic (FOL)
Database Management Systems, R. Ramakrishnan1 Relational Calculus Chapter 4.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
Math 51/COEN 19 Day 3, 1.4 Quantifiers 1. 3 Predicates A lot like functions that return booleans Let P(x) denote x
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
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,
Word Problem Consider the following problem: To register, you will need either a yellow card or a note from the Dean. To obtain a note from the Dean you.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
Lecture 7 – Jan 28, Chapter 2 The Logic of Quantified Statements.
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
For Friday Read chapter 8 Homework: –Chapter 7, exercises 2 and 10 Program 1, Milestone 2 due.
Semantics of Predicate Calculus For the propositional calculus, an interpretation was simply an assignment of truth values to the proposition letters of.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Section 1.5 and 1.6 Predicates and Quantifiers. Vocabulary Predicate Domain Universal Quantifier Existential Quantifier Counterexample Free variable Bound.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Propositional Logic.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 1 Predicates and Quantifiers 1.4.
Relational Calculus Chapter 4, Section 4.3.
3. The Logic of Quantified Statements Summary
Chapter 3 The Logic of Quantified Statements
Relational Calculus Chapter 4, Part B
CSE 311 Foundations of Computing I
Discussion #14 Predicate Calculus
CMSC Discrete Structures
Chapter 1 The Foundations: Logic and Proofs
Today’s Topics Universes of Discourse
The Foundations: Logic and Proofs
Predicate logic Also known as predicate calculus or First-Order-Logic(FOL) or First- Order-Predicate-Calculus (FOPC). Meant to overcome the weaknesses.
CS201: Data Structures and Discrete Mathematics I
Formal Program Specification
CS 220: Discrete Structures and their Applications
CSE 311 Foundations of Computing I
Formal Program Specification
Predicate Calculus Discussion #14 Chapter 2, Section 1.
1st-order Predicate Logic (FOL)
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Negations of quantifiers
Discrete Mathematics Lecture 3: Predicate and Quantifier
Discrete Mathematics CMP-200 Propositional Equivalences, Predicates & Quantifiers, Negating Quantified Statements Abdul Hameed
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Predicates and Quantifiers
CS201: Data Structures and Discrete Mathematics I
Predicate Calculus. Predicate Calculus Topics Predicates Variables and instantiation Quantifiers Logical expressions Bound and free variables.
CSE 311: Foundations of Computing
Relational Calculus Chapter 4, Part B 7/1/2019.
Formal Program Specification
1st-order Predicate Logic (FOL)
Relational Calculus Chapter 4, Part B
Presentation transcript:

Predicate Calculus Discussion #14 Chapter 2, Section 1 1/20

Topics Predicates Variables and instantiation Quantifiers Logical expressions Bound and free variables Discussion #14 Chapter 2, Section 1 2/20

Calculus What does calculus mean? Lots of calculus studies … Comes from the word “stone” Implies a process of calculating Lots of calculus studies … Differential calculus Integral calculus Relational calculus Propositional calculus Predicate calculus Predicate calculus is a generalization of propositional calculus. Discussion #14 Chapter 2, Section 1 3/20

Predicate Calculus Predicate calculus is also called Predicate Logic or First-Order Logic Predicate calculus contains all the components of propositional calculus. In addition, predicate calculus has predicates, a universe of discorse (UofD), terms, and quantifiers. Discussion #14 Chapter 2, Section 1 4/20

Predicates A predicate is a statement that is either true or false and has zero or more arguments. A predicate has a name followed by a list of arguments enclosed in parentheses and is called an atomic formula. Examples: Jane is the mother of Mary isMother(Jane, Mary) M(j, m) Atomic formulas can be combined by logical connectives. Example: isMother(Jane,Mary)  isMother(Mary,Jane) If all arguments of a predicate are individual constants, the resulting atomic formula must either be true or false. Examples: Jane is the mother of Mary = T isMother(Jane, Mary) = T isMother(Mary, Jane) = F The number and order of predicate arguments is significant. The number of elements in the predicate list is called the arity of the predicate. Discussion #14 Chapter 2, Section 1 5/20

UofD, Terms, Quantifiers The Universe of Discorse (UofD) is a set of values. The UofD represents all values being considered. The UofD is sometimes called the domain of interest, or simply the domain. Arguments in predicates can be constants (values in the UofD), variables (whose value assignments come from the UofD), or terms (expressions that evaluate to values in the UofD). Quantifiers give us a way to evaluate predicate calculus formulas with variables that range over the entire UofD. Discussion #14 Chapter 2, Section 1 6/20

Less Than  a Well Known Predicate 2nd arg < 1 2 3 Examples: 2 < 3 True 3 < 2 False <(2, 3) True <(3, 2) False <(x, y) ? Predicate evaluation Plug in constants from the UoD. Sometimes we have pre-agreed meanings. In general, we must specify the result. 1 F T T 1st arg 2 F F T 3 F F F UoD = {1, 2, 3} Discussion #14 Chapter 2, Section 1 7/20

Predicate Evaluation (continued…) Sometimes we know the “meaning” but we don’t know which assignments hold until we are told. For example: T F Sara Zed Sally Jim siblingOf UoD = {Jim, Sally, Sara, Zed} siblingOf(x,y) Discussion #14 Chapter 2, Section 1 8/20

Predicate Evaluation (continued…) Sometimes we don’t know the “meaning” but we are “given” the assignments. For example: F T c b a P UoD = {a, b, c} P(x, y) Facts: P(b, c) P(c, a) P(a, c) Under a “closed world assumption,” we only need to list the facts (substitutions that evaluate to True). All others are False. Discussion #14 Chapter 2, Section 1 9/20

Instantiation Instantiation is the substitution of a constant for a variable (or in general, the substitution of a term, which is an expression that yields a constant.) Sxt A means substitute term t for all variables x in A. Sxt A is called an instantiation of A and t is said to be an instance of x. Examples: Sx3 P(x, y) = P(3, y) Sx3+1 P(x, y, z, x) = P(3+1, y, z, 3+1) = P(4, y, z, 4) Discussion #14 Chapter 2, Section 1 10/20

Universal Quantification Let A be an expression, and let x be a variable. If we want to say that P(x) is true for all substitutions of values for x in the UofD, we write xP(x). The symbol  is pronounced “for all” and is called the universal quantifier. Examples: All cats have tails, x(cat(x)  hasTail(x)). For every integer x, x+1 > x, x(>(x+1, x)). Discussion #14 Chapter 2, Section 1 11/20

Universal Quantification (continued…) x P(x) is shorthand for: x P(x) = P(a)  P(b)  P(c) with UoD = {a, b, c}. x P(x) = P(0)  P(1)  … with UoD = non-negative integers. x P(x) = T when P(x) = T for all substitutions from the UoD. (Only need one false predicate instantiation to make the formula false.) Examples: x red(x) = T for UoD = red apples x red(x) = F for UoD = apples Discussion #14 Chapter 2, Section 1 12/20

Existential Quantification Let A be an expression, and let x be a variable. If we want to say that P(x) is true for at least one value of x, we write xP(x). The symbol  is pronounced “there exists” and is called the existential quantifier. Examples: Some people like apples, x(likesApples(x)). There is an integer larger than 10, x(>(x, 10)). Discussion #14 Chapter 2, Section 1 13/20

Existential Quantification (continued…) x is shorthand for: x P(x) = P(a)  P(b)  P(c) with UoD = {a, b, c}. x P(x) = P(1)  P(2) … with UoD = non-negative integers. x P(x) = T when P(x) = T for one or more substitutions from UoD. (Only need one true predicate instantiation to make the formula true.) Examples: x red(x) = T for UoD = all apples x red(x) = F for UoD = golden delicious apples Discussion #14 Chapter 2, Section 1 14/20

Expressions with Quantifiers Quantifiers associate right to left. Example with UoD = {Ann, Sue, Tim} xy loves(x, y) = (x(y(loves(x, y)))) = x(loves(x, Ann)  loves(x, Sue)  loves(x, Tim)) = (loves(Ann, Ann)  loves(Ann, Sue)  loves(Ann, Tim))  (loves(Sue, Ann)  loves(Sue, Sue)  loves(Sue, Tim))  (loves(Tim, Ann)  loves(Tim, Sue)  loves(Tim, Tim)) We say, for every x, there exists a y such that x loves y. (Everybody loves somebody.) Discussion #14 Chapter 2, Section 1 15/20

Expressions with Quantificates (continued…) What about yx loves(x, y)? There exists a y such that for every x, x loves y. Somebody is loved by everybody. Not the same as everybody loves somebody. What about xy loves(x, y)? There exists an x such that for every y, x loves y. Somebody loves everybody. What about yx loves(x, y)? For every y there exists an x such that x loves y. Everybody is loved by somebody. Order matters. Discussion #14 Chapter 2, Section 1 16/20

Precedence Quantifiers have the highest precedence:    (unary operators)     yx P(x, y)  Q(x)  x R(x, y, z) y (x P(x, y))  Q(x)  (x R(x, y, z)) (y (x P(x, y)))  Q(x)  ((x R(x, y, z))) (y (x P(x, y)))  (Q(x)  ((x R(x, y, z)))) ((y (x P(x, y)))  (Q(x)  ((x R(x, y, z))))) Discussion #14 Chapter 2, Section 1 17/20

Scope, Bound, and Free Scope defines extent. Parentheses define scope, and precedence dictates how to insert parentheses. Bound variables define “sameness”. A variable is bound if it “is introduced by” a quantifier. A variable remains bound throughout the scope of the quantifier unless rebound by another quantifier in a nested sub formula. Any variable that is not bound is said to be free. We can consider bound variables to be local to the scope of the quantifier, just as parameters and locally declared variables in procedures are local to the procedure in which they are declared. If several quantifiers use the same bound variable for quantification, then all those variables are local to their scope and are distinct. Discussion #14 Chapter 2, Section 1 18/20

Scope, Bound, and Free (continued…) Which variables are bound and which are free? y x (P(x, y)  (Q(x)  x R(x, y, z))) Discussion #14 Chapter 2, Section 1 19/20

Scope, Bound, and Free (continued…) Which variables are bound and which are free? y x (P(x, y)  (Q(x)  x R(x, y, z))) y is bound x is bound x is bound z is free different x’s Discussion #14 Chapter 2, Section 1 20/20