2. Rule-Based Systems
Definition:
Rule-Based Systems make decisions or infer conclusions based on a predefined set of IF-THEN rules. These systems do not “learn” from data like machine learning but instead operate on logical reasoning.
Structure:
IF <condition> THEN <action>
Example:
IF temperature > 100°C THEN alert = "Overheat"
- If the temperature rises above a certain point, the system detects it.
- If it does, it generates an alert.
Key Components:
- Knowledge Base:
Contains the set of IF-THEN rules.
Example:- IF oil level < 20% THEN alert = “Low oil”
- IF pressure > 150 PSI THEN action = “Shut down pump”
- Inference Engine:
The part of the system that applies the rules to the data.- It checks the current input/facts (like sensor data).
- It matches these facts to conditions in the rules.
- It executes actions when conditions are met.
What is Sensor Data?
Sensor data means information collected by sensors — devices that detect physical conditions like temperature, pressure, speed, light, motion, etc.
In Rule-Based Systems:
Sensors are used to monitor real-world conditions, and the data they collect is used as input for the system to make decisions.
Examples of Sensor Data:
Type of Sensor What It Assesses | Sample Information |
---|---|
Sensor for temperature | 110°C is the heat level temperature |
Sensor for pressure | 160 PSI (pounds per square inch) is the fluid/gas pressure |
Sensor for oil level | The amount of oil in the machine15% oil level |
A motion sensor | Identification of movement motion = detected |
A light sensor | Level of ambient light Low light |
How It’s Used:
- Sensor collects data (e.g.,
oil level = 15%
) - Inference engine reads that data
- Checks against rules:
IF oil level < 20% THEN alert = "Low oil"
- Takes action (e.g., shows alert)
In Short:
Sensor data = real-world input for a rule-based system to make logical decisions.
What is Logical Reasoning?
Logical reasoning means using rules and facts to reach a conclusion in a step-by-step, rational way — just like how humans think logically.
In the context of Rule-Based Systems, logical reasoning means:
Following IF-THEN rules to make decisions based on given information (data or facts).
Example:
Assume we have the following rule:
"Overheat" is the alert if the temperature is higher than 100°C.
And the current fact is:
temperature = 110°C
The system uses logical reasoning to check:
- Is 110 > 100? Yes → So the rule applies.
- Therefore, trigger the action: alert = “Overheat”.
Why it’s called logical?
Because the decision was made by applying logic — no guessing, no learning — just pure step-by-step evaluation of conditions.
Use Cases:
- Thermostats:
IF temperature < 18°C THEN turn_on = “Heater” - Industrial Automation:
IF conveyor belt speed > threshold THEN reduce_speed() - Diagnostic equipment (for automobiles, machinery, and medical devices):
“Engine Overheating” will be the alert if engine_temp is greater than 120°C. - Access Control Systems:
IF ID not in database THEN deny_access - Smart Home Systems:
IF motion_detected AND time = night THEN turn_on = “Lights”