Artificial Intelligence
Knowledge Representation
Contents
Logical Agents
Knowledge-based Agents
Data Information Knowledge
Knowledge Representation
KR Characteristics
Logical Agents
Humans know things and do reasoning, which are important
for artificial agents
intelligence of humans is achieved by processes of reasoning
that operate on internal representations of knowledge
In AI, this approach to intelligence is embodied in
knowledge-based agents
Knowledge-based Agents
The central component is the knowledge base, or KB
A knowledge base is a set of sentences
A sentence,
expressed in a language called a knowledge representation language
logic languages
represents some assertion about the world
Operations,
TELL - add new sentences to the KB
ASK - a way to query what is known
Both operations may involve inference - deriving new
sentences from old
Knowledge-based agent
KB initially contain some background knowledge
Each time the agent program is called, it does three things.
First, it TELLs the knowledge base what it perceives.
Second, it ASKs the knowledge base what action it should perform.
extensive reasoning may be done about the current state, the
outcomes of possible action sequences
Third, the agent program TELLs the knowledge base which action was
chosen, and the agent executes the action.
three functions that implement the interface
constructs a sentence asserting that the agent perceived the given
percept at the given time.
constructs a sentence that asks what action should be done at the current
time.
constructs a sentence asserting that the chosen action was executed.
Knowledge-based agent
Knowledge-based agent
A knowledge-based agent can be built in two ways,
declarative approach
Starting with an empty knowledge base
the agent designer can TELL sentences one by one until the agent
knows how to operate in its environment.
procedural approach
encodes desired behaviors directly as program code
successful agent often combines both declarative and
procedural elements in its design
Representation
Knowledge can take many forms and examples,
It is raining
Earth is round
Humans are idiots
how knowledge and facts about the world can be represented?
how should an AI agent store and manipulate knowledge?
what kinds of reasoning can be done with that knowledge
Data Information Knowledge
disconnected facts data with context, processing relationships among patterns
relationships among facts Knowledge is derived from
information by applying rules
Data Information Knowledge
Data: 20, 25, 30
This set of numbers are data representing a set of test results for a student.
(On their own they have no meaning because they have no context.)
Information:
The data has been processed and given context. It is now meaningful information.
student’s results Test 1 Test 2 Test 3
Raw mark 20 25 30
Max mark 20 50 100
Percentage 100% 50% 30%
Knowledge
The teacher can see that student’s results are showing a downward trend.
The teacher applies the rule of 40% for a pass to gain the knowledge that
student has passed Tests 1 and 2, and failed Test 3.
Data Information Knowledge
Ice Cream Shop Profit 2017 2018 2019
Month Profit in lakhs
200
2017 2018 2019 190
Jan 100.2 107.38 133.49 180
profit (in lakhs rupee)
170
Feb 120.28 126.56 136.04 160
150
Mar 143.86 163.54 163.95 140
Apr 142.81 161.53 170.26
130
120
May 168.32 194.48 199.17 110
100
Jun 161.67 184.14 190.22 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Jul 155.02 177.00 178.34
Months
Aug 142.65 164.48 173.04
Sep 132.46 134.80 145.29 Knowledge
Oct 137.12 143.74 170.96 Which are the months the profit is better
Nov 109.53 138.42 144.83 than previous month in all three years?
Dec 111.23 118.49 129.22
March, May and October
10
Knowledge Representation
knowledge representation can be considered at two levels :
knowledge level at which facts are described, and
symbol level at which the representations of the objects, defined in
terms of symbols, can be manipulated in the programs.
Knowledge Representation models are often based on:
Logic
Semantic Net
Frames
Rules
Characteristics of KR
Inferential adequacy and efficiency
Can it infer knowledge from different relations and do it efficiently
ability to manipulate the representational structures and to derive new
structure
Acquisitional adequacy
system’s ability to gain additional knowledge based on the
environment provide, using automatic methods
Representational adequacy
ability to represent all kinds of knowledge required
Logical Reasoning
the agent draws a conclusion from the available information
conclusion is guaranteed to be correct, if the available
information is correct
This is a fundamental property of logical reasoning.
The Wumpus World
environment in which knowledge-based agents can show their worth
The Wumpus World
Performance measure
+1000 for climbing out with the gold,
–1000 for falling into a pit or being eaten by the wumpus,
–1 for each action taken and –10 for using up the arrow
game ends either when the agent dies or agent get out with gold
Environment
A 4 × 4 grid of rooms, starts in the square [1,1]
Actuators
Forward, TurnLeft by 90◦, or TurnRight by 90◦, Grab, Shoot, Climb
Sensors
Stench, Breeze, Glitter, Bump and Scream
[Stench, Breeze, None, None, None]
The Wumpus World
[None, None, None, None, None] [None, Breeze, None, None, None]
The Wumpus World
[Stench, None, None, None, None] [Stench, Breeze, Glitter, None, None]
The End…
18