CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 10 CS 1813 – Discrete Mathematics Quantify What? Reasoning with Predicates.

Slides:



Advertisements
Similar presentations
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Advertisements

© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 3 CS 1813 – Discrete Mathematics Truth Inference and the Logical Way.
Predicate Logic and Quantifies
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Adapted from Discrete Math
Section 1.3: Predicates and Quantifiers
Chapter 1: The Foundations: Logic and Proofs
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
Discrete Mathematics CS 2610 August 24, Agenda Last class Introduction to predicates and quantifiers This class Nested quantifiers Proofs.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Lecture 1.2: Equivalences, and Predicate Logic* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren, Zeph.
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
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying.
Scope, free variable, closed wff §In  X(A) or  X(A), where A is a wff : X is called the variable quantified over; A is said to be (within) the scope.
1 Introduction to Abstract Mathematics Proofs in Predicate Logic , , ~, ,  Instructor: Hayk Melikya Purpose of Section: The theorems.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 2 CS 1813 – Discrete Mathematics Proofs Propositions and Calculuses.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
CSS342: Quantifiers1 Professor: Munehiro Fukuda. CSS342: Quantifiers2 Review of Propositions Proposition: a statement that is either true or false, but.
Lecture 1.3: Predicate Logic CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Discrete Mathematics CS 2610 August 22, Agenda Last class Propositional logic Logical equivalences This week Predicate logic & rules of inference.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
Discrete Structures – CNS 2300
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Discrete Structures Predicate Logic 1 Dr. Muhammad Humayoun Assistant Professor COMSATS Institute of Computer Science, Lahore.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Discrete Mathematics Mathematical reasoning: think logically; know how to prove Combinatorial analysis: know how to count Discrete structures: represent.
1 Outline Quantifiers and predicates Translation of English sentences Predicate formulas with single variable Predicate formulas involving multiple variables.
Section 1.5 and 1.6 Predicates and Quantifiers. Vocabulary Predicate Domain Universal Quantifier Existential Quantifier Counterexample Free variable Bound.
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
Lecture 1.3: Predicate Logic, and Rules of Inference* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 14 CS 1813 – Discrete Mathematics A Little Bit of Set Theory.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
1 Section 7.3 Formal Proofs in Predicate Calculus All proof rules for propositional calculus extend to predicate calculus. Example. … k.  x p(x) P k+1.
Introduction to Predicates and Quantified Statements I Lecture 9 Section 2.1 Wed, Jan 31, 2007.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 CS 1813 – Discrete Mathematics Review of Predicate Calculus Set Theory Inductive.
CSE15 Discrete Mathematics 01/23/17
Discrete Mathematics.
Chapter 1 The Foundations: Logic and Proofs
Lecture 4 CS 1813 – Discrete Mathematics
CS 1813 – Discrete Mathematics
Lecture 12 CS 1813 – Discrete Mathematics
Today’s Topics Universes of Discourse
Lecture 13 CS 1813 – Discrete Mathematics
CS201: Data Structures and Discrete Mathematics I
CS 1813 – Discrete Mathematics
Lecture 16 CS 1813 – Discrete Mathematics
Quizzes CS 1813 – Discrete Mathematics
Lecture 9 CS 1813 – Discrete Mathematics
Lecture 11 CS 1813 – Discrete Mathematics
Introduction to Predicates and Quantified Statements I
MA/CSSE 474 More Math Review Theory of Computation
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Computer Security: Art and Science, 2nd Edition
Negations of quantifiers
Lecture 1.3: Predicate Logic
Metatheorems Computational Logic Lecture 8
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Predicates and Quantifiers
Lecture 8 CS 1813 – Discrete Mathematics
CS201: Data Structures and Discrete Mathematics I
Lecture 1.3: Predicate Logic
Presentation transcript:

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 10 CS 1813 – Discrete Mathematics Quantify What? Reasoning with Predicates

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 2 More Examples with Forall  — the Universal Quantifier  L — predicate about qsort  L(n)  length(qsort[a 1, a 2, …, a n ] ) = n  Universe of discourse: U = N = {0, 1, 2, … }   n.L(n) — Do you expect  n.L(n) to be True?  I — another predicate about qsort  I(n, k)  (qsort[a 1, a 2, …, a n ] = [b 1, b 2, …, b n ] )  (b k  b k+1 )  Universe of discourse: U = {(n, k)  N  N | 0  k  n}   (n, k).I(n, k) A predicate calculus formula because each I(n, k) is a proposition (a non-atomic one in this case) Do you expect  (n, k).I(n, k) to be True? Alternative formulation:  n  1.  0  k  n. I(n, k) –I(n, k) is a proposition –So,  0  k  n. I(n, k) is a WFF in predicate calculus –So,  n  1.  0  k  n. I(n, k) is a WFF in predicate calc

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 3 Still More Examples with Forall  — the Universal Quantifier  Predicates about (++)  C(n, m)  length( [a 1, a 2, …, a n ] ++ [b 1, b 2, …, b m ] ) = n + m Universe of discourse –U = N  N = {(0,0), (1,0), (0,1), (2,0), …}  (n, k).C(n, k) –Do you expect  (n, k).C(n, k) to be True? A more common way to express this idea –Universe of discourse: U = N –  n.  k. C(n, k) –Nested formula, same universe of discourse on each level  A(xs, ys, zs)  xs ++ (ys ++ zs) = (xs ++ ys) ++ zs Universe of discourse: U = {xs | xs :: [a] }, a  Haskell types  xs.  ys.  zs. A(xs, ys, zs) –Note three levels of nesting –Do you expect this formula to be True?

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 4  —the Existential Quantifier, There Exists   x.P(x)  This formula is a WFF of predicate calculus whenever P(x) is a WFF of predicate calculus  True if there is at least one x in the universe of discourse for which the proposition P(x) is True  False if  x.  P(x) is True  Equivalent to forming the Logical Or of all P(x)’s  Example – E predicate about maximum  E(n, k)  maximum[s 1, s 2, …, s n ] = s k   k.E(23, k) Universe of discourse: U = {1, 2, …, 23}  k.E(23, k) means E(23,1)  E(23,2)  …  E(23,23) Do you think  k.E(23, k) is True? Note: When U is finite, quantifiers not required –Clumsy to write big formulas without quantifiers, though –Without quantifiers, reasoning can be more complex, too

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 5 Another Example with There Exists  — the Existential Quantifier  R —predicate about qsort  R(n, j, k)  (qsort[a 1, a 2, …, a n ] = [b 1, b 2, …, b n ] )  (a j = b k )  Universe of discourse Triples of non-zero natural numbers where no number in the triple exceeds the first number in the triple U = {(n, j, k)  N  N  N | 0  k  n, 0  j  n}   k.R(1009, 503, k) Universe of discourse: U = {1, 2, 3, …, 1009} Do you expect  k.R(1009, 503, k) to be True?  Forall and There Exists, in combination  n  0.  0  j  n.  0  k  n. R(n, j, k) Universe of discourse: U = N = {0, 1, 2, … } Must use nesting in this case (because of mixture of  and  ) The universe of discourse is actually different for n than for j and k in this formula, but the constraints spell this out

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 6 Free Variables and Bound Variables  Variables in WFFs of predicate calculus  Denoted by lower-case letters  Examples of predicate calculus WFFs with variables F(p, q)  G(q, r)variables: p, q, r (  x.F(x))  (G(y)  H(y))variables: x, y (  x.F(x, y)  G(y))  (H(z)  K(x))variables: x, y, z  Free variables and bound variables  Let e stand for a WFF of predicate calculus  Bound variable  x. ex is bound in the formula  x. e  x. ex is bound in the formula  x. e  Free variables are variables that are not bound Which variables are free?

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 7 Arbitrary Variables  A variable is arbitrary in a proof if it does not occur free in any undischarged assumption of that proof  Examples  x. F(x)  {  E} F(x) G(x, y)  {  I}  y. G(x, y) x arbitrary? P(x)  Q  {  E L } P(x)  {  I} P(x)  Q  P(x)  {  I}  x. P(x)  Q  P(x) x arbitrary? discharged Yes No Yes

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 8 Inference Rules of Predicate Calculus...plus the inference rules of propositional calculus Which rules trigger discharges?  x. F(x) {universe is not empty}  {  E} F(x) F(x) {x arbitrary}  {  I}  x. F(x)  x. F(x) F(x) |– A {x not free in A}  {  E} A F(x)  {  I}  x. F(x)  x. F(x) {y not in F(x)}  {  R}  y. F(y)  x. F(x) {y not in F(x)}  {  R}  y. F(y) Renaming Variables Introducing/Eliminating Quantifiers F(x) {x, y arbitrary, y not in F(x)}  {R} F(y)

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 9  {  E}  y.F(x,y)  x.  y.F(x,y) An Easy Proof, Just to Warm Up using {  I} and {  E} Theorem (  commutes)  x.  y. F(x,y) |–  y.  x. F(x,y) proof  {  E} F(x,y) {note: x arbitrary}  {  I}  x. F(x,y) {note: y arbitrary}  {  I}  y.  x. F(x,y)  x.F(x)  {  E} F(x) plays role of F(x) in {  E} rule F(x) {x arb}  {  I}  x.F(x)

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 10  x. F(x) F(x) |– A {x not free in A}  {  E} A  x. P(x)  Q(x)  {  E} P(x)  Q(x) Existential Elimination something like {  E} Theorem 31  x. P(x),  x. P(x)  Q(x) |–  x. Q(x) proof  {  E} Q(x)  {  E}  x. Q(x) {x not free in  x.Q(x)}  x. P(x) discharge  P(x)  x. Q(x)  x  U. Q(x)plays role of A in {  E} rule P plays role of F in {  E} rule {  I}

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 11 Bad Theorem  x. P(x),  x. P(x)  Q(x) |–  x. Q(x) An Incorrect Proof So, {  I} rule is not properly cited. F(x) {x arbitrary}  {  I}  x. F(x) y is free in this assumption Problem is here  {  I}  x. Q(x)  x. P(x)  Q(x)  {  E} P(x)  Q(x)  {  E} Q(x)  {  E}  x. Q(x)  x. P(x) P(x) Purported proof

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 12  y. F(x, y)  {  E} F(x, y) Existential Qualifier Can Move In but it can’t move out — like a roach motel Theorem 32  x.  y.F(x, y) |–  y.  x. F(x, y)  {  I}  x. F(x, y)  {  E}  y.  x.F(x, y)  x.  y.F(x, y)  {  I}  y.  x. F(x, y) {y arb} F(y) {y arbitrary}  {  I}  y. F(y)  x. F(x) F(x) |– A {x not free in A}  {  E} A  y. F(y)  {  E} F(y) F(x)  {  I}  x. F(x) F( , y)  x.F(x,  )  y.F( , y) F(x,  )

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 13 End of Lecture