Chapter Eight
Knowledge and
reasoning
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Learning objectives.
After this chapter , students will be able to :
• Learn and understand the basic concept of knowledge-
based agent
• Solve and understand the concept of Wumpus world
problem
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
A knowledge-based agent
• A knowledge-based agent includes a knowledge base and
an inference system.
• A knowledge base is a set of representations of facts of the
world.
• Each individual representation is called a sentence.
• The sentences are expressed in a knowledge
representation language.
• The agent operates as follows:
1. It TELLs the knowledge base what it perceives.
2. It ASKs the knowledge base what action it should
perform.
3. It performs the chosen action.
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Architecture of a knowledge-based agent
• Knowledge Level.
• The most abstract level: describe agent by saying what
it knows.
• Example: A taxi agent might know that the Golden
Gate Bridge connects San Francisco with the Marin
County.
• Logical Level.
• The level at which the knowledge is encoded into
sentences.
• Example: Links(GoldenGateBridge, SanFrancisco,
MarinCounty).
• Implementation Level.
• The physical representation of the sentences in the
logical level.
• Example: ‘(links goldengatebridge sanfrancisco
marincounty)
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
The Wumpus World environment
• The Wumpus computer game
• The agent explores a cave consisting of rooms connected by
passageways.
• Lurking somewhere in the cave is the Wumpus, a beast that
eats any agent that enters its room.
• Some rooms contain bottomless pits that trap any agent that
wanders into the room.
• Occasionally, there is a heap of gold in a room.
• The goal is to collect the gold and exit the world without
being eaten
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
A typical Wumpus world
• The agent always
starts in the field
[1,1].
• The task of the
agent is to find the
gold, return to the
field [1,1] and
climb out of the
cave.
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Agent in a Wumpus world: Percepts
• The agent perceives
• a stench in the square containing the wumpus and in the
adjacent squares (not diagonally)
• a breeze in the squares adjacent to a pit
• a glitter in the square where the gold is
• a bump, if it walks into a wall
• a woeful scream everywhere in the cave, if the wumpus is
killed
• The percepts are given as a five-symbol list. If there is a
stench and a breeze, but no glitter, no bump, and no scream,
the percept is
[Stench, Breeze, None, None, None]
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Wumpus world actions
• go forward
• turn right 90 degrees
• turn left 90 degrees
• grab: Pick up an object that is in the same square as
the agent
• shoot: Fire an arrow in a straight line in the direction
the agent is facing. The arrow continues until it either
hits and kills the wumpus or hits the outer wall. The
agent has only one arrow, so only the first Shoot action
has any effect
• climb is used to leave the cave. This action is only
effective in the start square
• die: This action automatically and irretrievably
happens if the agent enters a square with a pit or a live
wumpus
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Wumpus goal
The agent’s goal is to find the gold and bring it
back to the start square as quickly as possible,
without getting killed
• 1000 points reward for climbing out of the
cave with the gold
• 1 point deducted for every action taken
• 10000 points penalty for getting killed
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
The Wumpus agent’s first step
¬W
¬W
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Later
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Let’s Play!
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Specifying the environment
Like the vacuum world, the Wumpus world is a grid of squares
surrounded by walls, where each square can contain agents and
objects. The agent always starts in the lower left corner, a square that
we will label [1, 1]. The agent’s task is to find the gold, return to [1,
1], and climb out of the cave.
To specify the agent’s task, we specify its performance, environment,
actions, sensors [PEAS]. In the Wumpus world, these are as follows:
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Specifying the environment
Performance measure:
• 1,000 for picking up the gold.
• 1000 for falling into a pit or being eaten by Wumpus.
• One for each action taken.
• 10 for using up the arrow.
Environment:
• A 4 × 4 grid of rooms.
• The agent always starts in the square labeled [1, 1], facing to the
right.
• The locations of the gold and Wumpus are chosen randomly, with a
uniform distribution, from the squares other than the start square.
• Each square other than the start can be a pit, with probability 0.2.
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Specifying the environment
Actuators:
• The agent can move forward.
• Turn left by 90°.
• The agent dies a miserable death if it enters a square containing a
pit or a live Wumpus (it is safe, albeit smelly, to enter a square with
a dead Wumpus). Moving forward has no effect if there is a wall in
front of the agent.
• The action grab can be used to pick up an object that is in the same
square as the agent.
• The action shoot can be used to fire an arrow in straight line in the
direction the agent is facing. The arrow continues until it either hits
(and hence kills) the Wumpus or hits a wall. The agent only has
one arrow, so only first shoot action has any effect.
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Specifying the environment
Sensors:
• The agent has five sensors, each of which gives a single bit of
information.
• In the square containing the Wumpus and in the directly (not
diagonally) adjacent squares, the agent will perceive a stench.
• In the squares directly adjacent to pit, the agent will perceive a
breeze.
• In the square where the gold is, the agent will perceive a glitter.
• When an agent walks into a wall, it will perceive a bump.
• When the Wumpus is killed, it emits a woeful scream that can be
perceived anywhere in the cave.
• The percepts will be given to the agent in the form of list of five
symbols; for example, if there is a stench and a breeze, but no
glitter, bump, or scream, the agent will receive the percept
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Specifying the environment
The following are the properties of task environment:
• Partially observable
• Deterministic
• Sequential (need to remember state)
• Static
• Discrete
• Single agent (Wumpus is not treated as separate agent)
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Representation
• AI agents deal with knowledge (data)
• Facts (believe & observe knowledge)
• Procedures (how to knowledge)
• Meaning (relate & define knowledge)
• Right representation is crucial
• Early realisation in AI
• Wrong choice can lead to project failure
• Active research area
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Choosing a Representation
• For certain problem solving techniques
• ‘Best’ representation already known
• Often a requirement of the technique
• Or a requirement of the programming language (e.g. Prolog)
• Examples
• First order theorem proving… first order logic
• Inductive logic programming… logic programs
• Neural networks learning… neural networks
• Some general representation schemes
• Suitable for many different (and new) AI applications
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Some General Representations
1. Logical Representations
2. Production Rules
3. Semantic Networks
• Conceptual graphs, frames
4. Description Logics (see textbook)
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
What is a Logic?
• A language with concrete rules
• No ambiguity in representation (may be other errors!)
• Allows unambiguous communication and processing
• Very unlike natural languages e.g. English
• Many ways to translate between languages
• A statement can be represented in different logics
• And perhaps differently in same logic
• Expressiveness of a logic
• How much can we say in this language?
• Not to be confused with logical reasoning
• Logics are languages, reasoning is a process (may use logic)
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Syntax and Semantics
• Syntax
• Rules for constructing legal sentences in the logic
• Which symbols we can use (English: letters, punctuation)
• How we are allowed to combine symbols
• Semantics
• How we interpret (read) sentences in the logic
• Assigns a meaning to each sentence
• Example: “All lecturers are seven foot tall”
• A valid sentence (syntax)
• And we can understand the meaning (semantics)
• This sentence happens to be false (there is a counterexample)
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Propositional Logic
• Syntax
• Propositions, e.g. “it is wet”
• Connectives: and, or, not, implies, iff (equivalent)
• Brackets, T (true) and F (false)
• Semantics (Classical AKA Boolean)
• Define how connectives affect truth
• “P and Q” is true if and only if P is true and Q is true
• Use truth tables to work out the truth of statements
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Predicate Logic
• Propositional logic combines atoms
• An atom contains no propositional connectives
• Have no structure (today_is_wet,
john_likes_apples)
• Predicates allow us to talk about objects
• Properties: is_wet(today)
• Relations: likes(john, apples)
• True or false
• In predicate logic each atom is a predicate
• e.g. first order logic, higher-order logic
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
First Order Logic
• More expressive logic than propositional
• Used in this course (Lecture 6 on representation in FOL)
• Constants are objects: john, apples
• Predicates are properties and relations:
• likes(john, apples)
• Functions transform objects:
• likes(john, fruit_of(apple_tree))
• Variables represent any object: likes(X, apples)
• Quantifiers qualify values of variables
• True for all objects (Universal): X. likes(X, apples)
• Exists at least one object (Existential): X. likes(X, apples)
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Example: FOL Sentence
• “Every rose has a thorn”
• For all X
• if (X is a rose)
• then there exists Y
• (X has Y) and (Y is a thorn)
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Example: FOL Sentence
• “On Mondays and Wednesdays I go to John’s house for dinner”
 Note the change from “and” to “or”
– Translating is problematic
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Higher Order Logic
• More expressive than first order.
• Functions and predicates are also objects
• Described by predicates: binary(addition)
• Transformed by functions: differentiate(square)
• Can quantify over both
• E.g. define red functions as having zero at 17
• Much harder to reason with.
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Beyond True and False
• Multi-valued logics
• More than two truth values
• e.g., true, false & unknown
• Fuzzy logic uses probabilities, truth value in [0,1]
• Modal logics
• Modal operators define mode for propositions
• Epistemic logics (belief)
• e.g. p (necessarily p), p (possibly p), …
• Temporal logics (time)
• e.g. p (always p), p (eventually p), …
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Logic is a Good Representation
• Fairly easy to do the translation when possible
• Branches of mathematics devoted to it
• It enables us to do logical reasoning
• Tools and techniques come for free
• Basis for programming languages
• Prolog uses logic programs (a subset of FOL)
• Prolog based on HOL
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Representation & Logic
• AI wanted “non-logical representations”
• Production rules
• Semantic networks
• Conceptual graphs, frames
• But all can be expressed in first order logic!
• Best of both worlds
• Logical reading ensures representation well-defined
• Representations specialised for applications
• Can make reasoning easier, more intuitive
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
Knowledge representation issue
The issues that arise during victimization of KR techniques are
several. Some of these are explained in the following:
1. Important attributes: There are attributes that are of general
significance. There are two unit attributes, “instance” and “isa”,
that are of general importance. These attributes are important as
they support property inheritance.
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Knowledge representation issue
2. Relationship among attributes:
he relationship between the attributes of associate object, freelance of
specific data they cipher, could hold properties like inverses,
existence in associate “isa” hierarchy, techniques for reasoning
regarding values and single valued attributes.
a) Inverses
b) Existence in an “isa” hierarchy:
c) Techniques for reasoning about values:
d) Single valued attributes:
3. Choosing granularity: High-level facts might not be adequate for
illustration, whereas low-level primitives might need heaps of
storage.
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Knowledge representation issue
4. Set of object: The reason to represent sets of objects is described
as follows. If a property is true for all or most components of a
group, then it is more efficient to associate it once with the set rather
than to associate it with each component of the set. This is done in
different ways: in logical illustration through the utilization of
quantifier, and in hierarchal structure wherever node represents sets,
the inheritance propagates set level assertion down to individual.
5. Finding right structure: we have access to right structure for
describing a specific state of affairs. It needs to choose associated
initial structure so to reduce the selection.
Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari
Road, Daryaganj, New Delhi-110002
8.1 Knowledge-based
agent
8.2 Wumpus world
8.3 Specifying the
environment
8.4 What is knowledge
representation?
8.5 Knowledge
representation issues
Dr. Nilakshi Jain
Email ID :
nilakshijain1986@gmail.com
Thank you

More Related Content

PPTX
Indian Knowledge System and its inroduction
PPTX
Introduction to Quantum Computing Presentation
PPT
reinforcement-learning its based on the slide of university
PPTX
pattern recogintion learning and adaption
PPTX
Lecture 1.pptx
PPT
Chapter 2.ppt
PPT
Chapter 1.ppt
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
Indian Knowledge System and its inroduction
Introduction to Quantum Computing Presentation
reinforcement-learning its based on the slide of university
pattern recogintion learning and adaption
Lecture 1.pptx
Chapter 2.ppt
Chapter 1.ppt
2024 Trend Updates: What Really Works In SEO & Content Marketing

Recently uploaded (20)

PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
advance database management system book.pdf
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
MICROENCAPSULATION_NDDS_BPHARMACY__SEM VII_PCI .pdf
PDF
HVAC Specification 2024 according to central public works department
PDF
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
PPTX
What’s under the hood: Parsing standardized learning content for AI
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PPTX
Module on health assessment of CHN. pptx
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Race Reva University – Shaping Future Leaders in Artificial Intelligence
Cambridge-Practice-Tests-for-IELTS-12.docx
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
advance database management system book.pdf
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Hazard Identification & Risk Assessment .pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Unit 4 Computer Architecture Multicore Processor.pptx
MICROENCAPSULATION_NDDS_BPHARMACY__SEM VII_PCI .pdf
HVAC Specification 2024 according to central public works department
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
What’s under the hood: Parsing standardized learning content for AI
FORM 1 BIOLOGY MIND MAPS and their schemes
Module on health assessment of CHN. pptx
Ad
Ad

Artficial intelligence chapter wise notes for the student of btech computer

  • 2. 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Learning objectives. After this chapter , students will be able to : • Learn and understand the basic concept of knowledge- based agent • Solve and understand the concept of Wumpus world problem Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 3. A knowledge-based agent • A knowledge-based agent includes a knowledge base and an inference system. • A knowledge base is a set of representations of facts of the world. • Each individual representation is called a sentence. • The sentences are expressed in a knowledge representation language. • The agent operates as follows: 1. It TELLs the knowledge base what it perceives. 2. It ASKs the knowledge base what action it should perform. 3. It performs the chosen action. 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 4. Architecture of a knowledge-based agent • Knowledge Level. • The most abstract level: describe agent by saying what it knows. • Example: A taxi agent might know that the Golden Gate Bridge connects San Francisco with the Marin County. • Logical Level. • The level at which the knowledge is encoded into sentences. • Example: Links(GoldenGateBridge, SanFrancisco, MarinCounty). • Implementation Level. • The physical representation of the sentences in the logical level. • Example: ‘(links goldengatebridge sanfrancisco marincounty) 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 5. The Wumpus World environment • The Wumpus computer game • The agent explores a cave consisting of rooms connected by passageways. • Lurking somewhere in the cave is the Wumpus, a beast that eats any agent that enters its room. • Some rooms contain bottomless pits that trap any agent that wanders into the room. • Occasionally, there is a heap of gold in a room. • The goal is to collect the gold and exit the world without being eaten 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 6. A typical Wumpus world • The agent always starts in the field [1,1]. • The task of the agent is to find the gold, return to the field [1,1] and climb out of the cave. 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 7. Agent in a Wumpus world: Percepts • The agent perceives • a stench in the square containing the wumpus and in the adjacent squares (not diagonally) • a breeze in the squares adjacent to a pit • a glitter in the square where the gold is • a bump, if it walks into a wall • a woeful scream everywhere in the cave, if the wumpus is killed • The percepts are given as a five-symbol list. If there is a stench and a breeze, but no glitter, no bump, and no scream, the percept is [Stench, Breeze, None, None, None] 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 8. Wumpus world actions • go forward • turn right 90 degrees • turn left 90 degrees • grab: Pick up an object that is in the same square as the agent • shoot: Fire an arrow in a straight line in the direction the agent is facing. The arrow continues until it either hits and kills the wumpus or hits the outer wall. The agent has only one arrow, so only the first Shoot action has any effect • climb is used to leave the cave. This action is only effective in the start square • die: This action automatically and irretrievably happens if the agent enters a square with a pit or a live wumpus 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 9. Wumpus goal The agent’s goal is to find the gold and bring it back to the start square as quickly as possible, without getting killed • 1000 points reward for climbing out of the cave with the gold • 1 point deducted for every action taken • 10000 points penalty for getting killed 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 10. The Wumpus agent’s first step ¬W ¬W 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 11. Later Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 12. Let’s Play! 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 13. Specifying the environment Like the vacuum world, the Wumpus world is a grid of squares surrounded by walls, where each square can contain agents and objects. The agent always starts in the lower left corner, a square that we will label [1, 1]. The agent’s task is to find the gold, return to [1, 1], and climb out of the cave. To specify the agent’s task, we specify its performance, environment, actions, sensors [PEAS]. In the Wumpus world, these are as follows: Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 14. Specifying the environment Performance measure: • 1,000 for picking up the gold. • 1000 for falling into a pit or being eaten by Wumpus. • One for each action taken. • 10 for using up the arrow. Environment: • A 4 × 4 grid of rooms. • The agent always starts in the square labeled [1, 1], facing to the right. • The locations of the gold and Wumpus are chosen randomly, with a uniform distribution, from the squares other than the start square. • Each square other than the start can be a pit, with probability 0.2. Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 15. Specifying the environment Actuators: • The agent can move forward. • Turn left by 90°. • The agent dies a miserable death if it enters a square containing a pit or a live Wumpus (it is safe, albeit smelly, to enter a square with a dead Wumpus). Moving forward has no effect if there is a wall in front of the agent. • The action grab can be used to pick up an object that is in the same square as the agent. • The action shoot can be used to fire an arrow in straight line in the direction the agent is facing. The arrow continues until it either hits (and hence kills) the Wumpus or hits a wall. The agent only has one arrow, so only first shoot action has any effect. Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 16. Specifying the environment Sensors: • The agent has five sensors, each of which gives a single bit of information. • In the square containing the Wumpus and in the directly (not diagonally) adjacent squares, the agent will perceive a stench. • In the squares directly adjacent to pit, the agent will perceive a breeze. • In the square where the gold is, the agent will perceive a glitter. • When an agent walks into a wall, it will perceive a bump. • When the Wumpus is killed, it emits a woeful scream that can be perceived anywhere in the cave. • The percepts will be given to the agent in the form of list of five symbols; for example, if there is a stench and a breeze, but no glitter, bump, or scream, the agent will receive the percept Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 17. Specifying the environment The following are the properties of task environment: • Partially observable • Deterministic • Sequential (need to remember state) • Static • Discrete • Single agent (Wumpus is not treated as separate agent) Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 18. Representation • AI agents deal with knowledge (data) • Facts (believe & observe knowledge) • Procedures (how to knowledge) • Meaning (relate & define knowledge) • Right representation is crucial • Early realisation in AI • Wrong choice can lead to project failure • Active research area 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 19. Choosing a Representation • For certain problem solving techniques • ‘Best’ representation already known • Often a requirement of the technique • Or a requirement of the programming language (e.g. Prolog) • Examples • First order theorem proving… first order logic • Inductive logic programming… logic programs • Neural networks learning… neural networks • Some general representation schemes • Suitable for many different (and new) AI applications 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 20. Some General Representations 1. Logical Representations 2. Production Rules 3. Semantic Networks • Conceptual graphs, frames 4. Description Logics (see textbook) 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 21. What is a Logic? • A language with concrete rules • No ambiguity in representation (may be other errors!) • Allows unambiguous communication and processing • Very unlike natural languages e.g. English • Many ways to translate between languages • A statement can be represented in different logics • And perhaps differently in same logic • Expressiveness of a logic • How much can we say in this language? • Not to be confused with logical reasoning • Logics are languages, reasoning is a process (may use logic) 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 22. Syntax and Semantics • Syntax • Rules for constructing legal sentences in the logic • Which symbols we can use (English: letters, punctuation) • How we are allowed to combine symbols • Semantics • How we interpret (read) sentences in the logic • Assigns a meaning to each sentence • Example: “All lecturers are seven foot tall” • A valid sentence (syntax) • And we can understand the meaning (semantics) • This sentence happens to be false (there is a counterexample) 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 23. Propositional Logic • Syntax • Propositions, e.g. “it is wet” • Connectives: and, or, not, implies, iff (equivalent) • Brackets, T (true) and F (false) • Semantics (Classical AKA Boolean) • Define how connectives affect truth • “P and Q” is true if and only if P is true and Q is true • Use truth tables to work out the truth of statements 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 24. Predicate Logic • Propositional logic combines atoms • An atom contains no propositional connectives • Have no structure (today_is_wet, john_likes_apples) • Predicates allow us to talk about objects • Properties: is_wet(today) • Relations: likes(john, apples) • True or false • In predicate logic each atom is a predicate • e.g. first order logic, higher-order logic 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 25. First Order Logic • More expressive logic than propositional • Used in this course (Lecture 6 on representation in FOL) • Constants are objects: john, apples • Predicates are properties and relations: • likes(john, apples) • Functions transform objects: • likes(john, fruit_of(apple_tree)) • Variables represent any object: likes(X, apples) • Quantifiers qualify values of variables • True for all objects (Universal): X. likes(X, apples) • Exists at least one object (Existential): X. likes(X, apples) 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 26. Example: FOL Sentence • “Every rose has a thorn” • For all X • if (X is a rose) • then there exists Y • (X has Y) and (Y is a thorn) 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 27. Example: FOL Sentence • “On Mondays and Wednesdays I go to John’s house for dinner”  Note the change from “and” to “or” – Translating is problematic 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 28. Higher Order Logic • More expressive than first order. • Functions and predicates are also objects • Described by predicates: binary(addition) • Transformed by functions: differentiate(square) • Can quantify over both • E.g. define red functions as having zero at 17 • Much harder to reason with. 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 29. Beyond True and False • Multi-valued logics • More than two truth values • e.g., true, false & unknown • Fuzzy logic uses probabilities, truth value in [0,1] • Modal logics • Modal operators define mode for propositions • Epistemic logics (belief) • e.g. p (necessarily p), p (possibly p), … • Temporal logics (time) • e.g. p (always p), p (eventually p), … 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 30. Logic is a Good Representation • Fairly easy to do the translation when possible • Branches of mathematics devoted to it • It enables us to do logical reasoning • Tools and techniques come for free • Basis for programming languages • Prolog uses logic programs (a subset of FOL) • Prolog based on HOL 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 31. Representation & Logic • AI wanted “non-logical representations” • Production rules • Semantic networks • Conceptual graphs, frames • But all can be expressed in first order logic! • Best of both worlds • Logical reading ensures representation well-defined • Representations specialised for applications • Can make reasoning easier, more intuitive 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002
  • 32. Knowledge representation issue The issues that arise during victimization of KR techniques are several. Some of these are explained in the following: 1. Important attributes: There are attributes that are of general significance. There are two unit attributes, “instance” and “isa”, that are of general importance. These attributes are important as they support property inheritance. Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 33. Knowledge representation issue 2. Relationship among attributes: he relationship between the attributes of associate object, freelance of specific data they cipher, could hold properties like inverses, existence in associate “isa” hierarchy, techniques for reasoning regarding values and single valued attributes. a) Inverses b) Existence in an “isa” hierarchy: c) Techniques for reasoning about values: d) Single valued attributes: 3. Choosing granularity: High-level facts might not be adequate for illustration, whereas low-level primitives might need heaps of storage. Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 34. Knowledge representation issue 4. Set of object: The reason to represent sets of objects is described as follows. If a property is true for all or most components of a group, then it is more efficient to associate it once with the set rather than to associate it with each component of the set. This is done in different ways: in logical illustration through the utilization of quantifier, and in hierarchal structure wherever node represents sets, the inheritance propagates set level assertion down to individual. 5. Finding right structure: we have access to right structure for describing a specific state of affairs. It needs to choose associated initial structure so to reduce the selection. Copyright © 2019 by Wiley India Pvt. Ltd., 4436/7, Ansari Road, Daryaganj, New Delhi-110002 8.1 Knowledge-based agent 8.2 Wumpus world 8.3 Specifying the environment 8.4 What is knowledge representation? 8.5 Knowledge representation issues
  • 35. Dr. Nilakshi Jain Email ID : nilakshijain1986@gmail.com Thank you