Presentation is loading. Please wait.

Presentation is loading. Please wait.

CT214 – Logical Foundations of Computing Lecture 6 Predicate Calculus.

Similar presentations


Presentation on theme: "CT214 – Logical Foundations of Computing Lecture 6 Predicate Calculus."— Presentation transcript:

1 CT214 – Logical Foundations of Computing Lecture 6 Predicate Calculus

2 Predicate Calculus - The extension of propositional calculus that enables the use of variables such that quantified statements such as “there exists an x such that...” or “for any x, it is the case that...”, can be dealt with. Predicate – A function that returns either true or false. Quantifier – A symbol that indicates the degree to which the predicate is true for a specified set.

3 Universal Quantifier ( ) – Indicates that a predicate is true for all members of a specified set. Equivalent to saying – “For each” Existential Quantifier ( ) – Indicates that a predicate is true for at least one member of a specified set. Equivalent to saying – “There exists”

4 Variables: X, Y, Z Quantifiers:, Symbols:, ( ), { } Universe: U whereU = {u 1, u 2, u 3,............., u n }

5 Definition:Universal quantifier X : U P(X) Means P(u 1 ) ^ P(u 2 ) ^ P(u 3 )............. ^ P(u n ) Definition:Existential quantifier X : U P(X) Means P(u 1 ) v P(u 2 ) v P(u 3 )............. v P(u n )

6 Atomic predicate – Built from predicate symbol, constants, variables and symbols like ( ), but not using connectives. Predicate Symbol For example:P ( X )orP ( joe ) VariableConstant

7 P( joe )“joe is a tall person” P( X )“X is a tall person” U = the set of all people,X is an element of U Q( joe, cisco )“joe is employed by cisco” Q( X, Y )“person X is employed by company Y”

8 R( yuri, russia, russian ) “yuri from russia speaks russian” R( X, Y, Z ) “person X from country Y speaks language Z” Predicates can be formed by combining atomic predicates using logical connectives e.g.P( X ) ^ Q( X, Y ) “X is a tall person AND X is employed by Y”

9 Relative Quantification – Want to restrict or to some subset of U that satisfies some criteria. 1.Relative Universal Quantification X : U R( X ) -> P( X ) 2. Relative Existential Quantification X : U R( X ) ^ P( X ) R is a statement which narrows down the universe

10 1.Relative Universal Quantification X : U R( X ) -> P( X )

11 2. Relative Existential Quantification X : U R( X ) ^ P( X )

12 Example:Each German must vote X : U G( X ) -> V( X ) G - Germans V - Voters U – All people

13 Note that the universe is important! Each German must vote X : U V( X ) V - Voters U – All Germans

14 Example:Some French don’t vote X : U F( X ) ^ ¬V( X ) F - French ¬V – Non- voters U – All people

15 Example:London is bigger than any city in Europe X : U E( X ) -> B( London, X ) E( X ) – X is a European city B( Y, X ) – City Y is bigger than city X

16 Empty universes: U = = { } = null set X : U P( X )= True X : U P( X )= False Example: “All Irish people who went to the moon liked it there”

17 Example: “All Irish people who went to the moon liked it there” U = {All Irish people who went to the moon} = X : U L( X )= True No Irish people every went to the moon so “All Irish people who went to the moon liked it there” is a true statement.

18 Example: “Some Irish people who went to the moon liked it there” U = {All Irish people who went to the moon} = X : U L( X )= False There must be at least one Irish person who went to the moon in order for it to be possible for this statement to be true.


Download ppt "CT214 – Logical Foundations of Computing Lecture 6 Predicate Calculus."

Similar presentations


Ads by Google