You are on page 1of 82

Unit 4

Unit 4
Types of Knowledge:
Representing knowledge using rules, Procedural Vs Declarative
knowledge, Logic programming, forward and backward reasoning,
semantic nets, frames, scripts and conceptual dependency.
Knowledge representation using Rules
Knowledge is awareness or familiarity gained by experiences of facts,
data, and situations.
The types of knowledge include
1) Procedural knowledge (Commonly used -Production
Systems)
2) Declarative knowledge (Usually Static)
3) Heuristic knowledge
4) Meta Knowledge
5) Structural Knowledge
• Types of Knowledge
❑Heuristic Knowledge
Heuristics knowledge are rules of thumb or tricks.
• Heuristic knowledge is used to make judgments and also to
simplify solution of problems.
• It is acquired through previous experiences. An expert uses
his knowledge that he has gathered due to his experience
and learning.
• Experience-based techniques for problem solving, learning
and discovery that give a solution which is not guaranteed to
be optimal.
• Where the exhaustive search is impractical, heuristic
methods are used to speed up the process of finding a
satisfactory solution via mental shortcuts to ease the
cognitive load of making a decision.
• Examples of this method include using a rule of thumb, an
educated guess, an intuitive judgment, stereotyping, or
common sense.
❑ Meta-knowledge This type gives a knowledge about the
other types of knowledge that are suitable for solving
problem.
• Meta-knowledge is helpful in enhancing the efficiency of
problem solving through proper reasoning process.
• The main usage of meta-knowledge is to understand and
improve the nature of user interface components and to
maintain the knowledge bases that are used alongside
inference engines as well. With the increasing complexity
of problems around us, it can be said that extensive use of
meta-knowledge will be seen in the coming days
❑Structural knowledge Structural knowledge is associated
with the information based on rules, sets, concepts and
relationships.
• It provides the information necessary for developing the
knowledge structures and overall mental model of the
problem.
• Structural knowledge is basic knowledge to problem-solving.
It describes relationships between various concepts such as
kind of, part of, and grouping of something. It describes the
relationship that exists between concepts or objects.
Knowledge of real-worlds plays a vital role in intelligence and
same for creating artificial intelligence.
FORWARD CHAINING and BACKWARD CHAINING
The objective of search procedure is to find a path through a
problem space. There are two approaches. Forward chaining &
backward chaining
• Forward chaining starts from the known facts and move
forward by applying inference rules to extract more data, and it
continues until it reaches to the goal.
• Backward chaining starts from the goal, move backward by
using inference rules to determine the facts that satisfy the
goal.
FORWARD CHAINING
• Forward chaining is a technique for reasoning in AI where
inference rules are applied to existing information to remove
extra information until an objective is accomplished.
• Forward chaining is known as the down-up approach, whereas
backward chaining is known as a top-down approach.
• Forward chaining is called a data-driven inference technique
FORWARD CHAINING
• Forward chaining uses breadth-first search strategy, whereas
backward chaining uses depth-first search strategy.
• In Forward chaining, the inference engine turns over by
assessing existing conditions, derivations, and facts before
reasoning new data. An objective is accomplished through the
control of knowledge that exists in the knowledge base.
• It can be utilized in interpreting, controlling, monitoring, and
planning applications.

• It Is a deductive inference rule:


Forward Chaining: Conclude from "A" and "A implies B" to "B".
FORWARD CHAINING
Y
YàZ
Z Where,
Y is the beginning stage.
Y à Z addresses a fact
This fact is utilized to accomplish a decision Z.
Example 1; John is running (Y)
If an individual is running, he will sweat (Y à Z)
Consequently, JohnAis sweating (Z)
A -> B
B
Example 2:It is raining.
If it is raining, the street is
wet.
The street is wet.
BACKWARD CHAINING
Backward chaining is a concept that involves backtracking from the
endpoint or goal to steps that led to the endpoint.
This type of chaining starts from the goal and moves backward to
comprehend the steps that were taken to attain this goal.
Backward chaining is called a goal-driven inference technique.
The backtracking process can also enable a person establish logical
steps that can be used to find other important solutions.
Conclude from "B" and "A implies B" to "A".
Abductive inference rule: B
A -> B
A
Example 1: The street is wet.
If it is raining, the street is wet.
It is raining.
Example 2: Tom is sweating (B).
If a person is running, he will sweat (A->B).
Tom is running (A).
BACKWARD CHAINING
Z
YàZ
Y
Where,
Z is the endpoint or goal, that is utilized as the
beginning stage for the backward chaining.
Y à Z is a reality that should be stated to show up at
the endpoint Z.
Y is the initial state.
Example;
• John is sweating (Z)
• If an individual is running, he will sweat (Y à Z)
• John is running (Y)
Advantages of forward chaining:
• It’s more adaptable than backward chaining since it doesn’t
have a limit on the information got from it.
• It gives a decent premise to come to conclusions.
• It very well may be utilized to reach numerous conclusions.
Advantages of backward chaining:
• In this kind of chaining, the right arrangements can be inferred
successfully if pre-decided principles are met by the inference
engine.
• It’s a faster strategy for thinking than forward chaining because
the endpoint is accessible.
• The outcome is as of now known, which makes it simple to
deduce inferences.
• Forward and backward chaining both applies Modus
ponens inference rule.
• Forward chaining can be used for tasks such as
planning, design process monitoring, diagnosis, and
classification, whereas backward chaining can be used
for classification and diagnosis tasks.
• Forward chaining can be like an exhaustive search,
whereas backward chaining tries to avoid the
unnecessary path of reasoning.
• In forward-chaining there can be various ASK
questions from the knowledge base, whereas in
backward chaining there can be fewer ASK questions.
• Forward chaining is slow as it checks for all the rules,
whereas backward chaining is fast as it checks few
required rules only.
No. Forward Chaining Backward Chaining
1. Forward chaining starts from known facts Backward chaining starts from the goal
and applies inference rule to extract more and works backward through inference
data unit it reaches to the goal. rules to find the required facts that
support the goal.

2. It is a bottom-up approach It is a top-down approach

3. Forward chaining is known as data-driven Backward chaining is known as goal-


inference technique as we reach to the driven technique as we start from the
goal using the available data. goal and divide into sub-goal to extract
the facts.
4. Forward chaining reasoning applies a Backward chaining reasoning applies a
breadth-first search strategy. depth-first search strategy.

5. Forward chaining tests for all the available Backward chaining only tests for few
rules required rules.
6. Forward chaining is suitable for the Backward chaining is suitable for
planning, monitoring, control, and diagnostic, prescription, and debugging
interpretation application. application.

7. Forward chaining can generate an infinite Backward chaining generates a finite


number of possible conclusions. number of possible conclusions.

8. It operates in the forward direction. It operates in the backward direction.

9. Forward chaining is aimed for any Backward chaining is only aimed for the
conclusion. required data.
Techniques of knowledge representation
There are mainly four ways of knowledge
representation which are given as follows:

1.Logical Representation
2.Semantic Network Representation
3.Frame Representation
4.Production Rules.

Advantages of logical representation:


• Logical representation enables us to do logical reasoning.
• Logical representation is the basis for the programming languages.
Disadvantages of logical Representation:
• Logical representations have certain restrictions and are challenging
to work with.
• Logical representation technique may not be very natural, and
inference may not be so efficient.
Syntax:
Syntaxes are the rules which decide how we
can construct legal sentences in the logic.
It determines which symbol we can use in
knowledge representation.
How to write those symbols.

Semantics:
• Semantics are the rules by which we can interpret
the sentence in the logic.
• Semantic also involves assigning a meaning to
each sentence.
Semantic Network Representation
Semantic networks are alternative of predicate logic for knowledge representation.
In Semantic networks, we can represent our knowledge in the form of graphical
networks.
Popular in AI and NLP :It represents knowledge or support reasoning.
This network consists of nodes representing objects .
Arcs which describe the relationship between those objects.
Semantic networks can categorize the object in different forms and can also link those
objects. Semantic networks are easy to understand and can be easily extended.
Also known as Associative Nets because nodes are associated.
• This representation consist of mainly two types of relations:
IS-A relation (Inheritance)
A Kind-of-relation (AKO)
• A semantic network :
A classic AI representation technique used for propositional
information
A propositional net
• A proposition : a statement that is either true or false
• A semantic net
A labeled, directed graph
The structure of a semantic net is shown graphically in terms of nodes
and the arcs connecting them.
Nodes are sometimes referred to as objects
Arcs as links or edges
The links are used to express relationships
Nodes are to represent physical objects, concepts, or situation
Statements:
• Jerry is a cat.
• Jerry is a mammal
• Jerry is owned by Priya.
• Jerry is brown colored.
• All Mammals are animal.
• Semantic Network is of two types
1) Simple Semantic network
2) Partition Semantic network
Simple Semantic network
In this we will have
a) Is a relation 🡪 classes
b) Has a relation🡪 properties
c) Instance relation🡪 class and instance
Ex: Create a simple semantic network for a class mammal, person class inherits properties
of class mammal, person class has instance named Ram who is in the team XYZ having blue
color.Person class has a property that it as a nose.
Representing Non-binary Predicates
Simple binary predicates like isa(Person, Mammal) can represent easily by semantic
nets but other non-binary predicates can also represent by using general-purpose
predicates such as isa and instance
• John gave a book to Mary
• Mary recipient GIVE giver John
object

book
• Teacher gave a certificate to student

Giving Event

isa

G(x)

Giver Object Receiver

Teacher C(x) x

Three or even more place predicates can also convert to a binary form by creating one new object representing the
entire predicate statement and then introducing binary predicates to describe a relationship to this new object.
Animal

INHERITANCE IN
isa
SEMANTIC NETWORKS

Bird Has_Parts
Wings

Parrot

Ram Totu
Partition Semantic network
• Partition Semantic networks allows to represent difference b/w description of
individual objects or process and description of set of objects, the set description
involves quantification.
• Basic idea: Break network into spaces which consists of groups of nodes and arcs
and regard each space as node.
• Partition of semantic network makes semantic network logically more adequate.
• How to represent-
a) Create a General statement GS this is a special class.
b) Make node ’g’ as instance of GS
c) Every element will have two attributes.
-- a form that states which relations is being asserted.
---for all ,there exist some connections that represent
universally quantified variables and sentences.
• Draw partition semantic network for,
a) The dog bite the mail carrier.
b) Every dog has bitten a mail carrier.
c) Every dog in town has bitten every mail.

d) Every dog in town has bitten the constable.


• Drawbacks in Semantic representation:
1.Semantic networks take more computational time at runtime as
we need to traverse the complete network tree to answer some
questions. It might be possible in the worst case scenario that
after traversing the entire tree, we find that the solution does
not exist in this network.
2.Semantic networks try to model human-like memory (Which
has several neurons and links) to store the information, but in
practice, it is not possible to build such a vast semantic
network.
3.These types of representations are inadequate as they do not
have any equivalent quantifier, e.g., for all, for some, none, etc.
4.Semantic networks do not have any standard definition for the
link names.
5.These networks are not intelligent and depend on the creator of
the system.
• Advantages of Semantic network:
1.Semantic networks are a natural representation
of knowledge (easy to visualize).
2.Semantic networks convey meaning in a
transparent manner.
3.These networks are simple and easily
understandable because the related knowledge is
easily clustered.
Frames
Evolution Frames
• Although there is no clear distinction between a semantic net and
frame system, more structured the system is, more likely it is to be
termed as a frame system.
• A frame is a collection of attributes (called slots) and associated values
that describe some entities in the world. Sometimes a frame describes
an entity in some absolute sense.
• Sometimes it represents the entity from a particular point of view only.
• A single frame taken alone is rarely useful; we build frame systems out
of collections of frames that connected to each other by virtue of the
fact that the value of an attribute of one frame may be another frame.
Frame Representation
• Although there is no clear distinction between a semantic net and frame system,
more structured the system is, more likely it is to be termed as a frame system.
• A frame is a record like structure which consists of a collection of attributes and
its values to describe an entity in the world. Frames are the AI data structure
which divides knowledge into substructures by representing stereotypes
situations.
• It consists of a collection of slots and slot values. These slots may be of any type
and sizes. Slots have names and values which are called facets.
• A frame is also known as slot-filter knowledge representation in artificial
intelligence.
• A single frame taken alone is rarely useful.
Type 1: Example : Knowledge about Rama in a frame
<Frame> <Slot> <Faucet> <Value>
(Rama (Family_Deatails (Father (Dasharatha))
(Mother(Kausalya))
(Wife(Sita))
(Children(Kusha,Lava))
(Kingdom_Details (Capital (Ayodhya))
(Country (Bharath)) )
Type 2 : Frames representation Using Tables
Frame Slot Facet Value
Name
Rama Family Father Dasharatha
Mother Kausalya
Wife Sita
Children Kusha Lava
Kingdom Capital Ayodhya
Details Country Bharath
Frames as Sets and Instances

‘*’ astric sign means that


particular property is inherited
by each and every instance of a
particular class
Slots as Full-Fledged Objects (Frames)
• Till now we have used
attributes as slots, but
now we will represent
attributes explicitly and
describe their
properties.
• Example 2:
Let's suppose we consider the entity, Peter. Peter is an engineer
by profession, and his age is 25, he lives in city London, and the
country is England.

Slots Filler

Name Peter
Profession Engineer
Age 25
Marital status Single
Weight 78
Advantages of frame representation:
• The frame knowledge representation makes the programming easier by grouping
the related data.
• The frame representation is comparably flexible and used by many applications in
AI.
• It is very easy to add slots for new attribute and relations.
• It is easy to include default data and to search for missing values.
• Frame representation is easy to understand and visualize.
Suppose that we are interested in following facts:
Krishna spotted Arjuna.
Bheema devoured Payasa
Now, this could be represented as
Spotted (agent(Krishna), object (Arjuna))
devoured (agent(Bheema), object(Payasa))

Such a representation can make it easy to answer questions such as:


Who spotted Arjuna?
Who devoured Payasa ?
Suppose we want to know : "Did Krishna see Arjuna?“ or “Did Bheema eat Payasa?”

Given only one fact, user cannot discover that answer.

Hence, the user can add other facts, such as


Spotted (x, y) → saw (x, y)
Devoured(x,y) 🡪 ate(x,y)
Introduction to Strong Slot and Filler Structures

• The main problem with semantic networks and frames is that they lack
formality; there is no specific guideline on how to use the representations.
• In frame when things change, we need to modify all frames that are
relevant – this can be time-consuming.
• Strong slot and filler structures typically represent links between objects
according to more rigid rules, specific notions of what types of object and
relations between them are provided and represent knowledge about
common situations.
• Moreover, We have types of strong slot and filler structures:
1. Conceptual Dependency (CD) 2. Scripts
Conceptual Dependency (CD)
Conceptual Dependency originally developed to represent knowledge acquired from
natural language input. The goals of this theory are: To help in the drawing of inference from
sentences.
To be independent of the words used in the original input.
That is to say: For any 2 (or more) sentences that are identical in meaning there
should be only one representation of that meaning.
CD developed by Schank et al.
CD provides:
• a structure into which nodes representing information can be placed
• a specific set of primitives
• at a given level of granularity.
• Sentences are represented as a series of diagrams depicting actions using both abstract and
real world physical situations.
• The agent and the objects are represented more clearly
• The actions are built up from a set of primitive acts which can be modified by tense.
CD models provide the following advantages for representing knowledge:
1. The ACT primitives help in representing wide knowledge in a succinct way. To
illustrate this, consider the following verbs. These are verbs which correspond to transfer
of mental information.
• I. See
• II. Learn
• III. Bear
• IV. Inform
• V. Remember
In CD representation all these are represented using a single ACT primitive MTRANS.
They are not represented individually as given. Similarly, different verbs which indicate
various activities are clubbed under unique ACT primitives, thereby reducing the number
of inference rules.
The main goal of CD representation is to make explicit of what is implicit. That is
why, every statement which is made has not only one actor and object but time and
location, source and destination.
Primitive CD actions
1. ATRANS – Transfer of abstract relationship (e.g., give, Donate)
2. PTRANS – Transfer of physical location of an object (e.g., go, run, proceed)
3.. PROPEL – Application of physical force of an object (e.g., throw, push, pull ,hit)
4. MOVE – Movement of body part of an animal by the animal (e.g., kick, pick, shake, wave…)
5. GRASP – Grasping of an object by an actor (e.g. hold, grasp)
6. INGEST – Taking of an object by an animal to the inside of that animal (e.g., drink, eat,
swallow)
7. EXPEL – Expulsion of an object from inside the body by an animal to the world (e.g., cry, spit)
8. MTRANS – Transfer of mental information between animals or within an animal (e.g., tell,
think ,convey)
9. MBUILD – Construction of a new information from an old information (e.g., decide, plan)
10. SPEAK – Action of producing sound (e.g., say, sing)
11. ATTEND – Focusing a sense organ towards a stimulus (e.g., listen, hear)
Apart from the primitive CD actions we may use the following categories of
objects:
1. PP: Picture producers Only physical objects are physical producers.
2. ACT: Actions are done by an actor to an object (a person who performs some action
is known as actor).
3. LOC: Locations Every action takes place at some locations and serves as source and
destination.
4. T: Times An action can take place at a particular location at a given specified time.
The time can be represented on an absolute scale or relative scale.
5. AA: Action aiders These serve as modifiers of actions, the actor PROPEL has a
speed factor associated with it which is an action aider.
6. PA: Picture Aiders Serve as aides of picture producers. Every object which serves as
a PP, needs certain characteristics by which they are defined. PA’s practically serve PP’s
by defining the characteristics.
There are certain rules which the conceptual categories of types of objects discussed can
be combined
• The following second set of primitive conceptual categories
provide building blocks . Using these dependency structures are built:

• PP-- Real world objects.


• ACT-- Real world actions.
• PA-- Attributes of objects.
• AA-- Attributes of actions.
• T-- Times.
• LOC-- Locations.
The following set of conceptual tenses make usage of CD more precise:
• 🡪 Arrows indicate the direction of dependency

• Double arrow indicate the two way link between actor and object

• o – object case relationship

• R – recipient case relationship

• p – past

• f – future

• t – transition
• D ---Direction of object in the action.
Advantages of Conceptual Dependency
• Using these primitives involves fewer inference rules.
• So, Many inference rules already represented in CD structure.
• Moreover, The holes in the initial structure help to focus on the points still
to established.
Disadvantages of Conceptual Dependency
• Knowledge must decompose into fairly low-level primitives. Impossible or
difficult to find the correct set of primitives.
• Also, A lot of inference may still require.
• Representations can be complex even for relatively simple actions.
• Consider: Dave bet Frank five pounds that Wales would win the Rugby
World Cup. Moreover, Complex representations require a lot of storage.
Write the CD diagram for the following
• Ram gave a book to krishna
• Ram ate an apple
• Krishna is short
• John owns a cat
• Peter visited a restaurant
• Peter sat on the chair
• Peter ordered for a large burger
• Bill shot Bob
Scripts
• This was suggested by Roger Schank of Yale University. This is used for representing
knowledge at various times or bat various locations etc.
• It consists of a number of Scenes, where each scene consists of a number of events.
• It is similar to a thought sequence or a chain of situations which could be anticipated.
• It could be considered to consist of a number of slots or frames but with more
specialized roles.
Scripts are beneficial because:
• Events tend to occur in known runs or patterns.
• Causal relationships between events exist.
• Entry conditions exist which allow an event to take place
• Prerequisites exist for events taking place. E.g. when a student progresses through a
degree scheme or when a purchaser buys a house.
Following are the components of a script
1. Props: These are objects present explicitly or implicitly in the various
scenes
2. Roles: These are the actors present explicitly or implicitly in the
scenes
3. Scenes : Each scene consists of a number of events and scripts
consists of a number of Scenes
4. Entry condition: These are the conditions to be satisfied before
events can take place
5. Results : These are the consequences of the actions.
• It must activate based on its significance.
• If the topic important, then the script should open.
• If a topic just mentioned, then a pointer to that script could hold.

For example, given “John enjoyed the play in theater”, a script “Play in Theater”
suggested above invoke.
All implicit questions can answer correctly. Here the significance of this script is high.
• Did John go to the theater?
• Also, Did he buy the ticket?
• Did he have money?

If we have a sentence like “John went to the theater to pick his daughter”, then invoking
this script will lead to many wrong answers.

• Here significance of the script theater is less.


Advantages of Script
• Capable of predicting implicit events
• Single coherent interpretation may be build up from a collection of
observations.

Disadvantage of Script
More specific (inflexible) and less general than frames.
Not suitable to represent all kinds of knowledge.
End of unit 4

You might also like