0% found this document useful (0 votes)
17 views45 pages

Unit 3

The document discusses knowledge representation and reasoning in artificial intelligence, defining knowledge as a combination of information and rules. It outlines various types of knowledge, such as procedural, declarative, and meta-knowledge, and describes approaches to knowledge representation, including logical representation, semantic networks, frame representation, and production rules. Additionally, it explains the architecture of knowledge-based agents, emphasizing the importance of a knowledge base and inference engine for intelligent decision-making.

Uploaded by

tejaskhan1254
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views45 pages

Unit 3

The document discusses knowledge representation and reasoning in artificial intelligence, defining knowledge as a combination of information and rules. It outlines various types of knowledge, such as procedural, declarative, and meta-knowledge, and describes approaches to knowledge representation, including logical representation, semantic networks, frame representation, and production rules. Additionally, it explains the architecture of knowledge-based agents, emphasizing the importance of a knowledge base and inference engine for intelligent decision-making.

Uploaded by

tejaskhan1254
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

UNIT 3

KNOWLEDGE REPRESENTATION
AND REASONING

What is knowledge?

• facts, information, and skills acquired through experience or education; the theoretical or
practical understanding of a subject.
• Knowledge = information + rules

• EXAMPLE :Doctors, managers.

What is Knowledge representation?

Humans are best at understanding, reasoning, and interpreting knowledge. Human knows
things, which is knowledge and as per their knowledge they perform various actions in the
real world. But how machines do all these things comes under knowledge representation
and reasoning. Hence we can describe Knowledge representation as:

-​ Knowledge representation(KR) is the field of artificial intelligence (AI) that


representing information about the world in a form of computer system, that can
solve complex tasks, such as diagnosing a medical condition.

-​ Knowledge representation is not just storing data into some database, but it also
enables an intelligent machine to learn from that knowledge and experiences so that
it can behave intelligently like a human.

What to Represent:

Following are the kind of knowledge which needs to be represented in AI systems:

●​ Object: All the facts about objects in our world domain.


E.g., Guitar contains strings, trumpets are brass instruments.
●​ Events: Events are the actions which occur in our world.

●​ Performance: It describe behavior which involves knowledge about how to do


things.

●​ Meta-knowledge: It is knowledge about what we know.

●​ Facts: Facts are the truths about the real world and what we represent.

●​ Knowledge-Base: The central component of the knowledge-based agents is the


knowledge base. It is represented as KB. The Knowledgebase is a group of the
Sentences (Here, sentences are used as a technical term and not identical with the
English language).

Knowledge: Knowledge is awareness or familiarity gained by experiences of facts, data,


and situations.

Following are the types of knowledge in artificial intelligence:

Types of knowledge:
1)Procedural Knowledge
●​ Procedural knowledge is a type of knowledge which is responsible for knowing
how to do something.
●​ It is also known as imperative knowledge.
●​ It can be directly applied to any task.
●​ It includes rules, strategies, procedures, agendas, etc.
●​ Procedural knowledge depends on the task on which it can be applied.
●​ Example - How to drive a car?

2)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.
●​ Example - Knowing that Paris is the capital of France.

3)Meta Knowledge
●​ Meta-knowledge is knowledge about knowledge, understanding which types of
knowledge to apply in different situations.
●​ Example - Knowing when to use a specific algorithm based on the problem at hand.
- The knowledge that blood pressure is more important for diagnosing a
medical condition than eye color.

4)Heuristic Knowledge
●​ Representing knowledge of some expert in a field or subject.
●​ Heuristic knowledge is rules of thumb based on previous experiences, awareness of
approaches, and which are good to work but not guaranteed.
●​ Example - Using an educated guess to approximate a solution when time is limited.

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.
●​ Example - Understanding the hierarchy of concepts in a taxonomy or the
relationships between different entities in a semantic network.
- How various parts of a car fit together to make a car, or knowledge
structures in terms of concepts, sub concepts and objects.

AI knowledge cycle:
An Artificial intelligence system has the following components for displaying
intelligent behavior:

The above diagram is showing how an AI system can interact with the real world
and what components help it to show intelligence.

AI system has Perception component by which it retrieves information from its


environment. It can be visual, audio or another form of sensory input.

The learning component is responsible for learning from data captured by


Perception comportment.

In the complete cycle, the main components are knowledge representation and
Reasoning.
These two components are involved in showing the intelligence in machine-like
humans. These two components are independent with each other but also coupled
together.

The planning and execution depend on analysis of Knowledge representation and


reasoning.

Approaches to knowledge representation:


There are mainly four approaches to knowledge representation, which are given
below:

1. Simple relational knowledge:


●​ It is the simplest way of storing facts which uses the relational method, and
each fact about a set of the object is set out systematically in columns.
●​ This approach of knowledge representation is famous in database systems
where the relationship between different entities is represented.
●​ This approach has little opportunity for inference.

Example: The following is the simple relational knowledge representation.

2. Inheritable knowledge:
●​ In the inheritable knowledge approach, all data must be stored into a
hierarchy of classes.
●​ All classes should be arranged in a generalized form or a hierarchal manner.
●​ In this approach, we apply inheritance property.
●​ Elements inherit values from other members of a class.
●​ This approach contains inheritable knowledge which shows a relation
between instance and class, and it is called instance relation.
●​ Every individual frame can represent the collection of attributes and its
value.
●​ In this approach, objects and values are represented in Boxed nodes.
●​ We use Arrows which point from objects to their values.

Example:
3. Inferential knowledge:
●​ Inferential knowledge approach represents knowledge in the form of formal
logics.
●​ This approach can be used to derive more facts.
●​ It guaranteed correctness.
Example: She's making herself a snack, so she must be hungry.
'He's taken his coat, so it must be cold outside. '
'They're an animal lover, so I bet they love cats too. '

4. Procedural knowledge:
●​ Procedural knowledge approach uses small programs and codes which
describe how to do specific things, and how to proceed.
●​ In this approach, one important rule is used which is the If-Then rule.
●​ In this knowledge, we can use various coding languages such as LISP
language and Prolog language.
●​ We can easily represent heuristic or domain-specific knowledge using this
approach.
●​ But it is not necessary that we can represent all cases in this approach.
Example: Making a cup of tea
A procedural knowledge representation for making tea could include the steps of boiling
water, adding a tea bag, pouring the hot water into a cup, and removing the tea bag.

Techniques of knowledge representation


There are mainly four ways of knowledge representation which are given as follows:
1. Logical Representation
●​ Logical representation is a language with some concrete rules which deals with
propositions and has no ambiguity in 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 logic using syntax and semantics.

Syntax:
●​ Syntaxes are the rules which decide how we can construct legal sentences in logic.
●​ It determines which symbol we can use in knowledge representation.
●​ How to write those symbols.

2. Semantics:
●​ Semantics are the rules by which we can interpret the sentence in the logic.
●​ Semantic also involves assigning a meaning to each sentence.
●​ Logical representation can be categorised into mainly two logics:
-​ Propositional Logics
-​ Predicate logics

Advantages of logical representation:


-​ Logical representation enables us to do logical reasoning.
-​ Logical representation is the basis for the programming languages.

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:


-​ IS-A relation (Inheritance)
-​ 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 white colored.
All Mammals are animals.

In the above diagram, we have represented the different types of knowledge in the form of
nodes and arcs. Each object is connected with another object by some relation.

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

Facets: The various aspects of a slot are known as Facets. Facets are features of frames
which enable us to put constraints on the frames.

Example: IF-NEEDED facts are called when data of any particular slot is needed. A frame
may consist of any number of slots, and a slot may include any number of facets and facets
may have any number of values. A frame is also known as slot-filter knowledge
representation in artificial intelligence.

Example: 1
Let's take an example of a frame for a book
Example 2:
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:

4. Production Rules
Production rules system consists 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.

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

Knowledge agent
●​ An intelligent agent needs knowledge about the real world for taking decisions and
reasoning to act efficiently.

●​ Knowledge-based agents are those agents who have the capability of maintaining an
internal state of knowledge, reason over that knowledge, update their knowledge
after observations and take actions.

●​ These agents can represent the world with some formal representation and act
intelligently.

●​ Knowledge-based agents are composed of two main parts:


-​ Knowledge-base and
-​ Inference system.

A knowledge-based agent must able to do the following:

●​ An agent should be able to represent states, actions, etc.


●​ An agent Should be able to incorporate new percepts
●​ An agent can update the internal representation of the world
●​ An agent can deduce the internal representation of the world
●​ An agent can deduce appropriate actions.

The architecture of knowledge-based agent:


The above 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 a sentence in English). These sentences are expressed in a language
which is called a knowledge representation language. The Knowledge-base of KBA stores
facts about the world.

Why use a knowledge base?


Knowledge-base is required for updating knowledge for an agent to learn with experiences
and take action as per the knowledge.

Inference Engine(IE): It is a knowledge-based system engine used to infer new


knowledge in the system.

Actions performed by an agent


Inference System is used when we want to update some information (sentences) in
Knowledge-Based System and to know the already present information.
This mechanism is done by TELL and ASK operations.
They include inference i.e. producing new sentences from old.
Inference must accept needs when one asks a question to KB and answer should follow
from what has been Told to KB.
Agent also has a KB, which initially has some background Knowledge.
Whenever, agent program is called, it performs some actions.
Actions done by KB Agent:

●​ It TELLS what it recognizes from the environment and what it needs to know to
the knowledge base.
●​ It ASKS what actions to do? and gets answers from the knowledge base.
●​ It TELLS which action is selected , then the agent will execute that action.

Algorithm :

function KB_AGENT (percept) returns an action


KB : knowledge base
t : time ( counter initially 0)
TELL(KB, MAKE_PERCEPT_SENTENCE (percept,t) )
action = ASK(KB, MAKE_ACTION_QUERY (t) )
TELL(KB, MAKE_ACTION_SENTENCE (action,t) )
t=t+1
return action

If a percept is given, agent adds it to KB, then it will ask KB for the best action and then
tells KB that it has in fact taken that action.
--------------------------------------------------------------------------------------------
Logic
●​ One of the prime activities of the human intelligence is reasoning.
●​ The activity of reasoning involves construction, organization and manipulation of
statements to arrive at new conclusions.
●​ Thus logic can be defined as a scientific study of the process of reasoning.
●​ Logic is a formal language.
●​ Logic is basically classified in two main categories
– Propositional logic
– Predicate logic

Predicate logic
Predicate Logic deals with predicates, which are propositions, consisting of variables.

Predicate Logic - Definition

A predicate is an expression of one or more variables determined on some specific domain.


A predicate with variables can be made a proposition by either authorizing a value to the
variable or by quantifying the variable.

Predicates: Predicates are statements or propositions that can be either true or false
depending on the values of their arguments. They represent properties, relations, or
characteristics of objects.

For example, "IsHungry(x)" can be a predicate, where "x" is a variable representing an


object, and the predicate evaluates to true if that object is hungry.

Variables: Variables are symbols that can take on different values. In predicate logic,
variables are used to represent objects or entities in the domain of discourse. For example,
"x" in "IsHungry(x)" can represent any object in the domain, such as a person, animal, or
thing.

Constants: Constants are specific values that do not change. They represent particular
objects in the domain. For instance, in a knowledge base about people, "Alice" and "Bob"
might be constants representing specific individuals.

The following are some examples of predicates.


●​ Consider E(x, y) denote "x = y"
●​ Consider X(a, b, c) denote "a + b + c = 0"
●​ Consider M(x, y) denote "x is married to y."

Quantifier:
The variable of predicates is quantified by quantifiers. There are two types of quantifier in
predicate logic - Existential Quantifier and Universal Quantifier.

●​ Existential Quantifier:

If p(x) is a proposition over the universe U. Then it is denoted as ∃x p(x) and read as
"There exists at least one value in the universe of variable x such that p(x) is true. The
quantifier ∃ is called the existential quantifier.

There are several ways to write a proposition, with an existential quantifier, i.e.,

(∃x∈A)p(x) or ∃x∈A such that p (x) or (∃x)p(x) or p(x) is true for some
x ∈A.

●​ Universal Quantifier:

If p(x) is a proposition over the universe U. Then it is denoted as ∀x,p(x) and read as "For
every x∈U,p(x) is true." The quantifier ∀ is called the Universal Quantifier.

There are several ways to write a proposition, with a universal quantifier.


∀x∈A,p(x) or p(x), ∀x ∈A Or ∀x,p(x) or p(x) is true for all x ∈A.

Propositional logic

Propositional logic is a representational language that makes the assumption that the world
can be represented solely in terms of propositions that are true or false.

One of the main concerns of propositional logic is the study of rules by which new logic
variables can be produced as functions of some given logic variables.

Syntax for Propositional logic


1. Logic constants: true, false
2. Propositional atoms: indivisible propositions A,B,C,… P,Q,R.
3. Connectives: negation, conjunctive, disjunctive, implication, equivalence
4. Sentences (well-formed formulas): wff

Connectives

----------------------------------------------------------------------------------------------
-
Well-formed formulas (WFF)
A well-formed formula (WFF) in artificial intelligence (AI) is a syntactically correct
formula that uses propositional symbols, logical connectives, and parentheses.
WFFs are used in propositional logic and predicate logic.

WFF consist of atomic symbols joined with connectives.


Examples: P, P ʌ ~Q, P v Q , P -> Q

Two Normal (Canonical) Forms


All wffs can be expressed in the following two normal forms
1. CNF (Conjunctive Normal Form)

2. DNF (Disjunctive Normal Form)

Semantics for Propositional logic


Example :
Write the syntax for propositional logic -
If the road is closed, then the traffic is blocked.
“the road is closed” is represented by a proposition, P .
“then the traffic is blocked” is represented by a proposition, Q .
The sentence is represented a

Truth tables for logical connectives

Inference rule
The inference rules of propositional logic provide the means to perform logical proofs or
deductions.

What are Rules of Inference?


Rules of inference are essential tools in logic and mathematics, enabling the derivation of
conclusions from premises. They form the backbone of logical reasoning, and proof
techniques, and are extensively used in fields such as computer science, engineering, and
mathematics.

1. Modus Ponens (Law of Detachment/"The way of affirmation")


If a conditional statement (“if-then” statement) is true, and its antecedent (the “if” part) is
true, then its consequent (the “then” part) must also be true.

Form: If p → q and p, then q.

Example:

Premise: If it rains, the ground will be wet.


Premise: It is raining.
Conclusion: The ground is wet.

2. Modus Tollens (Law of Contrapositive/"The way of negation")

If a conditional statement is true, and its consequent is false, then its antecedent must also
be false.

Form: If p → q and ¬q, then ¬p.

Example:

Premise: If it rains, the ground will be wet.


Premise: The ground is not wet.
Conclusion: It is not raining.

3. Hypothetical Syllogism (Chain Rule)

If two conditional statements are true, where the consequent of the first is the antecedent of
the second, then a third conditional statement combining the antecedent of the first and the
consequent of the second is also true.

Form: If p → q and q → r, then p → r.

Example:

Premise: If it rains, the ground will be wet.


Premise: If the ground is wet, the plants will grow.
Conclusion: If it rains, the plants will grow.

4. Disjunctive Syllogism

If a disjunction (an “or” statement) is true, and one of the disjuncts (the parts of the “or”
statement) is false, then the other disjunct must be true.

Form: If p ∨ q and ¬p, then q.

Example:
Premise: It is either raining or sunny.
Premise: It is not raining.
Conclusion: It is sunny.

5. Conjunction
If two statements are true, then their conjunction (an “and” statement) is also true.

Form:If p and q, then p ∧ q.

Example:

Premise: It is raining.
Premise: It is windy.
Conclusion: It is raining and windy.

6. Simplification
If a conjunction (an “and” statement) is true, then each of its conjuncts is also true.

Form:

If p ∧ q, then p
If p ∧ q, then q

Example:

Premise: It is raining and windy.


Conclusion: It is raining.

7. Addition
If a statement is true, then the disjunction (an “or” statement) of that statement with any
other statement is also true.

Form:

If p, then p ∨ q

Example:

Premise: It is raining.
Conclusion: It is raining or sunny.

Theorem proving: forward chaining, backward chaining, resolution

●​ Forward chaining: Conflict resolution


●​ Backward chaining: Use of backtracking
Backward and forward chaining are two fundamental reasoning methods used in rule-based
systems and artificial intelligence. The primary difference lies in their approach to
problem-solving.

Forward chaining is fact-based, starts with available facts, and applies rules to derive new
information moving step-by-step toward a conclusion.

In contrast, backward chaining is goal-focused, beginning with a hypothesis or desired


outcome and working backward to identify the facts and rules needed to support it effective
for targeted problem-solving.
Examples of Forward Chaining
Forward Chaining is great for working with large datasets and adapting to changing
information.

1. Fire Alarm Systems: Sensors detect smoke or heat (facts), and rules trigger alarms or
sprinklers (conclusions).

Fact: Smoke detected.


Rule: If smoke is detected, trigger the alarm.
Action: Alarm sounds.

2. Recommendation Systems: Systems like Netflix or Amazon use user data (facts) to
apply rules and suggest products or content (conclusions).

Fact: Users watch action movies.


Rule: If a user watches action movies, recommend similar genres.
Action: Suggest action-packed films.

3. Traffic Light Control :Sensors monitor vehicle flow (facts), and rules adjust traffic
signals (conclusions).
Fact: High traffic detected on Road A.
Rule: If Road A has high traffic, extend the green light duration.
Action: Green light on Road A stays longer.

4. Smart Home Systems: Sensors detect environmental changes (facts), and rules automate
device responses (conclusions).

Fact: Room temperature exceeds 25°C.


Rule: If the temperature is high, turn on the AC.
Action: AC activates.

Forward chaining is typically used in scenarios where data is available, and the system
needs to process all facts to reach a conclusion.

Examples of Backward Chaining


Backward Chaining is a top-down approach that evaluates whether the goal can be reached
by verifying the necessary facts and rules. It prioritizes efficiency and relevance, making it
ideal for solving specific problems with a clear goal in mind

1. Medical Diagnosis: A doctor suspects a patient has diabetes (goal) and seeks evidence to
confirm it.

Goal: Confirm diabetes.


Step 1: Check if blood sugar levels exceed thresholds.
Step 2: If not, check for symptoms like frequent urination or fatigue.
Step 3: Verify family history of diabetes.
Conclusion: If all supporting facts align, the diagnosis is confirmed.

2. Troubleshooting a Car Engine: A car won’t start (goal).

Goal: Identify the cause of failure.


Step 1: Check if the battery is dead.
Step 2: If functional, test the fuel pump.
Step 3: If fuel pump works, inspect the ignition system.
Conclusion: The root cause (e.g., faulty spark plugs) is identified.

3. Customer Support Chatbots: A user reports “payment failed” (goal).

Goal: Resolve the payment issue.


Step 1: Ask if the card details are correct.
Step 2: If yes, check for sufficient funds.
Step 3: If funds are adequate, verify payment gateway connectivity.
Conclusion: Pinpoint the issue (e.g., expired card).
4.Educational Tutoring Systems: A student answers a math problem incorrectly (goal).

Goal: Identify the knowledge gap.


Step 1: Check if the student understands the formula.
Step 2: If yes, verify arithmetic steps.
Step 3: If steps are correct, assess misinterpretation of the question.
Conclusion: The error source (e.g., miscalculation) is found.

Both methods serve distinct purposes. Forward chaining is effective for knowledge
discovery, while backward chaining excels in hypothesis validation. Choosing the right
approach depends on the problem context and the available data structure.

Let’s conclude these differences in table format:

Boolean circuit agents

A Boolean Circuit Agent in AI refers to an intelligent system that utilizes Boolean circuits
to process information, make decisions, or perform computations.
Boolean circuits are computational models made up of logic gates (AND, OR, NOT, XOR,
etc.) that take binary inputs (0s and 1s) and produce binary outputs.

Boolean Circuits:

●​ These are combinational logic circuits that compute Boolean functions.


●​ They consist of interconnected logic gates.
●​ They do not have memory (unless extended with sequential components).
Agent in AI:
●​ An agent is an entity that perceives its environment and acts upon it to achieve a
goal.
●​ Agents can be simple (reactive) or complex (learning, adaptive).

Boolean Circuit-Based AI Agent:


●​ Uses Boolean logic to represent decision-making processes.
●​ Can be implemented in hardware (e.g., FPGAs, ASICs) or software (e.g., rule-based
systems).
●​ Efficient for tasks that require fast and deterministic decisions.

Applications
●​ Digital Decision-Making: Used in robotics, automation, and embedded systems.
●​ Expert Systems: Implements rule-based AI using Boolean logic.
●​ Cryptography & Security: Used in circuit-based cryptographic protocols.
●​ Hardware AI: Optimized circuits in neuromorphic computing and logic-based AI.

Example: Boolean Circuit-Based AI Agent for Traffic Light Control


Let’s design a simple Boolean circuit agent for controlling a traffic light at an intersection
based on sensor inputs.

Inputs:
●​ V (Vehicle sensor) – 1 if a vehicle is detected at the intersection, 0 otherwise.
●​ P (Pedestrian sensor) – 1 if a pedestrian is waiting to cross, 0 otherwise.
●​ T (Timer condition) – 1 if the light has been green for a minimum time, 0 otherwise.

Outputs:
●​ G (Green Light ON)
●​ R (Red Light ON)

Boolean Logic Formulation


We define the logic for switching lights:

●​ The green light (G) stays ON if no pedestrian is waiting OR the timer has not
expired:

G=(¬P)∨(¬T)

●​ The red light (R) turns ON if a pedestrian is waiting AND the timer has expired:

R=P∧T

Boolean Circuit Implementation


The circuit consists of:
●​ NOT gates to invert P and T.
●​ AND gate for P∧T.
●​ OR gate for ¬P∨¬T

Truth Table

How It Works
●​ If no pedestrian is detected (P=0), the light stays green.
●​ If a pedestrian is waiting and the timer has expired (P=1,T=1), the light turns red.
●​ Vehicles do not directly affect the decision but will experience the light change
when a pedestrian is waiting.

Why Use a Boolean Circuit Agent?


●​ Fast Response: Logic gates operate in constant time (O(1)).
●​ Efficient in Hardware: Can be implemented using FPGAs or ASICs for real-time
decision-making.
●​ Deterministic: No need for complex machine learning models.

Here's a Boolean circuit diagram for the Traffic Light Controller using logic gates. 🚦
Circuit Components
Inputs:
●​ P (Pedestrian sensor)
●​ T (Timer condition)

Logic Gates:
●​ NOT gates to invert P and T.
●​ AND gate to compute R=P∧T.
●​ OR gate to compute G=¬P∨¬T.

Outputs:
●​ G (Green light)
●​ R (Red light)
Circuit Diagram

P ----| NOT |----\


| OR |---- G (Green Light)
T ----| NOT |----/

P ----\
| AND |---- R (Red Light)
T ----/

Explanation
1.​ The NOT gates invert P and T, ensuring that if no pedestrian is present or the timer
hasn't expired, the light stays green.
2.​ The OR gate combines ¬P and ¬T, controlling the Green Light (G).
3.​ The AND gate ensures the Red Light (R) turns on only when both P=1 and T=1.

Rule Based Systems


●​ Rule-based systems, a foundational technology in artificial intelligence (AI), have
long been instrumental in decision-making and problem-solving across various
domains.

●​ These systems operate on a set of predefined rules and logic to make decisions,
perform tasks, or derive conclusions.

●​ Despite the rise of more advanced AI methodologies, such as machine learning and
neural networks, rule-based systems remain crucial due to their transparency, ease
of use, and interpretability.

Components of a Rule-Based System


A typical rule-based system comprises several key components:

1.​ Rules: The core of the system, these are conditional statements that define the
system's behavior. A rule generally follows the format "IF condition THEN action."
For example, in an expert system for medical diagnosis, a rule might be "IF patient
has fever AND cough THEN consider flu."

2.​ Knowledge Base: This is the repository where all the rules and facts are stored. The
knowledge base is built from domain-specific knowledge and can be manually
curated or derived from expert input.

3.​ Inference Engine: The inference engine is the component that applies the rules to
the knowledge base to derive conclusions or make decisions. It interprets the rules,
processes them against the current facts or data, and determines the appropriate
actions or outputs.
4.​ Working Memory: This is a dynamic component that holds the current facts or data
being processed by the system. It is updated as the inference engine applies rules
and new information becomes available.

5.​ User Interface: In many rule-based systems, the user interface allows users to
interact with the system, input data, and receive outputs or recommendations.

How Rule-Based Systems Work?


The operation of a rule-based system involves several stages:
●​ Data Input: The system receives input data from the user or another source. This
data can range from simple numerical values to complex information like patient
symptoms or transaction records.
●​ Rule Matching: The inference engine examines the input data against the rules
stored in the knowledge base. It looks for rules whose conditions match the input
data.
●​ Rule Execution: Once a rule is matched, the inference engine executes the
corresponding action. This might involve updating the working memory, deriving
new facts, or generating an output.
●​ Conflict Resolution: In cases where multiple rules are triggered simultaneously, the
inference engine uses conflict resolution strategies to determine which rule to apply
first. Common strategies include prioritizing rules based on specificity or order of
entry.
●​ Output Generation: The system generates an output based on the executed rules.
This output can be a decision, recommendation, or another form of response. For
example, in a medical diagnosis system, the output might be a suggested treatment
plan.
Example of a Rule-Based System in Action
Consider a simplified example of a rule-based system used in a customer service chatbot:
●​ Rule 1: If the customer asks about their account balance, then retrieve and display
the current balance.
●​ Rule 2: If the customer asks about recent transactions, then retrieve and display the
last five transactions.
●​ Rule 3: If the customer asks to speak to a human agent, then transfer the chat to a
human operator.

When a customer interacts with the chatbot, the inference engine matches their query with
the appropriate rule and executes the corresponding action.
Structured Knowledge Reasoning
●​ Structured knowledge reasoning is a way of using knowledge that is organized into
structures to solve problems.

●​ It is used in artificial intelligence (AI) and can help systems understand, infer, and
act on information.

Knowledge structure
●​ Knowledge is structured when its components have logical relationships.
●​ For example, a description of the London underground system is structured by
listing stations and the connections between them.

Knowledge representation
●​ Knowledge is represented graphically using nodes and lines or arcs to show
relationships.

Reasoning
●​ Reasoning processes include comparing and contrasting, interpreting, and
generalizing.

Structured knowledge reasoning can help systems perform better predictions and
make better decisions.

Semantic Net
●​ Formalism for representing information about objects, people, concepts and specific
relationships between them.

●​ The syntax of semantic net is simple.

●​ Graphical representation of knowledge in terms of nodes and the arcs connecting


them

-​ Nodes represents objects

-​ Arcs represent links or relationships

●​ It is a network of labeled nodes and links.


-​ It’s a directed graph with nodes corresponding to concepts, facts, objects etc.
and

-​ arcs showing relation or association between two concepts.

●​ The commonly used links in semantic net are of the following types.

-​ isa → subclass of entity (e.g., child hospital is subclass of hospital)

-​ inst → particular instance of a class (e.g., India is an instance of country)

●​ prop → property link (e.g., property of dog is ‘bark)

EXAMPLE 1 : Knowledge Base:

●​ Every human, animal and bird is a living thing who breathes and eats.
●​ All birds can fly.
●​ All men and women are humans who have two legs.
●​ Cats are animals and have fur.
●​ All animals have skin and can move.
●​ Giraffe is an animal who is tall and has long legs.
●​ Parrot is a bird and is green in color.

EXAMPLE 2 : Knowledge Base:

●​ Tom is a cat.
●​ Tom caught a bird.
●​ Tom is owned by John.
●​ Tom is ginger in color.
●​ Cats like cream.
●​ The cat sat on the mat.
●​ A cat is a mammal.
●​ A bird is an animal.
●​ All mammals are animals.
●​ Mammals have fur

Inheritance

●​ Inheritance mechanism allows knowledge to be stored at the highest possible level


of abstraction which reduces the size of the knowledge base.

-​ It facilitates inferencing of information associated with semantic nets.

-​ It is a natural tool for representing taxonomically structured information and


ensures that all the members and sub-concepts of a concept share common
properties.

-​ It also helps us to maintain the consistency of the knowledge base by adding new
concepts and members of existing ones.

●​ Properties attached to a particular object (class) are to be inherited by all


subclasses and members of that class.

Property Inheritance Algorithm

●​ Input: Object, and property to be found from Semantic Net

●​ Output:Yes, if the object has the desired property else return false

●​ Procedure:

Find an object in the semantic net; Found = false;


While {(object ≠ root) OR Found } DO

{ If there is a property attribute attached with an object then


{ Found = true; Report ‘Yes’} else
object=inst(object, class) OR isa(object, class)
};
If Found = False then report ‘No’; Stop

Frames:
What Are Frames in AI?
●​ Frames are data structures used in AI to represent stereotypical situations or
scenarios.
●​ They encapsulate information about objects, events, and their interrelationships
within a particular context.
●​ Each frame consists of a set of attributes and values, forming a template for
understanding specific situations.

For instance, a "restaurant" frame might include attributes such as "menu," "waitstaff," and
"tables," each with its own set of details.
●​ Frames are designed to provide a structured way to capture the essential aspects of a
situation, facilitating easier retrieval and manipulation of information.
●​ They are akin to schemas or blueprints that organize knowledge into manageable
chunks.

Key Components of Frames:


1.​ Slots:
-​ Slots are attributes or properties of a frame.
-​ They represent the different aspects or characteristics of the frame's concept.
-​ Example: For a "Person" frame, slots might include:
●​ Name: The individual's name
●​ Age: The individual's age
●​ Occupation: The individual's profession
●​ Address: The individual's home address
2.​ Facets
-​ Facets provide additional details or constraints for slots, defining acceptable
values or specifying how slots should be used.
-​ Example: For the "Age" slot in the "Person" frame:
●​ Type: Integer
●​ Range: 0 to 120
●​ Default Value: 30
3. Default Values

-​ Default values are predefined values assigned to slots if no specific value is


provided.
-​ They offer a baseline that can be overridden with more specific information.

-​ Example: In a "Car" frame:

●​ Make: Default value could be "Unknown"


●​ Model: Default value could be "Unknown"
●​ Year: Default value could be the current year

4. Procedures:

-​ Procedures are methods or functions associated with frames that define how
the information within the frame should be processed or utilized.

-​ Example: In an "Account" frame:

-​ Procedure: CalculateInterest - A method to compute interest based on the


account balance.

Example of a Complete Frame

Let’s construct a complete frame for a "Book" in a library management system:

Frame Name: Book

1.​ Slots:
Title: "To Kill a Mockingbird"
Author: "Harper Lee"
Publication Year: 1960
SBN: "978-0-06-112008-4"
Genre: "Fiction"

2.​ Facets:
Publication Year:
Type: Integer
Range: 1450 to current year (reasonable range for publication years)
ISBN:
Format: 13-digit number

3.​ Default Values:


Genre: "Unknown" (if not specified)

4.​ Procedures:
Check Availability: A method to check if the book is currently available in the library.

Update Record: A method to update the book’s record when it is borrowed or


returned.
This frame encapsulates all necessary information about a book and provides mechanisms
to interact with that information.
Frame Network:
●​ 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
-​ ako / subc (links two class frames, one of which is subclass of other
e.g., science_faculty class is ako of faculty class),
-​ is_a / inst ( 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).
Frame Network – Example
Detailed Representation of Frame Network
Description of Frames
● Each frame represents either a class or an instance.
● Class frame represents a general concept whereas instance frame represents a 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.

Inheritance in Frames
● Suppose we want to know nationality or phone of an instance-frame
frame13 of renuka.
● These informations are not given in this frame.
● Search will start from frame13 in upward direction till we get our
answer or have reached root frame.
● The frames 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.

Conceptual Dependency formalism


●​ CD theory was developed by Schank in 1973 to 1975 to represent the meaning of
NL sentences.
– It helps in drawing inferences
– It is independent of the language
●​ CD representation of a sentence is not built using words in the sentence rather built
using conceptual primitives which give the intended meanings of words.
●​ CD provides structures and a specific set of primitives from which representation
can be built.
Primitive Acts of CD theory
● ATRANS Transfer of an abstract relationship (i.e. give)
● PTRANS Transfer of the physical location of an object (e.g., go)
● PROPEL Application of physical force to an object (e.g. push)
● MOVE Movement of a body part by its owner (e.g. kick)
● GRASP Grasping of an object by an action (e.g. throw)
● INGEST Ingesting of an object by an animal (e.g. eat)
● EXPEL Expulsion of something from the body of an animal(e.g. cry)
● MTRANS Transfer of mental information (e.g. tell)
● MBUILD Building new information out of old (e.g decide)
● SPEAK Producing of sounds (e.g. say)
● ATTEND Focusing of a sense organ toward a stimulus (e.g. listen)
Conceptual category
There are four conceptual categories
− ACT Actions {one of the CD primitives}
− PP Objects {picture producers}
− AA Modifiers of actions {action aiders}
− PA Modifiers of PP’s {picture aiders}
Example: I gave a book to the man. CD representation is as follows:

It should be noted that this representation is same for different saying with the same
meaning. For example
– I gave the man a book,
– The man got book from me,
– The book was given to man by me etc.
Few conventions
● Arrows indicate directions of dependency
● Double arrow indicates two way link between actor and action.
O – for the object case relation
R – for the recipient case relation
P – for past tense
D - destination
--------------------------------------------------------------------------------------------------------------
Reasoning Under Uncertainty:

Examples:
1.​ There are Six Tea Cups on top of the table if one falls down and how many are
remaining?
=> 5

Note Most Intelligence Systems have some degree of uncertainty associated with them.
2.​ All birds Fly !!!

Most of the birds Fly !!! ; 95% of the birds Fly !!!
Source of Uncertainty:
●​ Uncertain Inputs :
1. Missing data
2. Noisy data
3. Incomplete data
4. Unreliable data
5. Inconsistent data
6. Imprecise data
7. Guess data
8. Default data

●​ Uncertain Knowledge :
1. Multiple causes leads to multiple effects
2. Incomplete knowledge
3. Theoretical ignorance
4. Practical ignorance

●​ Uncertain Outputs :
1. Abduction, induction are uncertain
2. Default reasoning
3. Incomplete deduction inference

What's the solution for uncertainty?


Probabilistic reasoning is a way of knowledge representation where we apply the concept
of probability to indicate the uncertainty in knowledge.
Probabilistic Reasoning and Uncertainty:
Probability :
Probability can be defined as a chance that an uncertain event will occur.
It is the numerical measure of the likelihood that an event will occur.
The value of probability always remains between 0 and 1 that represent ideal
uncertainties.

Probability: the precise representation of knowledge and uncertainty


Probability theory: how to optimally update your knowledge based on new
information
Decision theory: probability theory + utility theory how to use this information to
achieve maximum expected Utility

Example: Consider again the bus schedule. What’s the utility function?

Suppose the schedule says the bus comes at 8.05 am.

Situation A- You have a class at 8.30 am.


Situation B- You have a class at 8.30 am and it’s cold and raining.
Situation C- You have a final exam at 8.30 am.

Bayes Theorem
Bayes' theorem and Bayesian networks are crucial in AI for reasoning under uncertainty,
allowing systems to update beliefs based on new evidence and make informed decisions.
Bayes' theorem is also known as Bayes' rule, Bayes' law, or Bayesian reasoning, which
determines the probability of an event with uncertain knowledge.
In probability theory, it relates the conditional probability and marginal probabilities of two
random events.
What is Bayes Theorem?
Bayes Theorem is a method of calculating conditional probability.
●​ The traditional method of calculating conditional probability (the probability that
one event occurs given the occurrence of a different event) is to use the conditional
probability formula, calculating the joint probability of event one and event two
occurring at the same time, and then dividing it by the probability of event two
occurring.
●​ However, conditional probability can also be calculated in a slightly different
fashion by using Bayes Theorem.
When calculating conditional probability with Bayes theorem, you use the following steps:
❖​ Determine the probability of condition B being true, assuming that condition A is
true.
❖​ Determine the probability of event A being true.
❖​ Multiply the two probabilities together.
❖​ Divide by the probability of event B occurring.
❖​ This means that the formula for Bayes Theorem could be expressed like this:

Where,
- P(A) and P(B) are the probabilities of events A and B also
- P(B) is never equal to zero,
- P(A|B) is the probability of event A when event B happens,
- P(B|A) is the probability of event B when A happens.

It shows the simple relationship between joint and conditional probabilities.


Here,
• P(A|B) is known as posterior, which we need to calculate, and it will be read as
Probability of hypothesis A when we have occurred an evidence B.
• P(B|A) is called the likelihood, in which we consider that hypothesis is true, then
we calculate the probability of evidence.
• P(A) is called the prior probability, probability of hypothesis before considering
the evidence
• P(B) is called marginal probability, pure probability of an evidence.
Bayesian networks:
●​ A Bayesian Network (BN) is a probabilistic graphical model that represents a set of
random variables and their conditional dependencies via a directed acyclic graph.

●​ It enormously simplified the representation of probabilistic relationships between


random variables.
●​ They can be used for a wide range of tasks including diagnostics, reasoning, causal
modeling,decision making under uncertainty, anomaly detection, automated insight
and prediction.

The nodes represent random variables.


The edges represent causal relationships.

Example: Bad weather causes traffic jams (not the opposite).


Inference: given the presence of traffic jams it is possible to estimate the probability of bad
weather.

Case Study: Medical Diagnosis Expert systems built with the help of doctors and with
statistical records. Each disease has some symptoms.
Using a Bayesian network we can infer the probability of a certain disease given the
presence of specific symptoms.
Differential diagnostic tools, like DXPlain, use the Bayesian inference decision process to
take into account symptoms or lab results and then calculate the statistical probabilities of
various diagnoses.
By combining attributes from the patient’s file with clinical expertise, external data, it
identifies potential treatment plans for a patient.
--------------------------------------------------------------------------------------------------------
Certainty Factor
The Certainty Factor (CF) is a numeric value which tells us about how likely an event or a
statement is supposed to be true.
●​ It was introduced for systems which works on AI.
●​ CF is a measure of Uncertainty.
●​ It is based on the numbers of observations.
●​ Confidence tells about how likely the statement is true or false.
Confidence can be measured in 2 ways:
1. Measure of Belief
2. Measure of Disbelief
●​ CF is always lies between in the interval 1 and -1
●​ If CF is -1 then the statement never be true
●​ +1 then the statement is always true
Measure of Belief
It is always denoted as MB[H,E], where H is Hypothesis & E is Evidence
If MB[H,E]=0 then the H is false for E
If MB[H,E]=1 then the H is True for E
It always lies between interval[0,1]
Measure of Disbelief
MD[H,E]
MD[H,E]=0, then H supports Evidence
MD[H,E]=1, then H Does not supports Evidence
MB[H,E], MD[H,E]
Formulae for CF
Multiple Evidences and single Hypothesis
• MB[H,E1 and E2 ]=MB[H,E1]+ MB[H,E2]*[1- MB[H,E1]]
• MD[H,E1 and E2 ]=MD[H,E1]+ MD[H,E2]*[1- MD[H,E1]]
• CF[H,E1 and E2]= MB[H,E1 and E2 ]- MD[H,E1 and E2 ]
Now calculate CF
If MB[H,E]=1(True) then MD[H,E]=0
CF[H,E]=1
If MB[H,E]=0(False) then MD[H,E]=1
CF[H,E]=0

EXAMPLE
FOR E1 EVIDENCE:
MB[H,E1]=0.4
MD[H,E1]=0
FOR E2 EVIDENCE:
MB[H,E21]=0.3
MD[H,E2]=0.1
MB[H,E1 and E2 ]=MB[H,E1]+ MB[H,E2]*[1- MB[H,E1]
= 0.4+0.3*(1-0.4)
=0.4+0.3*0.6
=0.58
MD[H,E1 and E2 ]=MD[H,E1]+ MD[H,E2]*[1- MD[H,E1]
= 0+0.1*(1-0)
=0.1
CF=0.58-0.1= 0.48
Dempster-Shafer theory
Dempster-Shafer Theory was given by Arthur P. Dempster in 1967 and his student Glenn
Shafer in 1976.
This theory was released because of the following reason:-
• Bayesian theory is only concerned about single evidence.
• Bayesian probability cannot describe ignorance.
• DST is an evidence theory, it combines all possible outcomes of the problem.
Hence it is used to solve problems where there may be a chance that a piece of different
evidence will lead to some different result.
The uncertainty in this model is given by:-
• Consider all possible outcomes.
• Belief will lead to belief in some possibility by bringing out some evidence. (What is this
supposed to mean?)
• Possibility will make evidence compatible with possible outcomes.
• Example: Let us consider a room where four people are present, A, B, C, and D. Suddenly
the lights go out and when the lights come back, B has been stabbed in the back by a knife,
leading to his death. No one came into the room and no one left the room. We know that B
has not committed suicide. Now we have to find out who the murderer is.
To solve these there are the following possibilities:
• Either {A} or {C} or {D} has killed him.
• Either {A, C} or {C, D} or {A, D} have killed him.
• Or the three of them have killed him i.e; {A, C, D}
• None of them have killed him {o} (let’s say).
• There will be possible evidence by which we can find the murderer by the measure of
possibility.
Using the above example we can say:
Set of possible conclusion (P): {p1, p2….pn}
where P is a set of possible conclusions and cannot be exhaustive, i.e. at least one
(p) I must be true.
(p)I must be mutually exclusive.
Power Set will contain 2n elements where n is the number of elements in the possible set.
For eg:- If P =3 { a, b, c}, then Power set is given as {o, {a}, {b}, {c}, {a, d}, {d ,c}, {a, c},
{a, c ,d }}= 2 elements.

Non Monotonic Reasoning


Monotonic means something that does not vary or change.
Example:
Sun rises in the East and sets in the West.
Non-Monotonic means something which can vary according to the situation or condition.
Non-monotonic Reasoning is the process that changes its direction or values as the
knowledge base increases.
Non-monotonic Reasoning will increase or decrease based on the condition.
Since Non-monotonic Reasoning depends on assumptions, It will change itself with
improving knowledge or facts.
Example:
Consider a bowl of water, If we put it on the stove and turn the flame on it will obviously
boil hot and as we will turn off the flame it will cool down gradually.
The definite clause logic is monotonic in the sense that anything that could be concluded
before a clause is added can still be concluded after it is added; adding knowledge does not
reduce the set of propositions that can be derived.
A logic is non-monotonic if some conclusions can be invalidated by adding more
knowledge.
The logic of definite clauses with negation as failure is non-monotonic.
Non-monotonic reasoning is useful for representing defaults.
A default is a rule that can be used unless it overridden by an exception.
Truth maintenance Systems
A truth maintenance system is a knowledge representation and reasoning system designed
to manage inconsistent and uncertain information.
It helps maintain a consistent and coherent view of the world by tracking the beliefs and
assumptions used to derive conclusions.
It is used to detect and resolve conflicts between different beliefs and assumptions.
In other words, it’s a way of ensuring that the AI system is aware of all the knowledge it
possesses and that this knowledge is valid and up-to-date.
The TMS works by keeping a record of all the beliefs or facts in the knowledge base, along
with the reasoning that led to them.
When new information is added to the knowledge base, the TMS checks to see if it is
consistent with the existing beliefs.
If it is not, the TMS identifies the conflicting beliefs and tries to resolve the inconsistency
by removing or modifying one or more of them. This process is called “belief revision.”
The TMS also keeps track of the dependencies between different beliefs.
For example, if one belief is based on another belief, the TMS will ensure that the latter
belief is still valid before accepting the former. This helps to maintain the integrity of the
knowledge base.
In practical terms, a TMS is often used in expert systems or decision-making systems,
where the accuracy and reliability of the information are critical.
It can also be used in natural language processing, where it helps to ensure that the AI
system is interpreting language correctly and consistently.

Architecture of Truth maintenance system

How does the Truth Maintenance System work?


At its core, a TMS is a set of algorithms and data structures used to represent and manage
the beliefs and assumptions of a knowledge-based system. These beliefs and assumptions
are organized into a knowledge base, represented as logical assertions that can be either
true or false.
When new information is added to the system, the TMS checks if it is consistent with the
existing knowledge base. If it is consistent, it is added to the knowledge base. If it is not
consistent, the TMS may either reject the new information or modify the existing beliefs
and assumptions to make them consistent with the new information.
When new information is added to the knowledge base, the TMS checks to see if it is
consistent with the existing beliefs. If there is a conflict, the TMS identifies the conflicting
beliefs and tries to resolve the inconsistency by removing or modifying one or more of
them. This process is called “belief revision.” To facilitate this process, the TMS also keeps
track of the dependencies between different beliefs. If one belief is based on another belief,
the TMS ensures that the latter belief is still valid before accepting the former.
Analogy:
A truth maintenance system in AI can be likened to a librarian in a library. Just as a
librarian organizes and maintains books, a truth maintenance system organizes and
maintains knowledge in an AI system. The librarian ensures that books are properly
categorized, indexed, and stored so that users can easily find and access them when needed.
Similarly, a truth maintenance system ensures that the knowledge in an AI system is
consistent, up-to-date, and can be easily accessed and used by other parts of the system.
When new information is added, the truth maintenance system updates the knowledge base
and resolves any conflicts or inconsistencies. Similarly, when new books are added to the
library, the librarian ensures that they are properly integrated into the existing collection.
Applications of Truth Maintenance Systems:
Truth maintenance systems (TMS) can have a wide range of applications in various
domains. Some of the common applications of TMS include:
●​ Expert systems: TMS can be used in expert systems to maintain the consistency of
knowledge and trace the consequences of actions taken by the system.
●​ Robotics: TMS can be used in robotics to ensure the consistency of sensor data and
trace the consequences of robot actions.
●​ Natural language processing: TMS can be used in natural language processing to
maintain consistency in the interpretation of a text and to trace the consequences of
text processing.
●​ Planning and scheduling: TMS can be used in planning and scheduling applications
to maintain consistency in the scheduling of tasks and to trace the consequences of
schedule changes.
●​ Decision support systems: TMS can be used in decision support systems to
maintain consistency in the decision-making process and to trace the consequences
of decisions.
●​ Diagnosis and troubleshooting: TMS can be used in diagnosis and troubleshooting
applications to maintain consistency in the diagnosis process and trace the
consequences of troubleshooting actions.
Benefits of the Truth Maintenance System:
●​ Consistency maintenance: TMS can ensure that the beliefs in an AI system remain
consistent even when new information is added or old information is modified. This
can help prevent contradictory beliefs from causing errors in the system.
●​ Explanation generation: TMS can generate explanations for why certain beliefs are
held or actions were taken by tracing them back to their sources. This can help
improve the transparency and accountability of AI systems.
●​ Error detection and diagnosis: TMS can detect and diagnose errors in an AI system
by tracing them back to their sources. This can help identify and correct problems in
the system.
●​ Efficient reasoning: TMS can improve the efficiency of reasoning in an AI system
by only updating beliefs and actions that are affected by new information or
changes. This can reduce the computational resources required for reasoning.
●​ Incremental learning: TMS can support incremental learning by allowing new
information to be added to the system without requiring the entire system to be
re-evaluated. This can improve the scalability and adaptability of AI systems.
Drawbacks of the Truth Maintenance System:
While there are several benefits of using a truth maintenance system (TMS) in AI, there are
also some drawbacks that should be considered. These include:
●​ Complexity: TMS can be complex to implement and maintain, especially in large and complex
AI systems. This can require significant expertise and resources, which can be a barrier to
adoption.
●​ Computational overhead: TMS can introduce additional computational overhead to the
reasoning process, which can slow down the system and increase the resources required.
●​ The overhead of explanation generation: While explanation generation can be a benefit of
TMS, it can also introduce additional computational overhead and require significant resources
to generate and store explanations for all beliefs and actions in the system.
●​ Limited applicability: TMS may not be suitable for all AI applications and may only be useful
in certain domains or problem spaces.
●​ Limited scalability: TMS may not scale well to very large or complex knowledge bases, which
can limit its usefulness in certain applications.
Overall, while TMS can be a powerful tool for maintaining consistency and traceability in
AI systems, it may not be suitable for all applications and may introduce additional
complexity and computational overhead. Therefore, careful consideration should be given
to whether or not TMS is the best approach for a given problem.
Overview of Fuzzy Logic
The term fuzzy refers to things that are not clear or are vague.
In the real world many times we encounter a situation when we can’t determine whether
the state is true or false, their fuzzy logic provides very valuable flexibility for reasoning.
In this way, we can consider the inaccuracies and uncertainties of any situation.
Fuzzy Logic is a form of many-valued logic in which the truth values of variables may be
any real number between 0 and 1, instead of just the traditional values of true or false. It is
used to deal with imprecise or uncertain information and is a mathematical method for
representing vagueness and uncertainty in decision-making.
The fundamental concept of Fuzzy Logic is the membership function, which defines the
degree of membership of an input value to a certain set or category. The membership
function is a mapping from an input value to a membership degree between 0 and 1, where
0 represents non-membership and 1 represents full membership.
Fuzzy Logic is implemented using Fuzzy Rules, which are if-then statements that express
the relationship between input variables and output variables in a fuzzy way. The output of
a Fuzzy Logic system is a fuzzy set, which is a set of membership degrees for each possible
output value.
In the boolean system truth value, 1.0 represents the absolute truth value and 0.0 represents
the absolute false value. But in the fuzzy system, there is no logic for the absolute truth and
absolute false value. But in fuzzy logic, there is an intermediate value too present which is
partially true and partially false.
ARCHITECTURE
Its Architecture contains four parts :
RULE BASE: It contains the set of rules and the IF-THEN conditions provided by the
experts to govern the decision-making system, on the basis of linguistic information.
Recent developments in fuzzy theory offer several effective methods for the design and
tuning of fuzzy controllers. Most of these developments reduce the number of fuzzy rules.
FUZZIFICATION: It is used to convert inputs i.e. crisp numbers into fuzzy sets. Crisp
inputs are basically the exact inputs measured by sensors and passed into the control
system for processing, such as temperature, pressure, rpm’s, etc.
INFERENCE ENGINE: It determines the matching degree of the current fuzzy input with
respect to each rule and decides which rules are to be fired according to the input field.
Next, the fired rules are combined to form the control actions.
DEFUZZIFICATION: It is used to convert the fuzzy sets obtained by the inference engine
into a crisp value. There are several defuzzification methods available and the best-suited
one is used with a specific expert system to reduce the error.

Application
●​ It is used in the aerospace field for altitude control of spacecraft and satellites.
●​ It has been used in the automotive system for speed control, traffic control.
●​ It is used for decision-making support systems and personal evaluation in the large
company business.
●​ It has application in the chemical industry for controlling the pH, drying, chemical
distillation process.
●​ Fuzzy logic is used in Natural language processing and various intensive
applications in Artificial Intelligence.
●​ Fuzzy logic is extensively used in modern control systems such as expert systems.
●​ Fuzzy Logic is used with Neural Networks as it mimics how a person would make
decisions, only much faster. It is done by Aggregation of data and changing it into
more meaningful data by forming partial truths as Fuzzy sets.

You might also like