Professional Documents
Culture Documents
Knowledge
Reasoning & Inference
Reasoning
Analogi
Common
Deductive
Abductive
Inductive deduce new info
cal
sense
drawing conclusion from a set of
from the lessons observed cases
learned – look (generalization)
for similarities
& differences
deductive reasoning that
allows plausible inference
Important Concepts
Pattern Instantiatio
Unification
matching n
Substitute/
Matching Pattern
replace a
between matching
variable
symbols,
with +
and
another instantiatio
between
variable or n
predicates.
a constant.
Pattern Matching
2 symbols/predicates
are matched if they arePattern 2
identical
mi
sm
tweety tweety ... match
atc
h
mismatch
Pattern3 tweaty ... not match
tweety
Pattern 1
fly flies ... not match
a tch
man men ... not match
m
Pattern 4
teach(X, math) teach(she,
math) ... match
Pattern Matching
tweety tweety exactly the same string of symbols
Modus Ponens
Hypothetical
Modus
Resolution
Tollens
Syllogism
Chaining Strategies:
• Forward
• Backward
Modus Ponens
Definition: Rule of logic that asserts IF A and (A
B) are known to be true, then one can infer that B is
true.
1. A
2. A B
3. B
Modus Ponens
A B
A
B
((A B) A) B
..... a tautology
Modus Ponens
ABC
A
B
C
((((A B) C) A) B) C
Forward & Backward
Chaining Strategy
1 2 3 4
R2: X B E Y
R3: A X
R4: C L
R5: L M N
Finally, fire
Repeat Step 3 the goal rule.
by jumping
If found, and firing all
check its relevant sub-
premise(s). goal rules.
Search for • If premise is
the goal rule. primitive, check if
it is in the
working memory,
ask user a
Identify question if it is
not there.
the goal. • If premise is non-
primitive, jump
to the rule where
it belongs to as a
conclusion (sub-
goal rule).
Repeat Step 3.
Example
R1: (A and B) or C implies
D
R2: D and G implies T
◦ Goal …. T.
◦ Goal rule ….. R2.
◦ T is unknown, thus stack R2 and attempt to establish D and G.
D becomes the sub-goal … search a rule with in THEN part, find
it at R1, stack R1. Attempt to establish both A and B or just C.
If A and B true, fire R1 and add D into working memory.
Return to sub-goal D. Next, check G.
R1: (A and B) or C implies
D
R2: D and G implies T
? X Y Z
X
Y
Z
YDZ
XBEY
AX
CL
LMN
Backward vs Forward Chaining
Attribute Backward Chaining Forward Chaining
Also known as Goal-driven Data-driven
Starts from Possible conclusion New data
Processing Efficient Somewhat wasteful
Aims for Necessary data Any conclusion (s)
Approach Conservative/cautious Opportunistic
Practical if Number of possible final Combinatorial explosion
answers is reasonable or creates an infinite number of
a set of known possible right answers
alternatives is available
Appropriate for Diagnostic application Scheduling and monitoring
Example of Selecting a specific type Making changes to corporate
application of investment pension fund
Exercise 1
R1: cheerful(X) happy(aunt_petunia)
R2: kicking(X, Y) eating(X) cheerful(X)
R3: wizard(X) magical(X)
R4: magical(X) scares(X,dudley) hates(uncle_vernon, X)
A1: wizard(harry).
A2: muggle(aunt_petunia).
A3: muggle(uncle_vernon).
A4: scares(hagrid, dudley).
A5: chases(crookshanks, scabbars).
A6: eating(dudley).
(a) Apply Forward Chaining and list all the newly generated
facts.
(b) Use Backward Chaining to prove all aunt_petunia is happy is
true
Exercise 2
R1: caught_with(X1, Y1) attempted_to_bring_in(X1, Y1, C1).
R2: foreign_visitor(X2) drugs(Y2) country(C2)
attempted_to_bring_in(X2/casey,Y2/cocine,C2/malaysia)
facing(X2, death_penalty).
A1: country(malaysia)
A2: foreign_visitor(casey)
A3: drugs(cocaine)
A4: caught_with(casey, cocaine)