← IGCSE Computer Science Paper 1

Rule base

The part of an expert system holding IF-THEN rules (IF condition THEN conclusion) that link facts to conclusions, often joined with AND/OR, which the inference engine uses to reach answers.

Understanding Rule base in IGCSE Computer Science Paper 1

What it does: The fact (engine = silent) follows IF and the conclusion (fault = battery) follows THEN, which is how rules link facts to conclusions. With OR only one condition has to be true for the rule to give its conclusion, so either cough or sneeze is enough. The rule base holds the rules. The user interface is the separate part the user types into. AND needs both conditions to be true. OR needs only one of them to be true. Each rule says what conclusion to draw when its conditions match the facts. Facts alone are held in the knowledge base.

Common mistakes: The rule is missing the THEN keyword. A rule must be written IF condition THEN conclusion, so it should be IF fever AND cough THEN flu. ELSE is used instead of THEN. In a rule base the conclusion follows THEN, so the line should be IF smoke OR overheat THEN stop.

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 of these is a rule that could be stored in the rule base of an expert system?
IF temperature > 38 THEN feverThe patient feels hot and tired
Matches
THEN suspect = flu IF fever = yes
↓
The parts are in the wrong order: a rule must start with IF condition and then give THEN conclusion
Applying
Meanings
Term
rule base
Meaning
The part of an expert system holding IF-THEN rules (IF condition THEN conclusion) that link facts to conclusions, often joined with AND/OR, which the inference engine uses to reach answers.
Practice
RULE 1: IF fever = TRUE THEN flu_possible = TRUE
Testing
Gaps
fever = TRUE THEN diagnosis = "flu"
Check Answer
Spots
1IF fever AND cough flu
2IF rash THEN measles

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

The 'Spider' badge — Web Weaver, 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 of these is a rule that could be stored in the rule base of an expert system?
A. The patient feels hot and tired
B. IF temperature > 38 THEN fever ✓
A rule base stores IF-THEN rules. A condition goes after IF and a conclusion goes after THEN.
2. What does the rule base of an expert system contain?
A. IF-THEN rules that link facts to conclusions ✓
B. The screen the user types questions into
The rule base holds the rules. The user interface is the separate part the user types into.
3. In the rule IF rain = true THEN take umbrella, which part is the conclusion?
A. take umbrella ✓
B. rain = true
The conclusion comes after THEN. The condition (rain = true) comes after IF.
4. Which rule needs BOTH facts to be true before the conclusion is drawn?
A. IF fever AND rash THEN measles ✓
B. IF fever OR rash THEN measles
AND needs both conditions to be true. OR needs only one of them to be true.
5. The rule is IF fever OR cough THEN see doctor. A patient has a cough but no fever. What is the result?
A. No conclusion is drawn
B. The conclusion is see doctor ✓
With OR, only one condition needs to be true. The cough is enough to give the conclusion.

Match the Pairs

IF fever = yes THEN suspect = flu → A single rule in the rule base: if the condition is true, the system draws the conclusion
IF rain = yes AND wind = high THEN storm = likely → A rule where both conditions must be true before the conclusion is drawn
A rule links a fact to a conclusion using IF and THEN → IF engine = silent THEN fault = battery
OR lets a rule fire when at least one of its conditions is true → IF cough = yes OR sneeze = yes THEN check = cold
THEN suspect = flu IF fever = yes → The parts are in the wrong order: a rule must start with IF condition and then give THEN conclusion
IF temp > 30 AND temp < 10 THEN weather = hot → AND makes the rule impossible to meet, because a temperature cannot be above 30 and below 10 at once

Key Term

rule base
The part of an expert system holding IF-THEN rules (IF condition THEN conclusion) that link facts to conclusions, often joined with AND/OR, which the inference engine uses to reach answers.

Fill in the Blanks

1. IF fever = TRUE THEN diagnosis = "flu"
Hint: Type the keyword that starts every rule and introduces its condition.
2. IF fever = TRUE THEN diagnosis = "flu"
Hint: Type the keyword that links the condition to the conclusion.
3. IF fever = TRUE AND cough = TRUE THEN diagnosis = "flu"
Hint: Type the operator that means both conditions must be true.
4. IF rash = TRUE OR itch = TRUE THEN advice = "see doctor"
Hint: Type the operator that means at least one condition must be true.
5. IF light = "red" THEN action = "stop" IF light = "green" THEN action = "go"
Hint: Type the fact name that both rules test, as shown in the first rule.

Spot the Error

Question 1
A IF fever AND cough flu
B IF rash THEN measles
C IF sneeze THEN cold
Line A — The rule is missing the THEN keyword. A rule must be written IF condition THEN conclusion, so it should be IF fever AND cough THEN flu.
Question 2
A IF no_fuel THEN no_start
B IF flat_battery THEN no_start
C IF smoke OR overheat ELSE stop
Line C — ELSE is used instead of THEN. In a rule base the conclusion follows THEN, so the line should be IF smoke OR overheat THEN stop.
Question 3
A IF Mon THEN weekday
B IF Tue THEN weekday
C IF Sat AND Sun THEN weekend
Line C — A day cannot be both Saturday and Sunday, so an AND rule would never fire. OR is needed because either fact is enough: IF Sat OR Sun THEN weekend.
Question 4
A IF overdue THEN fine
B THEN block_card IF fine
C IF paid THEN unblock_card
Line B — The parts of the rule are the wrong way round. The condition comes after IF and the conclusion after THEN, so it should be IF fine THEN block_card.
Question 5
A light = red THEN stop
B IF light = green THEN go
C IF light = amber THEN slow
Line A — The rule does not start with IF. Every rule must begin with IF followed by the condition, so it should be IF light = red THEN stop.

Student with a class code? Join your class →