You are on page 1of 8

4

Knowledge Representation
and Reasoning

Introduction
In this chapter on knowledge representation, we will be looking at different knowl-
edge representation schemes including rules, frames and semantic networks.

We will look at how to choose between them; the advantages and disadvantages
of each and how to represent knowledge in a form suitable for knowledge-based
systems (KBSs). We will also compare deep and shallow knowledge and consider
the issues of brittleness and explanation facilities.

The chapter consists of five sections:


1. Using knowledge
2. Logic, rules and representation
3. Developing rule-based systems
4. Semantic networks
5. Frames.

Objectives
By the end of the chapter you will be able to:
r explain how knowledge can be represented in declarative programs
r describe and analyse the inference process
r explain the principles of backward and forward chaining
r analyse the type of chaining used by a specific expert system (ES)
r explain how semantic networks represent data
r identify the advantages and disadvantages of semantic networks
r explain how frames can be used to represent knowledge
r evaluate the risks associated with developing unintelligent explanation facilities
r explain the concept of brittleness.

108
Knowledge Representation and Reasoning 109

SECTION 1: USING KNOWLEDGE

Introduction
This section introduces the subject of knowledge representation. It briefly looks at
the use of rules and declarative programming. Rule-based approaches to knowledge
representation are covered in depth in section 2 of this chapter.

Objectives
By the end of the section you will be able to:
r explain how knowledge can be represented in declarative programmes
r distinguish between shallow and deep knowledge in the context of ESs.

Different Types of Knowledge


Acquiring knowledge is one of the main objectives of humans. We have always
sought to obtain knowledge, to apply that knowledge to solve everyday problems,
and to expand on it to improve ourselves and our environment.

However, while some knowledge is easy to obtain and understand (e.g. what the
sequence and meaning of traffic lights is), other knowledge may be difficult to
obtain or interpret. For example, many of the problems being tackled by experts
are poorly understood because the subject areas are very specialised and experts
find it difficult to communication information on that knowledge area.

In many situations, experts do not have any formal basis for problem solving or
communicating the results of that problem solving. So they tend to use ‘rules of
thumb’ (heuristics) developed on the basis of their experience to help them make
decisions in their particular field.

Heuristics implies that knowledge is acquired more by trial and error than by
any definite decision-making process. This does not cast doubt on the value of
heuristics: the rules established by experts through experience can often be valuable
and this differentiates the ‘expert’ from less experienced people. An example of
a heuristic is the statement that people with high blood pressure are more likely
to have a heart attack. While not all people with high blood pressure have a heart
attack it is still a useful rule of thumb and if a doctor advised you that it was critical
to lower your blood pressure you would be unlikely to ignore this advice.
110 An Introduction to Knowledge Engineering

Deep and Shallow Knowledge


Expert systems, can have two types of knowledge: deep and shallow.

Shallow knowledge indicates that the system has been built with a working knowl-
edge of the problem domain only and a system built on the basis of it will only be
useful in some very specific situations. If the problem facing the ES is not covered
by any of these basic relationships, then the system will not be able to provide a
solution to that problem.

Deep knowledge is knowledge of the fundamental laws on which a system is based.


This knowledge is not dependent on a specific situation and can thus be used to solve
a range of problems. As with a human expert, the system will be able to ‘understand’
the causal links within the knowledge base. Including this type of knowledge within
an ES is difficult, if not impossible, in many situations. Many systems are simply
too complex to show all the causal relationships, and experts may sometimes make
intuitive leaps to reach a conclusion, which the ES cannot mimic.

Shallow knowledge therefore tends to be:


r task dependent
r brittle
r additive
r but also provides effective reasoning.

On the other hand, deep knowledge tends to be


r task independent
r describes causal relations
r complete at a certain level of abstraction
r however reasoning with this knowledge can be difficult.

Activity 1
An ES has been produced to provide assistance in the diagnosis of faults in
Brand X televisions.
Explain how the concepts of shallow and deep knowledge could be applied to
this system.
Comment on how difficult deep knowledge is to apply in such a context.

Feedback 1
Shallow knowledge implies that the ES only has information concerning its
domain—perhaps a database of common faults and probable causes and solu-
tions for this particular brand of television. Using this knowledge the system
will provide correct fault-finding diagnosis on most occasions.
Knowledge Representation and Reasoning 111

However, this knowledge would not apply to fixing faults in TVs made by other
manufacturers nor to other types of TV receivers such as plasma screen TVs if
company X started to make these.
Deep knowledge could be built into the system, such as the relationship between
voltage, resistance and current (Ohm’s law) and other aspects of the physics of
electricity. This additional knowledge might allow the ES to diagnose faults in
other types of electrical equipment. However, such diagnosis would be work-
ing from first principles and reaching a diagnosis could be difficult and time
consuming. Deep knowledge is therefore more difficult to apply because it is
not based on specific knowledge of a particular piece of equipment that may
be gained from experience.

Representing Rules in ESs


Most decision-making rules within ESs can be represented using the IF. . . THEN
format, that is

IF situation THEN action

Other clauses such as OR and ELSE can also be used within this construct to show
alternative situations or different courses of action.

For example, a simple rule could be:


IF Christmas day falls on a Monday,
OR Christmas day falls on a Tuesday
THEN many factories will close for the whole of Christmas week.

Features of Rule-Based Systems


The main features of rule-based systems are:
r They represent practical human reasoning in the form of IF. . . THEN rules. Most
humans use this type of statement (even if they don’t realise it) so the syntax
will be relatively easy to understand.
r The knowledge of the system grows as more rules are added. This implies that
the accuracy of the predictions made by the system will increase as more rules
become available.
r Where a conflict occurs between two or more rules, the rule-based system may
be sophisticated enough to try to choose the best rule to use.
r Use an inference technique (either backward or forward chaining—explained
later in this chapter) to manipulate expertise to solve a problem.
112 An Introduction to Knowledge Engineering

Procedural vs. Declarative Programming


Procedural Programming
A program written in C++ or Java consists of a set of procedures that must
be performed in a strict sequence to accomplish a purpose. This is procedural
programming.

Key features of procedural programming include:


r The programme is constructed as a sequence of step-by-step ‘how to’ instruc-
tions. However, explanations may be included to tell the user why certain activ-
ities are being carried out.
r The programming format implies automatic response to stimuli; there is little or
no thinking about the response or course of action, these are included within the
programme.

Declarative Programming
Rules in a KBS stand alone as statements of truth or fact and can be used by an
inference engine to reach other true conclusions. This is declarative programming.
The sequence of actions taken during processing is not defined. The inference
engine will automatically select and apply rules as it sees fit.

Key features of declarative programming are listed below:


r It provides facts on a given knowledge domain, literally stating what things are.
r The statements within declarative programming provide information concerning
the associations between different objects.
r Knowledge is normally shallow or surface-level, providing examples of associ-
ations that experts can visualise easily.

Activity 2
Explain what type of programming each of the following statements are exam-
ples of:
1. Smoking causes cancer.
2. Find the price of a new car. If the price is less than £10,000, then purchase
the car, else leave money in the bank and check prices in another month.

Feedback 2
Statement 1 is an example of declarative knowledge because it provides a
statement about knowledge within a domain.
Statement 2 is an example of procedural knowledge because it provides a list
of instructions to carry out.
Knowledge Representation and Reasoning 113

Before a KBS can be used to make decisions, the knowledge that the system will
use must be encoded in some way and made available either as part of the ES itself
or readily accessible to it. Three common methods of encoding knowledge are:
r rules
r semantic networks
r frames.

If knowledge is to be held in the system, then some formal method of holding that
knowledge must be agreed to enable the user to encode the knowledge correctly.
The inference engine must understand this knowledge representation scheme if it is
to apply that knowledge to a particular problem and draw appropriate conclusions.
Thus the inference engine dictates the knowledge representation scheme used.
Some inference engines for example understand rules but not frames.

Activity 3
The main requirements for a knowledge representation language are given
below. What do you think the 1st, 4th and 5th of these requirements means?
Representational adequacy
Inferential adequacy. New knowledge must be inferred from a basic set of facts.
Inferential efficiency. Any inferences that are made from the data should be
made efficiently, so as not to waste user or processing time.
Clear syntax and semantics
Naturalness

Feedback 3
You should have been able to interpret the requirements approximately as
follows:
Representational adequacy. The system must allow you to represent all the
knowledge that you need to reason with.
Inferential adequacy. New knowledge must be inferred from a basic set of facts.
Inferential efficiency. Any inferences that are made from the knowledge should
be made efficiently, so as not to waste user or processing time.
Clear syntax and semantics. The knowledge in the system must be in a format
that can be understood and processed by a computer (i.e., inferenced).
Naturalness. The language needs to be easy to use. This means it must be in
a format that is familiar to humans and can easily be used to represent the
knowledge that is required in the ES.

Summary
This section has shown how knowledge can be stored in a KBS in the form of
rules.
114 An Introduction to Knowledge Engineering

Self-Assessment Questions
Question 1
Does an Internet search engine use deep or shallow knowledge and declarative
or procedural programming? Make a series of brief notes highlighting the main
issues and considerations.

Question 2
You accidentally drop a plate and you instantly reach the conclusion that it will
drop to the ground. As you are currently standing on a concrete floor you expect
the plate to break on impact.
(a) Did you use deep or shallow knowledge to reach these conclusions?
(b) If a scientist wanted to calculate the trajectory of a rocket would they use deep
or shallow knowledge?
(c) Would it be advantageous to apply the knowledge a scientist has to the problem
of a plate dropping?

Answer to Self-Assessment Questions


Answer 1
Areas that you need to consider within your answer include:
An Internet search cannot, by its nature, include deep knowledge of any subject
area. It is a general-purpose tool for finding matches for keywords, rather than
looking for specific knowledge within a domain.
However, some element of deep knowledge may be noted in the system. The search
engine must ‘understand’ how to parse the questions or statements given to it so
that appropriate hits can be located for the user. For example, the question ‘tell
me about motor vehicles in the 1950’s’ could be given to the search engine. The
engine must be smart enough to realise that tell me about are not really part of
the search, and that 1950s is related to motor vehicles, otherwise a list of 1950s
websites could be provided.
The type of programming used is likely to be procedural, particularly where ques-
tions need to be parsed in a specific way, or websites searched for specific
keywords. The search engine is simply following a list of instructions to carry
out these actions.
The use of declarative knowledge is limited, because most of the activities
of the search engine can be carried out using a list of procedures, and the
engine does not have to understand any of the knowledge domains being
visited.
Knowledge Representation and Reasoning 115

Answer 2
(a) You know from personal experience that if you drop an item it will fall and
an item such as a plate will almost certainly break if it hits a hard surface.
You did not need to understand the detail laws of physics to reach this
conclusion.
(b) Understanding that items when dropped will fall will not enable a scientist to
calculate the trajectory of a rocket. To calculate this you need to understand the
laws of physics regarding gravity, momentum and motion. If you understand
these laws you can apply them to a range of situations, e.g. determining the
speed of a car rolling down a hill.
(c) You could determine what would happen to the plate based on the laws of
physics but the calculations would be long and complex. In performing such
calculation it would be possible to make a mistake. Why go through this long
and complex process, taking the risk of making a mistake, when we know
from years of personal experience what will happen?
From this example we can see that deep knowledge can be applied to a range
of problems (and this can combat the issue of brittleness described elsewhere in
this book) however it is not easy to obtain and can be difficult to apply. Thus for
practical purposes shallow knowledge may be better. The appropriate use of deep
or shallow knowledge is a decision that the knowledge engineer must make when
considering each system to be developed.

You might also like