Module 2
Module 2
Knowledge Representation
Chapter 4
Knowledge
• Knowledge is an abstract term that attempts to capture an individual’s understanding of a
given subject
• In the world of intelligent systems the domain-specific knowledge is captured.
• Domain is a well focused subject area
Data is viewed as collection of disconnected facts.
Example : It is raining
Information emerges when relationships among facts are established and understood, provides answers to
“who”, ”what”, ”where”, and “when”.
Both Data and Information deal with past, they are based on gathering facts.
Example: The temperature dropped 15 degrees and then it started raining.
Knowledge emerges when relationships among patterns are identified and understood. Provides answers to
“how”. Deals with present that enables us to perform
Example: If humidity is very high and the temp drops substantially then atmosphere is unlikely to hold the
moisture, so it rains.
Wisdom is the pinnacle of understanding, uncovers the principles of relationships that describe patterns.
Provides answers to “why”.
Example: Encompasses understanding of all the interactions that happen between raining, evaporation, air
currents, temperature gradients and changes.
Knowledge Representation
• Knowledge representation is the method used to encode knowledge in an intelligent
system’s knowledge base.
• The object of knowledge representation is to express knowledge in computer tractable
form, such that it can be used to help intelligent system perform well.
• Earlier it was believed that the best approach to solutions was through the
development of general purpose problem solver, that is, systems powerful to prove a
theorem in geometry, perform a complex robotic task, or to develop a plan to
complete a sequence of operations.
• But it was deduced that the systems became effective only when the solution
methods incorporated domain specific rules and facts, i.e., after gaining specific
knowledge.
• It eventually led to knowledge based systems.
A KR language should allow user to:
- Represent adequately the knowledge needed for the problem.
- Do it in a clear, precise and natural way.
- Allows to reason on that knowledge, drawing new conclusions.
Framework for Knowledge representation
• Computer requires a well defined problem description to process and provide well
defined acceptable solution.
• To collect fragments of knowledge first formulate a description in spoken language
and then represent it in formal language so that computer can understand.
• The computer can then use an algorithm to compute an answer.
Knowledge
Knowledge Representation
Representation
Intellectual A study of how
A way describing knowledge is actually
acquaintance with or
certain fragments or picturized & how
perception of fact or
information effectively it resembles
truth
the representation of
knowledge in human
brain
Knowledge Base
Representation of knowledge and the reasoning processes that brings knowledge
to life -center to entire field of AI.
• Using the deductive mechanism of the logic, we may generate the new representation object
hastail(spot)
• Using an appropriate backward mapping function we could generate the English sentence:
Spot has a tail
Spot is a dog
Dog(spot)
Every dog has a tail
Hastail(spot)
• Fact-representation mapping is not one-to-one it is many to
many relations.
• Good representation can make a reasoning program trivial.
The Multilated Checkerboard Problem
“Consider a normal checker board from which two squares, in opposite
corners, have been removed.
The task is to cover all the remaining squares exactly with dominos, each
of which covers two squares. No overlapping, either of dominoes on top
of each other or of dominoes over the boundary of the multilated board
are allowed.
Can this task be done?”
(a) (b) (c)
• A domino placed on the chess board will always cover one white square and one black square
Therefore a collection of dominos placed on the board will cover an equal numbers of square of each
color
• If the two white corners are removed from the board then 30 white squares & 32 black squares remain
to be covered by dominos so this is impossible.
• If two black corners are removed instead the 32 white & 30 black square remain, this is impossible
Mapping between Facts and Representation
A knowledge representation system should have following properties.
1. Representational Adequacy : The ability to represent all kinds of knowledge that are
needed in that domain.
2. Inferential Adequacy: The ability to manipulate the representational structures to derive
new structures corresponding to new knowledge inferred from old.
3. Inferential Efficiency :The ability to incorporate additional information into the knowledge
structure that can be used to focus the attention of the inference mechanisms in the most
promising direction.
4. Acquisitional Efficiency: Moreover, The ability to acquire new knowledge using automatic
methods wherever possible rather than reliance on human intervention
Knowledge Representation Approaches
1.Relational Knowledge
• The simplest way to represent declarative facts is a set of relations of the same sort used in
the database system.
• Provides a framework to compare two objects based on equivalent attributes. Any instance
in which two different objects are compared is a relational type of knowledge.
• The table shows a simple way to store facts. Also, The facts about a set of objects are put
systematically in columns. This representation provides little opportunity for inference.
• Knowledge represented in this form serve as the input to more powerful inference engine.
• Given the facts, it is not possible to answer a simple question such as: “Who is the
heaviest player?”
• Also, But if a procedure for finding the heaviest player is provided, then these facts
will enable that procedure to compute an answer.
• Moreover, We can ask things like who “bats – left” and “throws – right”.
2. Inheritable Knowledge
• Here the knowledge elements inherit attributes from their parents.
• The knowledge embodied in the design hierarchies found in the functional, physical and
process domains.
• Within the hierarchy, elements inherit attributes from their parents, but in many cases, not
all attributes of the parent elements prescribed to the child elements. Also, The inheritance
is a powerful form of inference, but not adequate.
• Moreover, The basic KR (Knowledge Representation) needs to augment with inference
mechanism.
• Property inheritance: The objects or elements of specific classes inherit attributes and
values from more general classes. So, The classes organized in a generalized hierarchy.
Boxed nodes — objects and values of attributes of
objects.
Arrows — the point from object to its value.
So, Many inference procedures available to implement standard rules of logic popular in
AI systems. e.g Automated theorem proving
Procedural Knowledge
• Representation of “how to make it”, “what to do when” rather than “what it is”
• A representation in which the control information, to use the knowledge, embedded in
the knowledge itself.
• For example, computer programs, directions, and recipes; these indicate specific use or
implementation;
• Moreover, Knowledge encoded in some procedures, small programs that know how to
do specific things, how to proceed.
• May have inferential efficiency but no inferential adequacy and acquisitional efficiency.
• Can be represented in LISP,ADA, PROLOG etc.
Advantages:
• Heuristic or domain-specific knowledge can represent.
• Moreover, Extended logical inferences, such as default reasoning facilitated.
Disadvantages:
• Completeness — not all cases may represent.
• Consistency — not all deductions may be correct. e.g If we know that Fred is a bird
we might deduce that Fred can fly. Later we might discover that Fred is an emu.
• Modularity sacrificed. Changes in knowledge base might have far-reaching effects.
• Cumbersome control information
Issues in Knowledge representation
Various issues that must be considered when representing various kinds of real world
knowledge.
• Important Attributes: Any attribute of objects so basic that they occur in almost every
problem domain?
• Relationships among Attributes: Any important relationship that exits among object
attributes?
• Choosing the granularity of representation: At what level of detail should the
knowledge be represented?
• Representing sets of objects: How sets of objects be represented?
• Finding the right structures as needed: Given a large amount of knowledge stored, how
can relevant parts be accessed
1. Important Attributes
• The attributes that occur in many different types of problem.
• There are attributes that are of general significance
• Two attributes are important because each supports property
inheritance.
Instance and isa
2. Relationship among Attributes
The relationship between the attributes of an object, independent of specific
knowledge they encode, may hold properties like:
Properties
- Inverses (consistency check)
- An ISA hierarchy of attributes (generalization-specialization)
- Techniques for reasoning about values(specify constraints)
- Single-valued attributes (weight cannot be two values)
Inverses
• Entities are related to each other in different ways.
• This is about consistency check, while a value is added to one attribute.
• Eg: Attributes(isa, instance, team) with directed arrow,
- originating-object being described
- Terminating – object or value
An example of an inverse in a logical representation ,
Team(Pee-Wee-Reese, Brooklyn-Dodgers)
Can be treated as
Pee-Wee-Reese plays in the team Brooklyn-Dodgers or
Pee-Wee-Reese team is Brooklyn-Dodgers
Another representation is to use attributes that focus on a single entity but use
them in pairs, one the inverse of the other;
one associated with Pee-Wee-Reese:
Team=Brooklyn-Dodgers
one associated with Brooklyn Dodgers:
Team-members=Pee-Wee-Reese
An isa Hierarchy of Attributes:
• This is about generalization-specialization.
• Attributes and specialization of attributes.
• For example, the attribute height is a specialization of general attribute physical-
size which is, in turn, a specialization of physical attribute. These generalization-
specialization relationships are important for attributes because they support
inheritance.
Techniques for Reasoning about value
• Reasoning values of attributes are specified explicitly when a knowledge
base is created
Kinds of information
• Type of value: Height-Centimeter(must be in a unit of length)
• Constraints on related entity values: person_age<parent_age
• Backward/if needed rules: Rules for computing the value when it is needed
• Forward/If added rules: Rules describing actions that should be taken if a
value ever becomes known
Single value Attributes
• A kind of specific attribute that takes a unique values
• Eg: A baseball player can at time have only a single height and be a member of only one
team.
Different approaches to provide support for single-valued attributes
• Introduce an explicit notation for temporal interval. If two different values are ever
asserted for the same temporal interval, signal a contradiction automatically.
• Assume that the only temporal interval that is of interest is now. So if a new value is
asserted, replace the old value.
• Provide no explicit support.
3. Choosing the Granularity of Representation
• There are some properties of objects which satisfy the condition of a set together but not
as individual.
• Example: Consider the assertion made in the sentences:
S1: There are more sheep than people in Australia
S2: English speakers can be found all over the world
To describe these facts, the only way is to attach assertion to the sets representing people,
sheep, and English.
The reason to represent sets of object is:
If a property is true for all or most elements of a set, then it is more efficient to associate it
once with the set rather than to associate it explicitly with every elements of the set.
This is done in different ways:
• In logical representation through the use of universal quantifier, and
• In hierarchical structure where node represent sets, the inheritance propagate set level
assertion down to individual.
Example: assert large(elephant);
“Sue went out to lunch. She sat at a table and called a waitress, who bought her a menu.
She ordered a sandwich”
Questions:
1. Was sue in a restaurant?
2. Who was the “she” who ordered the sandwich?
Locating the
• Right structures as needed.
• Appropriate knowledge structures that have been stored in memory.
Eg: Restaurant script
Steak and Ale was an American chain of casual dining restaurants
John went to steak and ale last night. He ordered a large rare steak, paid his bill, and
left.
- Ask: Did John eat dinner last night?
- Answer: Yes.(by using restaurant script)
• How will a system select appropriate script among many others.
Scripts
Going to hotel
-Eating
-Paying the bill
-Exiting
The components of a script include:
Entry conditions: These must be satisfied before events in the script can occur.
Results: Conditions that will be true after events in script occur.
Props: Slots representing objects involved in events
Roles: Persons involved in the events.
Track: Variations on the script. Different tracks may share components of the same script.
Scenes: The sequence of events that occur. Events are represented in conceptual
dependency form.
• The information is stored in a large amount.
• The question is how to access the relevant information out of whole?
• To describe a particular situation, it is always important to find the access of right
structure.
• This can be done by selecting an initial structure and then revising the choice.
• While selecting and reversing the right structure, it is necessary to solve following
problem statements.
• They include the process on how to:
-Select an initial appropriate structure.
-Fill the necessary details from the current situations.
-Determine a better structure if the initially selected structure is not appropriate to fulfil
other conditions
-Find the solution if none of the available structures is appropriate.
-Create and remember a new structure for the given condition.
• There is no specific way to solve these problems, but some of the effective knowledge
representation techniques have the potential to solve them
Selecting an Initial structure:
Three important properties
1. Index has structure: Directly by the significant English words that can be used to
describe them.
Eg: Word “Fly” has a different meaning
- John flew to Newyork (He rode in a plane
- John flew a kite (He held a kite that was up in the air)
- John flew down the street(he moved very rapidly)
- John flew into a rage(An idiom)
2. Major concepts as a pointer to all of the structures
Concepts steak-points to 2 scripts
one for Restaurant
One for supermarket
Concept Bill-Points to 2 scripts
One for Restaurant
One for shopping script
Take intersection of those sets that involves all the content words
ON(Plant12, Tablet34)
UNDER(Table34, Window13)
IN(Table34,Room15)
• But what happens during the problem-solving process if each of those descriptions is
very long?
• Most of the facts will not change from one state to another, yet each fact will be
represented once at every node, and we will quickly run out of memory.
• Time is more utilized for creating these nodes and copying these facts-most of which
do not change often-from one node to another.
• For example, in the robot world, we could spend a lot of time recording
above(Ceiling, Floor) at every node.
• All of this is, of course, in addition to the real problem of figuring out which facts
should be different at each node.
• This whole problem of representing the facts that change as well as those that do not
is known as the frame problem.
• For example, in the robot world,
Table with a plant on it under window
Move the table to the center of the room
Inference-plant in the center of the room while window remains as such.
Frame Axioms:
• To support this kind of reasoning, some systems make use of an explicit set of axioms
called frame axioms, which describe all the things that do not change when a
particular operator is applied in state n to produce state n+1.
(The things that do change must be mentioned as part of the operator itself.)
• Thus, in the robot domain, we might write axioms such as
color(x,y, s1)^move(x,s1, S2)->color(x,y, S2)
• If x has color y in state s1 and the operation of moving x is applied in state s1 to
produce state s2, then the color of x in s2 is still y.
• Unfortunately, in any complex domain, a huge number of these axioms becomes
necessary.
• An alternative approach is to make the assumption that the only things that
change are the things that must.
• By “must” here we mean that the change is either required explicitly by the axioms
that describe the operator or that it follows logically from some change that is
asserted explicitly.
• This idea of circumscribing the set of unusual things is a very powerful one, it can
be used as a partial solution to the frame problem and as a way of reasoning with
incomplete knowledge.
• But now let us return briefly to the problem of representing a changing problem
state.
• For example, what do we have to change to undo the effect of moving the table to the
center of the room?
• There are two ways this problem can be solved:
-Do not modify the initial state description at all
At each node, store an indication of the specific changes that should be made at this
node. Whenever it is necessary to refer to the description of the current problem state, look at
the initial state description and also look back through all the nodes on the path from the start
state to the current state. This approach makes backtracking very easy, but it makes referring to
the state description fairly complex.
- Modify the initial state description
Also record at each node an indication of what to do to undo the move should it ever be
necessary to backtrack through the node. Then, whenever it is necessary to backtrack, check
each node along the way and perform the indicated operations on the state description.
State Variable
- A specific indication of the time at which the fact was true.
Eg:
- Robot world- before the table was moved it was under the window and after being
moved, it was in the center of the room.
• But to apply the same technique to a real-world problem, we need, for example,
separate facts to indicate all the times.
• There is no simple answer either to the question of knowledge representation or to the
frame problem.
• Each of them is discussed in greater depth later in the context of specific problems. But
it is important to keep these questions in mind when considering search strategies, since
the representation of knowledge and the search process depend heavily on each other.