Conflict Resolution in Expert Systems
Learn how conflict resolution works in expert systems and why multiple applicable rules require a selection strategy. Explore rule priority, specificity, recency, rule ordering, refractoriness, and a Python implementation.
Imagine an expert system designed to diagnose problems in an industrial machine.
A worker reports two symptoms: the machine is overheating, and its cooling system is making unusual noise.
The system checks its knowledge base and discovers two rules that can be applied:
Rule 1:
IF machine is overheating
THEN inspect the cooling system.
Rule 2:
IF machine is overheating
AND unusual noise is present
THEN inspect the cooling pump.
Both rules match the available information. But which one should the system execute first?
This is a common problem in rule-based expert systems. Sometimes, several rules become applicable at the same time, and the system needs a way to choose between them.
This process is called Conflict Resolution.
It helps an expert system decide which applicable rule should be executed when multiple rules compete for attention.
1. What Is Conflict Resolution?
Conflict Resolution is the process of selecting one rule from a group of applicable rules in an expert system.
When the inference engine examines the knowledge base, it may find several rules whose conditions match the facts stored in working memory.
These applicable rules form a conflict set, also called a conflict set of rules or an agenda in some expert-system architectures.
The system then uses a conflict resolution strategy to decide which rule should be executed next.
For example:
Available facts:
- Machine is overheating.
- Unusual noise is present.
Applicable rules:
- Rule 1: Inspect cooling system.
- Rule 2: Inspect cooling pump.
Conflict resolution:
Choose the rule that is more specific.
In this example, Rule 2 contains more conditions and addresses a more specific situation.
The system may therefore select Rule 2 first.
In simple terms, conflict resolution helps an expert system choose which rule to apply when several rules are applicable.
2. Why Do Conflicts Occur?
Conflicts occur because a knowledge base may contain multiple rules that match the same set of facts.
There are several reasons for this.
A. Overlapping Conditions
Different rules may contain similar conditions.
For example:
Rule 1:
IF temperature is high
THEN inspect the cooling system.
Rule 2:
IF temperature is high
THEN check the temperature sensor.
If the temperature is high, both rules become applicable.
B. Different Levels of Specificity
One rule may describe a general situation, while another describes a more specific situation.
Rule 1:
IF machine is overheating
THEN inspect the cooling system.
Rule 2:
IF machine is overheating
AND coolant level is low
THEN inspect the coolant supply.
When both conditions are satisfied, the system must decide which rule should take priority.
C. Multiple Possible Actions
A system may have several possible actions for the same situation.
For example, a troubleshooting system may recommend checking the power supply, inspecting a cable, or testing a component.
The system needs a strategy for selecting the next action.
D. Large Knowledge Bases
As the number of rules increases, the possibility of multiple applicable rules also increases.
A conflict resolution mechanism helps organise their execution.
3. Conflict Resolution Strategies
Expert systems can use different strategies to select rules from a conflict set.
The appropriate strategy depends on the system’s design and the nature of the problem.
A. Rule Priority
In this strategy, each rule is assigned a priority.
The system selects the applicable rule with the highest priority.
For example:
| Rule | Action | Priority |
|---|---|---|
| Rule 1 | Inspect cooling system | 2 |
| Rule 2 | Inspect cooling pump | 5 |
| Rule 3 | Check temperature sensor | 3 |
If all three rules are applicable, Rule 2 is selected because it has the highest priority.
This strategy is useful when certain actions are considered more important than others.
B. Specificity
The specificity strategy gives preference to the rule with more detailed conditions.
Consider:
Rule 1:
IF temperature is high
THEN inspect the cooling system.
Rule 2:
IF temperature is high
AND coolant level is low
THEN inspect the coolant supply.
If both conditions are satisfied, Rule 2 is more specific because it considers an additional condition.
The system may choose Rule 2 before Rule 1.
This is useful when specific information should take precedence over general information.
C. Recency
The recency strategy gives preference to rules that use more recently added or updated facts in working memory.
For example, suppose a machine-monitoring system receives new sensor readings.
A rule that depends on the latest temperature reading may be selected before another rule based on older information.
This strategy can be useful in systems where recent observations are particularly relevant.
D. Rule Ordering
Some expert systems use a predefined order for executing rules.
For example:
Rule 1
Rule 2
Rule 3
Rule 4
If multiple rules are applicable, the system may select the first matching rule according to this order.
This approach is straightforward, but the order must be designed carefully. A poorly chosen order may lead to less useful decisions.
E. Refractoriness
Refractoriness prevents a rule from being executed repeatedly on the same set of facts when its execution has already occurred.
For example, if a rule has already generated a recommendation based on a particular set of facts, the system may avoid executing it again unless relevant information changes.
This helps prevent unnecessary repeated actions and, in some systems, endless cycles of rule execution.
4. How Does Conflict Resolution Work?
Let’s understand the complete process through an example.
Suppose an expert system is monitoring an industrial machine.
The working memory contains:
Machine overheating: Yes
Coolant level low: Yes
Unusual noise: Yes
The knowledge base contains these rules:
Rule 1:
IF machine is overheating
THEN inspect cooling system.
Rule 2:
IF machine is overheating
AND coolant level is low
THEN inspect coolant supply.
Rule 3:
IF machine is overheating
AND unusual noise is present
THEN inspect cooling pump.
All three rules are applicable.
The system creates a conflict set:
Conflict Set:
Rule 1
Rule 2
Rule 3
Now suppose the system uses specificity as its conflict resolution strategy.
Rule 1 has one condition, while Rules 2 and 3 each have two conditions.
The system may therefore select Rule 2 or Rule 3 first, depending on its additional selection policy.
After executing a rule, the system updates working memory and checks which rules remain applicable.
This process continues until the system reaches its stopping condition.
5. The Conflict Resolution Process
The general process can be represented as follows:
Working Memory
|
v
Match Knowledge
Base Rules
|
v
Find Applicable
Rules
|
v
Create Conflict
Set
|
v
Apply Resolution
Strategy
|
v
Select One Rule
|
v
Execute the Rule
|
v
Update Working
Memory
|
v
Repeat if Needed
The important point is that conflict resolution takes place after the system identifies applicable rules and before it executes the selected rule.
6. Python Implementation of a Simple Conflict Resolution System
Let’s create a small example to understand how rule priority can be implemented.
Each rule will have:
- A name.
- A set of conditions.
- An action.
- A priority value.
The system will identify applicable rules and select the one with the highest priority.
rules = [
{
"name": "Rule 1",
"conditions": {"overheating"},
"action": "Inspect cooling system",
"priority": 2
},
{
"name": "Rule 2",
"conditions": {"overheating", "low_coolant"},
"action": "Inspect coolant supply",
"priority": 5
},
{
"name": "Rule 3",
"conditions": {"overheating", "unusual_noise"},
"action": "Inspect cooling pump",
"priority": 3
}
]
facts = {
"overheating",
"low_coolant",
"unusual_noise"
}
# Find applicable rules
conflict_set = []
for rule in rules:
if rule["conditions"].issubset(facts):
conflict_set.append(rule)
# Select the rule with the highest priority
if conflict_set:
selected_rule = max(
conflict_set,
key=lambda rule: rule["priority"]
)
print("Selected:", selected_rule["name"])
print("Action:", selected_rule["action"])
else:
print("No applicable rule found.")
Output:
Selected: Rule 2
Action: Inspect coolant supply
All three rules were applicable, but Rule 2 had the highest priority.
Therefore, the system selected Rule 2.
This is a simplified implementation. Real expert systems may use multiple strategies together, maintain an agenda of rule activations, and update that agenda whenever working memory changes.
7. Advantages of Conflict Resolution
Conflict resolution improves the organisation and operation of rule-based expert systems.
1. Organised reasoning
It provides a systematic way to select rules when several are applicable.
2. Better prioritisation
Important or more specific rules can be executed before less relevant ones.
3. Reduced unnecessary execution
Strategies such as refractoriness can prevent repeated execution of the same rule under unchanged conditions.
4. More predictable behaviour
A defined conflict resolution strategy makes rule selection more consistent.
5. Support for large knowledge bases
It helps manage rule execution as the number of rules grows.
8. Limitations and Challenges
Conflict resolution also has some challenges.
1. Choosing the right strategy
A strategy that works well in one expert system may not be appropriate for another.
2. Incorrect priorities
If rules are assigned unsuitable priorities, the system may execute less useful rules first.
3. Complex conflict sets
Large knowledge bases can produce many applicable rules, making selection more complicated.
4. Strategy combinations
When multiple strategies are combined, their order and interaction must be carefully designed.
5. Rule conflicts may reflect knowledge problems
Sometimes, conflicting rules are not merely an execution-order problem. They may indicate that the knowledge base contains incomplete, inconsistent, or poorly designed knowledge.
Selecting one rule does not automatically resolve the underlying contradiction.
9. Conflict Resolution vs Forward and Backward Chaining
These concepts are related, but they perform different roles in an expert system.
| Concept | Main Purpose |
|---|---|
| Forward Chaining | Derives conclusions from available facts |
| Backward Chaining | Works backwards from a goal to supporting facts |
| Conflict Resolution | Selects which applicable rule should execute next |
Forward and backward chaining describe the direction of reasoning. Conflict resolution determines which rule is selected when multiple rules are available for execution.
Conclusion
An expert system may contain hundreds or thousands of rules. When several rules become applicable at the same time, the system needs a method to decide which one should be executed first.
Conflict resolution provides that method.
Strategies such as rule priority, specificity, recency, rule ordering, and refractoriness help manage rule execution.
However, selecting a rule is only part of building a reliable expert system. The rules themselves must also be accurate, consistent, and relevant to the problem.
In the next article, we will explore how knowledge is represented inside expert systems and how facts, relationships, and rules are organised so that an AI system can use them.
Next Article: Knowledge Representation in Expert Systems
Quick quiz
5 questionsOriginally published at farhanpaal.com — https://farhanpaal.com/articles/conflict-resolution-in-expert-systems/
Keep a copy
Read offline as a printout or PDF.
farhanpaal.com