Chap 5 Knowledge Represent
Chap 5 Knowledge Represent
Artificial intelligence
An intelligent agent
needs knowledge about the real
world for taking decisions
and reasoning to act efficiently.
Knowledge-based agents are those agents who have the
capability of followings:
maintaining an internal state of knowledge
reason over that knowledge
update their knowledge after observations
take actions
The above diagram is representing a generalized architecture for a knowledge-based agent. The knowledge-based
agent (KBA) take input from the environment by perceiving the environment. The input is taken by the inference
engine of the agent and which also communicate with KB to decide as per the knowledge store in KB. The learning
element of KBA regularly updates the KB by learning new knowledge.
Knowledge base:
Knowledge-base is a central component of a knowledge-
based agent, it is also known as KB.
It is a collection of sentences (here 'sentence' is a
technical term and it is not identical to sentence in
English).
These sentences are expressed in a language which is
called a knowledge representation language.
The Knowledge-base of KBA stores fact about the world.
Why use a knowledge base?
1. Knowledge level
2. Logical level
3. Implementation level
1. Knowledge level
• The knowledge level is the first level of knowledge-
based agent, and in this level, we need to specify what
the agent knows, and what the agent’s goals are. With
these specifications, we can fix its behavior.
• For example, suppose an automated taxi age; in this
level, we need to specify what the agent knows and the
agent goal needs to go from a station A to station B,
and he knows the way from A to B, so this comes at the
knowledge level.
2. Logical level:
• At this level, we understand that how the knowledge
representation of knowledge is stored. At this level, sentences
are encoded into different logics.
• At the logical level, an encoding of knowledge into logical
sentences occurs.
• At the logical level we can expect the automated taxi agent to
reach the destination B.
3. Implementation level:
• This is the physical representation of logic and knowledge.
Object: All the facts about objects in our world domain. E.g.,
Guitars contain strings, trumpets are brass instruments.
Facts: Facts are the truths about the real world and what we
represent.
Player1 65 23
Player2 58 18
Player3 75 24
2. Inheritable knowledge:
• In the inheritable knowledge approach, all data must be stored into a hierarchy
of classes.
• All classes should be arranged in a generalized form or a hierarchal manner.
• In this approach, we apply inheritance property.
• Elements inherit values from other members of a class.
• This approach contains inheritable knowledge which shows a relation between
instance and class, and it is called instance relation.
• Every individual frame can represent the collection of attributes and its value.
• In this approach, objects and values are represented in Boxed nodes.
• We use Arrows which point from objects to their values.
3. Inferential knowledge
• Inferential knowledge approach represents knowledge in the form of formal
logics.
• This approach can be used to derive more facts.
• It guaranteed correctness.
Example: Let's suppose there are two statements:
Marcus is a man
All men are mortal
Then it can represent as;
man(Marcus)
∀x = man (x) ----------> mortal (x)s
4. Procedural knowledge:
• Procedural knowledge approach uses small programs and codes
which describes how to do specific things, and how to proceed.
• In this approach, one important rule is used which is If-Then rule.
• In this knowledge, we can use various coding languages such
as LISP language and Prolog language.
• We can easily represent heuristic or domain-specific knowledge
using this approach.
• But it is not necessary that we can represent all cases in this
approach.
Requirements for knowledge Representation system:
A good knowledge representation system must possess the following
properties.
• Representational Accuracy: KR system should have the ability to represent
all kind of required knowledge.
• Inferential Adequacy:KR system should have ability to manipulate the
representational structures to produce new knowledge corresponding to the
existing structure.
• Inferential Efficiency:The ability to direct the inferential knowledge
mechanism into the most productive directions by storing appropriate
guides.
• Acquisitional efficiency- The ability to acquire new knowledge easily using
automatic methods.
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
1. Logical Representation
• Logical representation is a language with some concrete rules which
deals with propositions and has no ambiguity in representation.
Logical representation means drawing a conclusion based on various
conditions.
• This representation lays down some important communication rules. It
consists of precisely defined syntax and semantics which supports the
sound inference.
• Each sentence can be translated into logics using syntax and
semantics.
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.
Logical representation can be categorized into mainly
two logics:
1.Propositional Logics
2.Predicate logics
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 some restrictions and are
challenging to work with.
• Logical representation technique may not be very
natural, and inference may not be so efficient.
Semantics:
2.Kind-of-relation
Example: Following are some statements which we need to represent in
the form of nodes and arcs.
Statements:
1.Jerry is a cat.
2.Jerry is a mammal
3.Jerry is owned by Priya.
4.Jerry is white colored.
5.All Mammals are animal.
Example:
IF-NEEDED facts are called when data of any particular slot is needed.
A frame may consist of any number of slots, and a slot may include any
number of facets and facets may have any number of values.
A frame is also known as slot-filter knowledge
representation in artificial intelligence.
Frames are derived from semantic networks and later
evolved into our modern-day classes and objects.
Slots Filters
Title Artificial Intelligence
Genre Computer Science
Author Peter Norvig
Edition Third Edition
Year 1996
Page 1152
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.
Disadvantages of frame representation:
• In frame system inference mechanism is not be easily
processed.
• Inference mechanism cannot be smoothly proceeded
by frame representation.
• Frame representation has a much generalized
approach.
4. Production Rules
Production rules system consist of (condition, action)
pairs which mean, "If condition then action".
It has mainly three parts:
• The set of production rules
• Working Memory
• The recognize-act-cycle
The set of production rules
• In production rules agent checks for the condition
and if the condition exists then the production rule
fires and corresponding action is carried out.
• The condition part of the rule determines which rule
may be applied to a problem. And the action part
carries out the associated problem-solving steps.
• This complete process is called a recognize-act
cycle.
Working Memory
The working memory contains the description of the current state of
problem-solving and rules that can write knowledge to the working
memory. This knowledge match and may fire other rules.
• If there is a new situation (state) generates, then
multiple production rules will be fired together, this is
called conflict set.
• In this situation, the agent needs to select a rule from
these sets, and it is called a conflict resolution.
Example:
•IF (at bus stop AND bus arrives) THEN action (get into the bus)
•IF (on the bus AND paid AND empty seat) THEN action (sit down).
•IF (on bus AND unpaid) THEN action (pay charges).
•IF (bus arrives at destination) THEN action (get down from the bus).
Advantages of Production rule:
• The production rules are expressed in natural language.
• The production rules are highly modular, so we can easily
remove, add or modify an individual rule.
Disadvantages of Production rule:
• Production rule system does not exhibit any learning
capabilities, as it does not store the result of the
problem for the future uses.
• During the execution of the program, many rules may
be active hence rule-based production systems are
inefficient.