SlideShare a Scribd company logo
1 of 71
Unit-III
• In previous chapters
– agents solve problem by searching
– no knowledge (past experience) is used
– Humans solve problem
• by reusing knowledge and
• new facts concluded under reasoning of knowledge
• even under partially observable environment
– Reasoning is very important
• especially in the world where the results of actions are
unknown
• Knowledge is the collection of skills and
/information a person has acquired through
experience.
• Intelligence is the ability to apply knowledge.
• Humans are best at understanding,
reasoning, and interpreting knowledge
• Understanding is a psychological process
related to an abstract or physical object, such
as a person, situation, or message whereby
one is able to use concepts to model that
object.
• Interpretation is the act of explaining,
reframing, or otherwise showing your own
understanding of something.
• A person who translates one language into
another is called an interpreter because they
are explaining what a person is saying to
someone who doesn't understand.
• reasoning involves using specific instances as a
basis for making a valid conclusion.
• In this approach, specific instances 1, 2, and 3
lead to a generalized conclusion about the whole
situation.
• For example: I have a Sony television, a Sony
stereo, a Sony car radio, a Sony video system, and
they all work well.
• It is clear that Sony produces superior electronic
products.
Logical agents
“Humans, it seems, know things; and what they
know helps them do things”
Above sentences make strong claims about how the
intelligence of humans is achieved—not by purely
reflex mechanisms but by processes of reasoning
that operate on internal representations of
knowledge.
• In AI this techniques for intelligence are present
in Knowledge Based Agents..
knowledge-based agents.
• 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 maintaining an internal
state of knowledge, reason over that knowledge,
update their knowledge after observations and
take actions.
• These agents can represent the world with some
formal representation and act intelligently.
• Knowledge-based agents are composed of two
main parts:
– Knowledge-base and
– Inference system.
A knowledge-based agent must able to do the following:
– An agent should be able to represent states ,
actions, etc.
– An agent Should be able to incorporate new
percepts
– An agent can update the internal representation of
the world
– An agent can deduce the internal representation of
the world
– An agent can deduce appropriate actions.
The architecture of 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 (KB):
• Knowledge-base is a central component of a
knowledge-based agent
• It is a collection of sentences
• These sentences are expressed in a language
which is called a knowledge representation
language.
• The Knowledge-base of KBA stores fact about the
world.
Inference system
• Inference means deriving new sentences from old.
• Inference system allows us to add a new sentence to
the knowledge base.
• A sentence is a proposition about the world.
– Example of a proposition: "Grass is green",
and "2 + 5 = 5"
– The first proposition has the truth value of "true" and the
second "false".
• Inference system applies logical rules to the KB to
deduce new information.
Operations Performed by KBA
Following are three operations which are performed by KBA in
order to show the intelligent behavior:
• TELL: This operation tells the knowledge base
what it perceives from the environment.
• ASK: This operation asks the knowledge base
what action it should perform.
• Perform: It executing the selected action.
Following is the structure outline of a generic knowledge-based
agents program:
function KB-AGENT(percept): return action
persistent: KB, a knowledge base
t, a counter, initially 0, indicating time
TELL(KB, MAKE-PERCEPT-SENTENCE(percept, t))
Action = ASK(KB, MAKE-ACTION-QUERY(t))
TELL(KB, MAKE-ACTION-SENTENCE(action, t))
t = t + 1
return action
A generic knowledge-based agent.
Given a percept,
• the agent adds the percept to its knowledge base,
•asks the knowledge base for the best action,
•and tells the knowledge base that it has in fact taken that action
Approaches to designing a knowledge-based agent:
There are mainly two approaches to build a knowledge-based agent:
1. Declarative approach: We can create a knowledge-based agent by
initializing with an empty knowledge base and telling the agent all
the sentences with which we want to start with. This approach is
called Declarative approach.
2. Procedural approach: In the procedural approach, we directly
encode desired behavior as a program code. Which means we just
need to write a program that already encodes the desired behavior
or agent.
However, in the real world, a successful agent can be built by
combining both declarative and procedural approaches,.
What is knowledge representation?
• Humans are best at understanding, reasoning,
and interpreting knowledge.
• Human knows things, which is knowledge and
as per their knowledge they perform various
actions in the real world.
• But how machines do all these things comes
under knowledge representation and
reasoning.
What is knowledge representation?
• Knowledge representation and reasoning (KR, KRR) is the
part of Artificial intelligence which concerned with AI
agents thinking and how thinking contributes to intelligent
behavior of agents.
• It is responsible for representing information about the
real world so that a Agent can understand and, can utilize
this knowledge to solve the complex real world problems
– such as diagnosis a medical condition or
– communicating with humans in natural language.
• It is also a way which describes how we can represent
knowledge in artificial intelligence. Knowledge
representation is not just storing data into some database,
but it also enables an intelligent machine to learn from
that knowledge and experiences so that it can behave
intelligently like a human.
What to Represent:
Following are the kind of knowledge which needs to be
represented in AI systems:
Object: All the facts about objects in our world domain.
E.g., Guitars contains strings, trumpets are brass
instruments.
Events: Events are the actions which occur in our world.
Performance: It describe behavior which involves
knowledge about how to do things.
Facts: Facts are the truths about the real world and what
we represent.
Knowledge-Base: The Knowledgebase is a group of the
Sentences
THE 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
THE WUMPUS WORLD
• The Wumpus world is a cave which has 4/4 rooms connected with
passageways.
• 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.
– A beast is an animal — and usually not a gentle or attractive one. You can also
call a person a beast when they're behaving in a crude, savage, or horrible
way.
• 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.
There are also some components which can help the agent to
navigate the cave.
These components are given as follows:
• The rooms adjacent to the Wumpus room are
smelly, so that it would have some stench.
• The room adjacent to PITs has a breeze, so if the
agent reaches near to PIT, then he will perceive
the breeze.
• There will be glitter in the room if and only if the
room has gold.
• The Wumpus can be killed by the agent if the
agent is facing to it, and Wumpus will emit a
horrible scream which can be heard anywhere in
the cave.
PEAS description of Wumpus world:
To explain the Wumpus world we have given PEAS description as below:
• 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.
• 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.
Actuators:
– Left turn,
– Right turn
– Move forward
– Grab
– Release
– Shoot.
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 a horrible scream which can be
perceived anywhere in the cave.
PEAS description of Wumpus world:
These percepts can be represented as five
element list, in which we will have different
indicators for each sensor.
• Example
– if agent perceives stench, breeze, but no glitter,
no bump, and no scream then it can be
represented as:
[Stench, Breeze, None, None, None].
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:
Now we will explore the Wumpus world and will determine how the agent
will find its goal by applying logical reasoning.
Agent's First step:
• Initially, the agent is in the first room or on the square [1,1], and we
already know that this room is safe for the agent,
– At Room [1,1] agent does not feel any breeze or any Stench which means the adjacent
squares are also OK.
Exploring the Wumpus world:
Agent's second Step:
 Now agent needs to move forward, so it will either move to [1, 2], or [2,1].
 Let's suppose agent moves to the room [2, 1], at this room agent perceives
some breeze which means Pit is around this room.
 The pit can be in [3, 1], or [2,2], so we will add symbol P? to say that, is this Pit
room?
•Now agent will stop and think and will not make
any harmful move. The agent will go back to the
[1, 1] room.
•The room [1,1], and [2,1] are visited by the
agent, so we will use symbol V to represent the
visited squares.
Agent's third step:
• At the third step, now agent will move
to the room [1,2] which is OK.
• In the room [1,2] agent perceives a
stench which means there must be a
Wumpus nearby.
• But Wumpus cannot be in the room
[1,1] as by rules of the game,
and also not in [2,2]
(Agent had not detected any stench
when he was at [2,1]).
• Therefore agent infers that Wumpus is
in the room [1,3], and in current state,
there is no breeze which means in [2,2]
there is no Pit and no Wumpus.
– So it is safe, and we will mark it OK,
– and the agent moves further in
[2,2].
Agent's fourth step:
• At room [2,2], here
no stench and no
breezes present
• so let's suppose
agent decides to
move to [2,3].
• At room [2,3] agent
perceives glitter,
• so it should grab the
gold and climb out
of the cave.
Types of knowledge
Declarative Knowledge: (descriptive knowledge )
– Declarative knowledge is to know about something.
– It includes concepts, facts, and objects.
– expressed in declarative sentences.
Procedural Knowledge (imperative knowledge.)
– knowing how to do something.
– It can be directly applied to any task.
– It includes rules, strategies, procedures, agendas, etc.
– It depends on the task on which it can be applied.
Heuristic knowledge: Heuristic knowledge is rules of thumb based on
previous experiences, awareness of approaches, and which are
good to work but not guaranteed.
Structural knowledge:
– Structural knowledge is basic knowledge to problem-solving.
– It describes relationships between various concepts such as kind of,
part of, and grouping of something.
– It describes the relationship that exists between concepts or objects.
Techniques of knowledge representation
There are mainly four ways of knowledge
representation which are given as follows:
– Logical Representation
– Semantic Network Representation
– Frame Representation
– Production Rules
Logical Representation
• Logical representation is a language with
standard rules which deals with propositions
and has no ambiguity in representation.
• It consists of precisely defined syntax and
semantics which supports the sound
inference.
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.
Semantics:
–Semantics are the rules by which we can
interpret the sentence in the logic.
–Semantic involves assigning a meaning to
each sentence.
Logical representation can be categorized into
mainly two logics:
• Propositional Logics
• Predicate logics
Propositional logic in Artificial intelligence
• Propositional logic (PL) is the simplest form of
logic where all the statements are made by
propositions.
• A proposition is a declarative statement which is
either true or false.
• It is a technique of knowledge representation in
logical and mathematical form.
• Example:
– a) today is wednes day
– b) The Sun rises from West (False proposition)
– c) 3+3= 6(true proposition)
Following are some basic facts about propositional
logic:
– In propositional logic, we use symbolic variables to
represent the logic, and we can use any symbol for a
representing a proposition, such A, B, C, P, Q, R, etc.
– The atomic sentences consist of a single proposition
symbol.
– Complex sentences are constructed from simpler
sentences.
– Propositions can be either true or false, but it cannot
be both.
– Propositional logic consists of an object, relations or
function, and logical connectives.
Syntax of propositional logic:
The syntax of propositional logic defines the
allowable sentences for the knowledge
representation.
There are two types of Propositions:
– Atomic Propositions
– Compound propositions
Atomic Proposition:
• Atomic propositions are the simple propositions.
• It consists of a single proposition symbol.
• These are the sentences which must be either true
or false.
• Examples :
– 2+2 is 4, it is an atomic proposition as it is a true fact.
– "The Sun is cold" is also a proposition as it is a false fact.
Compound proposition:
• Compound propositions are constructed by
combining simpler or atomic propositions,
using parenthesis and logical connectives.
• Examples:
– "It is raining today, and street is wet."
– "Ankit is a doctor, and his clinic is in Mumbai."
Logical Connectives:
• Logical connectives are used to connect two
simpler propositions or representing a sentence
logically.
• We can create compound propositions with the
help of logical connectives.
• There are mainly five connectives, which are
given as follows:
Conjunction :
A sentence which has ∧ connective
– P ∧ Q is called a conjunction.
Example: Rohan is intelligent and hardworking.
Disjunction:
A sentence which has ∨ connective.
– P ∨ Q. is called disjunction.
Example: "Raju is a doctor or surgon",
Negation:
A sentence such as ¬ P is called negation of P.
A literal can be either Positive literal or negative literal.
Implication: A sentence such as P → Q, is called
an implication.
 Implications are also known as if-then rules.
examples: If it is raining, then the street is wet.
Let P= It is raining, and
Q= Street is wet
so it is represented as P → Q
Biconditional
• A sentence such as P⇔ Q is a Biconditional
sentence,
• Ex:- If and only if I am breathing, then I am
alive
P= I am breathing,
Q= I am alive,
it can be represented as P ⇔ Q.
Truth Table:
• In propositional logic, we need to know the
truth values of propositions in all possible
scenarios.
• We can combine all the possible combination
with logical connectives, and the
representation of these combinations in a
tabular format is called Truth table.
OR (∨)
−The OR operation of two propositions A and B (written as A∨B ) is true if at
least any of the propositional variable A or B is true.
The truth table is as follows −
A B A ∨ B
True True True
True False True
False True True
False False False
• AND (∧) − The AND operation of two
propositions A and B (written as A∧B ) is true
if both the propositional variable A and B is
true.
• The truth table is as follows −
A B A ∧ B
True True True
True False False
False True False
False False False
Negation (¬)
− The negation of a proposition A (written as ¬A)
is false when A is true and is true when A is
false.
The truth table is as follows
A ¬ A
True False
False True
if-then (→)
− An implication A→B is the proposition “if A,
then B”.
It is false if A is true and B is false.
The rest cases are true.
• The truth table is as follows −
A B A → B
True True True
True False False
False True True
False False True
A B A ⇔ B
True True True
True False False
False True False
False False True
If and only if (⇔) (reverse of Exclusive OR)
− (A⇔B) is bi-conditional logical connective which is true
when A and B are same, i.e. both are false or both are true.
The truth table is as follows −
Precedence of connectives:
• Just like arithmetic operators, there is a precedence order for
propositional connectors or logical operators.
• This order should be followed while evaluating a propositional
problem.
• Following is the list of the precedence order for operators:
Precedence Operators
First Precedence Parenthesis
Second Precedence Negation
Third Precedence Conjunction(AND)
Fourth Precedence Disjunction(OR)
Fifth Precedence Implication
Six Precedence Biconditional
Logical equivalence:
• Logical equivalence is one of the features of
propositional logic.
• Two propositions are said to be logically
equivalent if and only if the columns in the
truth table are identical to each other.
Standard logical equivalences.
• (p∧ Q) ≡ (Q ∧ P) commutativity of ∧
• (P∨ Q) ≡ (Q ∨ P) commutativity of ∨
• The symbols P, Q, and R stand for arbitrary
sentences of propositional logic.
Standard logical equivalences.
• ((P∧ Q) ∧ R) ≡ (P∧ (Q ∧ R)) associativity of ∧
• ((P∨ Q) ∨ R) ≡ (P∨ (Q ∨ R)) associativity of ∨
• The symbols P, Q, and R stand for arbitrary
sentences of propositional logic.
Standard logical equivalences.
• ¬(¬P) ≡ P double-negation elimination
• (P⇒ Q) ≡ (¬Q ⇒ ¬P) contraposition
• (P⇒ Q) ≡ (¬P∨ Q) implication elimination
• (P⇔ Q) ≡ ((P⇒ Q) ∧ (Q ⇒ P)) biconditional elimination
• The symbols P, Q, and R stand for arbitrary
sentences of propositional logic.
Standard logical equivalences.
• ¬(P∧ Q) ≡ (¬P∨ ¬Q) De Morgan
• ¬(P∨ Q) ≡ (¬P∧ ¬Q) De Morgan
• (P∧ (Q ∨ R)) ≡ ((P∧ Q) ∨ (P∧ R)) distributivity of ∧ over ∨
• (P∨ (Q ∧ R)) ≡ ((P∨ Q) ∧ (P∨ R)) distributivity of ∨ over ∧
The symbols P, Q, and R stand for arbitrary sentences of propositional logic.
Rules of inferences
– To deduce new statements from the statements whose truth
value that we already know, Rules of Inference are used.
Rules of Inference
– Mathematical logic is often used for logical proofs.
– Proofs are valid arguments that determine the truth values of
mathematical statements.
• An argument is a sequence of statements.
• The last statement is the conclusion and all its preceding
statements are called premises (or hypothesis).
• The symbol “∴” is placed before the conclusion.
• A valid argument is one where the conclusion follows from
the truth values of the premises.
• Rules of Inference provide the templates or guidelines for
constructing valid arguments from the statements ( that we
already have.)
Modus Ponens:
• it states that if P and P → Q is true,
• then we can infer that Q will be true.
Example:
• Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be
true.
Proof by Truth table:
Modus Tollens:
• It state that if P→ Q is true and ¬ Q is true,
then ¬ P will also true.
• EX:-
• Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P
• Proof by Truth table:
Addition:
The Addition rule states that
– If P is true, then P∨Q will be true.
Example:
Statement: I have a vanilla ice-cream. ==> P
Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)
Proof by Truth-Table:
Simplification:
• The simplification rule state that
• if P∧ Q is true, then Q or P will also be true.
It can be represented as:
Proof by Truth-Table:
Resolution:
• The Resolution rule state that
• if P∨Q and ¬ P∧R is true, then Q∨R will also be true.
• It can be represented as
Proof by Truth-Table:
proposition variable for Wumpus world:
• Let Pi,j be true if there is a Pit in the room [i, j].
• Let Bi,j be true if agent perceives breeze in [i, j].
• Let Wi,j be true if there is wumpus in the square[i, j].
• Let Si,j be true if agent perceives stench in the square [i, j].
• Let Vi,j be true if that square[i, j] is visited.
• Let Gi,j be true if there is gold (and glitter) in the square [i, j].
• Let OKi,j be true if the room is safe.
Some Propositional Rules for the wumpus world:
(B2,1 AND B4,1 AND B3,2) P3,1
(B2,3 AND B3,2 AND B3,4 AND B4,3) P3,3
(B4,3 AND B3,4) P4,4
1,4 2,4 3,4 4,4
1,3 2,3 3,3 4,3
1,2 2,2 3,2 4,2
2,1 3,1 4,1
Representation of Knowledgebase for Wumpus world:
Following is the Simple KB for wumpus world when an agent
moves from room [1, 1], to room [2,1]:
• Examples for use of inference rules and
equivalences in the wumpus world.
• We can prove that wumpus is in the room (1, 3) using
propositional rules which we have derived for the wumpus
world and using inference rule.
1,4 2,4 3,4 4,4
1,3 2,3 3,3 4,3
1,2 2,2 3,2 4,2
2,1 3,1 4,1
• Apply Modus Ponens with ¬S11 and R1:
•Apply And-Elimination Rule: ¬ W11 ∧ ¬ W12 ∧ ¬ W21
¬ W11, ¬ W12, and ¬W21.
•Apply Modus Ponens to ¬S21, and R2:
•Apply and-elimination rule to ¬ W21 ∧ ¬ W22 ∧¬ W31,
¬ W21 , ¬ W22 and ¬ W31
• Apply Modus Ponens to ¬S1,2, and R4
•Apply Unit resolution on W13 ∨ W12 ∨ W22 ∨W11 and ¬ W11 :
•Apply Unit resolution on W13 ∨ W12 ∨ W22 and ¬ W22 :
• Apply Unit Resolution on W13 ∨ W12 and ¬ W12 :

More Related Content

Similar to Unit-III.pptx

IntelligentAgents.ppt
IntelligentAgents.pptIntelligentAgents.ppt
IntelligentAgents.pptjuwel16
 
08-Knowledge Based Agent.pptx
08-Knowledge Based Agent.pptx08-Knowledge Based Agent.pptx
08-Knowledge Based Agent.pptxMehwish Mehmood
 
Lecture No.1 Introduction to Intelligence.pptx
Lecture No.1 Introduction to Intelligence.pptxLecture No.1 Introduction to Intelligence.pptx
Lecture No.1 Introduction to Intelligence.pptxSyedHaroonShah4
 
Human computer interaction -Input output channel with Scenario
Human computer interaction -Input output channel with ScenarioHuman computer interaction -Input output channel with Scenario
Human computer interaction -Input output channel with ScenarioN.Jagadish Kumar
 
AI ROUGH NOTES.pptx
AI ROUGH NOTES.pptxAI ROUGH NOTES.pptx
AI ROUGH NOTES.pptxnireekshan1
 
Artificial intelligence introduction
Artificial intelligence introductionArtificial intelligence introduction
Artificial intelligence introductionRujalShrestha2
 
Artificail Intelligent lec-1
Artificail Intelligent lec-1Artificail Intelligent lec-1
Artificail Intelligent lec-1tjunicornfx
 
Artificial intelligence introduction
Artificial intelligence introductionArtificial intelligence introduction
Artificial intelligence introductionBHAGYAPRASADBUGGE
 
Sensation and Perception
Sensation and PerceptionSensation and Perception
Sensation and PerceptionMikeRifino
 
KBA, Wumpus world.ppt
KBA, Wumpus world.pptKBA, Wumpus world.ppt
KBA, Wumpus world.pptssuserd24233
 
Artificial Intelligence Introduction
Artificial Intelligence Introduction Artificial Intelligence Introduction
Artificial Intelligence Introduction Kaushlendra Rajput
 

Similar to Unit-III.pptx (20)

Artificial Intelligence - An Introduction
Artificial Intelligence - An IntroductionArtificial Intelligence - An Introduction
Artificial Intelligence - An Introduction
 
IntelligentAgents.ppt
IntelligentAgents.pptIntelligentAgents.ppt
IntelligentAgents.ppt
 
UNIT 2.pdf
UNIT 2.pdfUNIT 2.pdf
UNIT 2.pdf
 
Unit 2 ai
Unit 2 aiUnit 2 ai
Unit 2 ai
 
AI.ppt
AI.pptAI.ppt
AI.ppt
 
08-Knowledge Based Agent.pptx
08-Knowledge Based Agent.pptx08-Knowledge Based Agent.pptx
08-Knowledge Based Agent.pptx
 
Lecture No.1 Introduction to Intelligence.pptx
Lecture No.1 Introduction to Intelligence.pptxLecture No.1 Introduction to Intelligence.pptx
Lecture No.1 Introduction to Intelligence.pptx
 
Human computer interaction -Input output channel with Scenario
Human computer interaction -Input output channel with ScenarioHuman computer interaction -Input output channel with Scenario
Human computer interaction -Input output channel with Scenario
 
Unit 1 AI.pptx
Unit 1 AI.pptxUnit 1 AI.pptx
Unit 1 AI.pptx
 
AI ROUGH NOTES.pptx
AI ROUGH NOTES.pptxAI ROUGH NOTES.pptx
AI ROUGH NOTES.pptx
 
l1.pptx
l1.pptxl1.pptx
l1.pptx
 
l1.pptx
l1.pptxl1.pptx
l1.pptx
 
l1.pptx
l1.pptxl1.pptx
l1.pptx
 
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit 1.ppt
 
Artificial intelligence introduction
Artificial intelligence introductionArtificial intelligence introduction
Artificial intelligence introduction
 
Artificail Intelligent lec-1
Artificail Intelligent lec-1Artificail Intelligent lec-1
Artificail Intelligent lec-1
 
Artificial intelligence introduction
Artificial intelligence introductionArtificial intelligence introduction
Artificial intelligence introduction
 
Sensation and Perception
Sensation and PerceptionSensation and Perception
Sensation and Perception
 
KBA, Wumpus world.ppt
KBA, Wumpus world.pptKBA, Wumpus world.ppt
KBA, Wumpus world.ppt
 
Artificial Intelligence Introduction
Artificial Intelligence Introduction Artificial Intelligence Introduction
Artificial Intelligence Introduction
 

Recently uploaded

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 

Unit-III.pptx

  • 2. • In previous chapters – agents solve problem by searching – no knowledge (past experience) is used – Humans solve problem • by reusing knowledge and • new facts concluded under reasoning of knowledge • even under partially observable environment – Reasoning is very important • especially in the world where the results of actions are unknown
  • 3. • Knowledge is the collection of skills and /information a person has acquired through experience. • Intelligence is the ability to apply knowledge. • Humans are best at understanding, reasoning, and interpreting knowledge
  • 4. • Understanding is a psychological process related to an abstract or physical object, such as a person, situation, or message whereby one is able to use concepts to model that object.
  • 5. • Interpretation is the act of explaining, reframing, or otherwise showing your own understanding of something. • A person who translates one language into another is called an interpreter because they are explaining what a person is saying to someone who doesn't understand.
  • 6. • reasoning involves using specific instances as a basis for making a valid conclusion. • In this approach, specific instances 1, 2, and 3 lead to a generalized conclusion about the whole situation. • For example: I have a Sony television, a Sony stereo, a Sony car radio, a Sony video system, and they all work well. • It is clear that Sony produces superior electronic products.
  • 7. Logical agents “Humans, it seems, know things; and what they know helps them do things” Above sentences make strong claims about how the intelligence of humans is achieved—not by purely reflex mechanisms but by processes of reasoning that operate on internal representations of knowledge. • In AI this techniques for intelligence are present in Knowledge Based Agents..
  • 8. knowledge-based agents. • 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 maintaining an internal state of knowledge, reason over that knowledge, update their knowledge after observations and take actions. • These agents can represent the world with some formal representation and act intelligently.
  • 9. • Knowledge-based agents are composed of two main parts: – Knowledge-base and – Inference system.
  • 10. A knowledge-based agent must able to do the following: – An agent should be able to represent states , actions, etc. – An agent Should be able to incorporate new percepts – An agent can update the internal representation of the world – An agent can deduce the internal representation of the world – An agent can deduce appropriate actions.
  • 11. The architecture of 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.
  • 12. Knowledge base (KB): • Knowledge-base is a central component of a knowledge-based agent • It is a collection of sentences • These sentences are expressed in a language which is called a knowledge representation language. • The Knowledge-base of KBA stores fact about the world.
  • 13. Inference system • Inference means deriving new sentences from old. • Inference system allows us to add a new sentence to the knowledge base. • A sentence is a proposition about the world. – Example of a proposition: "Grass is green", and "2 + 5 = 5" – The first proposition has the truth value of "true" and the second "false". • Inference system applies logical rules to the KB to deduce new information.
  • 14. Operations Performed by KBA Following are three operations which are performed by KBA in order to show the intelligent behavior: • TELL: This operation tells the knowledge base what it perceives from the environment. • ASK: This operation asks the knowledge base what action it should perform. • Perform: It executing the selected action.
  • 15. Following is the structure outline of a generic knowledge-based agents program: function KB-AGENT(percept): return action persistent: KB, a knowledge base t, a counter, initially 0, indicating time TELL(KB, MAKE-PERCEPT-SENTENCE(percept, t)) Action = ASK(KB, MAKE-ACTION-QUERY(t)) TELL(KB, MAKE-ACTION-SENTENCE(action, t)) t = t + 1 return action A generic knowledge-based agent. Given a percept, • the agent adds the percept to its knowledge base, •asks the knowledge base for the best action, •and tells the knowledge base that it has in fact taken that action
  • 16. Approaches to designing a knowledge-based agent: There are mainly two approaches to build a knowledge-based agent: 1. Declarative approach: We can create a knowledge-based agent by initializing with an empty knowledge base and telling the agent all the sentences with which we want to start with. This approach is called Declarative approach. 2. Procedural approach: In the procedural approach, we directly encode desired behavior as a program code. Which means we just need to write a program that already encodes the desired behavior or agent. However, in the real world, a successful agent can be built by combining both declarative and procedural approaches,.
  • 17. What is knowledge representation? • Humans are best at understanding, reasoning, and interpreting knowledge. • Human knows things, which is knowledge and as per their knowledge they perform various actions in the real world. • But how machines do all these things comes under knowledge representation and reasoning.
  • 18. What is knowledge representation? • Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence which concerned with AI agents thinking and how thinking contributes to intelligent behavior of agents. • It is responsible for representing information about the real world so that a Agent can understand and, can utilize this knowledge to solve the complex real world problems – such as diagnosis a medical condition or – communicating with humans in natural language. • It is also a way which describes how we can represent knowledge in artificial intelligence. Knowledge representation is not just storing data into some database, but it also enables an intelligent machine to learn from that knowledge and experiences so that it can behave intelligently like a human.
  • 19. What to Represent: Following are the kind of knowledge which needs to be represented in AI systems: Object: All the facts about objects in our world domain. E.g., Guitars contains strings, trumpets are brass instruments. Events: Events are the actions which occur in our world. Performance: It describe behavior which involves knowledge about how to do things. Facts: Facts are the truths about the real world and what we represent. Knowledge-Base: The Knowledgebase is a group of the Sentences
  • 20. THE 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.
  • 22. THE WUMPUS WORLD • The Wumpus world is a cave which has 4/4 rooms connected with passageways. • 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. – A beast is an animal — and usually not a gentle or attractive one. You can also call a person a beast when they're behaving in a crude, savage, or horrible way. • 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.
  • 23. There are also some components which can help the agent to navigate the cave. These components are given as follows: • The rooms adjacent to the Wumpus room are smelly, so that it would have some stench. • The room adjacent to PITs has a breeze, so if the agent reaches near to PIT, then he will perceive the breeze. • There will be glitter in the room if and only if the room has gold. • The Wumpus can be killed by the agent if the agent is facing to it, and Wumpus will emit a horrible scream which can be heard anywhere in the cave.
  • 24. PEAS description of Wumpus world: To explain the Wumpus world we have given PEAS description as below: • 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. • 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.
  • 25. Actuators: – Left turn, – Right turn – Move forward – Grab – Release – Shoot. 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 a horrible scream which can be perceived anywhere in the cave. PEAS description of Wumpus world:
  • 26. These percepts can be represented as five element list, in which we will have different indicators for each sensor. • Example – if agent perceives stench, breeze, but no glitter, no bump, and no scream then it can be represented as: [Stench, Breeze, None, None, None].
  • 27. 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.
  • 28. Exploring the Wumpus world: Now we will explore the Wumpus world and will determine how the agent will find its goal by applying logical reasoning. Agent's First step: • Initially, the agent is in the first room or on the square [1,1], and we already know that this room is safe for the agent, – At Room [1,1] agent does not feel any breeze or any Stench which means the adjacent squares are also OK.
  • 29. Exploring the Wumpus world: Agent's second Step:  Now agent needs to move forward, so it will either move to [1, 2], or [2,1].  Let's suppose agent moves to the room [2, 1], at this room agent perceives some breeze which means Pit is around this room.  The pit can be in [3, 1], or [2,2], so we will add symbol P? to say that, is this Pit room? •Now agent will stop and think and will not make any harmful move. The agent will go back to the [1, 1] room. •The room [1,1], and [2,1] are visited by the agent, so we will use symbol V to represent the visited squares.
  • 30. Agent's third step: • At the third step, now agent will move to the room [1,2] which is OK. • In the room [1,2] agent perceives a stench which means there must be a Wumpus nearby. • But Wumpus cannot be in the room [1,1] as by rules of the game, and also not in [2,2] (Agent had not detected any stench when he was at [2,1]). • Therefore agent infers that Wumpus is in the room [1,3], and in current state, there is no breeze which means in [2,2] there is no Pit and no Wumpus. – So it is safe, and we will mark it OK, – and the agent moves further in [2,2].
  • 31. Agent's fourth step: • At room [2,2], here no stench and no breezes present • so let's suppose agent decides to move to [2,3]. • At room [2,3] agent perceives glitter, • so it should grab the gold and climb out of the cave.
  • 32. Types of knowledge Declarative Knowledge: (descriptive knowledge ) – Declarative knowledge is to know about something. – It includes concepts, facts, and objects. – expressed in declarative sentences. Procedural Knowledge (imperative knowledge.) – knowing how to do something. – It can be directly applied to any task. – It includes rules, strategies, procedures, agendas, etc. – It depends on the task on which it can be applied. Heuristic knowledge: Heuristic knowledge is rules of thumb based on previous experiences, awareness of approaches, and which are good to work but not guaranteed. Structural knowledge: – Structural knowledge is basic knowledge to problem-solving. – It describes relationships between various concepts such as kind of, part of, and grouping of something. – It describes the relationship that exists between concepts or objects.
  • 33. Techniques of knowledge representation There are mainly four ways of knowledge representation which are given as follows: – Logical Representation – Semantic Network Representation – Frame Representation – Production Rules
  • 34. Logical Representation • Logical representation is a language with standard rules which deals with propositions and has no ambiguity in representation. • It consists of precisely defined syntax and semantics which supports the sound inference.
  • 35. 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. Semantics: –Semantics are the rules by which we can interpret the sentence in the logic. –Semantic involves assigning a meaning to each sentence.
  • 36. Logical representation can be categorized into mainly two logics: • Propositional Logics • Predicate logics
  • 37. Propositional logic in Artificial intelligence • Propositional logic (PL) is the simplest form of logic where all the statements are made by propositions. • A proposition is a declarative statement which is either true or false. • It is a technique of knowledge representation in logical and mathematical form. • Example: – a) today is wednes day – b) The Sun rises from West (False proposition) – c) 3+3= 6(true proposition)
  • 38. Following are some basic facts about propositional logic: – In propositional logic, we use symbolic variables to represent the logic, and we can use any symbol for a representing a proposition, such A, B, C, P, Q, R, etc. – The atomic sentences consist of a single proposition symbol. – Complex sentences are constructed from simpler sentences. – Propositions can be either true or false, but it cannot be both. – Propositional logic consists of an object, relations or function, and logical connectives.
  • 39. Syntax of propositional logic: The syntax of propositional logic defines the allowable sentences for the knowledge representation. There are two types of Propositions: – Atomic Propositions – Compound propositions
  • 40. Atomic Proposition: • Atomic propositions are the simple propositions. • It consists of a single proposition symbol. • These are the sentences which must be either true or false. • Examples : – 2+2 is 4, it is an atomic proposition as it is a true fact. – "The Sun is cold" is also a proposition as it is a false fact.
  • 41. Compound proposition: • Compound propositions are constructed by combining simpler or atomic propositions, using parenthesis and logical connectives. • Examples: – "It is raining today, and street is wet." – "Ankit is a doctor, and his clinic is in Mumbai."
  • 42. Logical Connectives: • Logical connectives are used to connect two simpler propositions or representing a sentence logically. • We can create compound propositions with the help of logical connectives. • There are mainly five connectives, which are given as follows:
  • 43. Conjunction : A sentence which has ∧ connective – P ∧ Q is called a conjunction. Example: Rohan is intelligent and hardworking. Disjunction: A sentence which has ∨ connective. – P ∨ Q. is called disjunction. Example: "Raju is a doctor or surgon", Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or negative literal.
  • 44. Implication: A sentence such as P → Q, is called an implication.  Implications are also known as if-then rules. examples: If it is raining, then the street is wet. Let P= It is raining, and Q= Street is wet so it is represented as P → Q
  • 45. Biconditional • A sentence such as P⇔ Q is a Biconditional sentence, • Ex:- If and only if I am breathing, then I am alive P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
  • 46. Truth Table: • In propositional logic, we need to know the truth values of propositions in all possible scenarios. • We can combine all the possible combination with logical connectives, and the representation of these combinations in a tabular format is called Truth table.
  • 47. OR (∨) −The OR operation of two propositions A and B (written as A∨B ) is true if at least any of the propositional variable A or B is true. The truth table is as follows − A B A ∨ B True True True True False True False True True False False False
  • 48. • AND (∧) − The AND operation of two propositions A and B (written as A∧B ) is true if both the propositional variable A and B is true. • The truth table is as follows − A B A ∧ B True True True True False False False True False False False False
  • 49. Negation (¬) − The negation of a proposition A (written as ¬A) is false when A is true and is true when A is false. The truth table is as follows A ¬ A True False False True
  • 50. if-then (→) − An implication A→B is the proposition “if A, then B”. It is false if A is true and B is false. The rest cases are true. • The truth table is as follows − A B A → B True True True True False False False True True False False True
  • 51. A B A ⇔ B True True True True False False False True False False False True If and only if (⇔) (reverse of Exclusive OR) − (A⇔B) is bi-conditional logical connective which is true when A and B are same, i.e. both are false or both are true. The truth table is as follows −
  • 52. Precedence of connectives: • Just like arithmetic operators, there is a precedence order for propositional connectors or logical operators. • This order should be followed while evaluating a propositional problem. • Following is the list of the precedence order for operators: Precedence Operators First Precedence Parenthesis Second Precedence Negation Third Precedence Conjunction(AND) Fourth Precedence Disjunction(OR) Fifth Precedence Implication Six Precedence Biconditional
  • 53. Logical equivalence: • Logical equivalence is one of the features of propositional logic. • Two propositions are said to be logically equivalent if and only if the columns in the truth table are identical to each other.
  • 54. Standard logical equivalences. • (p∧ Q) ≡ (Q ∧ P) commutativity of ∧ • (P∨ Q) ≡ (Q ∨ P) commutativity of ∨ • The symbols P, Q, and R stand for arbitrary sentences of propositional logic.
  • 55. Standard logical equivalences. • ((P∧ Q) ∧ R) ≡ (P∧ (Q ∧ R)) associativity of ∧ • ((P∨ Q) ∨ R) ≡ (P∨ (Q ∨ R)) associativity of ∨ • The symbols P, Q, and R stand for arbitrary sentences of propositional logic.
  • 56. Standard logical equivalences. • ¬(¬P) ≡ P double-negation elimination • (P⇒ Q) ≡ (¬Q ⇒ ¬P) contraposition • (P⇒ Q) ≡ (¬P∨ Q) implication elimination • (P⇔ Q) ≡ ((P⇒ Q) ∧ (Q ⇒ P)) biconditional elimination • The symbols P, Q, and R stand for arbitrary sentences of propositional logic.
  • 57. Standard logical equivalences. • ¬(P∧ Q) ≡ (¬P∨ ¬Q) De Morgan • ¬(P∨ Q) ≡ (¬P∧ ¬Q) De Morgan • (P∧ (Q ∨ R)) ≡ ((P∧ Q) ∨ (P∧ R)) distributivity of ∧ over ∨ • (P∨ (Q ∧ R)) ≡ ((P∨ Q) ∧ (P∨ R)) distributivity of ∨ over ∧ The symbols P, Q, and R stand for arbitrary sentences of propositional logic.
  • 58. Rules of inferences – To deduce new statements from the statements whose truth value that we already know, Rules of Inference are used. Rules of Inference – Mathematical logic is often used for logical proofs. – Proofs are valid arguments that determine the truth values of mathematical statements. • An argument is a sequence of statements. • The last statement is the conclusion and all its preceding statements are called premises (or hypothesis). • The symbol “∴” is placed before the conclusion. • A valid argument is one where the conclusion follows from the truth values of the premises. • Rules of Inference provide the templates or guidelines for constructing valid arguments from the statements ( that we already have.)
  • 59. Modus Ponens: • it states that if P and P → Q is true, • then we can infer that Q will be true. Example: • Statement-1: "If I am sleepy then I go to bed" ==> P→ Q Statement-2: "I am sleepy" ==> P Conclusion: "I go to bed." ==> Q. Hence, we can say that, if P→ Q is true and P is true then Q will be true. Proof by Truth table:
  • 60. Modus Tollens: • It state that if P→ Q is true and ¬ Q is true, then ¬ P will also true. • EX:- • Statement-1: "If I am sleepy then I go to bed" ==> P→ Q Statement-2: "I do not go to the bed."==> ~Q Statement-3: Which infers that "I am not sleepy" => ~P • Proof by Truth table:
  • 61. Addition: The Addition rule states that – If P is true, then P∨Q will be true. Example: Statement: I have a vanilla ice-cream. ==> P Statement-2: I have Chocolate ice-cream. Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q) Proof by Truth-Table:
  • 62. Simplification: • The simplification rule state that • if P∧ Q is true, then Q or P will also be true. It can be represented as: Proof by Truth-Table:
  • 63. Resolution: • The Resolution rule state that • if P∨Q and ¬ P∧R is true, then Q∨R will also be true. • It can be represented as Proof by Truth-Table:
  • 64.
  • 65. proposition variable for Wumpus world: • Let Pi,j be true if there is a Pit in the room [i, j]. • Let Bi,j be true if agent perceives breeze in [i, j]. • Let Wi,j be true if there is wumpus in the square[i, j]. • Let Si,j be true if agent perceives stench in the square [i, j]. • Let Vi,j be true if that square[i, j] is visited. • Let Gi,j be true if there is gold (and glitter) in the square [i, j]. • Let OKi,j be true if the room is safe.
  • 66. Some Propositional Rules for the wumpus world: (B2,1 AND B4,1 AND B3,2) P3,1 (B2,3 AND B3,2 AND B3,4 AND B4,3) P3,3 (B4,3 AND B3,4) P4,4 1,4 2,4 3,4 4,4 1,3 2,3 3,3 4,3 1,2 2,2 3,2 4,2 2,1 3,1 4,1
  • 67. Representation of Knowledgebase for Wumpus world: Following is the Simple KB for wumpus world when an agent moves from room [1, 1], to room [2,1]:
  • 68. • Examples for use of inference rules and equivalences in the wumpus world. • We can prove that wumpus is in the room (1, 3) using propositional rules which we have derived for the wumpus world and using inference rule. 1,4 2,4 3,4 4,4 1,3 2,3 3,3 4,3 1,2 2,2 3,2 4,2 2,1 3,1 4,1
  • 69. • Apply Modus Ponens with ¬S11 and R1: •Apply And-Elimination Rule: ¬ W11 ∧ ¬ W12 ∧ ¬ W21 ¬ W11, ¬ W12, and ¬W21. •Apply Modus Ponens to ¬S21, and R2: •Apply and-elimination rule to ¬ W21 ∧ ¬ W22 ∧¬ W31, ¬ W21 , ¬ W22 and ¬ W31
  • 70. • Apply Modus Ponens to ¬S1,2, and R4 •Apply Unit resolution on W13 ∨ W12 ∨ W22 ∨W11 and ¬ W11 : •Apply Unit resolution on W13 ∨ W12 ∨ W22 and ¬ W22 :
  • 71. • Apply Unit Resolution on W13 ∨ W12 and ¬ W12 :