0% found this document useful (0 votes)
13 views

Chapter 5 Part-I Intro&Wumpus World

Uploaded by

Nandini Ganjewar
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)
13 views

Chapter 5 Part-I Intro&Wumpus World

Uploaded by

Nandini Ganjewar
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/ 58

Chapter 3:

Knowledge & Reasoning :


Logical Agents and First order Logic

Prepared By
Ms Lalita Randive
MIT (E), Aurangabad
A) Logical Agents: Knowledge Based Agents
Issues, Propositional Logic
Introduction: Knowledge
• Knowledge is a general term.

• Knowledge is a progression that starts with data which is of limited


utility.

• By organizing or analyzing the data, we understand what the data


means, and this becomes information.

• The interpretation or evaluation of information yield knowledge

• An understanding of the principles embodied within the knowledge is


wisdom.
• Knowledge Progression
Knowledge Category
• Knowledge is categorized into two major types: Tacit and Explicit.

• term “Tacit” corresponds to "in formal" or "implicit" type of knowledge

• term “Explicit” corresponds to "formal" type of knowledge.


Knowledge Representation

How do we Represent what we know ?

• Knowledge is a general term.

• An answer to the question, "how to represent knowledge", requires an


analysis to distinguish between knowledge “how” and knowledge “that”.

• knowing "how to do something". e.g. "how to drive a car" is a


Procedural knowledge.

• knowing "that something is true or false". e.g. "that is the speed limit for
a car on a motorway" is a Declarative knowledge.
Knowledge Representation

• Knowledge and Representation are two distinct entities. They play central
but distinguishable roles in intelligent system.

• Knowledge is a description of the world. It determines a system’s


competence by what it knows.

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


Knowledge Representation
The knowledge Representation models/mechanisms are often based
on:

• Logic- Propositional and Predicates logic


• Rules- If then
• Semantic Net (Meaning Graph)- e.g. Google Graph
• Frames- slots and fillers (object & Attributes)
• Scripts
Knowledge Representation

A variety of ways of representing knowledge have been exploited in AI


programs.

• There are two different kinds of entities, we are dealing with.

1.Facts: Truth in some relevant world. Things we want to represent.

2.Representation of facts in some chosen formalism. Things we will


actually be able to manipulate.
Knowledge Representation

• These entities are structured at two levels:

1.The knowledge level, at which facts are described.

2.The symbol level, at which representation of objects are defined in


terms of symbols that can be manipulated by programs.
Mapping between Facts and
Representation
• Knowledge is a collection of “facts” from some domain.

• We need a representation of "facts" that can be manipulated by a program.

• Normal English is insufficient, too hard currently for a computer program to


draw inferences in natural languages.

• Thus some symbolic representation is necessary.

• Therefore, we must be able to map "facts to symbols" and "symbols to


facts" using forward and backward representation mapping.
Mapping between Facts and
Representation
Example : Consider an English sentence
Forward and Backward Representations
• The forward and backward representations are elaborated below :

• The doted line on top indicates the abstract reasoning process that a program
is intended to model.

• The solid lines on bottom indicates the concrete reasoning process that the
program performs
Approaches to knowledge Representation

1. Representational adequacy:- the ability to represent all of the kinds of knowledge that are
needed in that domain.

2. Inferential Adequacy: - the ability to manipulate the representation structures in such a way as
to derive new structures corresponding to new knowledge inferred from old

3. Inferential Efficiency: - the ability to incorporate into the knowledge structure additional
information that can be used to focus the attention of the inference mechanism in the most
promising directions.

4. Acquisitional Efficiency: - The ability to acquire new knowledge using automatic methods
wherever possible rather than reliance on human intervention

Note : To date no single system can optimizes all of the above properties.
Types of Knowledge Representation

• There are four types of Knowledge representation :

1. Relational
2. Inheritable
3. Inferential
4. Declarative/Procedural.
1. Relational Knowledge
• 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.

• This knowledge associates elements of one domain with another domain.

−Relational knowledge is made up of objects consisting of attributes and


their corresponding associated values.

−The results of this knowledge type is a mapping of elements among


different domains.
Given the facts it is not possible to answer simple question such as : " Who is the
heaviest player ? ". but if a procedure for finding heaviest player is provided, then these
facts will enable that procedure to compute an answer.

We can ask things like who "bats – left" and "throws – right".
2. Inheritable Knowledge

• Here the knowledge elements inherit attributes from their parents.

• The inheritance is a powerful form of inference, but not adequate.


The basic KR needs to be augmented with inference mechanism

• The KR in hierarchical structure is called “semantic network” or a


collection of “frames” or “slot-and-filler structure".

• The structure shows property inheritance and way for insertion of


additional knowledge.
cont.…

• Viewing a node as a frame

• Example : Baseball-player

isa : Adult-Male

Bats : EQUAL handed

Height : 6.1

Batting-average : 0.252
Algorithm : Property Inheritance
• Retrieve a value V for an attribute A of an instance object O. Steps to follow:

1. Find object O in the knowledge base.

2. If there is a value for the attribute A then report that value.

3. Else, if there is a value for the attribute instance; If not, then fail.

4. Else, move to the node corresponding to that value and look for a value for the
attribute A; If one is found, report it.

5. Else, do until there is no value for the “isa” attribute or until an answer is found :

(a) Get the value of the “isa” attribute and move to that node.

(b) See if there is a value for the attribute A; If yes, report it.
• This can be applied to the example of knowledge base
illustrated, in the previous slide, to derive answers to the
following queries :

−team (Pee-Wee-Reese) = Brooklyn–Dodger −batting

–average(Three-Finger-Brown) = 0.106

−height (Pee-Wee-Reese) = 6.1

−bats (Three Finger Brown) = right


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.

• Given a set of relations and values, one may infer other values or relations.

• A predicate logic (a mathematical deduction) is used to infer from a set of attributes.

• inference through predicate logic uses a set of logical operations to relate individual
data.

• the symbols used for the logic operations are : → " (implication), " ¬ " (not), " V "
(or), " Λ " (and), " ∀ " (for all), " ∃ " (there exists).
Examples of predicate logic statements :

Note :If more information is made available about these objects and their relations,
then more knowledge can be inferred.
4. Declarative/Procedural Knowledge
• Differences between Declarative/Procedural knowledge is not very clear.

Declarative knowledge:

Here, the knowledge is based on declarative facts about axioms and domains.

−axioms are assumed to be true unless a counter example is found to invalidate


them.

−domains represent the physical world and the perceived functionality.

−axiom and domains thus simply exists and serve as declarative statements that
can stand alone.
• Procedural knowledge:

Here, the knowledge is a mapping process between domains that specify “what to do

when” and the representation is of “how to make it” rather than “what it is”.

The procedural knowledge :

−may have inferential efficiency, but no inferential adequacy and acquisitional efficiency.

−are represented as small programs that know how to do specific things, how to

proceed.

Example : A parser in a natural language has the knowledge that a noun phrase may

contain articles, adjectives and nouns. It thus accordingly call routines that know how to

process articles, adjectives and nouns


Issues in Knowledge Representation
• The issues that arise while using KR techniques are many. Some of these are
explained below.

1. Important Attributes : Any attribute of objects so basic that they occur in almost every
problem domain ?

2. Relationship among attributes: Any important relationship that exists among object
attributes ?

3. Choosing Granularity : At what level of detail should the knowledge be represented ?

4. Set of objects : How sets of objects be represented ?

5. Finding Right structure : Given a large amount of knowledge stored, how can
relevant parts be accessed ?
1.Important Attributes
• There are attributes that are of general significance.

• There are two attributes "instance" and "isa", that are of general importance.

These attributes are important because they support property inheritance .


2. Relationship among attributes
1. Inverses- This is about consistency check, while a value is added to one
attribute.

2. Existence in an "isa" hierarchy - This is about generalization-specialization,


like, classes of objects and specialized subsets of those classes. There are
attributes and specialization of attributes.

3. Techniques for reasoning about values - This is about reasoning values of


attributes not given explicitly

4. Single valued attributes - This is about a specific attribute that is guaranteed to


take a unique value.
3. Choosing Granularity
• 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.
Example of Granularity : −
• Suppose we are interested in following facts
• John spotted Merry.
−This could be represented as Spotted (agent(John), object (Merry))
−Such a representation would make it easy to answer questions such are
Who spotted Merry ?
• Suppose we want to know
• Did John see Merry ?
−Given only one fact, we cannot discover that answer.
−We can add other facts,
such as Spotted (x , y) → saw (x , y)

−We can now infer the answer to the question


4. Set of Objects
• Certain properties of objects that are true as member of a set but not as
individual;

• Example : Consider the assertion made in the sentences

"there are more sheep than people in Australia",

and

"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.
4. Set of objects
• The reason to represent sets of objects 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);


the set of elephants is large or any thing that is an elephant is large.
5. Finding Right structure
• Access to right structure for describing a particular situation. It requires, selecting an initial
structure and then revising the choice.

• While doing so, it is necessary to solve following problems :

−how to perform an initial selection of the most appropriate structure.

−how to fill in appropriate details from the current situations.

−how to find a better structure if the one chosen initially turns out not to be appropriate.

−what to do if none of the available structures is appropriate.

−when to create and remember a new structure.

• There is no good, general purpose method for solving all these problems. Some knowledge
representation techniques solve some of them
The Wumpus World Problem
• The Wumpus World’s agent is an example of a knowledge-based agent that represents
Knowledge representation, reasoning and planning.

• Knowledge-Based agent links general knowledge with current percepts to infer hidden
characters of current state before selecting actions.

• Its necessity is vital in partially observable environments.


Problem Statement:
Some elements support the agent to
explore the cave
1. The wumpus’s adjacent rooms are stenchy

2. The agent is given one arrow which it can use to kill the wumpus when facing it
(Wumpus screams when it is killed)

3. The adjacent rooms of the room with pits are filled with breeze

4. The treasure room is always glittery


PEAS Description for the Wumpus World
problem:

1. Performance measures:
•Agent gets the gold and return back safe = +1000 points
•Agent dies = -1000 points
•Each move of the agent = -1 point
•Agent uses the arrow = -10 points
2. Environment: A cave with 16(4×4) rooms
•Rooms adjacent (not diagonally) to the Wumpus are smelly
•Rooms adjacent (not diagonally) to the pit are breezy
•The room with the gold glitters
•Agent’s initial position – Room[1, 1] and facing right side
3. Actuators:
Devices that allow the agent to perform the following actions in the environment.
•Move forward
•Turn right
•Turn left
•Shoot
•Grab
•Release

4. Sensors:
Devices which helps the agent in sensing the following from the environment
• Breeze
• Stench
• Glitter
• Shout (When the Wumpus is killed)
• Crash (when the agent hits a wall)
Wumpus world
characterization
• Fully Observable

• Deterministic

• Episodic

• Static

• Discrete

• Single-agent?
Wumpus world
characterization
• Fully Observable No – only local perception

• Deterministic

• Episodic

• Static

• Discrete

• Single-agent?
Wumpus world
characterization
• Fully Observable No – only local perception

• Deterministic Yes – outcomes exactly specified

• Episodic

• Static

• Discrete

• Single-agent?
Wumpus world
characterization
• Fully Observable No – only local perception

• Deterministic Yes – outcomes exactly specified

• Episodic No – sequential at the level of actions

• Static

• Discrete

• Single-agent?
Wumpus world
characterization
• Fully Observable No – only local perception

• Deterministic Yes – outcomes exactly specified

• Episodic No – sequential at the level of actions

• Static Yes – Wumpus and Pits do not move

• Discrete

• Single-agent?
Wumpus world
characterization
• Fully Observable No – only local perception

• Deterministic Yes – outcomes exactly specified

• Episodic No – sequential at the level of actions

• Static Yes – Wumpus and Pits do not move

• Discrete Yes

• Single-agent?
Wumpus world
characterization
• Fully Observable No – only local perception

• Deterministic Yes – outcomes exactly specified

• Episodic No – sequential at the level of actions

• Static Yes – Wumpus and Pits do not move

• Discrete Yes

• Single-agent? Yes – Wumpus is essentially a natural


feature
Wumpus World
• Percepts given to the agent
1. Stench
2. Breeze
3. Glitter
4. Bumb (ran into a wall)
5. Scream (wumpus has been hit by arrow)

• Principle Difficulty: agent is initially ignorant of the configuration of the environment

– going to have to reason to figure out where the gold is without getting killed!
Exploring the Wumpus World

Initial situation:

Agent in 1,1 and percept is


[None, None, None, None,
None]

From this the agent can infer the


neighboring squares are safe
(otherwise there would be a
breeze or a stench)
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world

In each case where the agent draws a conclusion from the available Information, that
conclusion is guaranteed to be correct if the available Information is correct…

This is a fundamental property of logical reasoning

You might also like