AIML-UNIT2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 97

MIT Art Design and Technology University

MIT School of Computing, Pune

21BTCS003- Artificial Intelligence & Machine Learning

Class - T.Y. (SEM-II), CORE


Unit – II Knowledge representation, Planning & Reasoning

Prof. Abhishek Das

AY 2023-2024 SEM-VI
Unit II - Syllabus
Unit – Knowledge representation, Planning & Reasoning 09 hours

• Knowledge representation issues;

• Techniques of knowledge representation- Logical Representation,

• Semantic Network Representation,

• Frame Representation,

• Production Rules;

• Role of Planning;

• Forward Chaining and backward chaining in AI;

• Reasoning in Artificial intelligence;

• Probabilistic reasoning- Bayes' theorem;

• Subsets of Artificial Intelligence


Unit II – Outline
• Knowledge representation issues;
• Techniques of knowledge representation- Logical Representation,
• Semantic Network Representation,
• Frame Representation,
• Production Rules;
• Role of Planning;
• Forward Chaining and backward chaining in AI;
• Reasoning in Artificial intelligence;
• Probabilistic reasoning- Bayes' theorem;
• Subsets of Artificial Intelligence
KNOWLEDGE REPRESENTATION

Humans are good at reasoning, understanding, analyzing, and


interpreting what they are seeing in their daily life. Human know how to
react and respond to the situation that are going through.

Knowledge is the
information about a
domain that can be used
to solve problems in that
domain.

But how to make machines perform Knowledge


similar actions?
MIT School of Computing
Department of Computer Science & Engineering

IMPORTANCE OF INTELLIGENCE

Decision: Not to jump Decision: To jump

You are intelligent because:


• you have knowledge Machine does not have knowledge,
• you have an ability to process gathered intelligence and reasoning ability because it
information is not intelligent.
• you have an ability to take decision

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?

• Logic is the main component of any knowledge as it facilitates a


person to draw conclusion by filtering required information from large
volumes of sentences.
• In AI, knowledge is represented using logic. Every logic has three main
elements:
• Syntax
• Semantics
• Logical inference

10
CYCLE OF KNOWLEDGE REPRESENTATION

Perception gathers information from it’s


environment. This component can be in audio,
visual or any other form.

Learning is responsible for data stored by the


perception component.

Representation is related to representing the


knowledge in proper way so that machine’s
can understand what the knowledge says. It is
Reasoning is involved to show the intelligence the most important component in the cycle of
of machine as like real human. Reasoning is knowledge.
another important component. Although Planning is the way how the execution process
knowledge representation and reasoning are will be done. Execution is the final component
different components they are mostly coupled. in the cycle which completes the cycle.

11
RELATION BETWEEN KNOWLEDGE &
INTELLIGENCE

Example: There is one decision-maker


whose actions are justified by sensing the
environment and using knowledge. But, if
we remove the knowledge part here, it will
not be able to display any intelligent
behavior.

12
PROPERTIES OF A KNOWLEDGE
REPRESENTATION SYSTEM

A good knowledge representation system must possess the following properties.

Representational It is the ability of the system to represent all kinds of knowledge


Adequacy needed in a specific domain.

It is the ability of a knowledge representation system to manipulate


Inferential
the current stored knowledge so that newly gained knowledge could
Adequacy
be added.

Inferential It is the ability of the system to directly add new knowledge in the
Efficiency system with efficiency.

It is the ability of the system to automatically acquire new knowledge


Acquisitional
from the environment. This leads the system to give more productive
Efficiency
result as more knowledge adds up with the current knowledge.
MIT School of Computing
Department of Computer Science & Engineering
TECHNIQUES OF KNOWLEDGE
REPRESENTATION

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.

Further divided as:

This technique is also known as propositional calculus, statement


Propositional
logic, or sentential logic. It is used for representing the knowledge
Logic
about what is true and what is false.

It is also known as Predicate logic or First-order predicate calculus


(FOPL). This technique is used to represent the objects in the form of
First-order Logic predicates or quantifiers. It is different from Propositional logic as it
removes the complexity of the sentence represented by it. In short,
FOPL is an advance version of propositional logic.

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

KNOWLEDGE REPRESENATION: ISSUES

1. Choosing Granularity: How much detailed knowledge is needed to be


represented?

1. Set of Objects: How to represent the set of objects?

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.

• Rules which decide how to construct legal sentences in the logic.


Syntax
• Determines which symbol we can use in knowledge
representation.
• How to write those symbols.

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

LOGICAL REPRESENTATION: TYPES

Propositional Logic First-order Logic

• Also known as propositional calculus or


statement logic.
• Simplest methods of knowledge
representation to a machine.
• Proposition means sentences. • Also known as the First Order Predicate
• Applies the Boolean logic to convert our Calculus Logic (FOPL).
real-world data into a format that is • Represents the objects in quantifiers and
readable to the computer. predicates.
• Method of expressing knowledge in logical • Advanced version of propositional logic.
and mathematical terms.
• "Proposition“ refers to a declarative
statement that can be true or false.

20
MIT School of Computing
Department of Computer Science & Engineering

PROPOSITIONAL LOGIC: BASIC FACTS

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

• The essential parts of propositional logic are propositions and connectives.

• Connectives are logical operators that link two sentences together.

• 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

Propositions are divided into two categories

• Simple assertions are referred to as atomic propositions.


• Made up of only one proposition sign.
Atomic • Sentences that must be true or false in order to pass.
Propositions Example:
1. 2+2 is 4, it is an atomic proposition as it is a true fact.
2. "The Sun is cold" is also a proposition as it is a false fact.

• Simpler or atomic statements are combined with parenthesis


and logical connectives to form compound propositions.
Compound
Example:
Propositions
1. "It is raining today, and street is wet."
2. "Ankit is a doctor, and his clinic is in Mumbai."

22
MIT School of Computing
Department of Computer Science & Engineering

PROPOSITIONAL LOGIC: LOGICAL CONNECTIVES

• Used to link two simpler ideas or to represent a statement logically.


• Can form compound assertions.
• Five primary connectives.

Ram can play tennis (let’s take it as variable X)

• 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

PROPOSITIONAL LOGIC: LOGICAL CONNECTIVES

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.

Negation Conjunction Disjunction Implication Bi-conditional


P Q
¬P ¬Q P^Q PvQ P→Q P⇔Q

True True False False True True True True

True False False True False True False False

False True True False False True True False

False False True True False False True True

24
MIT School of Computing
Department of Computer Science & Engineering

PROPOSITIONAL LOGIC: PROPERTIES OF OPERATORS

Commutativity: Associativity:
P ∧ Q= Q ∧ P, or (P ∧ Q) ∧ R = P ∧ (Q ∧ R),
P ∨ Q = Q ∨ P. (P ∨ Q) ∨ R= P ∨ (Q ∨ R).

Identity element: Distributive:


P ∧ True = P, P ∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
P ∨ True= True. P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ 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

PROPOSITIONAL LOGIC: LIMITATIONS

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

• The expressive power of propositional logic is restricted.

• We can't explain propositions in propositional logic in terms of their qualities or logical


relationships

26
MIT School of Computing
Department of Computer Science & Engineering

FIRST ORDER LOGIC

Propositional Logic is failed to represent complicated phrases or natural language statements.

"Some humans are intelligent"


PL logic is insufficient to represent. we required some more powerful logic, such as first-order
logic.

FOL is also called predicate logic.

First-order logic is another method of knowledge representation. It is a variant of propositional


logic.

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

FIRST ORDER LOGIC


First-order logic also has two main parts as a natural language:
(i) Syntax (ii) Semantics

Syntax of FOL determines which set of symbols represents a logical expression.

28
MIT School of Computing
Department of Computer Science & Engineering

FIRST ORDER LOGIC: ATOMIC SENTENCES

• 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

FIRST ORDER LOGIC: COMPLEX SENTENCES

Connectives are used to join atomic sentences to form complex sentences.

Divided into two parts:


• Subject: The major component of the sentence is the subject.
• Predicate: A predicate is a relationship that ties two atoms together in a sentence.

Example: "x is an integer."

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.

There are two types of quantifiers:


• Universal quantifier: for all, everyone, everything.
• Existential quantifier: for some, at least one.

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

If x is a variable, then ∀ x can read as:

• For all x
• For every x
• For each x

32
MIT School of Computing
Department of Computer Science & Engineering

FIRST ORDER LOGIC: UNIVERSAL QUANTIFIERS

Example: Every Student Likes Educative.

Explanation:

In logical notation, it can be written as:

∀ x student(x) → likes(x, Educative)

This can be interpreted as: There is every x


where x is a student who likes Educative.

33
MIT School of Computing
Department of Computer Science & Engineering

FIRST ORDER LOGIC: EXISTENTIAL QUANTIFIERS

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.

If x is a variable, the existential quantifier will be ∃ x:

• For some x
• There exists an x
• For at least one x

34
FIRST ORDER LOGIC: EXISTENTIAL QUANTIFIERS

Example: Some people like Football.

Explanation:

In logical notation, it can be written as:

∃ x: people(x) ∧ likes Football(x)

It can be interpreted as: There are some x


where x is people who like football.

35
MIT School of Computing
Department of Computer Science & Engineering

EXAMPLE

All birds fly.


The predicate in this question is "fly(bird)."
Because all birds are able to fly, it will be portrayed as follows.
∀ x bird(x) →fly(x).

Every man respects his parent.


The predicate in this question is "respect(x, y)," where x=man, and y= parent.
Because there is every man so will use ∀, and it will be portrayed as follows:
∀ x man(x) → respects (x, parent).

Some boys play cricket.


In this question, the predicate is "play(x, y), " where x= boys, and y= game.
Because there are some boys so we will use ∃, and it will be portrayed as:
∃ x boys(x) ∧ play(x, cricket).

36
MIT School of Computing
Department of Computer Science & Engineering

EXAMPLE

Not all students like both Mathematics and Science.


The predicate in this question is "like(x, y)," where x= student, and y= subject.
Because there are not all students, so we will use ∀ with negation, so following portray
for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].

Only one student failed in Mathematics.


The predicate in this question is "failed(x, y)," where x= student, and y= subject.
Because there is only one student who failed in Mathematics, so we will use following
portray for this:
∃ (x) [ student(x) ∧ failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧ student(y) → ¬failed (x,
Mathematics) ] ].

37
FIRST ORDER LOGIC: FREE AND BOUND VARIABLES

Free Variable:

In a formula, a variable is said to be a free variable if it exists outside of the quantifier's


scope.

Example: ∀ x ∃(y)[P (x, y, z)], where z is a free variable.

Bound Variable:

In a formula, a variable is considered to be a bound variable if it exists within the


quantifier's scope.

Example: ∀ x, ∀ y [A (x) B( y)], here x and y are the bound variables.

38
MIT School of Computing
Department of Computer Science & Engineering

SEMANTIC NETWORK REPRESENTATION

Semantic Networks or Semantic Net is a knowledge representation technique used


for propositional information.

It is a knowledge base that represents concepts in a network and the systematic


relations between them.

It is also known as Associative Nets.

Semantic Network is a directed or undirected graph consisting of vertices.

39
MIT School of Computing
Department of Computer Science & Engineering

SEMANTIC NETWORK REPRESENTATION

Graphical notation for representing knowledge in interconnected nodes pattern.

Popular in AI and NLP tasks. It represents knowledge or supporting reasoning.

Alternative of predicate logic.

Nodes represents objects

rectangle
circle (physical) ellipse (concept) (situation)

Arcs represents relation between objects (also known as links/arrows).

Link Labels (specify relationships)

40
MIT School of Computing
Department of Computer Science & Engineering

SEMANTIC NETWORK: COMPONENTS

Consists of:
1. Nodes: Represent the object or concept.
Lexical Components 2. Links: Denoting relation between nodes.
3. Labels: Denoting particular objects & relations.

Links and nodes form a directed graph wherein the labels


Structural Component
are placed on the link and nodes.

Semantic Component Meanings related to the links and labels of nodes.

The creation of new links and nodes is permitted by


Procedural Components constructors, whereas the destructors are responsible for
the removal of links and nodes.

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

SEMANTIC NETWORK: TYPES

Semantic networks were developed initially for computers in 1956 by Richard H. R.


of the Cambridge Language Research Unit (CLRU), for machine translation of natural
languages.

Currently six types of semantic networks that enable declarative graphic


representation, which is further used to represent knowledge and support
automated systems for reasoning about the knowledge.

Definitional Networks Executable Networks

Assertional Networks Learning Networks

Implicational Networks Hybrid Networks

43
MIT School of Computing
Department of Computer Science & Engineering

SEMANTIC NETWORK: ADVANTAGES & DISADVANTAGES

Advantages Disadvantages

1. More computational time at runtime as


we need to traverse the complete network
1. It is simple and comprehensible. tree to answer some questions. It might be
2. Efficient in space requirement. possible in the worst case scenario that
3. Easily clusters related knowledge. after traversing the entire tree, we find
4. It is flexible and easy to visualize. that the solution does not exist in this
5. It is a natural representation of network
knowledge. 2. Do not have any equivalent quantifier.
6. Conveys meaning in a transparent 3. Do not have any standard definition for
manner. the link names.
4. Network representation depends on the
creator of the system.

44
SEMANTIC NETWORK: APPLICATION

In natural language processing applications like semantic parsing, word sense


disambiguation, etc.

Specialized retrieval tasks, like plagiarism detection.

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

• Devised by Marvin Minsky, 1974


• A variant of semantic networks.
• Frames - semantic net with properties
• A frame is a record like structure which consists of a collection of attributes
and its values to describe an entity in the world.
• Frames are the AI data structure which divides knowledge into
substructures by representing stereotypes/fixed situations.
• It consists of a collection of slots and slot values.
• These slots may be of any type and size. Slots have names and values
which are called facets.

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.

Frames are organized into hierarchies or network of frames.

Lower level frames can inherit information from upper level frames in network.

Nodes are connected using links viz.,


• “subc“ (links two class frames, one of which is subclass of other e.g.,
science_faculty class is ako(a kind of) of faculty class),
• “is_a“ (connects a particular instance of a class frame e.g., Renuka is_a
science_faculty)
• “a_part_of“ (connects two class frames one of which is contained in other e.g.,
faculty class is_part_of department class).
• Property link of semantic net is replaced by SLOT fields.

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

FRAME NETWORK: EXAMPLE

51
FRAME NETWORK: DETAILED REPRESENTATION

52
MIT School of Computing
Department of Computer Science & Engineering

FRAMES

• Each frame represent either a class or an instance.


• Class frame represents a general concept whereas instance frame represents a
Description

specific occurrence of the class instance.


• Class frame generally have default values which can be redefined at lower levels.
• If class frame has actual value facet then decedent frames can not modify that
value.
• Value remains unchanged for subclasses and instances.
• Suppose we want to know nationality or phone of an instance-frame13.
• These information are not given in this frame.
Inheritance

• 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

FRAME REPRESENTATION: FEATURES

Frames can support values more


naturally than semantic nets.

Frames can be easily implemented


using object-oriented programming
techniques.

Inheritance can be easily controlled.

54
FRAMES: ADVANTAGES AND DISADVANTAGES
Advantages Disadvantages

• Makes programming easier by grouping


related knowledge. • Just as with semantic nets, there are no
• Can be easily implemented using standards for defining frame-based
object oriented programming. systems (semantics).
• Expressive power, flexibility • No formal reasoning/inference
• Easy to set up slots for new properties mechanisms, not all properties of a class
and relations stereotype should be propagated to
• Easy to include default information subclasses.
and detect missing values • Frames cannot represent exceptions; by
• Inheritance is easily controlled definition, frames represent typical
• Frames are useful for simulating objects.
commonsense knowledge

55
PRODUCTION RULES

Production rules system consist of (condition, action) pairs which mean, "If condition then
action".

This system comprises


(1) set of production rules (2) rule applier
(3) working memory (4) recognize act cycle

For every input, conditions are checked from the set of a


production rule, and upon finding a suitable rule, an
action is committed.

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

• Expressed in natural language.


• Highly modular, so we can easily remove, add or modify an individual rule.

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

• Aim of Agent is to find the proper


sequence of actions which will lead
from starting state to goal state and
produce an efficient solution.
• Planning: set of actions
• Action:
• Precondition: for actions to be performed,
there is need of some preconditions
• Effect: Effect is result of action performed
• Example: Driver in real life.

60
MIT School of Computing
Department of Computer Science & Engineering

PLANNING PROBLEM IN AI

• Planning generally consists of the


following things:
• Choose the best rule
• Applying rule on the problem to get new
state
• Detect if solution is found
• Detect dead end so that new direction will
get explored

61
MIT School of Computing
Department of Computer Science & Engineering

PLANNING PROBLEM: EXAMPLE

• Take an example of an AI agent which can be coffee


maker, a printer, & mailing system. Also assume that
there are 3 people who have access to this agent.

• Suppose at the same time, all 3 users of the agent


give commands to execute 3 different tasks of coffee
making, printing and mailing

• Then as per the definition of planning, agent has to


decide the sequence of these actions.

• When a task comes to this agent, it has to decide the


sequence of actions to be taken and then according
execute those actions.

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

• Later on, this name was given other formal language.


• STRIPS is foundation for most of the language in order to express
automated planning in current use.
• ADL (Action Description Language): is an advancement of STRIPS proposed
by Pednault in 1987

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

FORWARD STATE SPACE PLANNING


What is FSSP or Progression Planner in AI?

70
MIT School of Computing
Department of Computer Science & Engineering

FORWARD STATE SPACE PLANNING


What is FSSP or Progression Planner in AI?

71
MIT School of Computing
Department of Computer Science & Engineering

FORWARD STATE SPACE PLANNING


Forward State Space Planning Example: Weather Forecasting System
• Suppose we have developed the following rules for our weather forecasting system,
Rule 1
• If we suspect temperature less than 20OC
• And there is humidity in the air
• Then there are chances of rain
Rule 2
• If Sun is behind the clouds
• And air is very cool
• Then we suspect temperature is less than 20OC
Rule 3
• If air is very high
• Then there is humidity in the air
• Now suppose we are given the following facts:
a) Sun is behind the clouds
b) Air is very heavy and cool

72
MIT School of Computing
Department of Computer Science & Engineering

FORWARD STATE SPACE PLANNING


Forward State Space Planning Example: Weather Forecasting System

73
MIT School of Computing
Department of Computer Science & Engineering

FORWARD STATE SPACE PLANNING


Forward State Space Planning Example: Weather Forecasting System

74
MIT School of Computing
Department of Computer Science & Engineering

FORWARD STATE SPACE PLANNING


Forward State Space Planning Example: Weather Forecasting System
MIT School of Computing
Department of Computer Science & Engineering

BACKWARD STATE SPACE PLANNING


What is BSSP or Regression Planner in AI?
MIT School of Computing
Department of Computer Science & Engineering

BACKWARD STATE SPACE PLANNING


Backward chaining example: We will use same example- Weather Forecasting System
Rule 1
• If we suspect temperature less than 20OC
• And there is humidity in the air
• Then there are chances of rain
Rule 2
• If Sun is behind the clouds
• And air is very cool
• Then we suspect temperature is less than 20OC
Rule 3
• If air is very high
• Then there is humidity in the air
MIT School of Computing
Department of Computer Science & Engineering

BACKWARD STATE SPACE PLANNING


Backward chaining example: We will use same example- Weather Forecasting System
MIT School of Computing
Department of Computer Science & Engineering

BACKWARD STATE SPACE PLANNING


Backward chaining example: We will use same example- Weather Forecasting System
MIT School of Computing
Department of Computer Science & Engineering

BACKWARD STATE SPACE PLANNING


Backward chaining example: We will use same example- Weather Forecasting System
MIT School of Computing
Department of Computer Science & Engineering

FORWARD CHAINING VS BACKWARD CHAINING


MIT School of Computing
Department of Computer Science & Engineering

REASONING: INTRODUCTION

Reasoning in AI refers to the process of using logical and deductive techniques to


draw conclusions, make inferences, and solve problems.

Reasoning is a fundamental aspect of AI systems as it enables them to make


intelligent decisions based on available information. It involves applying logical
rules, principles, and patterns to reach logical and informed conclusions.

82
TYPES OF REASONING

Deductive Reasoning: It involves using general rules to draw specific conclusions.


For example, if "All cats have tails" and "Whiskers is a cat," then we can deduce that
"Whiskers has a tail."

Inductive Reasoning: It involves making generalizations based on specific


observations. For instance, if we observe several cats and they all have tails, we
might conclude that "All cats have tails."

Abductive Reasoning: It involves generating the best explanation for given


evidence. For example, if a patient has a high fever and a sore throat, the doctor
might conclude that "The patient has strep throat."

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.

Example: If a customer has similar preferences to another customer who liked a


specific movie, we can recommend the same movie to the current customer.

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.

Probabilistic reasoning is a fundamental technique in AI for handling uncertainty.


Bayes' theorem provides a mathematical framework for updating probabilities
based on new evidence. This presentation explores the concept of probabilistic
reasoning and explains the application of Bayes' theorem in AI.

Example: Based on sensor data, a self-driving car can estimate the probability of an
object being a pedestrian and make decisions accordingly.

Importance: It allows AI systems to handle incomplete or noisy data, quantify


uncertainty, and make informed decisions based on available evidence.

87
MIT School of Computing
Department of Computer Science & Engineering
TYPES OF REASONING

• Reasoning is crucial for AI systems to make decisions and solve problems.


• Deductive, inductive, and abductive reasoning are common approaches.
• Rule-based reasoning, case-based reasoning, logical reasoning, and
probabilistic reasoning are widely used techniques.

88
BAYES’ THEOREM
Definition: Bayes' theorem is a fundamental concept in probabilistic reasoning,
named after the Reverend Thomas Bayes.

Formula: P(A|B) = (P(B|A) * P(A)) / P(B)

Interpretation: It calculates the probability of event A given that event B has


occurred, based on prior probabilities and the likelihood of B given A.

Components of Bayes' Theorem


Prior Probability (P(A)): The initial probability of event A before any new evidence is considered.

Likelihood (P(B|A)): The probability of observing evidence B given that event A is true.

Evidence Probability (P(B)): The probability of observing evidence B.

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

Scenario: Diagnosing a disease using Bayes' theorem.

Events: A (having the disease), B (testing positive).

Probabilities: P(A) (prior probability of having the disease), P(B|A) (likelihood of


testing positive if having the disease), P(B) (probability of testing positive).

90
EXAMPLE SCENARIO

Scenario: Diagnosing a disease using Bayes' theorem.

Events: A (having the disease), B (testing positive).

Probabilities: P(A) (prior probability of having the disease), P(B|A) (likelihood of


testing positive if having the disease), P(B) (probability of testing positive).
MIT School of Computing
Department of Computer Science & Engineering
SUBSETS OF AI

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.

Importance: Machine Learning has revolutionized various domains by enabling systems to


automatically learn and make predictions or decisions based on patterns and examples.

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.

Importance: NLP enables machines to understand and process human language,


leading to applications like virtual assistants, chatbots, and language translation.

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.

Importance: Computer Vision has numerous applications, including autonomous vehicles,


facial recognition, medical imaging analysis, and surveillance systems.

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.

Importance: Expert Systems provide specialized knowledge and decision-making capabilities,


allowing non-experts to access expert-level advice in various fields like medicine, finance, and
troubleshooting.

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.

Importance: Reinforcement Learning has applications in areas like game-playing, robotics,


and resource allocation, enabling systems to learn and adapt to dynamic environments
through continuous interaction.

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.

Importance: Genetic Algorithms have applications in optimization, scheduling, and


design problems where finding the best solution among a vast search space is
challenging.

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.

Importance: Deep Learning has revolutionized AI by achieving state-of-the-art


performance in various domains, including image recognition, natural language
processing, and speech recognition.
MIT School of Computing
Department of Computer Science & Engineering
SUMMARY AND CONCLUSION

• AI encompasses several subsets, each focusing on different


aspects of intelligence and problem-solving.
• Machine Learning, NLP, Computer Vision, Robotics, Expert
Systems, Reinforcement Learning, Data Mining, Genetic
Algorithms, and Deep Learning are some of the major subsets
within AI.
• Understanding these subsets helps in exploring their individual
applications and advancing the overall field of AI.

97

You might also like