AI Unit-2
AI Unit-2
Wednesday, 16 October
GIET UNIVERSITY, GUNUPUR
Adversarial Search :-
Adversarial search is a search, where we examine the problem
which arises when we try to plan ahead of the world and other
agents are planning against us.
We have studied that search strategies are only associated with a
single agent that aims to find the solution which often expressed
in the form of a sequence of actions. But there might be some
situations where more than one agent is searching for the
solution in the same search space, and this situation usually
occurs in game playing.
The environment with more than one agent is termed as multi-
agent environment, in which each agent is an opponent of other
agent and playing against each other. Each agent needs to
consider the action of other agent and effect of that action on
their performance.
So, Searches in which two or more players with conflicting goals
are trying to explore the same search space for the solution are
called adversarial searches, often known as Games.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Adversarial Search :-
Games are modeled as a Search problem and heuristic
evaluation function, and these are the two main factors which
help to model and solve games in AI.
Adversarial search is a game-playing technique where the agents
are surrounded by a competitive environment.
A conflicting goal is given to the agents (multiagent). These
agents compete with one another and try to defeat one another
in order to win the game.
Such conflicting goals give rise to the adversarial search. Here,
game-playing means discussing those games where human
intelligence and logic factor is used, excluding other factors such
as luck factor.
Tic-tac-toe, chess, checkers, etc., are such type of games where
no luck factor works, only mind works.
Mathematically, this search is based on the concept of ‘Game
Theory.’ According to game theory, a game is played between two
players. To complete the game, one has to win the game and the
other loses automatically.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Elements of Game playing search :-
To play a game, we use a game tree to know all the possible choices
and to pick the best one out a game can be defined as a type of
search in AI which can be formalized of the following elements:
So: It is the initial state from where a game begins.
PLAYER(s): It defines which player is having the current turn to
make a move in the state.
ACTIONS(s): It defines the set of legal moves to be used in a
state.
RESULT (s): It is a transition model which defines the result of a
move.
TERMINAL-TEST (s): It defines that the game has ended and
returns true.
UTILITY (s, p): It defines the final value with which the game has
ended. This function is also known as Objective function or
Payoff function. The price which the winner will get i.e.
(-1): If the PLAYER loses.
(+1): If the PLAYER wins.
(0): If there is a draw between the PLAYERS.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Types of Games in AI :-
Perfect Information: A game with the perfect information is that
in which agents can look into the complete board. Agents have all
the information about the game, and they can see each other
moves also. Examples are Chess, Checkers, Go, etc.
Imperfect Information: If in a game agents do not have all
information about the game and not aware with what's going on,
such type of games are called the game with imperfect information,
such as tic-tac- toe, Battleship, blind, Bridge, etc.
Deterministic Games: Deterministic games are those games
which follow a strict pattern and set of rules for the games, and
there is no randomness associated with them. Examples are chess,
Checkers, Go, tic-tac- toe, etc.
Non-deterministic Games: Non-deterministic are those games
which have various unpredictable events and has a factor of
chance or luck. This factor of chance or luck is introduced by
either dice or cards. These are random, and each action response
is not fixed. Such games are also called as stochastic games.
Example: Backgammon, Monopoly, Poker, etc.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Zero-Sum Game :-
Zero-sum games are adversarial search which involves pure
competition.
In Zero-sum game each agent's gain or loss of utility is exactly
balanced by the losses or gains of utility of another agent.
One player of the game try to maximize one single value, while
other player tries to minimize it.
Each move by one player in the game is called as play.
Chess and tic-tac-toe are examples of a Zero-sum game.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Zero-sum game - Embedded thinking :-
The Zero-sum game involved embedded thinking in which one
agent or player is trying to figure out:
1. What to do.
2. How to decide the move
3. Needs to think about his opponent as well
4. The opponent also thinks what to do
Each of the players is trying to find out the response of his
opponent to their actions. This requires embedded thinking or
backward reasoning to solve the game problems in AI.
Games :-
Games in AI refer to competitive environments where players
take turns to make moves, aiming to maximize their gains and
minimize losses.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Optimal Decisions in games :-
Making the best decisions is crucial while playing games since
they can affect the result and ultimately determine whether a
player wins or loses.
To make a decision that is well-informed and most likely to result
in a favorable outcome, it involves evaluating the information at
hand and utilizing a variety of decision-making tactics and
procedures.
Optimal decision-making in games is a fundamental challenge in
the field of Artificial Intelligence (AI). Various techniques and
approaches have been developed to enable AI agents to make
optimal decisions in games.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Game tree :-
A game tree is a tree where nodes of the tree are the game states
and Edges of the tree are the moves by players.
Game tree involves initial state, actions function, and result
Function.
Example: Tic-Tac-Toe game tree
Game Playing in Artificial Intelligence:
Game Playing is an important domain of artificial intelligence.
Games don’t require much knowledge; the only knowledge we need
to provide is the rules, legal moves and the conditions of winning or
losing the game.
Both players try to win the game. So, both of them try to make the
best move possible at each turn. Some searching techniques like are
not accurate for this as the branching factor is very high, so
searching will take a lot of time. So, we need another search
procedure that improve –
Generate procedure so that only good moves are generated.
Test procedure so that the best move can be explored first.
The most common search technique in game playing is
minimax search procedure.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Mini-Max Algorithm in Artificial Intelligence:-
It is also known as Optimal decision in games.
Mini-max algorithm is a recursive or backtracking algorithm which is
used in decision-making and game theory. It provides an optimal
move for the player assuming that opponent is also playing optimally.
Mini-Max algorithm uses recursion to search through the game-tree.
Min-Max algorithm is mostly used for game playing in AI. Such as
Chess, Checkers, tic-tac-toe, go, and various tow-players game. This
Algorithm computes the minimax decision for the current state.
In this algorithm two players play the game, one is called MAX and
other is called MIN.
Both the players fight it as the opponent player gets the minimum
benefit while they get the maximum benefit.
Both Players of the game are opponent of each other, where MAX will
select the maximized value and MIN will select the minimized value.
The minimax algorithm performs a depth-first search algorithm for
the exploration of the complete game tree.
The minimax algorithm proceeds all the way down to the terminal
node of the tree, then backtrack the tree as the recursion.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Working of Min-Max Algorithm:-
The working of the minimax algorithm can be easily described using
an example. Below we have taken an example of game-tree which is
representing the two-player game.
In this example, there are two players one is called Maximizer and
other is called Minimizer.
Maximizer will try to get the Maximum possible score, and Minimizer
will try to get the minimum possible score.
This algorithm applies DFS, so in this game-tree, we have to go all the
way through the leaves to reach the terminal nodes.
At the terminal node, the terminal values are given so we will compare
those value and backtrack the tree until the initial state occurs.
Following are the main steps involved in solving the two-player game
tree.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Algorithm of Min-Max Algorithm:-
Step 1: Generate the whole game tree to leaves
Step 2: Apply utility(payoff) function to leaves
Step 3: uses DFS for expanding the tree
Step 4: Back-up values from leaves toward the root:
- A max node computes the maximum value from its child node.
- A min node computes the minimum value from its child values.
Step 5: When value reaches the root: optimal move is determined.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Properties of Min-Max Algorithm:-
Complete: Yes (if tree is finite)
Optimal: Yes (against an optimal opponent)
Time complexity: O(bm)
Space complexity: O(bm) (depth-first exploration)
Limitations – Not always feasible to traverse entire tree, Time
limitations
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Alpha-beta Pruning Algorithm :-
Pruning: eliminating a branch of the search tree from
consideration without exhaustive examination of each node.
Alpha-beta pruning is an optimization technique used in
conjunction with the minimax algorithm.
It reduces the number of nodes evaluated in the game tree by
eliminating branches that are guaranteed to be suboptimal.
This technique can significantly speed up the search process
and make it feasible to search deeper into the game tree.
Alpha-beta pruning is used on top of minimax search to
detect paths that do not need to be explored.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Algorithm of Alpha-beta Pruning :-
The algorithm for alpha-beta pruning is almost same as
minimax algorithm, but while backing-up values, one
condition has to be checked, i.e. alpha>=beta, then the right
sub tree is pruned.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Imperfect real time decisions :-
Imperfect real-time decisions in AI refer to scenarios where an agent
must make decisions within a limited time, often without having
complete information or being able to calculate an optimal solution
due to time constraints. This is commonly seen in real-world
applications, especially in environments where decisions need to be
made quickly, such as in games, robotics, or autonomous vehicles.
Techniques for Imperfect Real-Time Decisions:
1. Alpha-Beta Pruning with Time Limits: Alpha-beta pruning is
commonly used in adversarial games (like chess), but in real-time
situations, time constraints limit how deep the search tree can go. The
agent stops exploring the tree when time runs out and makes a
decision based on the partial search.
2. Iterative Deepening: This approach allows an agent to search
deeper into a decision space as time permits. It starts with shallow
searches and progressively deepens until the time runs out, always
using the best move found so far.
Examples of Imperfect Real-Time Decisions: Video Games, Robotics,
Autonomous vehicles
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge and Reasoning :-
Knowledge refers to the information that an AI agent has about
the world, which it uses to make decisions and perform tasks. In
AI, knowledge is represented in a structured way to allow
machines to process it efficiently.
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
declarative sentences.
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
Wednesday, applied.
16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge and Reasoning :-
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.
Reasoning is the process of deriving new information or making
decisions based on known facts and rules. AI agents use reasoning
to draw conclusions, make predictions, or choose actions.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge and Reasoning :-
Reasoning is the process of deriving new information or making
decisions based on known facts and rules. AI agents use
reasoning to draw conclusions, make predictions, or choose
actions.
Logical agents:
Logical agents in AI are a type of intelligent agent that use
formal logic to represent knowledge about the world and reason
about it to make decisions. These agents are built on the
principles of knowledge-based systems and apply rules of logic
to derive conclusions or actions based on their knowledge.
Knowledge based agents:
An intelligent agent needs knowledge about the real world for
taking decisions and reasoning to act efficiently. Knowledge-
based agents are those agents who have the capability of
maintaining an internal state of knowledge, reason over that
knowledge, update their knowledge after observations and take
actions. These agents can represent the world with some formal
representation and act intelligently.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge and Reasoning :-
Knowledge-based agents are composed of two main parts:
- Knowledge base
- Inference system
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge and Reasoning :-
The diagram is representing a generalized architecture for a
knowledge-based agent.
The knowledge-based agent (KBA) take input from the
environment by perceiving the environment. The input is taken
by the inference engine of the agent and which also
communicate with KB to decide as per the knowledge store in
KB.
The learning element of KBA regularly updates the KB by
learning new knowledge.
Knowledge base:
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.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge and Reasoning :-
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
The inference engine is the component of the intelligent system
in artificial intelligence, which applies logical rules to the
knowledge base to infer new information from known facts.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
Knowledge representation in AI is the process of encoding
information about the world in a form that a computer system
can utilize to solve complex tasks like diagnosing a medical
condition, answering questions, or playing a game.
It involves representing objects, properties, relationships, and
rules so that an AI system can make decisions or infer new
information.
Key Elements of Knowledge Representation:
1. Objects: Entities in the world (e.g., "dog," "car").
2. Properties: Attributes or characteristics of objects (e.g., "the
dog is brown").
3. Relationships: Connections between objects (e.g., "the car is
parked in the garage").
4. Actions: Things that can be done in the world (e.g., "drive a
car," "feed the dog").
5. Events: Things that happen in the world (e.g., "a dog barks").
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
There are mainly 4 ways of knowledge representation which are
given as follows:
1. Logical Representation
2. Semantic Network Representation
3. Frame Representation
4. Production Rules
1. Logical Representation:
Logical representation means drawing a conclusion based on
various conditions. This representation lays down some
important communication rules.
It consists of precisely defined syntax and semantics which
supports the sound inference. Each sentence can be translated
into logics using syntax and semantics.
Logical representation is a language with some concrete rules
which deals with propositions and has no ambiguity
in representation.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
Syntax:
Syntaxes are the rules which decide how we can construct legal
sentences in the logic.
It determines which symbol we can use in knowledge
representation.
How to write those symbols.
Semantics:
Semantics are the rules by which we can interpret the sentence
in the logic.
Semantic also involves assigning a meaning to each sentence.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Propositional Logic :-
Introduction
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.
Examples-
1. It is Sunday.
2. The Sun rises from West (False proposition)
3. 3+3= 7(False proposition)
4. 5 is a prime number.
Basic facts about propositional logic:
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.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Propositional Logic :-
These connectives are also called logical operators.
The propositions and connectives are the basic elements of the
propositional logic.
Connectives can be said as a logical operator which connects two
sentences.
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.
A proposition formula which has both true and false values is called
a paradox
Statements which are questions, commands, or opinions are not
propositions such as "Where is Rohini", "How are you", "What is your
name", are not propositions.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Syntax of Propositional logic :-
The syntax of propositional logic defines the allowable sentences
for the knowledge representation. There are two types of
Propositions:
1. 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.
Eg- 2+2 is 4, it is an atomic proposition as it is a true fact.
"The Sun is cold" is also a proposition as it is a false fact.
2. Compound Propositions-
Compound propositions are constructed by combining simpler or
atomic propositions, using parenthesis and logical connectives.
Eg- "It is raining today, and street is wet."
"Ankit is a doctor, and his clinic is in Mumbai."
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Logical connectives :-
Logical connectives are used to connect two simpler propositions
or representing a sentence logically.
We can create compound propositions with the help of logical
connectives.
There are mainly five connectives, which are given as follows:
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.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Logical connectives :-
4. Implication: A sentence such as P → Q, is called an implication.
Implications are also known as if-then rules.
Example- 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.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Truth Table :-
• In propositional logic, we need to know the truth values of
propositions in all possible scenarios. We can combine all the
possible combination with logical connectives, and the
representation of these combinations in a tabular format is
called Truth table. Following are the truth table for all logical
connectives:
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Precedence of connectives :-
Just like arithmetic operators, there is a precedence order for
propositional connectors or logical operators. This order should
be followed while evaluating a propositional problem. Following is
the list of the precedence order for operators:
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
2. Semantic Network representation:
In Semantic networks, we can represent our knowledge in the
form of graphical networks. This network consists of nodes
representing objects and arcs which describe the relationship
between those objects.
Semantic networks can categorize the object in different forms
and can also link those objects. Semantic networks are easy to
understand and can be easily extended.
This representation consist of mainly two types of relations:
a. IS-A relation (Inheritance)
b. Kind-of-relation
Example: Following are some statements which we need to
represent in the form of nodes and arcs.
Statements- Jerry is a cat.
Jerry is a mammal
Jerry is owned by Priya.
Jerry is brown colored.
All Mammals are animal.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
In this diagram, we have represented the different type of
knowledge in the form of nodes and arcs. Each object is
connected with another object by some relation.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
3. Frame representation:
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 situations. It consists
of a collection of slots and slot values.
These slots may be of any type and sizes. Slots have names and
values which are called facets.
Frames are derived from semantic networks and later evolved
into our modern-day classes and objects. A single frame is not
much useful. Frames system consist of a collection of frames
which are connected.
Example:
Let's suppose we are taking an entity, Peter. Peter is an engineer
as a profession, and his age is 25, he lives in city London, and
the country is England. So following is the frame representation
for this:
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
4. Production rules:
Production rules system consist of (condition, action) pairs
which mean, "If condition then action". It has mainly three
parts:
• The set of production rules
• Working Memory
• The recognize-act-cycle
In production rules agent checks for the condition and if the
condition exists then production rule fires and corresponding
action is carried out.
The condition part of the rule determines which rule may be
applied to a problem. And the action part carries out the
associated problem-solving steps. This complete process is
called a recognize-act cycle.
The working memory contains the description of the current
state of problems-solving and rule can write knowledge to the
working memory. This knowledge match and may fire other
rules.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Knowledge representation in AI :-
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 these
sets, and it is called a conflict resolution.
Example:
IF (at bus stop AND bus arrives) THEN action (get into the bus)
IF (on the bus AND paid AND empty seat) THEN action (sit
down).
IF (on bus AND unpaid) THEN action (pay charges).
IF (bus arrives at destination) THEN action (get down from the
bus).
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Rules of inference in AI :-
In artificial intelligence, we need intelligent computers which can
create new logic from old logic or by evidence, so generating the
conclusions from evidence and facts is termed as Inference.
Inference Rules-
Inference rules are the templates for generating valid arguments.
Inference rules are applied to derive proofs in artificial intelligence, and
the proof is a sequence of the conclusion that leads to the desired goal.
In inference rules, the implication among all the connectives plays an
important role. Following are some terminologies related to inference
rules:
Implication: It is one of the logical connectives which can be
represented as P → Q. It is a Boolean expression.
Converse: The converse of implication, which means the right-hand
side proposition goes to the left-hand side and vice-versa. It can be
written as Q → P.
Contrapositive: The negation of converse is termed as
contrapositive, and it can be represented as ¬ Q → ¬ P.
Inverse: The negation of implication is called inverse. It can be
represented as ¬ P → ¬ Q.
Wednesday, 16 October
2024 GIET UN IVERSITY, GUNUPUR
Types of inference rules :-
1. Modus Ponens: The Modus Ponens rule is one of the most
important rules of inference, and it states that if P and P → Q is
true, then we can infer that Q will be true. It can be represented
as:
Example-
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be
true.
2. Modus Tollens: The Modus Tollens rule state that if P→ Q is true
and ¬ Q is true, then ¬ P will also true. It can be represented as:
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Types of inference rules :-
Example
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P
3. Hypothetical Syllogism: The Hypothetical Syllogism rule state that
if P→R is true whenever P→Q is true, and Q→R is true. It can be
represented as the following notation:
P-> Q,Q->R then P->R
Example:
Statement-1: If you have my home key then you can unlock my
home. P→Q
Statement-2: If you can unlock my home then you can take my
money. Q→R
Conclusion: If you have my home key then you can take my money.
P→R
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Types of inference rules :-
4. Disjunctive Syllogism: The Disjunctive syllogism rule state that
if P∨Q is true, and ¬P is true, then Q will be true. It can be
represented as:
Example:
Statement-1: Today is Sunday or Monday. ==>P∨Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q
5. Addition: The Addition rule is one the common inference rule,
and it states that If P is true, then P∨Q will be true.
Example:
Statement-1: I have a vanilla ice-cream. ==> P
Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Types of inference rules :-
6. Simplification: The simplification rule state that if P∧ Q is
true, then Q or P will also be true. It can be represented as:
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Agents based on Propositional Logic :-
An AI agent that utilizes propositional logic to express its
knowledge and make decisions is known as a propositional
logic-based agent.
A straightforward form of agent, it decides what to do
depending on what it knows about the outside world.
A knowledge base, which is made up of a collection of logical
phrases or sentences, serves as a representation of the
propositional logic-based agent's knowledge.
The agent's knowledge is empty, however as it observes the
outside world, it fills it with fresh data. To decide what actions
to do in response to the environment, the agent uses its
knowledge base. Depending on the logical inference it makes on
its knowledge base, the agent takes judgments.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Working of Propositional Logic-based Agent :-
A propositional logic-based agent functions by expressing its
understanding of the outside world as logical statements. The
knowledge base is initially empty, but as the agent explores the
environment, it fills it with fresh data. The agent draws new
knowledge from its knowledge base through logical inference.
Deductive or inductive reasoning can be used to draw a
conclusion.
Deductive inference is the process of inferring new information
using logical principles from already known information. The
process of generalizing from specific data to arrive at a broader
conclusion is known as inductive inference. Based on the
objectives it seeks to attain, the agent decides what course of
action to take.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR
Agents based on Propositional Logic :-
Note:
Perception, reasoning, and action are the three stages of the
agent's decision-making process. Observing the surroundings
and updating the information base are steps in the perception
process. In order to generate new information, the reasoning
stage requires using logical inference to the knowledge base.
The action phase entails choosing an action based on the
information that was gathered and the agent's objectives.
Wednesday, 16 October
2024 GIET UNIVERSITY, GUNUPUR