SlideShare a Scribd company logo
UNIT III-REASON AND
PLANNING
K.K.Archana,AP/CSE
Intelligent Agent
• 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.
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.
Architecture Knowlegde based agent
• knowledge base: Knowledge-base is a central component of a
knowledge-based agent, it is also known as KB. It is a collection
of sentences (here 'sentence' is a technical term and it is not
identical to sentence in English).
• 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. Inference
system applies logical rules to the KB to deduce new
information.
• Inference system generates new facts so that an agent can
update the KB. An inference system works mainly in two rules
which are given as:
• Forward chaining
• Backward chaining
• Operations Performed by KBA
• Following are three operations which are performed by
KBA in order to show the intelligent behavior:
1.TELL: This operation tells the knowledge base what it
perceives from the environment.
2.ASK: This operation asks the knowledge base what action it
should perform.
3.Perform: It performs the selected action.
A generic knowledge-based agent:
1.function KB-AGENT(percept):
2.persistent: KB, a knowledge base
3. t, a counter, initially 0, indicating time
4.TELL(KB, MAKE-PERCEPT-SENTENCE(percept, t))
5.Action = ASK(KB, MAKE-ACTION-QUERY(t))
6.TELL(KB, MAKE-ACTION-SENTENCE(action, t))
7. t = t + 1
8. return action
• Firstly it TELLs the KB what it perceives.
• Secondly, it asks KB what action it should take
• Third agent program TELLS the KB that which action was
chosen.
• The MAKE-PERCEPT-SENTENCE generates a sentence as
setting that the agent perceived the given percept at the given
time.
• The MAKE-ACTION-QUERY generates a sentence to ask
which action should be done at the current time.
• MAKE-ACTION-SENTENCE generates a sentence which
asserts that the chosen action was executed.
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.
• 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 computer 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.
• 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.
• Meta-knowledge: It is knowledge about what we know.
• Facts: Facts are the truths about the real world and what we
represent.
• Knowledge-Base: The central component of the knowledge-based
agents is the knowledge base. It is represented as KB. The
Knowledgebase is a group of the Sentences (Here, sentences are
used as a technical term and not identical with the English
language).
Types of Knowledge
1. Declarative Knowledge:
• Declarative knowledge is to know about something.
• It includes concepts, facts, and objects.
• It is also called descriptive knowledge and expressed in
declarativesentences.
• It is simpler than procedural language.
2. Procedural Knowledge
• It is also known as imperative knowledge.
• Procedural knowledge is a type of knowledge which is
responsible for knowing how to do something.
• It can be directly applied to any task.
• It includes rules, strategies, procedures, agendas, etc.
• Procedural knowledge depends on the task on which it can be
applied.
3. Meta-knowledge:
• Knowledge about the other types of knowledge is called Meta-
knowledge.
4. Heuristic knowledge:
• Heuristic knowledge is representing knowledge of some experts
in a filed or subject.
• Heuristic knowledge is rules of thumb based on previous
experiences, awareness of approaches, and which are good to
work but not guaranteed.
5. 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.
AI knowledge cycle:
An Artificial intelligence system has the following components for
displaying intelligent behavior:
• Perception
• Learning
• Knowledge Representation and Reasoning
• Planning
• Execution
Knowledge cycle
Approaches to knowledge representation:
1. Simple relational knowledge:
• It is the simplest way of storing facts which uses the relational
method, and each fact about a set of the object is set out
systematically in columns.
• This approach of knowledge representation is famous in
database systems where the relationship between different
entities is represented.
• This approach has little opportunity for inference.
Player Weight Age
Player1 65 23
Player2 58 18
Player3 75 24
• 2. Inheritable knowledge:
• In the inheritable knowledge approach, all data must be stored
into a hierarchy of classes.
• All classes should be arranged in a generalized form or a
hierarchal manner.
• In this approach, we apply inheritance property.
• Elements inherit values from other members of a class.
• This approach contains inheritable knowledge which shows a
relation between instance and class, and it is called instance
relation.
• Every individual frame can represent the collection of attributes
and its value.
• In this approach, objects and values are represented in Boxed
nodes.
• We use Arrows which point from objects to their values.
Artificial Intelligence - Reason and Planning
• 3. Inferential knowledge:
• Inferential knowledge approach represents knowledge in the form of
formal logics.
• This approach can be used to derive more facts.
• It guaranteed correctness.
• Example: Let's suppose there are two statements:
• Marcus is a man
• All men are mortal
Then it can represent as;
man(Marcus)
∀x = man (x) ----------> mortal (x)s
4. Procedural knowledge:
• Procedural knowledge approach uses small programs and
codes which describes how to do specific things, and how to
proceed.
• In this approach, one important rule is used which is If-Then
rule.
• In this knowledge, we can use various coding languages such
as LISP language and Prolog language.
• We can easily represent heuristic or domain-specific knowledge
using this approach.
• But it is not necessary that we can represent all cases in this
approach.
Requirement for knowledge Representation
system
1. Representational Accuracy:
KR system should have the ability to represent all kind of required
knowledge.
2. Inferential Adequacy:
KR system should have ability to manipulate the representational
structures to produce new knowledge corresponding to existing
structure.
3. Inferential Efficiency:
The ability to direct the inferential knowledge mechanism into the most
productive directions by storing appropriate guides.
4. Acquisitional efficiency- The ability to acquire the new knowledge
easily using automatic methods.
Propositional Logic
• 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.
• Propositional logic is also called Boolean logic as it works on 0
and 1.
• 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.
• Propositions can be either true or false, but it cannot be both.
• Propositional logic consists of an object, relations or function,
and logical connectives.
• These connectives are also called logical operators.
• A proposition formula which is always true is called tautology,
and it is also called a valid sentence.
• A proposition formula which is always false is
called Contradiction.
Types of Proposition
1.Atomic Propositions
2.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.
• Compound proposition: Compound propositions are
constructed by combining simpler or atomic propositions, using
parenthesis and logical connectives.
Logical Connectives:
Logical connectives are used to connect two simpler propositions
1.Negation: A sentence such as ¬ P is called negation of P. A literal
can be either Positive literal or negative literal.
2.Conjunction: A sentence which has ∧ connective such as, P ∧ Q is
called a conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P= Rohan is intelligent,
Q= Rohan is hardworking. → P∧ Q.
3.Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is
called disjunction, where P and Q are the propositions.
Example: "Ritika is a doctor or Engineer",
Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P
∨ Q.
4.Implication: A sentence such as P → Q, is called an
implication. Implications are also known as if-then rules. It can be
represented as
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
5.Biconditional: A sentence such as P⇔ Q is a Biconditional
sentence, example If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔
Q.
Propositional logical connectives
Truth Table
• We can combine all the possible combination with logical
connectives, and the representation of these combinations in a
tabular format is called Truth table.
• Negation
Artificial Intelligence - Reason and Planning
Artificial Intelligence - Reason and Planning
• Limitations of Propositional logic:
• We cannot represent relations like ALL, some, or none with
propositional logic. Example:
• All the girls are intelligent.
• Some apples are sweet.
• Propositional logic has limited expressive power.
• In propositional logic, we cannot describe statements in terms
of their properties or logical relationships.
First-Order Logic in Artificial intelligence
• First-order logic is another way of knowledge representation in
artificial intelligence. It is an extension to propositional logic.
• FOL is sufficiently expressive to represent the natural language
statements in a concise way.
• First-order logic is also known as Predicate logic or First-
order predicate logic. First-order logic is a powerful language
that develops information about the objects in a more easy way
and can also express the relationship between those objects.
• First-order logic (like natural language) does not only assume
that the world contains facts like propositional logic but also
assumes the following things in the world:
• Objects: A, B, people, numbers, colors, wars, theories, squares, pits,
wumpus, ......
• Relations: It can be unary relation such as: red, round, is
adjacent, or n-any relation such as: the sister of, brother of, has
color, comes between
• Function: Father of, best friend, third inning of, end of, ......
• As a natural language, first-order logic also has two main parts:
• Syntax
• Semantics
Elements of First order logic
Constant 1, 2, A, John, Mumbai, cat,....
Variables x, y, z, a, b,....
Predicates Brother, Father, >,....
Function sqrt, LeftLegOf, ....
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃
Atomic sentences:
• Atomic sentences are the most basic sentences of first-order
logic. These sentences are formed from a predicate symbol
followed by a parenthesis with a sequence of terms.
• We can represent atomic sentences as Predicate (term1,
term2, ......, term n).
Example: Ravi and Ajay are brothers: => Brothers(Ravi,
Ajay).
Chinky is a cat: => cat (Chinky).
Complex Sentences:
• Complex sentences are made by combining atomic sentences
using connectives.
• First-order logic statements can be divided into two parts:
• Subject: Subject is the main part of the statement.
• Predicate: A predicate can be defined as a relation, which
binds two atoms together in a statement.
Quantifiers in First-order logic:
• A quantifier is a language element which generates
quantification, and quantification specifies the quantity of
specimen in the universe of discourse.
• These are the symbols that permit to determine or identify the
range and scope of the variable in the logical expression. There
are two types of quantifier:
• Universal Quantifier, (for all, everyone, everything)
• Existential quantifier, (for some, at least one).
All men drinks coffee
∀x man(x) → drink (x, coffee).
Some boys are intelligent
∃x: boys(x) ∧ intelligent(x)
Some Examples of FOL using quantifier:
• 1. All birds fly.
In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as
follows.
∀x bird(x) →fly(x).
• 2. Every man respects his parent.
In this question, the predicate is "respect(x, y)," where x=man,
and y= parent.
Since there is every man so will use ∀, and it will be
represented as follows:
∀x man(x) → respects (x, parent).
• 3. Some boys play cricket.
In this question, the predicate is "play(x, y)," where x= boys,
and y= game. Since there are some boys so we will use ∃, and
it will be represented as:
∃x boys(x) → play(x, cricket).
• 4. Not all students like both Mathematics and Science.
In this question, the predicate is "like(x, y)," where x= student,
and y= subject.
Since there are not all students, so we will use ∀ with
negation, so following representation for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x,
Science)].
Inference in First-Order Logic
• Inference in First-Order Logic is used to deduce new facts or
sentences from existing sentences.
• Substitution:
• Substitution is a fundamental operation performed on terms and
formulas. It occurs in all inference systems in first-order logic.
The substitution is complex in the presence of quantifiers in
FOL. If we write F[a/x], so it refers to substitute a constant "a" in
place of variable "x".
Equality symbol
• Example: Brother (John) = Smith.
• As in the above example, the object referred by the Brother
(John) is similar to the object referred by Smith. The equality
symbol can also be used with negation to represent that two
terms are not the same objects.
• Example: ¬(x=y) which is equivalent to x ≠y.
FOL inference rules for quantifier:
• Universal Generalization
• Universal Instantiation
• Existential Instantiation
• Existential introduction
Universal generalization
• Universal generalization is a valid inference rule which states
that if premise P(c) is true for any arbitrary element c in the
universe of discourse, then we can have a conclusion as ∀ x
P(x).
• It can be represented as:
• This rule can be used if we want to show that every element
has a similar property.
• In this rule, x must not appear as a free variable.
• Example: Let's represent, P(c): "A byte contains 8 bits", so
for ∀ x P(x) "All bytes contain 8 bits.", it will also be true.
Universal instantiation
• Universal Instantiation:
• Universal instantiation is also called as universal elimination or
UI is a valid inference rule. It can be applied multiple times to
add new sentences.
• The new KB is logically equivalent to the previous KB.
• As per UI, we can infer any sentence obtained by
substituting a ground term for the variable.
• The UI rule state that we can infer any sentence P(c) by
substituting a ground term c (a constant within domain x) from ∀
x P(x) for any object in the universe of discourse.
• Example:1.
• IF "Every person like ice-cream"=> ∀x P(x) so we can infer that
"John likes ice-cream" => P(c)
• Example: 2.
• Let's take a famous example,
• "All kings who are greedy are Evil." So let our knowledge base contains this detail
as in the form of FOL:
• ∀x king(x) ∧ greedy (x) → Evil (x),
• So from this information, we can infer any of the following statements using
Universal Instantiation:
• King(John) ∧ Greedy (John) → Evil (John),
• King(Richard) ∧ Greedy (Richard) → Evil (Richard),
• King(Father(John)) ∧ Greedy (Father(John)) → Evil (Father(John)),
Existential Instantiation:
• Existential instantiation is also called as Existential Elimination,
which is a valid inference rule in first-order logic.
• It can be applied only once to replace the existential sentence.
• The new KB is not logically equivalent to old KB, but it will be
satisfiable if old KB was satisfiable.
• This rule states that one can infer P(c) from the formula given in
the form of ∃x P(x) for a new constant symbol c.
• The restriction with this rule is that c used in the rule must be a
new term for which P(c ) is true.
• Example:
• From the given sentence: ∃x Crown(x) ∧ OnHead(x, John),
• So we can infer: Crown(K) ∧ OnHead( K, John), as long as K
does not appear in the knowledge base.
• The above used K is a constant symbol, which is called Skolem
constant.
• The Existential instantiation is a special case of Skolemization
process.
Existential introduction
• An existential introduction is also known as an existential
generalization, which is a valid inference rule in first-order logic.
• This rule states that if there is some element c in the universe of
discourse which has a property P, then we can infer that there
exists something in the universe which has the property P.
• Example: Let's say that,
"Priyanka got good marks in English."
"Therefore, someone got good marks in English."
Forward Chaining
• Forward chaining is also known as a forward deduction or
forward reasoning method when using an inference engine.
Forward chaining is a form of reasoning which start with atomic
sentences in the knowledge base and applies inference rules
(Modus Ponens) in the forward direction to extract more data
until a goal is reached.
• The Forward-chaining algorithm starts from known facts,
triggers all rules whose premises are satisfied, and add their
conclusion to the known facts. This process repeats until the
problem is solved.
Properties of Forward-Chaining:
• It is a down-up approach, as it moves from bottom to top.
• It is a process of making a conclusion based on known facts or
data, by starting from the initial state and reaches the goal
state.
• Forward-chaining approach is also called as data-driven as we
reach to the goal using available data.
• Forward -chaining approach is commonly used in the expert
system, such as CLIPS, business, and production rule systems.
example
• As per the law, it is a crime for an American to sell weapons to
hostile nations. Country A, an enemy of America, has some
missiles, and all the missiles were sold to it by Robert, who is
an American citizen.“
• Facts Conversion into FOL:
• Selling weapons to unfriendly or hostile countries is illegal in the
United States. (Let's say p, q, and r are variables)
American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) →
Criminal(p) ...(1)
• It is a method of arriving at a conclusion based on known facts or
data by starting at the beginning and working one's way to the end.
Applications
• Expert systems, such as CLIPS, business, and production rule
systems, frequently employ the forward-chaining approach.
Forward chaining Backward chaining
1. Forward chaining begins with known facts and uses
inference rules to extract more data units until it gets the
desired outcome.
Backward chaining starts with the objective and works
backwards using inference rules to locate the necessary
facts to support it.
2. It is a bottom-up approach. It is a top-down approach.
3. Forward chaining is also regarded as a data-
driven inference strategy because it allows us to attain our
goal using the data we already have.
Backward chaining is a goal-driven strategy since it begins
with the objective and divides it into sub-goals in order to
extract the facts.
4. Forward chaining is also regarded as a data-driven
inference strategy because it allows us to attain our goal
using the data we already have.
Backward chaining is a goal-driven strategy since it begins
with the objective and divides it into sub-goals in order to
extract the facts.
5. All of the available rules are subjected to
forward chaining testing.
Only a few required rules are tested via
backward chaining.
6. Forward chaining is appropriate for
applications such as planning, monitoring,
control, and interpretation.
Backward chaining is a useful technique for
diagnosing, prescribing, and debugging.
7. Forward chaining can lead to an unlimited
number of different outcomes.
The number of possible conclusions
generated by backward chaining is finite.
8. It works in the forward direction. It works in the backward direction.
9. The goal of forward chaining is to reach any
conclusion.
Backward chaining is only for the data that
is required.
Backward chaining
• Backward-chaining is also known as a backward deduction or backward
reasoning method when using an inference engine. A backward chaining
algorithm is a form of reasoning, which starts with the goal and works backward,
chaining through rules to find known facts that support the goal.
• Properties of backward chaining:
• It is known as a top-down approach.
• Backward-chaining is based on modus ponens inference rule.
• In backward chaining, the goal is broken into sub-goal or sub-goals to prove the
facts true.
• It is called a goal-driven approach, as a list of goals decides which rules are
selected and used.
• Backward -chaining algorithm is used in game theory, automated theorem
proving tools, inference engines, proof assistants, and various AI applications.
• The backward-chaining method mostly used a depth-first search strategy for
proof.
Forward chaining & Backward chaining
example
• "As per the law, it is a crime for an American to sell
weapons to hostile nations. Country A, an enemy of
America, has some missiles, and all the missiles were sold
to it by Robert, who is an American citizen."
• Prove that "Robert is criminal."
Forward chaining
• It is a crime for an American to sell weapons to hostile nations. (Let's say p, q, and r are
variables)
American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1)
• Country A has some missiles. ?p Owns(A, p) ∧ Missile(p). It can be written in two
definite clauses by using Existential Instantiation, introducing new Constant T1.
Owns(A, T1) ......(2)
Missile(T1) .......(3)
• All of the missiles were sold to country A by Robert.
?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4)
• Missiles are weapons.
Missile(p) → Weapons (p) .......(5)
• Enemy of America is known as hostile.
Enemy(p, America) →Hostile(p) ........(6)
• Country A is an enemy of America.
Enemy (A, America) .........(7)
• Robert is American
American(Robert). .....(8)
Forward chaining proof
• Step-1:American(Robert), Enemy(A, America),
Owns(A, T1), and Missile(T1)
• Step 2
• Step 3
Backward chaining
• American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1)
Owns(A, T1) ........(2)
• Missile(T1)
• ?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4)
• Missile(p) → Weapons (p) .......(5)
• Enemy(p, America) →Hostile(p) ........(6)
• Enemy (A, America) .........(7)
• American(Robert). ..........(8)
• Step-1:
Step 2
• Step 3
Step 4
• Step 5

More Related Content

PPTX
Knowledge-Based agent and representation.pptx
PPTX
Knowledge representation
PPTX
Artificial Intelligence_ Knowledge Representation
PPTX
Ch-I-Moduddddddddddddddddddddddddddddddddddddle-III.pptx
PPTX
Presentation of iot for artificial intelligence specialization
PPTX
Unit 2.pptx
PPTX
Knowledge base system
PPTX
MODULE-2_AI_Computer_Science_Engineering.pptx
Knowledge-Based agent and representation.pptx
Knowledge representation
Artificial Intelligence_ Knowledge Representation
Ch-I-Moduddddddddddddddddddddddddddddddddddddle-III.pptx
Presentation of iot for artificial intelligence specialization
Unit 2.pptx
Knowledge base system
MODULE-2_AI_Computer_Science_Engineering.pptx

Similar to Artificial Intelligence - Reason and Planning (20)

PPTX
pending-1664760315-2 knowledge based agent student.pptx
PPTX
pending-1664760315-2 knowledge based agent student.pptx
PDF
PPTX
PPT ON INTRODUCTION TO AI- UNIT-1-PART-3.pptx
PPTX
uploadscribd2.pptx
PPTX
Knowledge base system appl. p 1,2-ver1
PPTX
Artificial Intelligence.pptx
PPT
6 KBS_ES.ppt
PDF
Computational Intelligence Module iii.pdf
PDF
Knowledge Representatiodhdhhdhdn.pptx.pdf
PPTX
CHAPTER THREE of Knowledge management framework for the project management sy...
PPTX
AI material for you computer science.pptx
PDF
5.-Knowledge-Representation-in-AI_010824.pdf
PPT
PPT-UEU-Sistem-Pendukung-Keputusan-Pertemuan-11.ppt
PPTX
Knowledge-Based Agent in Artificial intelligence.pptx
PPTX
module-2 ppt knowledge representation computer application
PPT
Chapter3vmgvvh,vh,vvj,vdjvdsjvhdsvhgkvdd
PPTX
Unit 2(knowledge)
PPTX
AI_Unit-3 complete Notes.pptx from RAJIV GANDHI UNIVERSITY
PPTX
Teaching LMMs for Image Quality Scoring and Interpreting
pending-1664760315-2 knowledge based agent student.pptx
pending-1664760315-2 knowledge based agent student.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-3.pptx
uploadscribd2.pptx
Knowledge base system appl. p 1,2-ver1
Artificial Intelligence.pptx
6 KBS_ES.ppt
Computational Intelligence Module iii.pdf
Knowledge Representatiodhdhhdhdn.pptx.pdf
CHAPTER THREE of Knowledge management framework for the project management sy...
AI material for you computer science.pptx
5.-Knowledge-Representation-in-AI_010824.pdf
PPT-UEU-Sistem-Pendukung-Keputusan-Pertemuan-11.ppt
Knowledge-Based Agent in Artificial intelligence.pptx
module-2 ppt knowledge representation computer application
Chapter3vmgvvh,vh,vvj,vdjvdsjvhdsvhgkvdd
Unit 2(knowledge)
AI_Unit-3 complete Notes.pptx from RAJIV GANDHI UNIVERSITY
Teaching LMMs for Image Quality Scoring and Interpreting
Ad

Recently uploaded (20)

PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPTX
Fundamentals of Mechanical Engineering.pptx
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Visual Aids for Exploratory Data Analysis.pdf
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPTX
Management Information system : MIS-e-Business Systems.pptx
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PDF
Design Guidelines and solutions for Plastics parts
PPTX
Feature types and data preprocessing steps
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
Soil Improvement Techniques Note - Rabbi
PPTX
communication and presentation skills 01
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Fundamentals of Mechanical Engineering.pptx
Fundamentals of safety and accident prevention -final (1).pptx
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
R24 SURVEYING LAB MANUAL for civil enggi
Visual Aids for Exploratory Data Analysis.pdf
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Exploratory_Data_Analysis_Fundamentals.pdf
Management Information system : MIS-e-Business Systems.pptx
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
Safety Seminar civil to be ensured for safe working.
Categorization of Factors Affecting Classification Algorithms Selection
Design Guidelines and solutions for Plastics parts
Feature types and data preprocessing steps
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Soil Improvement Techniques Note - Rabbi
communication and presentation skills 01
Ad

Artificial Intelligence - Reason and Planning

  • 2. Intelligent Agent • 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.
  • 3. 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.
  • 5. • knowledge base: Knowledge-base is a central component of a knowledge-based agent, it is also known as KB. It is a collection of sentences (here 'sentence' is a technical term and it is not identical to sentence in English). • These sentences are expressed in a language which is called a knowledge representation language. The Knowledge-base of KBA stores fact about the world.
  • 6. • 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. Inference system applies logical rules to the KB to deduce new information. • Inference system generates new facts so that an agent can update the KB. An inference system works mainly in two rules which are given as: • Forward chaining • Backward chaining
  • 7. • Operations Performed by KBA • Following are three operations which are performed by KBA in order to show the intelligent behavior: 1.TELL: This operation tells the knowledge base what it perceives from the environment. 2.ASK: This operation asks the knowledge base what action it should perform. 3.Perform: It performs the selected action.
  • 8. A generic knowledge-based agent: 1.function KB-AGENT(percept): 2.persistent: KB, a knowledge base 3. t, a counter, initially 0, indicating time 4.TELL(KB, MAKE-PERCEPT-SENTENCE(percept, t)) 5.Action = ASK(KB, MAKE-ACTION-QUERY(t)) 6.TELL(KB, MAKE-ACTION-SENTENCE(action, t)) 7. t = t + 1 8. return action
  • 9. • Firstly it TELLs the KB what it perceives. • Secondly, it asks KB what action it should take • Third agent program TELLS the KB that which action was chosen. • The MAKE-PERCEPT-SENTENCE generates a sentence as setting that the agent perceived the given percept at the given time. • The MAKE-ACTION-QUERY generates a sentence to ask which action should be done at the current time. • MAKE-ACTION-SENTENCE generates a sentence which asserts that the chosen action was executed.
  • 10. 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.
  • 11. • 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 computer 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.
  • 12. • 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. • Meta-knowledge: It is knowledge about what we know. • Facts: Facts are the truths about the real world and what we represent. • Knowledge-Base: The central component of the knowledge-based agents is the knowledge base. It is represented as KB. The Knowledgebase is a group of the Sentences (Here, sentences are used as a technical term and not identical with the English language).
  • 14. 1. Declarative Knowledge: • Declarative knowledge is to know about something. • It includes concepts, facts, and objects. • It is also called descriptive knowledge and expressed in declarativesentences. • It is simpler than procedural language.
  • 15. 2. Procedural Knowledge • It is also known as imperative knowledge. • Procedural knowledge is a type of knowledge which is responsible for knowing how to do something. • It can be directly applied to any task. • It includes rules, strategies, procedures, agendas, etc. • Procedural knowledge depends on the task on which it can be applied.
  • 16. 3. Meta-knowledge: • Knowledge about the other types of knowledge is called Meta- knowledge. 4. Heuristic knowledge: • Heuristic knowledge is representing knowledge of some experts in a filed or subject. • Heuristic knowledge is rules of thumb based on previous experiences, awareness of approaches, and which are good to work but not guaranteed.
  • 17. 5. 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.
  • 18. AI knowledge cycle: An Artificial intelligence system has the following components for displaying intelligent behavior: • Perception • Learning • Knowledge Representation and Reasoning • Planning • Execution
  • 20. Approaches to knowledge representation: 1. Simple relational knowledge: • It is the simplest way of storing facts which uses the relational method, and each fact about a set of the object is set out systematically in columns. • This approach of knowledge representation is famous in database systems where the relationship between different entities is represented. • This approach has little opportunity for inference.
  • 21. Player Weight Age Player1 65 23 Player2 58 18 Player3 75 24
  • 22. • 2. Inheritable knowledge: • In the inheritable knowledge approach, all data must be stored into a hierarchy of classes. • All classes should be arranged in a generalized form or a hierarchal manner. • In this approach, we apply inheritance property. • Elements inherit values from other members of a class. • This approach contains inheritable knowledge which shows a relation between instance and class, and it is called instance relation.
  • 23. • Every individual frame can represent the collection of attributes and its value. • In this approach, objects and values are represented in Boxed nodes. • We use Arrows which point from objects to their values.
  • 25. • 3. Inferential knowledge: • Inferential knowledge approach represents knowledge in the form of formal logics. • This approach can be used to derive more facts. • It guaranteed correctness. • Example: Let's suppose there are two statements: • Marcus is a man • All men are mortal Then it can represent as; man(Marcus) ∀x = man (x) ----------> mortal (x)s
  • 26. 4. Procedural knowledge: • Procedural knowledge approach uses small programs and codes which describes how to do specific things, and how to proceed. • In this approach, one important rule is used which is If-Then rule. • In this knowledge, we can use various coding languages such as LISP language and Prolog language. • We can easily represent heuristic or domain-specific knowledge using this approach. • But it is not necessary that we can represent all cases in this approach.
  • 27. Requirement for knowledge Representation system 1. Representational Accuracy: KR system should have the ability to represent all kind of required knowledge. 2. Inferential Adequacy: KR system should have ability to manipulate the representational structures to produce new knowledge corresponding to existing structure. 3. Inferential Efficiency: The ability to direct the inferential knowledge mechanism into the most productive directions by storing appropriate guides. 4. Acquisitional efficiency- The ability to acquire the new knowledge easily using automatic methods.
  • 28. Propositional Logic • 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.
  • 29. • Propositional logic is also called Boolean logic as it works on 0 and 1. • 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. • Propositions can be either true or false, but it cannot be both. • Propositional logic consists of an object, relations or function, and logical connectives. • These connectives are also called logical operators.
  • 30. • A proposition formula which is always true is called tautology, and it is also called a valid sentence. • A proposition formula which is always false is called Contradiction. Types of Proposition 1.Atomic Propositions 2.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.
  • 31. • Compound proposition: Compound propositions are constructed by combining simpler or atomic propositions, using parenthesis and logical connectives.
  • 32. Logical Connectives: Logical connectives are used to connect two simpler propositions 1.Negation: A sentence such as ¬ P is called negation of P. A literal can be either Positive literal or negative literal. 2.Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a conjunction. Example: Rohan is intelligent and hardworking. It can be written as, P= Rohan is intelligent, Q= Rohan is hardworking. → P∧ Q. 3.Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called disjunction, where P and Q are the propositions. Example: "Ritika is a doctor or Engineer", Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.
  • 33. 4.Implication: A sentence such as P → Q, is called an implication. Implications are also known as if-then rules. It can be represented as 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 5.Biconditional: A sentence such as P⇔ Q is a Biconditional sentence, example If I am breathing, then I am alive P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
  • 35. Truth Table • We can combine all the possible combination with logical connectives, and the representation of these combinations in a tabular format is called Truth table. • Negation
  • 38. • Limitations of Propositional logic: • We cannot represent relations like ALL, some, or none with propositional logic. Example: • All the girls are intelligent. • Some apples are sweet. • Propositional logic has limited expressive power. • In propositional logic, we cannot describe statements in terms of their properties or logical relationships.
  • 39. First-Order Logic in Artificial intelligence • First-order logic is another way of knowledge representation in artificial intelligence. It is an extension to propositional logic. • FOL is sufficiently expressive to represent the natural language statements in a concise way. • First-order logic is also known as Predicate logic or First- order predicate logic. First-order logic is a powerful language that develops information about the objects in a more easy way and can also express the relationship between those objects.
  • 40. • First-order logic (like natural language) does not only assume that the world contains facts like propositional logic but also assumes the following things in the world: • Objects: A, B, people, numbers, colors, wars, theories, squares, pits, wumpus, ...... • Relations: It can be unary relation such as: red, round, is adjacent, or n-any relation such as: the sister of, brother of, has color, comes between • Function: Father of, best friend, third inning of, end of, ...... • As a natural language, first-order logic also has two main parts: • Syntax • Semantics
  • 41. Elements of First order logic Constant 1, 2, A, John, Mumbai, cat,.... Variables x, y, z, a, b,.... Predicates Brother, Father, >,.... Function sqrt, LeftLegOf, .... Connectives ∧, ∨, ¬, ⇒, ⇔ Equality == Quantifier ∀, ∃
  • 42. Atomic sentences: • Atomic sentences are the most basic sentences of first-order logic. These sentences are formed from a predicate symbol followed by a parenthesis with a sequence of terms. • We can represent atomic sentences as Predicate (term1, term2, ......, term n). Example: Ravi and Ajay are brothers: => Brothers(Ravi, Ajay). Chinky is a cat: => cat (Chinky).
  • 43. Complex Sentences: • Complex sentences are made by combining atomic sentences using connectives. • First-order logic statements can be divided into two parts: • Subject: Subject is the main part of the statement. • Predicate: A predicate can be defined as a relation, which binds two atoms together in a statement.
  • 44. Quantifiers in First-order logic: • A quantifier is a language element which generates quantification, and quantification specifies the quantity of specimen in the universe of discourse. • These are the symbols that permit to determine or identify the range and scope of the variable in the logical expression. There are two types of quantifier: • Universal Quantifier, (for all, everyone, everything) • Existential quantifier, (for some, at least one).
  • 45. All men drinks coffee ∀x man(x) → drink (x, coffee). Some boys are intelligent ∃x: boys(x) ∧ intelligent(x)
  • 46. Some Examples of FOL using quantifier: • 1. All birds fly. In this question the predicate is "fly(bird)." And since there are all birds who fly so it will be represented as follows. ∀x bird(x) →fly(x). • 2. Every man respects his parent. In this question, the predicate is "respect(x, y)," where x=man, and y= parent. Since there is every man so will use ∀, and it will be represented as follows: ∀x man(x) → respects (x, parent).
  • 47. • 3. Some boys play cricket. In this question, the predicate is "play(x, y)," where x= boys, and y= game. Since there are some boys so we will use ∃, and it will be represented as: ∃x boys(x) → play(x, cricket). • 4. Not all students like both Mathematics and Science. In this question, the predicate is "like(x, y)," where x= student, and y= subject. Since there are not all students, so we will use ∀ with negation, so following representation for this: ¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].
  • 48. Inference in First-Order Logic • Inference in First-Order Logic is used to deduce new facts or sentences from existing sentences. • Substitution: • Substitution is a fundamental operation performed on terms and formulas. It occurs in all inference systems in first-order logic. The substitution is complex in the presence of quantifiers in FOL. If we write F[a/x], so it refers to substitute a constant "a" in place of variable "x".
  • 49. Equality symbol • Example: Brother (John) = Smith. • As in the above example, the object referred by the Brother (John) is similar to the object referred by Smith. The equality symbol can also be used with negation to represent that two terms are not the same objects. • Example: ¬(x=y) which is equivalent to x ≠y.
  • 50. FOL inference rules for quantifier: • Universal Generalization • Universal Instantiation • Existential Instantiation • Existential introduction
  • 51. Universal generalization • Universal generalization is a valid inference rule which states that if premise P(c) is true for any arbitrary element c in the universe of discourse, then we can have a conclusion as ∀ x P(x). • It can be represented as:
  • 52. • This rule can be used if we want to show that every element has a similar property. • In this rule, x must not appear as a free variable. • Example: Let's represent, P(c): "A byte contains 8 bits", so for ∀ x P(x) "All bytes contain 8 bits.", it will also be true.
  • 53. Universal instantiation • Universal Instantiation: • Universal instantiation is also called as universal elimination or UI is a valid inference rule. It can be applied multiple times to add new sentences. • The new KB is logically equivalent to the previous KB. • As per UI, we can infer any sentence obtained by substituting a ground term for the variable. • The UI rule state that we can infer any sentence P(c) by substituting a ground term c (a constant within domain x) from ∀ x P(x) for any object in the universe of discourse.
  • 54. • Example:1. • IF "Every person like ice-cream"=> ∀x P(x) so we can infer that "John likes ice-cream" => P(c) • Example: 2. • Let's take a famous example, • "All kings who are greedy are Evil." So let our knowledge base contains this detail as in the form of FOL: • ∀x king(x) ∧ greedy (x) → Evil (x), • So from this information, we can infer any of the following statements using Universal Instantiation: • King(John) ∧ Greedy (John) → Evil (John), • King(Richard) ∧ Greedy (Richard) → Evil (Richard), • King(Father(John)) ∧ Greedy (Father(John)) → Evil (Father(John)),
  • 55. Existential Instantiation: • Existential instantiation is also called as Existential Elimination, which is a valid inference rule in first-order logic. • It can be applied only once to replace the existential sentence. • The new KB is not logically equivalent to old KB, but it will be satisfiable if old KB was satisfiable. • This rule states that one can infer P(c) from the formula given in the form of ∃x P(x) for a new constant symbol c. • The restriction with this rule is that c used in the rule must be a new term for which P(c ) is true.
  • 56. • Example: • From the given sentence: ∃x Crown(x) ∧ OnHead(x, John), • So we can infer: Crown(K) ∧ OnHead( K, John), as long as K does not appear in the knowledge base. • The above used K is a constant symbol, which is called Skolem constant. • The Existential instantiation is a special case of Skolemization process.
  • 57. Existential introduction • An existential introduction is also known as an existential generalization, which is a valid inference rule in first-order logic. • This rule states that if there is some element c in the universe of discourse which has a property P, then we can infer that there exists something in the universe which has the property P. • Example: Let's say that, "Priyanka got good marks in English." "Therefore, someone got good marks in English."
  • 58. Forward Chaining • Forward chaining is also known as a forward deduction or forward reasoning method when using an inference engine. Forward chaining is a form of reasoning which start with atomic sentences in the knowledge base and applies inference rules (Modus Ponens) in the forward direction to extract more data until a goal is reached. • The Forward-chaining algorithm starts from known facts, triggers all rules whose premises are satisfied, and add their conclusion to the known facts. This process repeats until the problem is solved.
  • 59. Properties of Forward-Chaining: • It is a down-up approach, as it moves from bottom to top. • It is a process of making a conclusion based on known facts or data, by starting from the initial state and reaches the goal state. • Forward-chaining approach is also called as data-driven as we reach to the goal using available data. • Forward -chaining approach is commonly used in the expert system, such as CLIPS, business, and production rule systems.
  • 60. example • As per the law, it is a crime for an American to sell weapons to hostile nations. Country A, an enemy of America, has some missiles, and all the missiles were sold to it by Robert, who is an American citizen.“ • Facts Conversion into FOL: • Selling weapons to unfriendly or hostile countries is illegal in the United States. (Let's say p, q, and r are variables) American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1) • It is a method of arriving at a conclusion based on known facts or data by starting at the beginning and working one's way to the end. Applications • Expert systems, such as CLIPS, business, and production rule systems, frequently employ the forward-chaining approach.
  • 61. Forward chaining Backward chaining 1. Forward chaining begins with known facts and uses inference rules to extract more data units until it gets the desired outcome. Backward chaining starts with the objective and works backwards using inference rules to locate the necessary facts to support it. 2. It is a bottom-up approach. It is a top-down approach. 3. Forward chaining is also regarded as a data- driven inference strategy because it allows us to attain our goal using the data we already have. Backward chaining is a goal-driven strategy since it begins with the objective and divides it into sub-goals in order to extract the facts. 4. Forward chaining is also regarded as a data-driven inference strategy because it allows us to attain our goal using the data we already have. Backward chaining is a goal-driven strategy since it begins with the objective and divides it into sub-goals in order to extract the facts.
  • 62. 5. All of the available rules are subjected to forward chaining testing. Only a few required rules are tested via backward chaining. 6. Forward chaining is appropriate for applications such as planning, monitoring, control, and interpretation. Backward chaining is a useful technique for diagnosing, prescribing, and debugging. 7. Forward chaining can lead to an unlimited number of different outcomes. The number of possible conclusions generated by backward chaining is finite. 8. It works in the forward direction. It works in the backward direction. 9. The goal of forward chaining is to reach any conclusion. Backward chaining is only for the data that is required.
  • 63. Backward chaining • Backward-chaining is also known as a backward deduction or backward reasoning method when using an inference engine. A backward chaining algorithm is a form of reasoning, which starts with the goal and works backward, chaining through rules to find known facts that support the goal. • Properties of backward chaining: • It is known as a top-down approach. • Backward-chaining is based on modus ponens inference rule. • In backward chaining, the goal is broken into sub-goal or sub-goals to prove the facts true. • It is called a goal-driven approach, as a list of goals decides which rules are selected and used. • Backward -chaining algorithm is used in game theory, automated theorem proving tools, inference engines, proof assistants, and various AI applications. • The backward-chaining method mostly used a depth-first search strategy for proof.
  • 64. Forward chaining & Backward chaining example • "As per the law, it is a crime for an American to sell weapons to hostile nations. Country A, an enemy of America, has some missiles, and all the missiles were sold to it by Robert, who is an American citizen." • Prove that "Robert is criminal."
  • 65. Forward chaining • It is a crime for an American to sell weapons to hostile nations. (Let's say p, q, and r are variables) American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1) • Country A has some missiles. ?p Owns(A, p) ∧ Missile(p). It can be written in two definite clauses by using Existential Instantiation, introducing new Constant T1. Owns(A, T1) ......(2) Missile(T1) .......(3) • All of the missiles were sold to country A by Robert. ?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4) • Missiles are weapons. Missile(p) → Weapons (p) .......(5) • Enemy of America is known as hostile. Enemy(p, America) →Hostile(p) ........(6) • Country A is an enemy of America. Enemy (A, America) .........(7) • Robert is American American(Robert). .....(8)
  • 66. Forward chaining proof • Step-1:American(Robert), Enemy(A, America), Owns(A, T1), and Missile(T1)
  • 69. Backward chaining • American (p) ∧ weapon(q) ∧ sells (p, q, r) ∧ hostile(r) → Criminal(p) ...(1) Owns(A, T1) ........(2) • Missile(T1) • ?p Missiles(p) ∧ Owns (A, p) → Sells (Robert, p, A) ......(4) • Missile(p) → Weapons (p) .......(5) • Enemy(p, America) →Hostile(p) ........(6) • Enemy (A, America) .........(7) • American(Robert). ..........(8)