Chapter 7
Rule-Based Expert Systems
7.1 Introduction
Rule-based systems (also known as production systems or expert systems) are the
simplest form of artificial intelligence. A rule based system uses rules as the
knowledge representation for knowledge coded into the system [1][3][4]
[13][14][16][17][18][20]. The definitions of rule-based system depend almost
entirely on expert systems, which are system that mimic the reasoning of human
expert in solving a knowledge intensive problem. Instead of representing know-
ledge in a declarative, static way as a set of things which are true, rule-based sys-
tem represent knowledge in terms of a set of rules that tells what to do or what to
conclude in different situations.
A rule-based system is a way of encoding a human expert's knowledge in a fair-
ly narrow area into an automated system. A rule-based system can be simply
created by using a set of assertions and a set of rules that specify how to act on the
assertion set. Rules are expressed as a set of if-then statements (called IF-THEN
rules or production rules):
IF P THEN Q
which is also equivalent to:
P⇒Q.
A rule-based system consists of a set of IF-THEN rules, a set of facts and
some interpreter controlling the application of the rules, given the facts. The idea
of an expert system is to use the knowledge from an expert system and to encode
it into a set of rules. When exposed to the same data, the expert system will
perform (or is expected to perform) in a similar manner to the expert. Rule-based
systems are very simple models and can be adapted and applied for a large kind
of problems. The requirement is that the knowledge on the problem area can
be expressed in the form of if-then rules. The area should also not be that large
because a high number of rules can make the problem solver (the expert system)
inefficient.
C. Grosan and A. Abraham: Intelligent Systems, ISRL 17, pp. 149–185.
springerlink.com © Springer-Verlag Berlin Heidelberg 2011
150 Rule-Based Expert Systems
7.2 Elements of a Rule-Based System
Any rule-based system consists of a few basic and simple elements as follows:
1. A set of facts. These facts are actually the assertions and should be any-
thing relevant to the beginning state of the system.
2. A set of rules. This contains all actions that should be taken within the
scope of a problem specify how to act on the assertion set. A rule relates
the facts in the IF part to some action in the THEN part. The system
should contain only relevant rules and avoid the irrelevant ones because
the number of rules in the system will affect its performance.
3. A termination criterion. This is a condition that determines that a solution
has been found or that none exists. This is necessary to terminate some
rule-based systems that find themselves in infinite loops otherwise.
Facts can be seen as a collection of data and conditions. Data associates the
value of characteristics with a thing and conditions perform tests of the values of
characteristics to determine if something is of interest, perhaps the correct classifi-
cation of something or whether an event has taken place.
For instance, if we have the fact:
temperature <0
then temperature is the data and the condition is <0.
Rules do not interact directly with data, but only with conditions either singly or
multiple (joined by logical operators as shown below). Figure 7.1 contains an ex-
ample showing the parts of a rule based systems and the interactions between
them.
Fig. 7.1 An example showing the parts of a rule based systems and the interactions between
them.
There are two ways for a rule to set new values for the data [2]:
• by assignment, where the value is directly set, and
• by assertion. The assertion does not in itself assign a value to the data,
but the condition acts like a constraint upon the data value, saying it must
be the value specified by the condition.