0% found this document useful (0 votes)
16 views74 pages

Unit 2

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 74

www.acharya.ac.

in

UNIT-II
KNOWLEDGE BASED AGENTS
A knowledge-based agent is a specific form of artificial
intelligence that utilizes a stored repository of information, referred
to as a knowledge base, to arrive at decisions. This agent draws upon
its stored world knowledge, incorporating facts, methodologies, and
cognitive abilities, to draw solutions.
Architecture of a knowledge-based agent

Dept. of BCA
Click to Edit
Knowledge base
• The knowledge base acts as a repository of facts, rules, processes,
and other necessary data that the agent uses to guide its decision-
making process. The knowledge base contains data from the past
experiences of the agent as well as knowledge of the world, its
environment, and other factors the agent is trained for.
Inference engine
• The inference engine is the agent's component that applies logical
rules to the knowledge base to deduce additional information. It
Dept. of BCA
Click to Edit essentially acts as a system of logical deduction that utilizes the
contents of the knowledge base to reach decisions.
• These two components collaborate to enable the agent to observe
its environment, interpret the input, and ascertain the correct
action based on its knowledge and logical deduction capabilities.
Approaches to designing a knowledge-based agent:
There are mainly two approaches to build a knowledge-based agent:
1. 1. Declarative approach: We can create a knowledge-based agent
by initializing with an empty knowledge base and telling the agent
all the sentences with which we want to start with. This approach
is called Declarative approach.
2. 2. Procedural approach: In the procedural approach, we directly
Dept. of BCA
encode desired behavior as a program code. Which means we just
Click to Edit need to write a program that already encodes the desired behavior
or agent.
The Wumpus World in Artificial intelligence

The Wumpus world is a simple world example to illustrate the worth of


a knowledge-based agent and to represent knowledge representation. It
was inspired by a video game Hunt the Wumpus by Gregory Yob in
1973.

• The Wumpus world is a cave which has 4/4 rooms connected with passageways.
So there are total 16 rooms which are connected with each other. We have a
knowledge-based agent who will go forward in this world.
• The cave has a room with a beast which is called Wumpus, who eats anyone who
Dept. of BCA
Click to Edit
enters the room. The Wumpus can be shot by the agent, but the agent has a single
arrow.
• In the Wumpus world, there are some Pits rooms which are bottomless, and if
agent falls in Pits, then he will be stuck there forever. The exciting thing with this
cave is that in one room there is a possibility of finding a heap of gold.
• So the agent goal is to find the gold and climb out the cave without fallen into
Pits or eaten by Wumpus. The agent will get a reward if he comes out with gold,
and he will get a penalty if eaten by Wumpus or falls in the pit.
• Following is a sample diagram for representing the Wumpus world. It is showing some rooms
with Pits, one room with Wumpus and one agent at (1, 1) square location of the world.

Dept. of BCA
Click to Edit

https://thiagodnf.github.io/wumpus-world-simulator/#

https://primaryobjects.github.io/wumpus/
There are also some components which can help the
agent to navigate the cave. These components are given
as follows:

1. The rooms adjacent to the Wumpus room are smelly, so that it


would have some stench.
2. The room adjacent to PITs has a breeze, so if the agent reaches
near to PIT, then he will perceive the breeze.
Dept. of BCA
Click to Edit 3. There will be glitter in the room if and only if the room has gold.
4. The Wumpus can be killed by the agent if the agent is facing to it,
and Wumpus will emit a horrible scream which can be heard
anywhere in the cave.
• PEAS description of Wumpus world:
• To explain the Wumpus world we have given PEAS
description as below:
• Performance measure:
• +1000 reward points if the agent comes out of the cave
with the gold.
• -1000 points penalty for being eaten by the Wumpus or
Dept. of BCA falling into the pit.
Click to Edit
• -1 for each action, and -10 for using an arrow.
• The game ends if either agent dies or came out of the
cave.
• Environment:
• A 4*4 grid of rooms.
• The agent initially in room square [1, 1], facing toward the right.
• Location of Wumpus and gold are chosen randomly except the
first square [1,1].
• Each square of the cave can be a pit with probability 0.2 except
the first square.
• Actuators:
• Left turn,
Dept. of BCA
Click to Edit • Right turn
• Move forward
• Grab
• Release
• Shoot.
• Sensors:
• The agent will perceive the stench if he is in the room
adjacent to the Wumpus. (Not diagonally).
• The agent will perceive breeze if he is in the room
directly adjacent to the Pit.
• The agent will perceive the glitter in the room where the
gold is present.
• The agent will perceive the bump if he walks into a wall.
Dept. of BCA
Click to Edit • When the Wumpus is shot, it emits a
horrible scream which can be perceived anywhere in the
cave.
• These percepts can be represented as five element list, in
which we will have different indicators for each sensor.
• Exploring the Wumpus world:
• Now we will explore the Wumpus world and will determine
how the agent will find its goal by applying logical reasoning.
• Agent's First step:
• Initially, the agent is in the first room or on the square [1,1],
and we already know that this room is safe for the agent, so to
represent on the below diagram (a) that room is safe we will
add symbol OK.
• Symbol A is used to represent agent, symbol B for the breeze,
Dept. of BCA
Click to Edit G for Glitter or gold, V for the visited room, P for pits, W for
Wumpus.
• At Room [1,1] agent does not feel any breeze or any Stench
which means the adjacent squares are also OK.
Dept. of BCA
Click to Edit
Agent’s second step
• Now agent needs to move forward, so it will either
move to [1, 2], or [2,1].
• Let's suppose agent moves to the room [2, 1], at this
room agent perceives some breeze which means Pit is
around this room.
• The pit can be in [3, 1], or [2,2], so we will add symbol
P? to say that, is this Pit room?
Dept. of BCA
Click to Edit • Now agent will stop and think and will not make any
harmful move. The agent will go back to the [1, 1]
room.
• The room [1,1], and [2,1] are visited by the agent, so
we will use symbol V to represent the visited squares.
• Agent's third step:
• At the third step, now agent will move to the room [1,2]
which is OK.
• In the room [1,2] agent perceives a stench which means
there must be a Wumpus nearby.
• But Wumpus cannot be in the room [1,1] as by rules of
the game, and also not in [2,2] (Agent had not detected
Dept. of BCA
Click to Edit
any stench when he was at [2,1]).
• Therefore agent infers that Wumpus is in the room [1,3],
and in current state, there is no breeze which means in
[2,2] there is no Pit and no Wumpus.
• So it is safe, and we will mark it OK, and the agent
moves further in [2,2].
Dept. of BCA
Click to Edit
• Agent's fourth step:
• At room [2,2], here no stench and no breezes present so
let's suppose agent decides to move to [2,3]. At room
[2,3] agent perceives glitter, so it should grab the gold
and climb out of the cave.
Dept. of BCA
Click to Edit
Propositional logic in Artificial intelligence
• Propositional logic (PL) is the simplest form of logic
where all the statements are made by propositions. A
proposition is a declarative statement which is either
true or false. It is a technique of knowledge
representation in logical and mathematical form.

• Example:
Dept. of BCA
Click to Edit 1. It is Sunday.
2. The Sun rises from West (False proposition)
3. 3+3= 7(False proposition)
4. 5 is a prime number. (True proposition)
• 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 Propositions
2. Compound propositions
• Atomic Proposition: Atomic propositions are the simple
propositions. It consists of a single proposition symbol.
Dept. of BCA
Click to Edit These are the sentences which must be either true or false.
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.
• Compound proposition: Compound propositions are
constructed by combining simpler or atomic
propositions, using parenthesis and logical connectives.
• Example:
1. a) "It is raining today, and street is wet."
2. b) "Ankit is a doctor, and his clinic is in Mumbai."

Dept. of BCA
Click to Edit
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.

Dept. of BCA Example: Rohan is intelligent and hardworking. It can be written as,
Click to Edit
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 Engineer, so we can write it as P ∨ Q.
4. Implication: A sentence such as P → Q, is called an
implication. Implications are also known as if-then rules. It
can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is
represented as
P→Q
5. Biconditional: A sentence such as P⇔ Q is a
Dept. of BCA Biconditional sentence, example If I am breathing, then
Click to Edit
I am alive
P= I am breathing, Q= I am alive, it can be represented
as P ⇔ Q.
Following is the summarized table for Propositional Logic
Connectives:

Dept. of BCA
Click to Edit
Truth Table

Dept. of BCA
Click to Edit

Ex-If there is rain then the roads are wet


Ex- I will go to mall iff I have to do shopping

Logical equivalence:
Dept. of BCA
Click to Edit
Logical equivalence is one of the features of
propositional logic. Two propositions are said to be
logically equivalent if and only if the columns in the
truth table are identical to each other.
Let's take two propositions A and B, so for logical
equivalence, we can write it as A⇔B. In below truth table
we can see that column for ¬A∨ B and A→B, are
identical hence A is Equivalent to B.

Dept. of BCA
Click to Edit
Properties of Operators:
Commutativity:
P∧ Q= Q ∧ P, or
P ∨ Q = Q ∨ P.
Associativity:
(P ∧ Q) ∧ R= P ∧ (Q ∧ R),
(P ∨ Q) ∨ R= P ∨ (Q ∨ R)
Dept. of BCA
Click to Edit Identity element:
P ∧ True = P,
P ∨ True= True.
Distributive:
P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
DE Morgan's Law:
¬ (P ∧ Q) = (¬P) ∨ (¬Q)
¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
Double-negation elimination:
Dept. of BCA
Click to Edit ¬ (¬P) = P.
First-Order Logic in Artificial intelligence
• In the topic of Propositional logic, we have seen that how to
represent statements using propositional logic.
• But unfortunately, in propositional logic, we can only represent
the facts, which are either true or false.
• PL is not sufficient to represent the complex sentences or natural
language statements.
• The propositional logic has very limited expressive power.
Dept. of BCA
• Consider the following sentence, which we cannot represent
Click to Edit using PL logic.
• "Some humans are intelligent", or
• "Sachin likes cricket."
• To represent the above statements, PL logic is not sufficient, so
we required some more powerful logic, such as first-order logic.
First-Order logic:
• First-order logic is another way of knowledge
representation in artificial intelligence. It is an extension
to propositional logic.
• FOL is sufficiently expressive to represent the natural
language statements in a concise way.
• First-order logic is also known as Predicate logic or
First-order predicate logic. First-order logic is a
Dept. of BCA
Click to Edit
powerful language that develops information about the
objects in a more easy way and can also express the
relationship between those objects.
• First-order logic (like natural language) does not only
assume that the world contains facts like propositional
logic but also assumes the following things in the world:
• Objects: A, B, people, numbers, colors, wars, theories, squares, pits,
wumpus, ......
• Relations: It can be unary relation such as: red, round, is adjacent, or
n-any relation such as: the sister of, brother of, has color, comes
between
• Function: Father of, best friend, third inning of, end of, ......
• As a natural language, first-order logic also has two main parts:
• Syntax
• Semantics
• Syntax of First-Order logic:
Dept. of BCA
Click to Edit
• The syntax of FOL determines which collection of symbols is a
logical expression in first-order logic. The basic syntactic
elements of first-order logic are symbols. We write statements in
short-hand notation in FOL.
• Basic Elements of First-order logic:
• Following are the basic elements of FOL syntax:
Constant 1, 2, A, John, Mumbai, cat,....

Variables x, y, z, a, b,....

Predicates Brother, Father, >,....

Function sqrt, LeftLegOf, ....

Connectives ∧, ∨, ¬, ⇒, ⇔
Dept. of BCA
Click to Edit
Equality ==

Quantifier ∀, ∃
Atomic sentences:
• Atomic sentences are the most basic sentences of first-order
logic. These sentences are formed from a predicate symbol
followed by a parenthesis with a sequence of terms.
• First-order logic statements can be divided into two
parts:
• Subject: Subject is the main part of the statement.
• Predicate: A predicate can be defined as a relation, which
Dept. of BCA binds two atoms together in a statement.
Click to Edit
• We can represent atomic sentences as Predicate (term1,
term2, ......, term n).
• Example: Ravi and Ajay are brothers: =>
Brothers(Ravi,Ajay).
Chinky is a cat: => cat (Chinky).
Click to Edit
Complex Sentences:
• Complex sentences are made by combining atomic
sentences using connectives.
Ex-She studied hard so that she could get a scholarship.

Dept. of BCA
Click to Edit
Quantifiers in First-order logic:
• A quantifier is a language element which generates
quantification, and quantification specifies the quantity
of specimen in the universe of discourse(set of all
elements or objects)
• These are the symbols that permit to determine or
identify the range and scope of the variable in the logical
expression. There are two types of quantifier:
Dept. of BCA
Click to Edit
• Universal Quantifier, (for all, everyone, everything)
• Existential quantifier, (for some, at least one).
1. Universal Quantifier (for all, everyone, everything)
In artificial intelligence and logic, the universal quantifier is a
concept used in first-order logic to express statements that apply to
all elements within a given domain. It is denoted by the symbol "∀"
(for all). It specifies that the s
Here's an example to illustrate the use of the universal quantifier in
AI:
• Statement: "All humans are mortal."
• In first-order logic with the universal quantifier, this statement
Dept. of BCA can be represented as:
Click to Edit
• Breaking it down:
• ∀x: For all elements x,
• (Human(x) → Mortal(x)): If x is a human, then x is mortal.
2. Existential quantifier (for some, at least one).
• In artificial intelligence and logic, the existential quantifier is a
concept used in first-order logic to express statements that assert the
existence of at least one element in a given domain satisfying a
particular condition.
• It is denoted by the symbol "∃" (there exists). The existential
quantifier indicates that there is at least one individual element for
which a specified statement is true.
• Here's an example to illustrate the use of the existential quantifier in
AI:
Dept. of BCA
Click to Edit • Statement: "There exists a smart student."
• In first-order logic with the existential quantifier, this statement can
be represented as:
• Breaking it down:
• ∃x: There exists an element x,
• (Student(x) ∧ Smart(x)): Such that x is a student and x is smart.
Some Examples of FOL using quantifier:
• 1. All birds fly.
In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as follows.
∀x bird(x) →fly(x).

• 2. Every man respects his parent.


In this question, the predicate is "respect(x, y)," where x=man, and y= parent.
Since there is every man so will use ∀, and it will be represented as follows:
∀x man(x) → respects (x, parent).

• 3. Some boys play cricket.


Dept. of BCA In this question, the predicate is "play(x, y)," where x= boys, and y= game. Since there
Click to Edit are some boys so we will use ∃, and it will be represented as:
∃x boys(x) → play(x, cricket).

• 4. Not all students like both Mathematics and Science.


In this question, the predicate is "like(x, y)," where x= student, and y= subject.
Since there are not all students, so we will use ∀ with negation, so following
representation for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].
5. Only one student failed in Mathematics.
In this question, the predicate is "failed(x, y)," where x=
student, and y= subject.
Since there is only one student who failed in Mathematics,
so we will use following representation for this:
∃(x) [ student(x) → failed (x, Mathematics) ∧∀
(y) [¬(x==y) ∧ student(y) → ¬failed (x, Mathematics)] .

Dept. of BCA
Click to Edit
Propositional versus first-order inference
Aspect Propositional Logic First-Order Logic
Propositions, Variables,
Propositions (True/False
Syntax Quantifiers, Predicates,
statements)
Functions
More expressive, can
Expressiveness Limited expressiveness represent complex
relationships
Resolution, Unification,
Truth tables, Model Semantic Tableau,
Inference Methods
checking Automated Theorem
Provers
Dept. of BCA
Detailed representation of
Click to Edit Scope Declarative statements relationships, attributes, and
quantification

Knowledge representation,
Applications Basic rule-based systems expert systems, natural
language understanding

Can be computationally
Simpler and more
Complexity intensive due to handling
computationally efficient
variables and quantifiers
Rules of Inference in First order Logic
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:

Rules of Inference in Artificial intelligence


Dept. of BCA
Example:
Click to Edit

Statement-1: "If I am sleepy then I go to bed" ==> P→ Q


Statement-2: "I am sleepy" ==> P
Therefore, "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and if P is true then Q will be true.
Proof by Truth table:
Rules of Inference in Artificial intelligence

Dept. of BCA
Click to Edit
2. Modus Tollens:
The Modus Tollens rule state that if P→ Q is true and if ¬ Q is true,
then ¬ P will also true. It can be represented as:

Rules of Inference in Artificial intelligence


If it is raining, then the ground will be wet. ( 𝑃→𝑄)
The ground is not wet. ( ¬𝑄)
Dept. of BCA
Click to Edit Therefore, it is not raining. ( ¬P )
3. Universal Generalization:
If you have a statement that’s true for a specific individual “a”, like
“P(a)”, you can generalize it to that its true for all instances “For all x,
P(x)”.
Ex- Statement :” Riya topped the science test”.
Conclusion: “All students as good as Riya topped the science test.”

Dept. of BCA
Click to Edit
4. Universal Instantiation:
If you have a statement that says something is true for all instances ,
like “For all x, P(x),” and you have a specific individual “a”, you can
conclude that “P(a)” is true.
Ex- If all dogs bark, then Fido also barks.
Give: All dogs(∀x Dog(x)) bark(P(x)).
Conclusion : Fido barks (Dog(Fido)  Bark(Fido)).

Dept. of BCA
Click to Edit
5. Existential Instantiation:
If you have a statement that says something exists, like “ There exists
an x such that P(x),” and you introduce a new variable “a”, you can
conclude that “P(a)” is true.
Given: “At least one student in the class speaks German”
Inference: “ Jerry is a student in the class who speaks German”.

Dept. of BCA
6. Existential Generalisation: If you have a statement that’s
Click to Edit true for a specific individual “a”, like P(a), you can generalise it to say
that something exists for all intances or “ There exists an x such that
P(x)”.
Ex- Given- “One student scored the highest marks in the exam”
Statement-” There exists a student who scored the highest marks in the
exam”
Click to Edit

Suppose the database contains the fact parent(john, mary). If you query parent(X,
mary), Prolog uses unification to infer that X = john.
Click to Edit

In a knowledge base that stores relationships like capital(Paris, France), a


query like "What is the capital of France?" is unified with capital(X,
France) to infer that X = Paris.
Example

Consider the following phrases, which must be unified.


“Eats(x,Apple)” is an expression
“Eats(Riya,y)” is an expression.

The following is unification process:


Comparision
Expression A(“Eats(x,Apple)”) is compared to Expression B (“Eats(Riya,y)”)

Unifying variable
Dept. of BCA We unify the variable “x” in Expression A with “Riya “ in Expression B. This results
Click to Edit in the substitution x=Riya.
We also unify the variable “y’ in Expression B with the constant “Apple”. This gives
us the substitution y= Apple.

Applying Substitutions
After substitutions, Expression A becomes “Eats(Riya, Apple)”.
Expression B remains the same: “Eats(Riya, Apple)”.

Unification successful and the unified expression is “Eats(Riya, Apple)”.


Click to Edit
Click to Edit
Example of Forward Chaining:
Let’s say you have the following facts:
•Fact 1: John is a man.
•Fact 2: All men are mortal.
And the following rule:
•Rule: If someone is a man, then that person is mortal.
Forward chaining process:
•Start with the known facts: John is a man.
Click to Edit •Apply the rule: Since John is a man
(which satisfies the condition of the rule),
you can infer that John is mortal.
•Add the new fact (John is mortal) to the knowledge base.
Forward Chaining is a data driven reasoning approach
used by inference engine. It starts with given facts and
applies rules to derive new conclusions or facts from them.
The engine keeps applying the rules until it reaches a
conclusion or cannot apply any more rules. It is based on
prediction methodology. One of its examples is the
prediction of trends in the stock market.
Click to Edit
Click to Edit
example
Let's consider a rule-based system that determines whether a student is eligible
for graduation based on the completion of required courses. The system has the
following rules:

Rule 1: If a student has completed all required courses, then the student is
eligible for graduation.
Rule 2: If a student has completed Course A, Course B, and Course C, then the
student has completed all required courses.
Click to Edit

Initial facts:
Student X has completed Course A.
Student X has completed Course B.
Student X has completed Course C
Now, let's use forward chaining to determine if Student X is eligible for graduation

Step 1: Apply Rule 2

Student X has completed Course A (fact).

Student X has completed Course B (fact).

Student X has completed Course C(fact).

Since Student X has completed Course A and Course B, course C mark the fact that Student

X has completed all required courses.

Click to Edit Step 2: Apply Rule 1

Student X has completed all required courses (fact from Rule 2).

Since Student X has completed all required courses, mark the fact that Student X is eligible

for graduation.

Conclusion: Based on the forward chaining process, the system concludes that Student X is

eligible for graduation.


Click to Edit
Click to Edit
Example
In backward chaining, the reasoning process starts with a goal and works backward to
determine if the goal can be satisfied based on existing facts and rules.
Goal: Determine if Student X is eligible for graduation.

Rules:
If a student has completed all required courses, then the student is eligible for graduation.
If a student has completed Course A, Course B, and Course C, then the student has
completed all required courses.
Click to Edit
Initial facts:
Student X has completed Course A.
Student X has completed Course B.
Student X has completed Course C
Now, let's use backward chaining to determine if the goal (Student X
is eligible for graduation) can be satisfied:

Step 1: Start with the Goal


Goal: Determine if Student X is eligible for graduation.

Step 2: Apply Rule 1


Goal: Determine if Student X is eligible for graduation.
Click to Edit Apply Rule 1: The goal is satisfied if Student X has completed all
required courses.
Step 3: Apply Rule 2

Goal: Determine if Student X is eligible for graduation.

Apply Rule 2: The goal is satisfied if Student X has completed Course A, Course B, and Course C.

Step 4: Check Facts

Goal: Determine if Student X is eligible for graduation.

Check facts: Student X has completed Course A and Course B, course C

Conclusion:
Click to Edit
Based on backward chaining, the system determines that Student X is eligible for graduation because the
goal can be satisfied using Rule 2 and the available facts about Student X's completed courses.

In backward chaining, the system starts with the goal and works backward through the rules and facts to
establish whether the goal can be achieved. It's a top-down approach that begins with the final objective
and traces the path backward to the available information.
Click to Edit
Resolution in First Order Logic
In artificial intelligence and logic, resolution is a rule of inference
used for automated theorem proving in propositional and first-order
logic. The resolution rule is particularly effective in resolving
(disproving) the negation of a statement by finding a contradiction
between clauses. This process is used in logic programming,
knowledge representation, and reasoning systems.

It operates on the principle of proof-by-contradiction and plays a


Click to Edit critical role in reasoning systems by helping determine whether a
knowledge base entails a particular proposition. This algorithm
forms the foundation of many AI systems, enabling them to reason
logically and deduce new information from given facts.
• Steps for Resolution:
1. Conversion of facts into first-order logic.
2. Convert FOL statements into CNF
3. Negate the statement which needs to prove (proof by
Click to Edit
contradiction)
4. Draw resolution graph (unification).
Click to Edit
Click to Edit
Click to Edit
Truth Maintainance System
• The world of artificial Intelligence is continuously
evolving and one of the essential components that have
emerged in AI research is the Truth Maintainance
System(TMS).
• A TMS is a knowledge representation and reasoning tool
that assists AI systems in maintaining and updating their
beliefs according to the available evidence.
Click to Edit
• A TMS is designed to manage inconsistencies and
contradictions , allowing AI systems to reason with
incomplete or uncertain information.
• It achieves this by tracking dependencies between beliefs
and assumptions , enabling the system to make informed
decisions based on the current state of knowledge.
Click to Edit
Types of TMS
1. Justification Based TMS
A Justification-Based Truth Maintenance System (JTMS) is a type of Truth
Maintenance System (TMS) in AI that keeps track of the justifications (or reasons)
behind beliefs, helping maintain consistency when the system’s knowledge base evolves or
new information is introduced.
Example of JTMS:
Let’s say a reasoning system in a weather forecasting AI uses the following beliefs:
Belief 1: "It is raining."
Justification: "The ground is wet" AND "Clouds are dark."

Click to Edit 2. Assumption Based TMS


An Assumption-Based Truth Maintenance System (ATMS) is a type of Truth
Maintenance System (TMS) used in AI to manage and reason about multiple
assumptions or hypotheses simultaneously.
Example: In diagnosing a problem with a car, you might assume either "the battery is dead"
or "the fuel is low." Each assumption leads to different conclusions.
Click to Edit
Click to Edit
Here are some real-world examples of applications where a Truth Maintenance System
(TMS) is useful:
• Medical Diagnosis: In a medical expert system, the system may diagnose a disease
based on a set of symptoms and conditions. If a new symptom is introduced that
contradicts the current diagnosis, the TMS helps to retract the previous diagnosis and
suggests a new one. For instance, if the patient shows signs of both flu and malaria, but
new evidence emerges that rules out malaria (e.g., a negative test result), the system
revises its belief.
• Robotics Planning: A robot plans to navigate a room, assuming all doors are open. If
the robot discovers that one door is closed (new information), the TMS helps the robot
update its beliefs and plan accordingly by revising the initial route.
• Real-Time Strategy Games: The AI opponent in a strategy game uses TMS to track
the locations of enemy units and resources.
• Task Management: If you ask a virtual assistant to schedule a meeting, and then later
Click to Edit ask to reschedule or cancel it, the TMS ensures that the assistant updates the calendar
and forgets the old meeting time, revising its understanding of your schedule.
• Obstacle Detection: A self-driving car’s TMS might maintain knowledge about the
position of obstacles on the road. If the car detects that an obstacle has been moved or
cleared, the TMS ensures that the vehicle updates its route to avoid unnecessary
maneuvers.
• Drones: A drone might receive conflicting information from GPS and visual sensors
about its location. A TMS would allow the system to maintain its belief in the most
reliable data and adjust its understanding as more accurate information is received.
THANK YOU
Click to Edit

You might also like