Inference engine

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Inference engine

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which part of an expert system does the reasoning?
A Inference engine
B Knowledge base
2. What does the inference engine match the user's answers and the knowledge base against?
A The user interface
B The rule base
3. Which statement is true?
A The inference engine is the 'brain' of an expert system
B The inference engine only stores facts about the subject
4. Who or what chooses which question to ask the user next?
A The inference engine
B The rule base
5. A doctor expert system has a user's symptoms and its rules. What reaches the diagnosis by applying the rules to the symptoms?
A Interface
B Inference engine

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1inference engine AThe reasoning part of an expert system that works out a conclusion
2inference engine + rule base Bconclusion = inference_engine.match(answers, knowledge_base, rule_base)
3The inference engine chooses which question to ask next, based on the answers given so far CThis confuses the inference engine with the knowledge base. The knowledge base stores the facts; the inference engine reasons using them.
4The inference engine matches the user's answers and the knowledge base against the rule base to reach a conclusion Dnext_question = inference_engine.choose(answers, rule_base)
5The inference engine stores all the facts about the subject, so it is the knowledge base. EThe inference engine applies the IF-THEN rules to the facts it has
6The inference engine is the screen where the user types answers and reads the advice. FThis describes the expert system interface, not the inference engine. The inference engine does the reasoning behind the scenes.

Definitions

inference engine

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF temperature > 38 ____ diagnosis ← "fever"
2.
result ← InferenceEngine(kb, _________)
3.
question ← ____________(rule_base)
4.
IF fever = TRUE ___ rash = TRUE THEN
5.
conclusion ← _______________(kb, rb, ans)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A OUTPUT answer FROM user
B SEARCH rule base FOR match
C IF match FOUND THEN
D OUTPUT conclusion
Question 2
A READ answers FROM rule base
B READ facts FROM knowledge base
C COMPARE with rule base
Question 3
A WHILE conclusion NOT FOUND
B ASK rule base next question
C STORE answer
D ENDWHILE
Question 4
A answer ← INPUT
B rule ← FIND in rule base
C IF answer DIFFERS rule THEN
D conclusion ← rule result
Question 5
A INPUT noStart FROM user
B INPUT lights FROM user
C IF noStart AND lights = 'dim'
D INPUT 'Flat battery'

Answer Key

Inference engine
Section A: Quick Questions
Q1
A — Inference engine
Q2
B — The rule base
Q3
A — The inference engine is the 'brain' of an expert system
Q4
A — The inference engine
Q5
B — Inference engine
Section B: Match the Pairs
Q1
inference engine → The reasoning part of an expert system that works out a conclusion
Q2
inference engine + rule base → The inference engine applies the IF-THEN rules to the facts it has
Q3
The inference engine chooses which question to ask next, based on the answers given so far → next_question = inference_engine.choose(answers, rule_base)
Q4
The inference engine matches the user's answers and the knowledge base against the rule base to reach a conclusion → conclusion = inference_engine.match(answers, knowledge_base, rule_base)
Q5
The inference engine stores all the facts about the subject, so it is the knowledge base. → This confuses the inference engine with the knowledge base. The knowledge base stores the facts; the inference engine reasons using them.
Q6
The inference engine is the screen where the user types answers and reads the advice. → This describes the expert system interface, not the inference engine. The inference engine does the reasoning behind the scenes.
Section C: Definitions
Q1
inference engine — The part of an expert system that reasons: it matches the user's answers and the knowledge base against the rule base to reach a conclusion. It is the 'brain' of the system.
Section D: Fill in the Blanks
Q1
IF temperature > 38 THEN diagnosis ← "fever"
Q2
result ← InferenceEngine(kb, rule_base)
Q3
question ← NextQuestion(rule_base)
Q4
IF fever = TRUE AND rash = TRUE THEN
Q5
conclusion ← InferenceEngine(kb, rb, ans)
Section E: Spot the Error
Q1
A — The inference engine needs the user's answers as input, so the line should be INPUT answer FROM user. OUTPUT would send data out instead of reading it in.
Q2
A — The user's answers come in through the expert system interface, not from the rule base. The rule base only holds the rules. It should be READ answers FROM interface.
Q3
B — The inference engine chooses the next question and asks the user, not the rule base. A rule base cannot answer questions. It should be ASK user next question.
Q4
C — The inference engine reaches a conclusion when the answers MATCH a rule. Testing for DIFFERS would fire on rules that do not apply. It should be IF answer MATCHES rule THEN.
Q5
D — Once the inference engine reaches a conclusion, the system must give it to the user, so it should be OUTPUT 'Flat battery'. INPUT reads data in and cannot show a result.