0% found this document useful (0 votes)
41 views71 pages

Module 2

The document discusses different types of knowledge representation including relational knowledge representation using tables and inheritable knowledge representation using hierarchies. It explains how knowledge can be represented and inherited in hierarchies and how relations can provide facts but limited inference. Additional inference mechanisms are needed for more powerful reasoning.

Uploaded by

sanjana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views71 pages

Module 2

The document discusses different types of knowledge representation including relational knowledge representation using tables and inheritable knowledge representation using hierarchies. It explains how knowledge can be represented and inherited in hierarchies and how relations can provide facts but limited inference. Additional inference mechanisms are needed for more powerful reasoning.

Uploaded by

sanjana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 71

Module-2

Knowledge Representation
Chapter 4

Knowledge Representation Issues

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.

Domain independent algorithm


Inference Engine

Knowledge base Domain specific content

Knowledge Base= Set of sentences in a formal language


To solve complex problems we need:
1. Large amount of knowledge
2. Mechanism for representation and manipulation of existing knowledge
to create new solution
In solving problems in AI we must represent knowledge and there are two entities to
deal with:
• Facts
- Truths in some relevant world describes the facts. These are the things we want
to represent.
- Example: guitars have strings
- This can be regarded as the knowledge level - to be represented
• Representation of facts
- Representations of facts in some chosen formalism . these are things we will
actually be able to manipulate.
- This can be regarded as the symbol level - program
Representations and Mappings :
• In order to solve complex problems encountered in artificial intelligence, one needs
both a large amount of knowledge and some mechanism for manipulating that
knowledge to create solutions.
• Knowledge and Representation are two distinct entities. They play central but
distinguishable roles in the intelligent system.
• Knowledge is a description of the world. It determines a system’s competence by
what it knows.
• Moreover, Representation is the way knowledge is encoded. It defines a system’s
performance in doing something.
• Different types of knowledge require different kinds of representation.
The links in the figure are called Representation mappings
Representation mappings:
-Forward representation: which maps from facts to representation
-Backward representation: which maps from representation to facts
Assumption of AI work is that:
• Knowledge may be represented as symbol structures(essentially, complex data
structures) representing bits of knowledge (objects, concepts, facts, rules,
strategies).
Example:
• red represents color red
• car represents my car
• red(car) represents fact that my car is red.
Intelligent behavior can be achieved through manipulation of symbol structures.
• Example we can use mathematical logic as the representation formalism.
• Consider the English sentence below
Spot is a dog

• Thus fact can also be represented in logic as follows:


dog(spot)
• Suppose we have a logical representation of the fact : all dogs have tails as shown below:

• 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

Spot 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.

This structure is known as a slot filler structure,


semantic network or a collection of frame

In slot filler system is structured as a set of entities and


their attributes.
- A slot-attribute
- A filler-Value that a slot can take
Semantic Nets: Information is represented as a set
of nodes connected to each other by a set of labelled
arcs which represent relationships among the node.

A frame is a data structure with typical knowledge


about a particular concept. Knowledge is organized
into small packets called frames. Each frame
represents a class (group of similar objects) or an
instance(object)
Algorithm Property Inheritance
The steps to retrieve a value V for an attribute A of an instance object O:
1. Find the object O in the knowledge base
2. If there is a value for the attribute A report it .
3. Otherwise look for a value for the attribute instance, if not, then fail
4. Also, Go to that node and find a value for the attribute and then report it
5. Otherwise, do until there is no value for the attribute or until an answer
is found:
a) Get the value of the attribute and move to that node
b) See if there is a value for the attribute A. If there is report it.
3. Inferential Knowledge
• This knowledge generates new information from the given information.
• This new information does not require further data gathering form source but does
require analysis of the given information to generate new knowledge.
• Example: given a set of relations and values, one may infer other values or relations.
A predicate logic (a mathematical deduction) used to infer from a set of attributes.
Moreover, Inference through predicate logic uses a set of logical operations to relate
individual data.
• Represent knowledge as formal logic:
• An inference engine is required
• All dogs have tails ∀x: dog(x) → hastail(x)
Advantages:
• A set of strict rules.
• Can use to derive more facts.
• Also, Truths of new statements can be verified.
• Guaranteed correctness.

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

Regardless of the KR formalism, it is necessary to know


• At what level should the knowledge be represented and what are the primitives?
• Should there be a small number or should there be a large number of low-level
primitives or high level facts.
• High level facts may not be adequate for inference while low level primitives may
require a lot of storage.

How much detailed knowledge is needed to be represented ?


Example of Granularity
Facts: John spotted sue
Representation: spotted(agent(john),object(sue))

• Such a representation would make it easy to answer questions such are:


Who spotted sue?
• But to know:
Did john see sue?
• Given only one fact, cannot discover that answer.
• Want to add other facts, such as
Spotted(x,y)->saw(x,y)
• Now can infer the answer to the question.
Disadvantages:
• At what level of detail should knowledge be represented?
- Balance the trade-off
-High-level facts may not be adequate for inference
-Low level primitives may require a lot of storage

CD- Conceptual Dependency


• CD representations of a sentence is built out of primitives and these primitives are
combined to form the meanings of the words
Arrows: Direction of
dependency.
Double arrow: two way link
between actor and the action
P: Indicates past tense
O: Indicates the object case
relation
R: indicates the recipient case
relation
D: Indicates the direction of
the object in the action
• The classical example- Kinship terminology
-one set of primitives:
Mother, Father, Son, Daughter, Brother and Sister
• Eg: Fact: Mary is sue’s cousin
• An attempt describe the cousin relationship in terms of the primitives could be interpreted
as,
Mary=daughter(brother(mother(sue)))
Mary=daughter(sister(mother(sue)))
Mary=daughter(brother(father(sue)))
Mary=daughter(sister(mother(sue)))
Change the primitives-
Mary=child(sibling(parent(sue)))
4. Representing sets of objects

• 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);

Remember to make clear distinction between,


-whether we are asserting some property of the set itself, means the set of elephants is large,
Or
-asserting some property that holds for individual elements of the set, means, any thing that is
an elephant is large.
How should sets of objects be represented?
There are 3 ways
1. By Names
2. By extensional definition
3. By intentional definition
By Names:
-Node named Baseball player in Semantic net
-Predicates Ball and Batter in Logical representations
• The simple representation makes it possible to associate predicate with sets.
• It does not provide any information about the set it represents.
• It does not tell how to determine whether a particular object is a member of the set or
not
There are 2 ways to state a definition of a set and its elements.
By Extensional Definition
• List the members
• Eg:{Earth}
By Intensional Definition
• Rule->When a particular object is evaluated, it returns Tue/False depending on
whether the object is in the set or not.
• Eg:
{x:sun-planet(x)^human-inhabited(x)}
{x:sun-planet(x)^nth fartherest from sun(x,3)}
{x:sun-planet(x)^nth biggest(x,5)}
5. Finding the Right structures as needed
Locating appropriate knowledge structures that have been stored in memory.
We have a sample script,

“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

A script is a knowledge representation structure used for describing stereo-typed


sequences of actions.
A script consists of a set of slots.
Events like,

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

3. Locate a major clue to select an initial structure


Revising the choice when necessary
• Candidate knowledge structure
• Detailed Matching process
-Variables-bound to objects
-Attributes-values compared
values satisfy-put into appropriate places
• If no appropriate values-then new structure
• If appropriate values-then current structure
• If situation change-new structure-revised situation
• Part of the structure should contain information-acceptable to make excuses.
• Heuristic:
-Appropriate if a desired feature is missing than an inappropriate feature is present
-Eg: Person with one leg is more plausible than a person with a tail
Similarity Network
Linking among a set of frames
• There is a CHAIR-4 legs can be modulated as
-TABLE-too big, no back
-STOOL-too high, no back
-BENCH-no back, too wide
-DESK- drawers
The frame problem
• The problem of efficiently determining which things remain the same in a changing
world
• In AI, the frame problem describes an issue with using first-order logic to express facts
about a robot in the world
• Representing the state of a robot with first-order logic requires the use of many axioms
that simply imply that things in the environment do not change arbitrarily.
• The frame problem in AI is concerned with the question of what piece of knowledge is
relevant to the situation.
• The whole problem of representing the facts that change as well as those that do not is
known as frame problem.
Robot World
• Consider the world of a household robot
• There are many objects and relationships in the world, and a state description must
somehow include facts like

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.

You might also like