Professional Documents
Culture Documents
AIML-UNIT2
AIML-UNIT2
AIML-UNIT2
AY 2023-2024 SEM-VI
Unit II - Syllabus
Unit – Knowledge representation, Planning & Reasoning 09 hours
• Frame Representation,
• Production Rules;
• Role of Planning;
Knowledge is the
information about a
domain that can be used
to solve problems in that
domain.
IMPORTANCE OF INTELLIGENCE
5
IMPORTANCE OF INTELLIGENCE
We have to induce right knowledge in the machine so that it can process it to
take right decision; like if we write right program we will get right output.
A machine sounds like an empty box unless it is encoded with some features or
information. Therefore, to make it a valuable machine, it is required to put the
necessary knowledge in it. So that it could understand it and is able to take the right
decisions.
There are three factors which are put into the machine, which makes it valuable:
1. Knowledge: The information related to the environment is stored in the machine.
2. Reasoning: The ability of the machine to understand the stored knowledge.
3. Intelligence: The ability of the machine to make decisions on the basis of the
stored information.
All these things comes under knowledge representation and reasoning also known
as KR or KRR. It is the representation of the information that is extracted from the
real world and utilized for solving complex problems.
6
KNOWLEDGE NEEDS TO BE REPRESENTED
7
KNOWLEDGE REPRESENTATION: TYPES
Knowledge is awareness gained by experiences of facts, data, and
situations.
8
KNOWLEDGE REPRESENTATION: TYPES
Structural knowledge:
Declarative knowledge:
• It is the basic knowledge to problem solving
• Describes what is known about problem
• describes relationships between various
• Tells us facts- what things are
concepts/objects
• Includes: concepts, facts and objects
• Also known as descriptive knowledge Meta knowledge:
• Describes knowledge about another
Procedural knowledge: knowledge
• Describes how to solve problem • Used to pick other knowledge that is best
• Also known as Imperative knowledge suited for solving a problem
• Provides direction on how to do
something Heuristic knowledge:
• Can be directly applied to a task. • It is representing knowledge of some experts
• Include: rules, strategies and in a field or subject
procedures • knowledge created by previous experiences,
approaches
9
WHAT IS LOGIC?
10
CYCLE OF KNOWLEDGE REPRESENTATION
11
RELATION BETWEEN KNOWLEDGE &
INTELLIGENCE
12
PROPERTIES OF A KNOWLEDGE
REPRESENTATION SYSTEM
Inferential It is the ability of the system to directly add new knowledge in the
Efficiency system with efficiency.
14
MIT School of Computing
Department of Computer Science & Engineering
TECHNIQUES OF KNOWLEDGE
REPRESENTATION
Logical Representation
It is the basic method used to represent the knowledge of a machine. The term logic
means to apply intelligence over the stored knowledge.
15
MIT School of Computing
Department of Computer Science & Engineering
TECHNIQUES OF KNOWLEDGE
REPRESENTATION
Rule-based System
In the rule-based system, we impose rules over the propositional logic and first-
order logic techniques. If-then clause is used for this technique. For example, if
there are two variables A and B. Value of both A and B is True. Consequently, the
result of both should also be True and vice-versa.
Semantic Networks
The technique is based on storing the knowledge into the system in the form of a
graph. Nodes of a graph represent the objects which exist in the real world, and the
arrow represents the relationship between these objects. Such techniques show the
connectivity of one object with another object.
16
MIT School of Computing
Department of Computer Science & Engineering
TECHNIQUES OF KNOWLEDGE
REPRESENTATION
Frames
In this technique, the knowledge is stored via slots and fillers. As we have seen in
DBMS, we store the information of an employee in the database, where, the Slots
are the entities and Fillers are its attributes. They are together stored in a frame. So,
whenever there is a requirement, the machine infers the necessary information to
take the decision.
Script is an advanced technique over the Frames. Here, the information is stored in
the form of a script. The script is stored in the system containing all the required
information. The system infers the information from that script and solves the
problem
17
MIT School of Computing
Department of Computer Science & Engineering
1. Finding the right structure: The information is stored in a large amount. The
question is how to access the relevant information out of whole?
18
MIT School of Computing
Department of Computer Science & Engineering
LOGICAL REPRESENTATION
Language with some concrete rules which deals with propositions and has no
ambiguity in representation.
It consists of precisely defined syntax and semantics which supports the sound
inference. Each sentence can be translated into logics using syntax and semantics.
Semantics
• Rules by which we can interpret the sentence in the logic.
• Defined the truth or meaning of sentence a world.
19
MIT School of Computing
Department of Computer Science & Engineering
20
MIT School of Computing
Department of Computer Science & Engineering
• Because it operates with 0 and 1, propositional logic is also known as Boolean logic.
• Symbolic variables are used to express the logic, and any symbol can be used to represent a
proposition, such as A, B, C, P, Q, R, and so on.
• Propositions can be true or false, but not both at the same time.
• An object, relations or functions, and logical connectives make up propositional logic.
• Logical operators are another name for these connectives.
• Statements that are inquiries, demands, or opinions are not propositions, such as "Where is
Rohini", "How are you", and "What is your name" are not propositions.
21
PROPOSITIONAL LOGIC: CATEGORIES
22
MIT School of Computing
Department of Computer Science & Engineering
• Ram cannot play tennis – There is a negation in the sentence, so symbolic representation will be ˜ X or ¬ X
• Ram can play tennis and badminton – There is a new addition ‘Badminton’, let’s take it as variable Y. Now, this
sentence has a Conjunction, so symbolic representation will be X ˄ Y
• Ram can play tennis or badminton – Here is a Disjunction, so symbolic representation will be X ˅ Y
• If Ram can play tennis then he can play badminton – There is a condition, so symbolic representation will be X
→Y
• Ram can play tennis if and only if he can play badminton – It is a biconditional sentence, so symbolic
representation will be X Y
23
MIT School of Computing
Department of Computer Science & Engineering
Once the machine reads the message, it applies the Boolean logic-based formulas to
create the TRUE and FALSE chart to interpret the final output of a complex proposition.
24
MIT School of Computing
Department of Computer Science & Engineering
Commutativity: Associativity:
P ∧ Q= Q ∧ P, or (P ∧ Q) ∧ R = P ∧ (Q ∧ R),
P ∨ Q = Q ∨ P. (P ∨ Q) ∨ R= P ∨ (Q ∨ R).
DE Morgan's Law:
Double-negation elimination:
¬(P ∧ Q) = (¬P) ∨ (¬Q),
¬(¬P) = P.
¬(P ∨ Q) = (¬ P) ∧ (¬Q).
25
MIT School of Computing
Department of Computer Science & Engineering
• This is not possible to represent relations like ALL, some, or none with propositional
logic.
Example:
All the girls are intelligent.
Some apples are sweet.
26
MIT School of Computing
Department of Computer Science & Engineering
FOL not only assumes that does the world contains facts (like PL does), but it also assumes the
following:
• Objects: A, B, people, numbers, colors, wars, theories, squares, pit, etc.
• Relations: It is unary relation such as red, round, sister of, brother of, etc.
• Function: father of, best friend, third inning of, end of, etc.
27
MIT School of Computing
Department of Computer Science & Engineering
28
MIT School of Computing
Department of Computer Science & Engineering
• Atomic sentences are the most fundamental first-order logic sentences. These
sentences are made up of a predicate symbol, a parenthesis, and a series of terms.
• Predicate can be used to represent atomic sentences (term1, term2, ......, term n).
• Predicate logic or First-order predicate logic are other names for first-order logic.
Example:
• Ravi and Ajay are brothers: => Brothers(Ravi, Ajay).
• Chinky is a cat: => cat (Chinky).
29
MIT School of Computing
Department of Computer Science & Engineering
30
QUANTIFIERS IN FIRST ORDER LOGIC
Quantifiers generate quantification and specify the number of specimen in the universe.
Quantifiers allow us to determine or identify the range and scope of the variable in a
logical expression.
31
FIRST ORDER LOGIC: UNIVERSAL QUANTIFIERS
Quantifiers generate quantification and specify the number of specimen in the universe.
Specify that the statement within the range is true for everything or every instance of a particular
thing.
Universal quantifiers are denoted by a symbol (∀ ) that looks like an inverted A. In a universal
quantifier, we use → .
• For all x
• For every x
• For each x
32
MIT School of Computing
Department of Computer Science & Engineering
Explanation:
33
MIT School of Computing
Department of Computer Science & Engineering
Existential quantifiers are used to express that the statement within their scope is true for at least
one instance of something.
∃ , which looks like an inverted E, is used to represent them. We always use AND or conjunction
symbols.
• For some x
• There exists an x
• For at least one x
34
FIRST ORDER LOGIC: EXISTENTIAL QUANTIFIERS
Explanation:
35
MIT School of Computing
Department of Computer Science & Engineering
EXAMPLE
36
MIT School of Computing
Department of Computer Science & Engineering
EXAMPLE
37
FIRST ORDER LOGIC: FREE AND BOUND VARIABLES
Free Variable:
Bound Variable:
38
MIT School of Computing
Department of Computer Science & Engineering
39
MIT School of Computing
Department of Computer Science & Engineering
rectangle
circle (physical) ellipse (concept) (situation)
40
MIT School of Computing
Department of Computer Science & Engineering
Consists of:
1. Nodes: Represent the object or concept.
Lexical Components 2. Links: Denoting relation between nodes.
3. Labels: Denoting particular objects & relations.
41
EXAMPLE
Mamm
Mat al Tom is a cat.
Tom caught a bird.
Tom is owned by John.
Tom is black in color.
Crea likes
Cat Animal Cats like cream.
m The cat sat on the mat.
A cat is a mammal.
A bird is an animal.
Tom Bird All mammals are animals
caught
Black John
42
MIT School of Computing
Department of Computer Science & Engineering
43
MIT School of Computing
Department of Computer Science & Engineering
Advantages Disadvantages
44
SEMANTIC NETWORK: APPLICATION
Knowledge Graph proposed by Google in 2012 uses semantic networks in the search
engines.
45
MIT School of Computing
Department of Computer Science & Engineering
FRAME REPRESENTATION
46
MIT School of Computing
Department of Computer Science & Engineering
FRAME (EXAMPLE)
47
MIT School of Computing
Department of Computer Science & Engineering
FRAME: TYPES
Class Frame
Individual or Instance
Frame
48
MIT School of Computing
Department of Computer Science & Engineering
FRAME: REPRESENTATION
Frames are more structured form of packaging knowledge, - used for representing
objects, concepts etc.
Lower level frames can inherit information from upper level frames in network.
49
MIT School of Computing
Department of Computer Science & Engineering
FRAME: REPRESENTATION
A frame may have any number of slots needed for describing object. e.g.,
• faculty frame may have name, age, address, qualification etc. as slot names.
Each frame includes two basic element : slots and facets (aspects of a slot).
• Each slot may contain one or more facets (called fillers) which may take many
forms such as :
• value (value of the slot),
• default (default value of the slot),
• range (indicates the range of integer or enumerated values, a slot can
have),
• demons (procedural attachments such as if_needed, if_deleted, if_added
etc.) and
• other (may contain rules, other frames, semantic net or any type of other
information).
50
MIT School of Computing
Department of Computer Science & Engineering
51
FRAME NETWORK: DETAILED REPRESENTATION
52
MIT School of Computing
Department of Computer Science & Engineering
FRAMES
• Search will start from frame13 in upward direction till we get our answer or
have reached root frame.
• The frame can be easily represented in prolog by choosing predicate name as
frame with two arguments.
• First argument is the name of the frame and second argument is a list of slot -
facet pair
53
MIT School of Computing
Department of Computer Science & Engineering
54
FRAMES: ADVANTAGES AND DISADVANTAGES
Advantages Disadvantages
55
PRODUCTION RULES
Production rules system consist of (condition, action) pairs which mean, "If condition then
action".
This cycle of selecting the rule based on some conditions and consequently acting to solve the
problem is known as a recognition and act cycle.
The working memory contains the description of the current state of problems-solving and rule can
write knowledge to the working memory.
56
MIT School of Computing
Department of Computer Science & Engineering
PRODUCTION RULES
If there is a new situation (state) generates, then multiple production rules will be fired
together, this is called conflict set. In this situation, the agent needs to select a rule
from working memory, and it is called a conflict resolution.
Example:
1. IF (at bus stop AND bus arrives) THEN action (get into the bus).
2. IF (on the bus AND paid AND empty seat) THEN action (sit down).
3. IF (on bus AND unpaid) THEN action (pay charges).
4. IF (bus arrives at destination) THEN action (get down from the bus).
57
ADVANTAGES AND DISADVANTAGES
Advantages
Disadvantages
• Does not exhibit any learning capabilities, as it does not store the result of the
problem for the future uses.
• During the execution of the program, many rules may be active hence rule-based
production systems are inefficient.
58
MIT School of Computing
Department of Computer Science & Engineering
PLANNING IN AI
• The planning in AI is about the decision
making tasks performed by the robots
or computer programs to achieve a
specific goal.
• The planning in AI is an activity where
agent has to come up with a sequence
of actions to accomplish task.
• In AI Intelligent system like robots or AI
Agent or Planning Agent always need to
do planning to perform any task
• To formulate planning problem
following information is required:
• Initial status of Agent
• Goal condition of Agent
• Set of Action Agent takes
59
MIT School of Computing
Department of Computer Science & Engineering
PLANNING IN AI
60
MIT School of Computing
Department of Computer Science & Engineering
PLANNING PROBLEM IN AI
61
MIT School of Computing
Department of Computer Science & Engineering
62
MIT School of Computing
Department of Computer Science & Engineering
STRIPS AI
• After planning problem, it is required to solve that problem and to solve problem
planning language or techniques are required.
• Languages should be expressive enough to explain a wide variety of problems
and must follow efficient algorithm to operate on it.
• Planning languages are known as action language.
• STRIPS are such action/language founded by Richard Fike & Nilsson in 1971 as an
automated planner.
• STRIPS stands for Stanford Research Institute Problem Solver.
• It’s an automated planning technique for finding goals by executing a domain
from the initial state.
63
MIT School of Computing
Department of Computer Science & Engineering
STRIPS AI
64
MIT School of Computing
Department of Computer Science & Engineering
EXAMPLE
65
MIT School of Computing
Department of Computer Science & Engineering
EXAMPLE
66
MIT School of Computing
Department of Computer Science & Engineering
EXAMPLE
67
MIT School of Computing
Department of Computer Science & Engineering
EXAMPLE
68
MIT School of Computing
Department of Computer Science & Engineering
EXAMPLE
69
MIT School of Computing
Department of Computer Science & Engineering
70
MIT School of Computing
Department of Computer Science & Engineering
71
MIT School of Computing
Department of Computer Science & Engineering
72
MIT School of Computing
Department of Computer Science & Engineering
73
MIT School of Computing
Department of Computer Science & Engineering
74
MIT School of Computing
Department of Computer Science & Engineering
REASONING: INTRODUCTION
82
TYPES OF REASONING
83
MIT School of Computing
Department of Computer Science & Engineering
TYPES OF REASONING
Deductive Reasoning
Deductive reasoning follows logical rules to draw specific conclusions.
Example: If we know that "All birds can fly" and "Robins are birds," then we can
logically deduce that "Robins can fly."
Inductive Reasoning
Inductive reasoning involves making generalizations from specific observations.
Example: If we observe multiple apples and they are all red, we may infer that "All
apples are red."
84
MIT School of Computing
Department of Computer Science & Engineering
TYPES OF REASONING
Abductive Reasoning
Abductive reasoning generates the best explanation based on available evidence.
Example: If someone finds a wet umbrella and sees dark clouds, they may conclude
that "It is likely to rain."
Rule-based Reasoning
Rule-based reasoning uses predefined rules to make deductions.
Example: If we have a rule that "If it's raining, take an umbrella," and we observe
that "It's raining," then we deduce that "We should take an umbrella."
85
TYPES OF REASONING
Case based Reasoning
Case-based reasoning solves problems based on similar past cases.
Logical Reasoning
Logical reasoning involves using formal logic to draw conclusions.
Example: If "A implies B" and "B implies C," we can logically conclude that "A implies
C."
86
MIT School of Computing
Department of Computer Science & Engineering
TYPES OF REASONING
Probabilistic Reasoning
Definition: Probabilistic reasoning is a method for making inferences and decisions
under uncertainty by using probability theory.
Example: Based on sensor data, a self-driving car can estimate the probability of an
object being a pedestrian and make decisions accordingly.
87
MIT School of Computing
Department of Computer Science & Engineering
TYPES OF REASONING
88
BAYES’ THEOREM
Definition: Bayes' theorem is a fundamental concept in probabilistic reasoning,
named after the Reverend Thomas Bayes.
Likelihood (P(B|A)): The probability of observing evidence B given that event A is true.
Posterior Probability (P(A|B)): The updated probability of event A after taking the evidence B into
account.
89
MIT School of Computing
Department of Computer Science & Engineering
EXAMPLE SCENARIO
90
EXAMPLE SCENARIO
Artificial Intelligence (AI) is a vast field with several subsets or branches that focus
on different aspects of intelligence and problem-solving. This presentation explores
some of the major subsets of AI and provides an overview of each.
Machine Learning
Definition: Machine Learning is a subset of AI that focuses on developing algorithms and
models that enable computers to learn from data and improve performance without explicit
programming.
92
MIT School of Computing
Department of Computer Science & Engineering
SUBSETS OF AI
Natural Language Processing (NLP)
Definition: Natural Language Processing is a subset of AI that deals with the
interaction between computers and human language. It involves tasks such as
speech recognition, language understanding, and language generation.
Computer Vision
Definition: Computer Vision is a subset of AI focused on enabling computers to understand and
interpret visual information from images or videos. It involves tasks like object recognition,
image classification, and image segmentation.
93
MIT School of Computing
Department of Computer Science & Engineering
SUBSETS OF AI
Robotics
Definition: Robotics is a subset of AI that deals with the design, construction, and operation of
robots. It involves the integration of AI techniques to enable robots to perceive their environment,
make decisions, and perform physical tasks.
Importance: Robotics combines AI, sensing, and mechanical systems to create intelligent machines
that can interact with and manipulate their surroundings, leading to advancements in areas such
as industrial automation, healthcare, and exploration.
Expert Systems
Definition: Expert Systems are AI systems that mimic human expertise and knowledge in a specific
domain. They use rule-based reasoning and knowledge representation to solve complex problems.
94
SUBSETS OF AI
Reinforcement Learning
Definition: Reinforcement Learning is a subset of machine learning that involves training
agents to make sequential decisions in an environment to maximize rewards. It utilizes a
trial-and-error approach to learn optimal strategies.
Data Mining
Definition: Data Mining is a subset of AI that focuses on discovering patterns and extracting
useful information from large datasets. It involves techniques such as clustering,
classification, and association rule mining.
Importance: Data Mining helps uncover hidden insights, make predictions, and support
decision-making processes in various fields, including finance, marketing, healthcare, and
fraud detection.
SUBSETS OF AI
Genetic Algorithms
Definition: Genetic Algorithms are search and optimization techniques inspired by
the process of natural selection. They use evolutionary principles to solve complex
problems by iteratively evolving a population of potential solutions.
Deep Learning
Definition: Deep Learning is a subset of machine learning that focuses on training
artificial neural networks with multiple layers to learn and extract hierarchical
representations from complex data.
97