Title: Inference Techniques
1Chapter 13
2Reasoning in Artificial Intelligence
- Knowledge must be processed (reasoned with)
- Computer program accesses knowledge for
inferencing - Inference engine or control program
- Rule interpreter (in rule-based systems)
- The inference engine directs search through the
knowledge base - The application of inference rules is called
pattern matching
3Reasoning Methods
Deductive Reasoning
- Move from a general principle to a specific
inference. A general principle is composed of two
or more premises - Deduce new information from logically related
known information. - Uses problem facts or axioms and related general
knowledge in the form of rules or implications
4Reasoning Methods
Deductive Reasoning
- The process begins with comparing the axioms with
a set of implications to conclude new axioms. - Ex.,
- Implication I will get wet if I am standing
- in the rain
- Axiom I am standing in the rain
- Conclusion I will get wet
5Reasoning Methods
Inductive Reasoning
- Move from some established facts to draw general
conclusions - Arrive at a general conclusion from a limited set
of facts by the process of generalization. - We form a generalization which we believe applies
to all cases of a certain type, on the basis of a
limited number of cases.
6Reasoning Methods
Inductive Reasoning
- Ex.,
- Premise Monkeys in the Pittsburgh zoo
- eat bananas
- Premise Monkeys in the Cleveland zoo
- eat bananas
- Conclusion In general, all monkeys eat
- bananas
7Reasoning Methods
Analogical Reasoning
- Derive an answer to a question by known analogy.
It is a verbalization of internalized learning
process. Use of similar experiences - They draw analogies between the two, looking for
similarities and differences to guide their
reasoning.
8Reasoning Methods
Analogical Reasoning
- Tiger Frame
- Specialization-of ANIMALS
- Number-of-legs 4
- Eats meat
- Lives India and Southeast Asia
- Color tawny with stripe
9Reasoning with Logic
Modus Ponens
- If A, then B and the fact that A is true, then B
is also true - A AND (A ? B) ? B
- A and (A ? B) are propositions in a knowledge
base - A It is sunny.
- B We will go to the beach
- A-gtB If it is sunny, then we will go to the
beach - Conclusion We will go to the beach
10Reasoning with Logic
- Modus Tollens
- If (A-gtB) is known to be true, and B is false,
then A is flase - Resolution combines substitution, modus ponens,
and other logical syllogisms - If (AVB) is true and (BVC) is true
- THEN (AVC) is true
11Inferencing with Rules
Forward and Backward Chaining
- Apply modus ponens
- Firing a rule When all of the rule's hypotheses
(the if parts) are satisfied - Can check every rule in the knowledge base in a
forward or backward direction - Continues until no more rules can fire, or until
a goal is achieved
12Forward and Backward Chaining
- Chaining Linking a set of pertinent rules
- Search process directed by a rule interpreter
approach - Forward chaining if the premise clauses match
the situation, then the process attempts to
assert the conclusion - Backward chaining if the current goal is to
determine the correct conclusion, then the
process attempts to determine whether the premise
clauses (facts) match the situation
13Backward Chaining
- Goal-driven - Start from a potential conclusion
(hypothesis), then seek evidence that supports
(or contradicts) it - Often involves formulating and testing
intermediate hypotheses (or subhypotheses)
14Backward Chaining
Procedure (goal Pay the bill)
- The inference engine starts by assuming the
conclusion Action needed pay the bill as the
possible solution to the goal, rule 5. It will
try to answer the question, Under what
conditions should the bill be paid? - The next step is to prove the premise of rule 5.
It looks at each rule in the KB to find the
action part of a rule that matches the premise of
rule 5. It finds it in rule 3.
15Backward Chaining
Procedure (goal Pay the bill)
- The inference engine goes to rule 3 and looks for
the action part og a rule that matches the
premise of rule 3. It find it in rule 1. - The systems tries to prove the premise of rule 1.
Since no other rules action matches the premise
of rule 1, in this case, the inference engine
asks the user, What is todays date? Whatever
it is, the default message would be Todays date
is due date.
16Backward Chaining
- Step Rule Rule
- 4 R1 IF due date on or before to day
- THEN payment is due
- 3 R2 IF due date is after today
- THEN payment is NOT due
- R3 IF payment is due
- THEN paying is recommended
- 2
- R5 IF paying is recommended
- 1 THEN action needed. Pay the bill
GOAL
17Forward Chaining
- Data-driven - Start from available information as
it becomes available, then try to draw
conclusions - What to Use?
- If all facts available up front (as in auditing)
- forward chaining - Diagnostic problems - backward chaining
18Forward Chaining
Procedure
- The system obtains problem information from the
user and places it in the working memory. - The inference engine scans the rules in some
predefined sequence looking for one whose premise
match the contents in the working memory. - If it finds a rule, it adds the rules conclusion
to the working memory (called firing the rule). - Then cycles and checks the rules again looking
for new matches. - On the new cycle, rules that previously fired are
ignored. - This process continues until no matches are found
19Forward Chaining
Step Rule Rule R1 IF due date
on or before to day THEN payment is due 1
R2 IF due date is after today THEN
payment is NOT due R3 IF payment is
due THEN paying is recommended 2
R5 IF paying is recommended THEN action
needed. Pay the bill
20The Functions of The Inference Engine
- Fire the rules
- Present the user with questions
- Add the answer to the ES blackboard (assertion
base) - Infer a new fact from a rule
- Add the inference fact to the blackboard
- Match the blackboard to the rules
- It there are any matches, fire the rules
- If there are two further matches, check to see
whether a goal is reached - Fire the lowest-numbered unfired rule
21The Inference Tree
- (Goal Tree or Logical Tree)
- Schematic view of the inference process
- Similar to a decision tree (Figure 13.3)
- Inferencing tree traversal
- Advantage Guide for the Why and How Explanations
22The Inference Tree
G
Root
R5
F
OR
R2
R3
BE
CD
Branches
AND
AND
E
R4
C
R1
AND
Fact
Fact
Fact
R4
Dead end
Fact
D
B
B
A
C
B
23Explanation
Explanation
- Human experts justify and explain their actions
- ES should also do so
- Explanation attempt by an ES to clarify
reasoning, recommendations, other actions (asking
a question) - Explanation facility (justifier)
24Explanation
Explanation Purposes
- Make the system more intelligible
- Uncover shortcomings of the rules and knowledge
base (debugging) - Explain unanticipated situations
- Satisfy users psychological and/or social needs
- Clarify the assumptions underlying the system's
operations - Conduct sensitivity analyses
25Rule Tracing Technique
- Why Provides a Chain of Reasoning
- Good Explanation Facility is critical in large ES
- Understanding depends on explanation
- Explanation is essential in ES
- Used for training
26Two Basic Explanations
Why Explanations - Why is a fact requested?
- Computer What is your annual income?
- Client Why? (Why do you need to know?)
- Computer In checking R2, I need to know whether
your income is above 40,000. If this is true, I
will conclude that b/c you have a college degree,
you should invest in growth stocks
27Two Basic Explanations
How Explanations - To determine how a certain
conclusion or recommendation was reached.
- Computer Invest in IBM stocks
- Client How? (How was the conclusion reached?)
- Computer (Displays the rules R5-R3-R7-R4 in the
sequence that they were fired)
28Generating Explanations
- Static Explanation preinsert pieces of English
text (scripts) in the system - Dynamic Explanation reconstruct explanation
according to the execution pattern of the rules