Professional Documents
Culture Documents
1
Chapter 3
2
Contents
1 PL drawbacks
2 Predicate
3 Quantifiers
5 Reasoning in FOL
3
PL drawbacks
"Not all integers are even", "some integers are not even"
4
PL drawbacks
✓ Predicates
✓ Quantifiers
5
Predicate
❖blue(tom’s car)
❖is_blue(sky)
❖b(book’s cover)
6
Predicate
❖parent(ahmed, ali)
❖give(ahmed, book, ali)
7
Predicate
8
Predicates with Connectives
Cool(john) → Cool(kay)
¬ Cool(john)
¬ Cool(john)&¬Cool(kay)
9
Quantifiers
10
Quantifiers
11
Quantifiers
Universal Quantifier
❖ The expression: x P(X), denotes the universal
quantification of the atomic formula P(X)
12
Quantifiers
13
Quantifiers
Existential Quantifier
❖ The expression: xP(X), denotes the existential
quantification of the atomic formula P(X).
❖ xP(X) translated into the English as:
14
Quantifiers
15
Quantifiers
16
Quantifiers
17
Quantifiers
18
Quantifiers
▪ Ex:
✓ In ∃x P(x, y), the variable x is bound while y is free.
✓ In x [∃y P(x, y) v Q(x, y) ]:
x and the y in P(x, y) are bound, while y in Q(x, y) is free,
because the scope of ∃ y is P(x, y) and The scope of x is
[∃ y P(x, y) v Q(x, y) ].
19
Quantifiers
20
Quantifiers
Translating English to Predicate Logic WFFs
x [L(ali,X) → L(ahmed,X)]
21
Quantifiers
Translating English to Predicate Logic WFFs:
E(x): x is even , O(x): x is odd
❖ "Not every integer is even"
¬ x E(x)
x ¬E(x)
x E(x) Λ x O(x)
22
Quantifiers
Translating English to Predicate Logic WFFs:
E(x): x is even , O(x): x is odd
❖ "If an integer is not even, then it is odd"
x [¬E(x) → O(x) ]
23
Quantifiers
Translating English to Predicate Logic WFFs:
I(x): x is integer, E(x): x is even , O(x): x is odd
❖ "All integers are even"
x [ I(x) → E(x) ]
x [I(x) Λ O(x)]
x [ E(x) → I(x) ]
24
First Order Logic (FOL)
Predicate Logic
25
First order logic (FOL)
Interpretation
❖ A WFF in general not proposition. EX : x P(X)
where P(X) denote: “X is Positive“
26
First order logic (FOL)
Evaluation
❖ Suppose we have two predicates p(x), q(x,y), and the
universe of discourse is the set {a,b}
❖ Suppose the following truth assignment:
p(a): T p(b): F
q(a,a): T q(b,b): F
q(a,b): F q(b,a): T
❖ The truth assignment for the wff: x [p(X) → q(X,X)] is:
Evaluation
❖ Suppose we have two predicates p(x), q(x,y), and the
universe of discourse is the set {a,b}
❖ Suppose the following truth assignment:
p(a): T p(b): F
q(a,a): T q(b,b): F
q(a,b): F q(b,a): T
❖ The truth assignment for the wff: x y q(X,Y) is:
[y q(a,Y) & y q(b,Y) ]
[ [q(a,a) q(a,b)] & [q(b,a) q(b,b)] ]
[ [T F] & [T F] ]
[ T & [T F] ]
[T&T]
T
28
First order logic (FOL)
Satisfaction
❖ Suppose we have two predicates p(x), q(x), and the universe
of discourse is the set {a,b}.
❖ The truth table for the wffs:
p(a) p(b)
x [p(X) → q(X)]
x q(X)
30
First order logic (FOL)
❖ Equivalence:
➢ Two wffs W1 and W2 are equivalent if and only if W1 ↔
W2 is valid, that is if and only if W1 ↔ W2 is true for all
interpretations.
➢ Ex: x P(x) and ¬x ¬P(x) are equivalent for any
predicate name P.
➢ Also, x [P(x) Λ Q(x)] and x P(x) Λ x Q(x) are
equivalent.
31
Reasoning in FOL
32
Reasoning in FOL
33
Reasoning in FOL
34
Reasoning in FOL
35
Reasoning in FOL
(EG):
36
Reasoning in FOL
• ¬xP(x) ↔ x¬P(x)
• ¬xP(x) ↔ x¬P(x)
Ex: let P(x) represents x is happy and the universe is the set of
people
37
Reasoning in FOL
x[P(X)&G(X)]
❖ Predicates :
▪ P(x): x is Positive
▪ G(x): x is greater than zero
▪ The universe is the set {1,2,3}
38
Reasoning in FOL
1) x[P(X)&G(X)] Premise
2)P(1)&G(1) 3 UI
3) P(1) 2 Simpl.
4) G(1) 2 Simpl.
5) xP(X) 3 UG
6) x G(X) 4 UG
7) xP(X) & x G(X) 5,6 Conj #
39
Reasoning in FOL
❖ Predicates :
▪ C(x): x is a check.
▪ T(x): x has been cashed within 30 days.
▪ V(x): x is void.
▪ S(x): x can be cashed.
40
Reasoning in FOL
x [ C(X)& ¬S(X)]
❖ Predicates :
▪ C(x): x is a check.
▪ T(x): x has been cashed within 30 days.
▪ V(x): x is void.
▪ S(x): x can be cashed.
41
Reasoning in FOL
1) C(this_check) Premise
2) ¬T(this_check) Premise
42
Assignment_3
44