5 - Predicate Logic (Lecture 19-22)
5 - Predicate Logic (Lecture 19-22)
Chandra Prakash
LPU
INTRODUCTION
Previous chapter much has been illustrated about knowledge and KR
related issues
This chapter , illustrates how knowledge may be represented as “symbol
structures” that characterize bits of knowledge about objects, concepts,
facts, rules, strategies.
Chandra Prakash
To present real world facts as logical
prepositions written as well-formed formulas
(wff)
7
PROPOSITIONAL LOGIC
A proposition is a statement, which in English would be a
declarative sentence. Every proposition is either TRUE or FALSE.
Examples:
(a) The sky is blue.,
(b) Snow is cold. ,
(c) 12 * 12=144
propositions are “sentences” , either true or false but not both.
a sentence is smallest unit in propositional logic.
if proposition is true, then truth value is "true" .if proposition is
false, then truth value is "false"
STATEMENT, VARIABLES AND
SYMBOLS
Simple statements (sentences),
Chandra Prakash
RAINING
It is sunny
SUNNY
It is windy
WINDY
If it is raining, then it is not sunny
RAINING SUNNY
16
CONT…
If we want to represent
Mohit is a man
Chandra Prakash
Mohitman
Rohit is a man
Rohitman
17
MAN(MOHIT)
MAN(ROHIT)
Chandra Prakash
Structure of representation reflects the
structure of knowledge itself.
Need to use predicate applied to arguments
Chandra Prakash
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. All Pompeians were either loyal to Caesar or hated
him.
6. Every one is loyal to someone.
7. People only try to assassinate rulers they are not
loyal to.
8. Marcus tried to assassinate Caesar.
21
1. Marcus was a man.
man(Marcus)
Chandra Prakash
2. Marcus was a Pompeian.
Pompeian(Marcus)
3. All Pompeians were Romans.
x: Pompeian(x) Roman(x)
4. Caesar was a ruler.
ruler(Caesar)
22
USING PREDICATE LOGIC
5. All Pompeians were either loyal to Caesar or hated him.
inclusive-or
x: Pompeians (x) loyalto(x, Caesar) hate(x, Caesar)
exclusive-or
x: Pompeians (x) (loyalto(x, Caesar) hate(x,
Caesar))
(loyalto(x, Caesar) hate(x,
Caesar))
23
6. Every one is loyal to someone.
x: y: loyalto(x, y)
Chandra Prakash
y: x: loyalto(x, y)
24
CONT…
Chandra Prakash
x: y: person(x) ruler(y)
tryassassinate(x, y)
loyalto(x, y)
Chandra Prakash
Using 7 & 8 fact, we can predict
Backward chaining
man(Marcus)
ruler(Caesar)
tryassassinate(Marcus, Caesar)
x: man(x) person(x)
loyalto(Marcus, Caesar) 26
USING PREDICATE LOGIC
Many English sentences are ambiguous.
Chandra Prakash
28
WAY TO REPRESENT CLASS
MEMBERSHIP
1. Class membership with unary predicates
Chandra Prakash
1. Man(Marcus).
2. Pompeian(Marcus).
3. x: Pompeian(x) Roman(x).
4. ruler(Caesar).
5. x: Roman(x) loyalto(x, Caesar) hate(x,
Caesar).
29
CONT…
Chandra Prakash
1. instance(Marcus, Man).
2. instance(Marcus ,Pompeian).
3. x: instance(x ,Pompeian) instance(x,
Roman).
4. Instance(Caesar, ruler).
5. x: instance(x, Roman) loyalto(x, Caesar)
hate(x, Caesar).
30
CONT…
Chandra Prakash
1. instance(Marcus, Man).
2. instance(Marcus ,Pompeian).
3. isa(Pompeian, Roman).
4. Instance(Caesar, ruler).
5. x: instance(x, Roman) loyalto(x, Caesar)
hate(x ,Caesar).
6. x: y: z: instance(x, y) isa(y,z)
31
instance(x,z)
COMPUTABLE FUNCTIONS AND
PREDICATES
Simple facts can be expressed as combination of individual
predicates,
Eg : tryassassinate(Marcus, Caesar)
Chandra Prakash
3. Marcus was born in 40 A.D
33
Is Marcus alive?
1. Marcus was a man man(marcus)
2. Marcus was Pompeian. Pompeian(Marcus)
Chandra Prakash
3. Marcus was born in 40 A.D born(marcus,40)
Chandra Prakash
alive(x,t) ]
35
REASONING
1. Marcus was a Pompeian.
Pompeian(Marcus)
36
RESOLUTION
Goes from conclusions to the given facts.
Produce proof by refutation
It gains its efficiency from the fact that it operates on
statements that have been converted to a very convenient
standard form.
To prove a statement, resolution attempts to show that the
negation of the statement produces a contradiction with the
known statements ( i.e. that it is unsatisfiable.)
37
RESOLUTION
The basic ideas
KB | KB |false
( ) ( ) ( )
38
CONVERSION TO CLAUSE FORM
1. Eliminate .
P Q P Q
2. Reduce the scope of each to a single term.
(P Q) P Q
(P Q) P Q
x: P x: P
x: p x: P
P P
44
QUESTION ANSWERING
1. When did Marcus die?
2. Whom did Marcus hate?
3. Who tried to assassinate a ruler?
4. What happen in 79 A.D.?.
5. Did Marcus hate everyone?
45
LIMITATIONS OF RESOLUTION
( EVOLUTION OF NATURAL
DEDUCTION)
The previous method of resolution brings uniformity, everything
looks the same. Hence at times, it becomes very difficult to pick
the statement that may be useful in solving the problem.
As we convert everything into clause form, we loose important
heuristic information.
Eg. We believe that all judges who are not crooked are well-
educated
¥x : judge(x) À ¬ crooked (x) educated(x)
In the clause form it will take the following shape
¬ judge (x) V crooked(x) V educated(x)
NATURAL DEDUCTION