View
215
Download
0
Embed Size (px)
Citation preview
Predicate Logic
Universal Quantifier
• Everything of a certain kind has a certain property (for every, for all)
Universal quantifier
Universal quantifier
Existential quantifier
Existential quantifier
Existential quantifier
Constraints
Constraints
• Universal quantification with constraint
D | P • Q
• Existential quantification with constraint
D | P • Q
Where D is declaration, P is predicate acting as constraint and Q is predicate being quantified
Recast with Constraints
Examples
• For every natural number n, less than or equal to 10, n squared is less than or equal to a hundred.
n : | n 10 • n2 100
or
n : • (n 10 n2 100)• For some natural number n, less than or equal to 10, n
squared is 64.
n : | n 10 • n2 = 64
or
n : • (n 10 n2 = 64)
Free variables
Free Variables
Free Variables
y : • x = y2 , x is free variable, y is a bound variable; y can be replaced by almost any name.
p : • x = p2, the meaning of the existential quantification is unchanged
x : • x = x2 , x no longer free
Mixing quantifiers
• Predicate begins with two quantifiers, one existential and one universal
• Must take care about changing their order, as in general this is not possible
x : • ( y : • y > x) – given any integer we can
always find bigger than it
` y : • ( x : • y > x) – we can find an integer
that is bigger than all the
integers
Example
• Sao Paolo is bigger than any other city in the same country• Rephrase it to
there is a certain country to which Sao Paolo belongs,
and Sao Paolo is bigger than any other city in that country
Formally stated
co : country • Sao Paolo is in co
ci : city • ci is in co ci is Sao Paolo
Soa Paolo is bigger than ci
Negation of quantifiers
• The negation of ‘Everything of a certain kind has a certain property’ is ‘at least one thing of that kind does not have that property’
• Example
n : | n > 5 • n2 > 100 -- every natural number greater than 5
has a square that is greater than 100
• Its negation
n : | n > 5 • n2 100 --- some natural number greater than 5
has a square that is not greater than
100• In general
(D | P • Q) ( D | P • (Q))
Negation of quantifiers
• The negation of ‘at least one thing of a certain kind has a certain property’ is ‘Everything of that kind does not have that property’
• Example
n : | n > 5 • n2 = 100 – there is a natural number greater than 5
whose square is 100• Its negation
n : | n > 5 • n2 100 -- every natural number greater than 5
has a square that is not 100• In general
( D | P • Q) ( D | P • (Q))
Example
• Sao Paolo is bigger than any city in Europe• Rephrase as follows:
for every city c
if c is in Europe then
Sao Paolo is bigger than c
• Formally can be written as
c : city • c is in Europe Sao Paolo is bigger than c
or
c : city • (c is in Europe Sao Paolo is bigger than c)
Equality
Equality
• 1 + 1 = 2• First day of fasting = first Ramadan
Equality : property
• Symmetric; if s=t then t=s• Transitivity; s=t, t=u, then s=u
Uniqueness and quantity
• Let x loves y mean that x is in love with y, and let Person be the set of all people
• Symbolizing proposition ‘only Romeo loves Juliet’
Romeo loves Juliet
p : Person • p loves Juliet p = Romeo
• Statement ‘there is at most one person with whom Romeo is in love’• Formally written
p, q : Person •
Romeo loves p Romeo loves q p = q
if p and q are two people that Romeo loves, then they must be the same person
• Statement ‘no more than two visitors are permitted’
• The notion of ‘at least one’ can be formalised using existential quantifier
• Statement ‘at least one person has applied’
p : Person : p Applicants• Statement ‘there are at least two applicants’; we use equality
p, q : Applicants • p q• Statement ‘there is exactly one book on my desk’
b : Book • b Desk ( c : Book | c Desk • c = b)
Definite Description
• We may describe an object in terms of its properties without giving it a name
• Examples indicate there is a unique object with certain properties
- the man who shot John Lennon
- the woman who discovered radium
- the oldest faculty in UPM
Definite Description
• The -notation is use for definite description of object• We write ( x : a | p) to denote the unique object x from a such that
p• Examples indicate there is a unique object with certain properties
( x : Person | x shot John Lennon)
( y : Person | y discovered radium)
( z : Faculty | z is the oldest faculties in UPM)
Marie Curie = ( y : Person | y discovered radium)
Marie Curie Person Marie Curie discovered radium
Definite Description