Module 4
Knowledge and Reasoning
CSC503.4
Use a natural language description of Statements in logic and apply inference
rules to design knowledge-based agents.
Knowledge
• 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 Procedural knowledge.
• Knowing "that something is true or false".
e.g. "that is the speed limit for a car on a motorway"
is Declarative knowledge.
Issues in Knowledge Representation
• The fundamental goal of knowledge Representation is to facilitate
inference (conclusions) from knowledge.
• The issues that arise while using KR techniques are many. Some of the
issues Are:
• Important Attributed
• Relationship among attributes
• Choosing Granularity
• Set of objects
• Finding Right structure
Knowledge Representation System/Cycle
Knowledge Representation System/Cycle
• Artificial Intelligent Systems usually consist of various components to
display their intelligent behavior. Some of these components include:
• Perception
• Learning
• Knowledge Representation & Reasoning
• Planning
• Execution
Knowledge Representation System/Cycle
• The Perception component retrieves data or information from
the environment. with the help of this component, you can retrieve
data from the environment, find out the source of noises and
check if the AI was damaged by anything. Also, it defines how to
respond when any sense has been detected.
• Then, there is the Learning Component that learns from the
captured data by the perception component. The goal is to build
computers that can be taught instead of programming them.
Learning focuses on the process of self-improvement. In order to
learn new things, the system requires knowledge acquisition,
inference, acquisition of heuristics, faster searches, etc.
Knowledge Representation System/Cycle
• The main component in the cycle is Knowledge Representation and
Reasoning which shows the human-like intelligence in the machines.
Knowledge representation is all about understanding intelligence.
Instead of trying to understand or build brains from the bottom up,
its goal is to understand and build intelligent behavior from the top-
down and focus on what an agent needs to know in order to behave
intelligently. Also, it defines how automated reasoning procedures
can make this knowledge available as needed.
• The Planning and Execution components depend on the analysis of
knowledge representation and reasoning. Here, planning includes
giving an initial state, finding their preconditions and effects, and a
sequence of actions to achieve a state in which a particular goal
holds. Now once the planning is completed, the final stage is the
execution of the entire process.
What is the Relation between Knowledge & Intelligence?
• In the real world, knowledge plays a vital role in intelligence as well as creating
artificial intelligence. It demonstrates the intelligent behavior in AI agents or
systems. It is possible for an agent or system to act accurately on some input
only when it has the knowledge or experience about the input
In this example, there is one decision-
maker whose actions are justified by
sensing the environment and using
knowledge. But, if we remove the
knowledge part here, it will not be able to
display any intelligent behavior.
Different Types of Knowledge
Different Types of Knowledge
• Declarative Knowledge – It includes concepts, facts, and objects
and expressed in a declarative sentence.
• Structural Knowledge – It is a basic problem-solving knowledge
that describes the relationship between concepts and objects.
• Procedural Knowledge – This is responsible for knowing how to
do something and includes rules, strategies, procedures, etc.
• Meta Knowledge – Meta Knowledge defines knowledge about
other types of Knowledge.
• Heuristic Knowledge – This represents some expert knowledge
in the field or subject.
Properties of Knowledge Representation System
▪ 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 existing structure.
▪ Inferential Efficiency: The ability to direct the inferential knowledge
mechanism into the most productive directions by storing
appropriate guides.
▪ Acquisition efficiency: The ability to acquire the new knowledge
easily using automatic methods.
Wumpus world:
• The Wumpus world is a simple world example to illustrate the worth of a
knowledge-based agent and to represent knowledge representation. It was
inspired by a video game Hunt the Wumpus by Gregory Yob in 1973.
• The Wumpus world is a cave which has 4/4 rooms connected with passageways.
So there are total 16 rooms which are connected with each other. We have a
knowledge-based agent who will go forward in this world.
• The cave has a room with a beast which is called Wumpus, who eats anyone who
enters the room. The Wumpus can be shot by the agent, but the agent has a
single arrow.
• In the Wumpus world, there are some Pits rooms which are bottomless, and if
agent falls in Pits, then he will be stuck there forever. The exciting thing with this
cave is that in one room there is a possibility of finding a heap of gold. So the
agent goal is to find the gold and climb out the cave without fallen into Pits or
eaten by Wumpus.
• The agent will get a reward if he comes out with gold, and he will get a penalty if
eaten by Wumpus or falls in the pit.
Sample diagram for representing the Wumpus world:
Note: Here Wumpus is static and cannot move
WUMPUS WORLD PEAS description
Performance measure:
✔ +1000 reward points if the agent comes out of the cave
with the gold.
✔ -1000 points penalty for being eaten by the Wumpus or
falling into the pit.
✔ -1 for each action, and -10 for using an arrow.
✔ The game ends if either agent dies or came out of the cave.
WUMPUS WORLD PEAS description
Environment:
• A 4*4 grid of rooms.
✔ The agent initially in room square [1, 1], facing toward the right.
✔ Location of Wumpus and gold are chosen randomly except the first
square [1,1].
✔ Each square of the cave can be a pit with probability 0.2 except the
first square.
WUMPUS WORLD PEAS description
Actuators:
A. Left turn,
B. Right turn
C. Move forward
D. Grab
E. Release
F. Shoot
WUMPUS WORLD PEAS description
• Sensors:
✓ The agent will perceive the stench if he is in the room adjacent to the Wumpus. (Not
diagonally).
✓ The agent will perceive breeze if he is in the room directly adjacent to the Pit.
✓ The agent will perceive the glitter in the room where the gold is present.
✓ The agent will perceive the bump if he walks into a wall.
✓ When the Wumpus is shot, it emits horrible scream which can be perceived
anywhere in the cave.
✓ These percepts can be represented as five element list, in which we will have
different indicators for each sensor.
The Wumpus world Properties:
• Partially observable: The Wumpus world is partially observable because
the agent can only perceive the close environment such as an adjacent
room.
• Deterministic: It is deterministic, as the result and outcome of the world are
already known.
• Sequential: The order is important, so it is sequential.
• Static: It is static as Wumpus and Pits are not moving.
• Discrete: The environment is discrete.
• One agent: The environment is a single agent as we have one agent only
and Wumpus is not considered as an agent.
Exploring the Wumpus world:
Agent's First step:
Artificial Intelligence
[Link] Korde
Artificial Intelligence
[Link] Korde
Artificial Intelligence
[Link] Korde
Artificial Intelligence
[Link] Korde
Artificial Intelligence
[Link] Korde
Percept Sequence:
• Percept (1,1)=(None, None, None, None, None,)
• Percept (2,1)=(Breeze, None, None, None, None,)
Percept (1,1)=(None, None, None, None, None,)
Percept (1,2)=(None, Stench, None, None, None,)
Percept (2,2)=(None, None, None, None, None,)
Percept (3,2)=(Breeze, None, None, None, None,)
Percept (2,3)=(None, None, Glitter, None, None,)
Artificial Intelligence
[Link] Korde