← IGCSE Computer Science Paper 1

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.

Understanding Inference engine in IGCSE Computer Science Paper 1

What it does: The inference engine looks at the answers so far and the rules, then decides what the interface should ask next. The inference engine is the reasoning part. The knowledge base only stores the facts it uses. It compares the answers and facts with the rules in the rule base to work out a conclusion.

Common mistakes: 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. 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.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 662–678) and word search (Modules 652–678).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which part of an expert system does the reasoning?
Knowledge baseInference engine
Matches
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.
Applying
Meanings
Term
inference engine
Meaning
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.
Practice
conclusion ← NONE
Testing
Gaps
IF temperature > 38 diagnosis ← "fever"
Check Answer
Spots
1OUTPUT answer FROM user
2SEARCH rule base FOR match

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Woodland Hedgehog' badge — Import Master, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which part of an expert system does the reasoning?
A. Inference engine ✓
B. Knowledge base
The inference engine is the reasoning part. The knowledge base only stores the facts it uses.
2. What does the inference engine match the user's answers and the knowledge base against?
A. The user interface
B. The rule base ✓
It compares the answers and facts with the rules in the rule base to work out a conclusion.
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
Storing facts is the job of the knowledge base. The inference engine is the 'brain' because it reasons.
4. Who or what chooses which question to ask the user next?
A. The inference engine ✓
B. The rule base
The inference engine decides the next question based on the answers so far and the rules. The rule base just holds the rules.
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 ✓
The interface only passes questions and answers back and forth. The inference engine does the reasoning.

Match the Pairs

inference engine → The reasoning part of an expert system that works out a conclusion
inference engine + rule base → The inference engine applies the IF-THEN rules to the facts it has
The inference engine chooses which question to ask next, based on the answers given so far → next_question = inference_engine.choose(answers, rule_base)
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)
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.
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.

Key Term

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.

Fill in the Blanks

1. IF temperature > 38 THEN diagnosis ← "fever"
Hint: Type the keyword that introduces the action part of a rule the inference engine matches.
2. result ← InferenceEngine(kb, rule_base)
Hint: Type the name of the part that holds the IF-THEN rules the engine matches against.
3. question ← NextQuestion(rule_base)
Hint: Type the function name that picks which question to ask the user next.
4. IF fever = TRUE AND rash = TRUE THEN
Hint: Type the logical operator that requires both conditions to match before the rule fires.
5. conclusion ← InferenceEngine(kb, rb, ans)
Hint: Type the name of the 'brain' part that reasons to reach the conclusion.

Spot the Error

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

Student with a class code? Join your class →