ct214 – logical foundations of computing lecture 6 predicate calculus
TRANSCRIPT
CT214 – Logical Foundations of ComputingCT214 – Logical Foundations of Computing
Lecture 6Lecture 6
Predicate CalculusPredicate Calculus
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.
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”
Variables: X, Y, Z
Quantifiers: ,
Symbols: , ( ), { }
Universe: U
where U = {u1, u2, u3, ............., un}
Definition: Universal quantifier
X : U P(X)
Means P(u1) ^ P(u2) ^ P(u3) ............. ^ P(un)
Definition: Existential quantifier
X : U P(X)
Means P(u1) v P(u2) v P(u3) ............. v P(un)
Atomic predicate – Built from predicate symbol, constants, variables and symbols like ( ), but not using connectives.
Predicate Symbol
For example:P ( X ) or P ( joe )
Variable Constant
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”
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”
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
1. Relative Universal Quantification
X : U R( X ) -> P( X )
2. Relative Existential Quantification
X : U R( X ) ^ P( X )
Example: Each German must vote
X : U G( X ) -> V( X )
G - Germans
V - Voters
U – All people
Note that the universe is important!
Each German must vote
X : U V( X )
V - Voters
U – All Germans
Example: Some French don’t vote
X : U F( X ) ^ ¬V( X )
F - French
¬V – Non-voters
U – All people
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
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”
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.
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.