Académique Documents
Professionnel Documents
Culture Documents
(ENG 504)
504)
Lecture 5
/
Email: amhm@zu.edu.eg / amhm162@gmail.com
Webpage: http://www.staff.zu.edu.eg/amhm/
2013/2014
Agenda
Expert systems
Predicate logic
Predicate Logic
2013/2014
2013/2014
Predicate Logic
2013/2014
Predicate Logic
2013/2014
Predicate Logic
2013/2014
Predicate Logic
Each predicate variable has a Domain or Universe which is the set of values that
can be assigned to the variable.
Thus, If P(x) is a predicate and x has domain U, the truth set of P(x) is the set
of all elements in U such that P(t) is true.
Example:
U={1,2,3,4,5,6,7,8,9,10}
P(x): x is prime
The truth set is {1,2,3,5,7}
2013/2014
Predicate Logic
Quantifiers:
x which means for all x in its domain is called the universal quantifier.
Example: All Human are Mortals, here is its FOL translation:
predicate: All x are y
H(x): x is a human
M(y): y is mortal
x, H(x) M(x)
x which means at least, there exists one value of x from its domain is
called the existential quantifier.
Example: Some numbers are prime
P(x): x is prime
x, P(x)
Dr. A. Helmi Eng. Sys. Design and Analysis (ENG 504)
2013/2014
Predicate Logic
x, M(x) B(x)
Answer: There exists one rational number such that it is greater than 3 and its
cubic is greater than 27.
Predicate Logic
2013/2014
10
2013/2014
Predicate Logic
Notice that:
11
If U={1,2,3}, then
Predicate Logic
2013/2014
12
x, P(x)
x ,P(x)
x,P(x) x, P(x)
2013/2014
Predicate Logic
13
distributes over :
x, (P(x) Q(x)) x,P(x) x,Q(x)
distributes over :
x,(P(x) Q(x)) x,P(x) x,Q(x)
But notice that: x,(P(x) Q(x)) x,P(x) x,Q(x)
is True.
Predicate Logic
2013/2014
14
Rules of inference:
1.
x, (P(x) Q(x))
Given
P(c)
Q(c)
Conclusion
2013/2014
Predicate Logic
15
Rules of inference:
2. Universal Modus Tollens :
Example:
All dogs bark
x, (P(x) Q(x))
Q(c)
P(c)
Predicate Logic
2013/2014
16
Rules of inference:
3. Universal Hypothetical Syllogism:
x, (P(x) Q(x))
x, (Q(x) R(x))
x, (P(x) R(x))
2013/2014
Predicate Logic
17
2013/2014
Predicate Logic
18
Example 3:
A horse that is registered for todays race is not a thoroughbred.
Every horse registered for todays race has won a race this year.
Therefore a horse that has won a race this year is not a thoroughbred. Proof?
Solution:
Predicates: P(x): x is registered for todays race
Q(x): x is a thoroughbred
R(x): x won a race this year
Domain: all horses.
FOL representation: x, (P(x) Q(x))
x, (P(x) R(x))
x, (R(x) Q(x))
Dr. A. Helmi Eng. Sys. Design and Analysis (ENG 504)
2013/2014
Predicate Logic
19
Example 3: Solution:
To proof that x, (R(x) Q(x)) we use the inference rules:
Step
Reason
x, (P(x) Q(x))
Given
From 1
P(a)
From 1
Q(a)
From 1
x, (P(x) R(x))
Given
P(a) R(a)
From 5
R(a)
From 3,6
R(a) Q(a)
From 4,7
x, (R(x) Q(x))
From 8
2013/2014
Predicate Logic
20
Example 4:
Tony, Shi-Kuo and Ellen belong to the Hoofers Club. Every member of the
Hoofers Club is either a skier or a mountain climber or both. No mountain
climber likes rain, and all skiers like snow. Ellen dislikes whatever Tony likes and
likes whatever Tony dislikes. Tony likes rain and snow.
Query: Is there a member of the Hoofers Club who is a mountain climber but
not a skier?
2013/2014
Predicate Logic
21
Example 4: Solution:
Predicates: S(x) : x is a skier , Domain: Hoffers club
M(x) : x is a mountain climber, Domain: Hoffers club
L(x,y) : x likes y, Domain of y: snow and rain.
x,S(x) v M(x)
FOL representation:
2013/2014
Predicate Logic
22
Example 4: Solution:
Step
Reason
x,S(x) v M(x)
given
M(x) v S(x)
From 1
given
given
L(Tony, x) L(Ellen, x)
given
L(Tony, Snow)
given
L(Ellen, Snow)
From 5,6
S(Ellen)
From 7,4
M(Ellen)
From 9,2
10
M(Ellen) S(Ellen)
From 10
Answer is Ellen
2013/2014
Applications
23
There are programming languages that are built upon the concepts of predicate
logic, i.e., PROLOG (programming in logic).
There are numerous examples of Expert Systems that are based on rule-based
reasoning:
DENDRAL : Infers molecular structure from the information provided by
a mass spectrometer
MYCIN: Diagnosis of blood infections, 450 rules; performs as well as
experts
PROSPECTOR: Correctly recommended exploratory drilling at geological
site
Assignment #2
#2
2013/2014
24
Predicate statements.
2. FOL representation.
3. Inference steps.
4. Answer to the query.
Dr. A. Helmi Eng. Sys. Design and Analysis (ENG 504)
2013/2014
Thanks