Knowledge Representation in Expert Systems
Explore how expert systems represent knowledge using logic, IF–THEN rules, semantic networks, frames, and ontologies. Learn how structured knowledge helps AI systems reason and make decisions.
Imagine asking a doctor why you have a fever.
A doctor does not simply remember that fever is an illness. They consider symptoms, medical history, possible causes, and relationships between different conditions before reaching a conclusion.
An expert system attempts to perform a similar kind of reasoning within a specific domain.
But how can a computer store knowledge about diseases, machines, financial decisions, or other specialised subjects in a form it can use?
It needs a way to organise and represent that knowledge.
This is called Knowledge Representation.
1. What Is Knowledge Representation?
Knowledge Representation (KR) is the process of organising and storing information about the world in a structured form that an AI system can use to reason, solve problems, and make decisions.
In expert systems, knowledge representation allows domain knowledge to be stored in a knowledge base.
This knowledge may include:
- Facts about a particular domain.
- Rules describing relationships and conditions.
- Objects and their properties.
- Relationships between different concepts.
- Procedures or information used to solve problems.
For example, a medical expert system may store:
Fact:
A patient has a fever.
Fact:
The patient has a sore throat.
Rule:
IF a patient has fever
AND sore throat
THEN consider a throat infection.
The system can use these facts and rules to produce a conclusion.
In simple terms, knowledge representation converts domain knowledge into a form that a computer can understand and use.
2. Why Is Knowledge Representation Important?
An expert system needs more than stored information. It must also be able to use that information.
Knowledge representation makes this possible.
1. Organises knowledge
It structures information so that the system can access and use it.
2. Supports reasoning
The inference engine uses represented knowledge to derive conclusions.
3. Makes relationships clear
It helps the system understand how facts, objects, and concepts are connected.
4. Supports decision-making
The system can apply stored knowledge to analyse a problem and suggest an action.
5. Makes knowledge easier to maintain
A well-organised knowledge base allows experts and developers to update or modify information when needed.
3. Methods of Knowledge Representation
There are several methods used to represent knowledge in AI systems.
The choice depends on the type of information, the problem being solved, and the reasoning required.
A. Logical Representation
Logical representation uses formal logic to express facts and relationships.
It allows an AI system to represent statements in a precise form and apply logical rules to derive conclusions.
For example:
Fact 1:
All humans are mortal.
Fact 2:
Ali is a human.
Conclusion:
Ali is mortal.
In predicate logic, these statements can be represented as:
\[
\forall x ; (Human(x) \rightarrow Mortal(x))
\]
\[
Human(Ali)
\]
Therefore:
\[
Mortal(Ali)
\]
Here:
Human(x)means x is a human.Mortal(x)means x is mortal.- The symbol \(\forall\) means “for all”.
Logical representation is useful when a system needs precise reasoning based on facts and rules.
B. Rule-Based Representation
Rule-based representation stores knowledge using IF–THEN rules.
It is one of the most commonly used approaches in traditional expert systems.
For example:
Rule 1:
IF temperature is high
AND coolant level is low
THEN inspect the cooling system.
The inference engine checks whether the conditions are satisfied.
If they are, it can execute the corresponding action or derive a conclusion.
Rule-based representation is useful in:
- Medical diagnosis.
- Troubleshooting systems.
- Industrial monitoring.
- Financial decision support.
C. Semantic Networks
A semantic network represents knowledge as a graph of connected concepts.
It contains:
- Nodes: Represent objects, concepts, or entities.
- Edges: Represent relationships between them.
For example:
Animal
|
is-a
|
Bird
|
is-a
|
Eagle
This structure represents relationships between concepts.
Another example:
Car
|
has
|
Engine
|
powered-by
|
Fuel
Semantic networks make relationships easier to understand visually.
They are useful for representing connected concepts and hierarchical relationships.
D. Frames
Frames represent knowledge through structured descriptions of objects or concepts.
A frame contains slots, which describe the properties of an object, and values, which provide the corresponding information.
For example:
Frame: Car
Slots:
Type: Vehicle
Wheels: 4
Fuel: Petrol
Transmission: Automatic
Colour: Red
A frame can represent a particular object or a general category.
Frames can also support inheritance, where a specialised frame receives properties from a more general frame.
For example, an Electric Car frame may inherit common properties from a Vehicle frame while adding its own properties, such as battery capacity.
Frames are useful when an expert system needs to represent objects and their attributes in an organised way.
E. Ontologies
An ontology is a formal representation of concepts within a domain and the relationships between them.
It defines important concepts, categories, properties, and relationships so that information can be organised with a shared meaning.
For example, a healthcare ontology may define:
Concepts:
Patient
Disease
Symptom
Medicine
Relationships:
Patient has Symptom
Disease causes Symptom
Medicine treats Disease
Ontologies are useful when different systems need to share and interpret knowledge consistently.
They are widely relevant in knowledge-based systems, semantic technologies, and information integration.
4. Comparison of Knowledge Representation Methods
| Method | How Knowledge Is Represented | Common Use |
|---|---|---|
| Logical Representation | Formal logical statements | Logical reasoning |
| Rule-Based Representation | IF–THEN rules | Expert systems |
| Semantic Networks | Connected concepts and relationships | Concept relationships |
| Frames | Objects, slots, and values | Structured object knowledge |
| Ontologies | Concepts and defined relationships | Knowledge sharing |
Each method has its own strengths. Some expert systems use one main method, while others combine several methods to represent different kinds of knowledge.
5. Example: Representing Knowledge in a Machine Diagnosis System
Let’s consider an expert system designed to identify problems in an industrial machine.
The system receives information from sensors and stores it as facts.
Step 1: Represent the Facts
Machine temperature is high.
Coolant level is low.
Cooling pump is making noise.
Step 2: Represent the Rules
Rule 1:
IF machine temperature is high
THEN inspect the cooling system.
Rule 2:
IF coolant level is low
THEN check for coolant leakage.
Rule 3:
IF cooling pump is making noise
THEN inspect the cooling pump.
Step 3: Apply the Knowledge
The inference engine compares the available facts with the conditions in the rules.
It identifies the rules that match and derives relevant conclusions.
Step 4: Generate Recommendations
The system may produce:
Recommendations:
1. Inspect the cooling system.
2. Check for coolant leakage.
3. Inspect the cooling pump.
This example demonstrates how facts and rules can be represented and used together to solve a practical problem.
6. How Knowledge Representation Works with the Inference Engine
Knowledge representation and the inference engine perform different but connected roles.
The knowledge base stores the represented knowledge, while the inference engine uses that knowledge to reason.
The general process is:
Domain Knowledge
|
v
Knowledge Representation
|
v
Knowledge Base
|
v
Inference Engine
|
v
Apply Reasoning
|
v
Derived Conclusions
|
v
Final Recommendation
For example, the knowledge base may contain a rule stating that low coolant levels can cause overheating.
When the system receives the facts that the machine is overheating and its coolant level is low, the inference engine can apply that rule and derive a conclusion.
This is how represented knowledge becomes useful for problem-solving.
7. Advantages of Knowledge Representation
1. Structured information
Knowledge is stored in an organised form instead of remaining as disconnected pieces of information.
2. Better reasoning
The system can use facts, rules, and relationships to derive new conclusions.
3. Reusability
Well-defined knowledge can sometimes be reused across different applications within the same domain.
4. Easier maintenance
A structured knowledge base can be updated when new information becomes available.
5. Knowledge sharing
Methods such as ontologies help different systems use common concepts and relationships.
8. Limitations of Knowledge Representation
Despite its importance, knowledge representation has several challenges.
1. Knowledge acquisition
Collecting accurate knowledge from human experts can be difficult and time-consuming.
2. Incomplete knowledge
A system may not have enough information to handle every possible situation.
3. Inconsistency
Different facts or rules may contradict each other, producing conflicting conclusions.
4. Knowledge maintenance
As a domain changes, the knowledge base must be updated to remain useful.
5. Choosing the right representation
A method suitable for logical reasoning may not be the best choice for representing complex relationships or uncertain information.
Conclusion
Knowledge representation is one of the foundations of expert systems.
It provides a structured way to store facts, rules, objects, concepts, and relationships so that an AI system can use them for reasoning and decision-making.
Logical representation, rule-based representation, semantic networks, frames, and ontologies offer different ways to organise knowledge.
The important idea is that an expert system does not simply store information. It needs to represent that information in a form that allows the inference engine to use it.
In the next article, we will move towards another important area of AI: Fuzzy Logic, which helps systems reason with information that is not simply true or false.
Next Article: Introduction to Fuzzy Logic
Quick quiz
5 questionsOriginally published at farhanpaal.com — https://farhanpaal.com/articles/knowledge-representation-in-expert-systems/
Keep a copy
Read offline as a printout or PDF.
farhanpaal.com