33
Predicate Logic

Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Predicate Logic

Page 2: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)
Page 3: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)
Page 4: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)
Page 5: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)
Page 6: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Universal Quantifier

• Everything of a certain kind has a certain property (for every, for all)

Page 7: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Universal quantifier

Page 8: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Universal quantifier

Page 9: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Existential quantifier

Page 10: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Existential quantifier

Page 11: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Existential quantifier

Page 12: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Constraints

Page 13: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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

Page 14: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Recast with Constraints

Page 15: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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)

Page 16: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Free variables

Page 17: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Free Variables

Page 18: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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

Page 19: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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

Page 20: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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

Page 21: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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))

Page 22: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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))

Page 23: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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)

Page 24: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Equality

Page 25: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Equality

• 1 + 1 = 2• First day of fasting = first Ramadan

Page 26: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Equality : property

• Symmetric; if s=t then t=s• Transitivity; s=t, t=u, then s=u

Page 27: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Uniqueness and quantity

Page 28: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

• 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

Page 29: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

• 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’

Page 30: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

• 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)

Page 31: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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

Page 32: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

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

Page 33: Predicate Logic. Universal Quantifier Everything of a certain kind has a certain property (for every, for all)

Definite Description