0% found this document useful (0 votes)
25 views39 pages

Knowledge Representation in AI Systems

The document discusses knowledge representation in artificial intelligence, covering topics such as predicate logic, semantic networks, and reasoning under uncertainty. It explains the architecture of knowledge-based agents, their components like knowledge bases and inference systems, and various approaches to designing these agents. Additionally, it outlines types of knowledge, techniques for representation, and the importance of knowledge in demonstrating intelligent behavior in AI systems.

Uploaded by

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

Knowledge Representation in AI Systems

The document discusses knowledge representation in artificial intelligence, covering topics such as predicate logic, semantic networks, and reasoning under uncertainty. It explains the architecture of knowledge-based agents, their components like knowledge bases and inference systems, and various approaches to designing these agents. Additionally, it outlines types of knowledge, techniques for representation, and the importance of knowledge in demonstrating intelligent behavior in AI systems.

Uploaded by

jerako
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

UNIT-III

Representation of Knowledge: Knowledge representation issues, predicate logic- logic


programming, semantic nets- frames and inheritance, constraint propagation, representing
knowledge using rules, rules based deduction systems. Reasoning under uncertainty, review of
probability, Bayes’ probabilistic interferences and dempstershafer theory.

Knowledge-Based Agent in Artificial intelligence:


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

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 system:
Inference means deriving new sentences from old. Inference system allows us to add a new
sentence to the knowledge base. A sentence is a proposition about the world. Inference system
applies logical rules to the KB to deduce new information.
Inference system generates new facts so that an agent can update the KB. An inference system
works mainly in two rules which are given as:
 Forward chaining
 Backward chaining

Operations Performed by KBA:


Following are three operations which are performed by KBA in order to show the intelligent
behavior:
1. TELL: This operation tells the knowledge base what it perceives from the environment.
2. ASK: This operation asks the knowledge base what action it should perform.
3. Perform: It performs the selected action.

A generic knowledge-based agent:


The knowledge-based agent takes percept as input and returns an action as output. The agent
maintains the knowledge base, KB, and it initially has some background knowledge of the real
world. It also has a counter to indicate the time for the whole process, and this counter is
initialized with zero.
Each time when the function is called, it performs its three operations:
 Firstly it TELLs the KB what it perceives.
 Secondly, it asks KB what action it should take
 Third agent program TELLS the KB that which action was chosen.
The MAKE-PERCEPT-SENTENCE generates a sentence as setting that the agent perceived the
given percept at the given time.
The MAKE-ACTION-QUERY generates a sentence to ask which action should be done at the
current time.
MAKE-ACTION-SENTENCE generates a sentence which asserts that the chosen action was
executed.
Various levels of knowledge-based agent:
A knowledge-based agent can be viewed at different levels which are given below:
1. Knowledge level:
Knowledge level is the first level of knowledge-based agent, and in this level, we need to specify
what the agent knows, and what the agent goals are. With these specifications, we can fix its
behavior. For example, suppose an automated taxi agent needs to go from a station A to station
B, and he knows the way from A to B, so this comes at the knowledge level.
2. Logical level:
At this level, we understand that how the knowledge representation of knowledge is stored. At
this level, sentences are encoded into different logics. At the logical level, an encoding of
knowledge into logical sentences occurs. At the logical level we can expect to the automated taxi
agent to reach to the destination B.
3. Implementation level:
This is the physical representation of logic and knowledge. At the implementation level agent
perform actions as per logical and knowledge level. At this level, an automated taxi agent
actually implement his knowledge and logic so that he can reach to the destination.

Approaches to designing a knowledge-based agent:


There are mainly two approaches to build a knowledge-based agent:
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. Procedural approach: In the procedural approach, we directly encode desired behavior as
a program code. Which means we just need to write a program that already encodes the
desired behavior or agent.
However, in the real world, a successful agent can be built by combining both declarative and
procedural approaches, and declarative knowledge can often be compiled into more efficient
procedural code.

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 following:
 Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence
which concerned with AI agents thinking and how thinking contributes to intelligent
behavior of agents.
 It is responsible for representing information about the real world so that a computer can
understand and can utilize this knowledge to solve the complex real world problems such
as diagnosis a medical condition or communicating with humans in natural language.
 It is also a way which describes how we can represent knowledge in artificial
intelligence. 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., Guitars 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:
Following are the various types of knowledge:

1. Declarative Knowledge:
 Declarative knowledge is to know about something.
 It includes concepts, facts, and objects.
 It is also called descriptive knowledge and expressed in declarative sentences.
 It is simpler than procedural language.
2. Procedural Knowledge:
 It is also known as imperative knowledge.
 Procedural knowledge is a type of knowledge which is responsible for knowing how to
do something.
 It can be directly applied to any task.
 It includes rules, strategies, procedures, agendas, etc.
 Procedural knowledge depends on the task on which it can be applied.
3. Meta-knowledge:
 Knowledge about the other types of knowledge is called Meta-knowledge.
4. Heuristic knowledge:
 Heuristic knowledge is representing knowledge of some experts in a filed or subject.
 Heuristic knowledge is rules of thumb based on previous experiences, awareness of
approaches, and which are good to work but not guaranteed.
5. Structural knowledge:
 Structural knowledge is basic knowledge to problem-solving.
 It describes relationships between various concepts such as kind of, part of, and grouping
of something.
 It describes the relationship that exists between concepts or objects.

The relation between knowledge and intelligence:


Knowledge of real-worlds plays a vital role in intelligence and same for creating artificial
intelligence. Knowledge plays an important role in demonstrating intelligent behavior in AI
agents. An agent is only able to accurately act on some input when he has some knowledge or
experience about that input.
Let's suppose if you met some person who is speaking in a language which you don't know, then
how you will able to act on that. The same thing applies to the intelligent behavior of the agents.
As we can see in below diagram, there is one decision maker which act by sensing the
environment and using knowledge. But if the knowledge part will not present then, it cannot
display intelligent behavior.
AI knowledge cycle:
An Artificial intelligence system has the following components for displaying intelligent
behavior:
 Perception
 Learning
 Knowledge Representation and Reasoning
 Planning
 Execution

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: Let's suppose there are two statements:
a. Marcus is a man
b. All men are mortal
Then it can represent as;

∀x = man (x) ----------> mortal (x)s


man(Marcus)

4. Procedural knowledge:
 Procedural knowledge approach uses small programs and codes which describes how to
do specific things, and how to proceed.
 In this approach, one important rule is used which is 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.

Requirements for knowledge Representation system:


A good knowledge representation system must possess the following properties.
[Link] Accuracy:
KR system should have the ability to represent all kind of required knowledge.
[Link] Adequacy:
KR system should have ability to manipulate the representational structures to produce new
knowledge corresponding to existing structure.
[Link] Efficiency:
The ability to direct the inferential knowledge mechanism into the most productive directions by
storing appropriate guides.
[Link] efficiency:
The ability to acquire the new knowledge easily using automatic methods.

Techniques of knowledge representation:


There are mainly four ways of knowledge representation which are given as follows:
1. Logical Representation
2. Semantic Network Representation
3. Frame Representation
4. Production Rules
1. Logical Representation
Logical representation 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 logics using syntax and semantics.
Syntax:
 Syntaxes are the rules which decide how we can construct legal sentences in the logic.
 It determines which symbol we can use in knowledge representation.
 How to write those symbols.
Semantics:
 Semantics are the rules by which we can interpret the sentence in the logic.
 Semantic also involves assigning a meaning to each sentence.
 Logical representation can be categorised into mainly two logics:
[Link] Logics
[Link] logics
Note: We will discuss Prepositional Logics and Predicate logics in later chapters.
Advantages of logical representation:
1. Logical representation enables us to do logical reasoning.
2. Logical representation is the basis for the programming languages.
Disadvantages of logical Representation:
1. Logical representations have some restrictions and are challenging to work with.
2. Logical representation technique may not be very natural, and inference may not be so
efficient.
Note: Do not be confused with logical representation and logical reasoning as logical
representation is a representation language and reasoning is a process of thinking logically.
2. Semantic Network Representation:
Semantic networks are alternative of predicate logic for knowledge representation. In Semantic
networks, we can represent our knowledge in the form of graphical networks. This network
consists of nodes representing objects and arcs which describe the relationship between those
objects. Semantic networks can categorize the object in different forms and can also link those
objects. Semantic networks are easy to understand and can be easily extended.
 This representation consist of mainly two types of relations:
a. IS-A relation (Inheritance)
b. Kind-of-relation
Example: Following are some statements which we need to represent in the form of nodes and
arcs.
Statements:
a. Jerry is a cat.
b. Jerry is a mammal
c. Jerry is owned by Priya.
d. Jerry is brown colored.
e. All Mammals are animal.
In the above diagram, we have represented the different type of knowledge in the form of nodes
and arcs. Each object is connected with another object by some relation.
Drawbacks in Semantic representation:
1. Semantic networks take more computational time at runtime as we need to traverse the
complete network tree to answer some questions. It might be possible in the worst case
scenario that after traversing the entire tree, we find that the solution does not exist in this
network.
2. Semantic networks try to model human-like memory (Which has 1015 neurons and links)
to store the information, but in practice, it is not possible to build such a vast semantic
network.
3. These types of representations are inadequate as they do not have any equivalent
quantifier, e.g., for all, for some, none, etc.
4. Semantic networks do not have any standard definition for the link names.
5. These networks are not intelligent and depend on the creator of the system.
Advantages of Semantic network:
1. Semantic networks are a natural representation of knowledge.
2. Semantic networks convey meaning in a transparent manner.
3. These networks are simple and easily understandable.
3. Frame Representation:
A frame is a record like structure which consists of a collection of attributes and its values to
describe an entity in the world. Frames are the AI data structure which divides knowledge into
substructures by representing stereotypes situations. It consists of a collection of slots and slot
values. These slots may be of any type and sizes. Slots have names and values which are called
facets.
Facets: The various aspects of a slot is 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.
Frames are derived from semantic networks and later evolved into our modern-day classes and
objects. A single frame is not much useful. Frames system consist of a collection of frames
which are connected. In the frame, knowledge about an object or event can be stored together in
the knowledge base. The frame is a type of technology which is widely used in various
applications including Natural language processing and machine visions.
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:

Advantages of frame representation:


1. The frame knowledge representation makes the programming easier by grouping the
related data.
2. The frame representation is comparably flexible and used by many applications in AI.
3. It is very easy to add slots for new attribute and relations.
4. It is easy to include default data and to search for missing values.
5. Frame representation is easy to understand and visualize.
Disadvantages of frame representation:
1. In frame system inference mechanism is not be easily processed.
2. Inference mechanism cannot be smoothly proceeded by frame representation.
3. Frame representation has a much generalized approach.
4. Production Rules:
Production rules system consist of (condition, action) pairs which mean, "If condition then
action". It has mainly three parts:
 The set of production rules
 Working Memory
 The recognize-act-cycle
In production rules agent checks for the condition and if the condition exists then production rule
fires and corresponding action is carried out. The condition part of the rule determines which rule
may be applied to a problem. And the action part carries out the associated problem-solving
steps. This complete process is called a recognize-act cycle.
The working memory contains the description of the current state of problems-solving and rule
can write knowledge to the working memory. This knowledge match and may fire other rules.
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).
Advantages of Production rule:
1. The production rules are expressed in natural language.
2. The production rules are highly modular, so we can easily remove, add or modify an
individual rule.
Disadvantages of Production rule:
1. Production rule system does not exhibit any learning capabilities, as it does not store the
result of the problem for the future uses.
2. During the execution of the program, many rules may be active hence rule-based
production systems are inefficient.

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:
a) It is Sunday.
b) The Sun rises from West (False proposition)
c) 3+3= 7(False proposition)
d) 5 is a prime number.
Following are some basic facts about propositional logic:
 Propositional logic is also called Boolean logic as it works on 0 and 1.
 In propositional logic, we use symbolic variables to represent the logic, and we can use
any symbol for a representing a proposition, such A, B, C, P, Q, R, etc.
 Propositions can be either true or false, but it cannot be both.
 Propositional logic consists of an object, relations or function, and logical connectives.
 These connectives are also called logical operators.
 The propositions and connectives are the basic elements of the propositional logic.
 Connectives can be said as a logical operator which connects two sentences.
 A proposition formula which is always true is called tautology, and it is also called a
valid sentence.
 A proposition formula which is always false is called Contradiction.
 A proposition formula which has both true and false values is called
 Statements which are questions, commands, or opinions are not propositions such as
"Where is Rohini", "How are you", "What is your name", are not propositions.
Syntax of propositional logic:
The syntax of propositional logic defines the allowable sentences for the knowledge
representation. There are two types of Propositions:
[Link] Propositions
[Link] propositions
 Atomic Proposition: Atomic propositions are the simple propositions. It consists of a
single proposition symbol. These are the sentences which must be either true or false.
Example:
a) 2+2 is 4, it is an atomic proposition as it is a true fact.
b) "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:
a) "It is raining today, and street is wet."
b) "Ankit is a doctor, and his clinic is in Mumbai."
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

2. Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a


literal or negative literal.

conjunction.
Example: Rohan is intelligent and hardworking. It can be written as,
P=Rohan is intelligent,

3. Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called disjunction,


Q= Rohan is hardworking. → P∧ Q.

where P and Q are the propositions.

Here P= Ritika is Doctor. Q= Ritika is Doctor, so we can write it as P ∨ Q.


Example: "Ritika is a doctor or Engineer",

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 Biconditional sentence, example If I am

P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.


breathing, then I am alive
Following is the summarized table for Propositional Logic Connectives:

Truth Table:
In propositional logic, we need to know the truth values of propositions in all possible scenarios.
We can combine all the possible combination with logical connectives, and the representation of
these combinations in a tabular format is called Truth table.
Following are the truth table for all logical connectives:
Truth table with three propositions:
We can build a proposition composing three propositions P, Q, and R. This truth table is made-
up of 8n Tuples as we have taken three proposition symbols.
Precedence of connectives:
Just like arithmetic operators, there is a precedence order for propositional connectors or logical
operators. This order should be followed while evaluating a propositional problem.
Following is the list of the precedence order for operators:

as ¬R∨ Q, It can be interpreted as (¬R) ∨ Q.


Note: For better understanding use parenthesis to make sure of the correct interpretations. Such

Logical equivalence:
Logical equivalence is one of the features of propositional logic. Two propositions are said to be

Let's take two propositions A and B, so for logical equivalence, we can write it as A ⇔B. In
logically equivalent if and only if the columns in the truth table are identical to each other.

below truth table we can see that column for ¬A∨ B and A→B, are identical hence A is
Equivalent to B

Properties of Operators:

 P∧ Q= Q ∧ P, or
 Commutativity:

 P ∨ Q = Q ∨ P.

 (P ∧ Q) ∧ R= P ∧ (Q ∧ R),
 Associativity:

 (P ∨ Q) ∨ R= P ∨ (Q ∨ R)

 P ∧ True = P,
 Identity element:

 P ∨ True= True.

 P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
 Distributive:

 P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R).
 ¬ (P ∧ Q) = (¬P) ∨ (¬Q)
 DE Morgan's Law:

 ¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
 Double-negation elimination:
 ¬ (¬P) = P.
Limitations of Propositional logic:
 We cannot represent relations like ALL, some, or none with propositional logic.
Example:
a. All the girls are intelligent.
b. Some apples are sweet.
 Propositional logic has limited expressive power.
 In propositional logic, we cannot describe statements in terms of their properties or
logical relationships.
Rules of Inference in Artificial intelligence
Inference:
In artificial intelligence, we need intelligent computers which can create new logic from old
logic or by evidence, so generating the conclusions from evidence and facts is termed as
Inference.
Inference rules:
Inference rules are the templates for generating valid arguments. Inference rules are applied to
derive proofs in artificial intelligence, and the proof is a sequence of the conclusion that leads to
the desired goal.
In inference rules, the implication among all the connectives plays an important role.
Following are some terminologies related to inference rules:
 Implication: It is one of the logical connectives which can be represented as P → Q. It is
a Boolean expression.
 Converse: The converse of implication, which means the right-hand side proposition
goes to the left-hand side and vice-versa. It can be written as Q → P.
 Contrapositive: The negation of converse is termed as contrapositive, and it can be
represented as ¬ Q → ¬ P.
 Inverse: The negation of implication is called inverse. It can be represented as ¬ P → ¬
Q.
From the above term some of the compound statements are equivalent to each other, which we
can prove using truth table:

Hence from the above truth table, we can prove that P → Q is equivalent to ¬ Q → ¬ P, and Q→
P is equivalent to ¬ P → ¬ Q.
Types of Inference rules:
1. Modus Ponens:
The Modus Ponens rule is one of the most important rules of inference, and it states that if P and
P → Q is true, then we can infer that Q will be true. It can be represented as:

Example:
Statement-1: "If I am sleepy then I go to bed" ==> P→ Q
Statement-2: "I am sleepy" ==> P
Conclusion: "I go to bed." ==> Q.
Hence, we can say that, if P→ Q is true and P is true then Q will be true.
Proof by Truth table:

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

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


Statement-2: "I do not go to the bed."==> ~Q
Statement-3: Which infers that "I am not sleepy" => ~P
Proof by Truth table:

3. Hypothetical Syllogism:
The Hypothetical Syllogism rule state that if P→R is true whenever P→Q is true, and Q→R is
true. It can be represented as the following notation:
Example:
Statement-1: If you have my home key then you can unlock my home. P→Q
Statement-2: If you can unlock my home then you can take my money. Q→R
Conclusion: If you have my home key then you can take my money. P→R
Proof by truth table:
4. Disjunctive Syllogism:
The Disjunctive syllogism rule state that if P∨Q is true, and ¬P is true, then Q will be true. It can
be represented as:

Example:
Statement-1: Today is Sunday or Monday. ==>P∨Q
Statement-2: Today is not Sunday. ==> ¬P
Conclusion: Today is Monday. ==> Q
Proof by truth-table:

5. Addition:
The Addition rule is one the common inference rule, and it states that If P is true, then P∨Q will
be true.

Example:
Statement: I have a vanilla ice-cream. ==> P
Statement-2: I have Chocolate ice-cream.
Conclusion: I have vanilla or chocolate ice-cream. ==> (P∨Q)
Proof by Truth-Table:

6. Simplification:
The simplification rule state that if P∧ Q is true, then Q or P will also be true. It can be
represented as:

Proof by Truth-Table:

7. Resolution:
The Resolution rule state that if P∨Q and ¬ P∧R is true, then Q∨R will also be true. It can be
represented as

Proof by Truth-Table:

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. Consider the
following sentence, which we cannot represent 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 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:
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:

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.
 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).
Complex Sentences:
 Complex sentences are made by combining atomic sentences using connectives.
 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 binds two atoms
together in a statement.
 Consider the statement: "x is an integer.", it consists of two parts, the first part
x is the subject of the statement and second part "is an integer," is known as a
predicate.
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.
 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:
 Universal Quantifier, (for all, everyone, everything)
 Existential quantifier, (for some, at least one).
Universal Quantifier:
 Universal quantifier is a symbol of logical representation, which specifies that the
statement within its range is true for everything or every instance of a particular thing.
 The Universal quantifier is represented by a symbol ∀, which resembles an inverted A.
 Note: In universal quantifier we use implication "→".
 If x is a variable, then ∀x is read as:
 For all x
 For each x
 For every x.
Example:
All man drink coffee.
 Let a variable x which refers to a cat so all x can be represented in UOD as below:

∀x man(x) → drink (x, coffee).


 It will be read as: There are all x where x is a man who drink coffee.
Existential Quantifier:
 Existential quantifiers are the type of quantifiers, which express that the statement within
its scope is true for at least one instance of something.
 It is denoted by the logical operator ∃, which resembles as inverted E. When it is used
with a predicate variable then it is called as an existential quantifier.
 Note: In Existential quantifier we always use AND or Conjunction symbol (∧).
 If x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:
 There exists a 'x.'
 For some 'x.'
 For at least one 'x.'
Example:
Some boys are intelligent.

∃x: boys(x) ∧ intelligent(x)


 It will be read as: There are some x where x is a boy who is intelligent.
Points to remember:
 The main connective for universal quantifier ∀ is implication →.
 The main connective for existential quantifier ∃ is and ∧.
Properties of Quantifiers:
 In universal quantifier, ∀x∀y is similar to ∀y∀x.
 In Existential quantifier, ∃x∃y is similar to ∃y∃x.
 ∃x∀y is not similar to ∀y∃x.
Some Examples of FOL using quantifier:
1. All birds fly.
In this question the predicate is "fly(bird)."

∀x bird(x) →fly(x).
And since there are all birds who fly so it will be represented as follows.

2. Every man respects his parent.

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

∀x man(x) → respects (x, parent).


3. Some boys play cricket.

boys so we will use ∃, and it will be represented as:


In this question, the predicate is "play(x, y)," where x= boys, and y= game. Since there are some

∃x boys(x) → play(x, cricket).


4. Not all students like both Mathematics and Science.

Since there are not all students, so we will use ∀ with negation, so following representation for
In this question, the predicate is "like(x, y)," where x= student, and y= subject.

¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].


this:

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

∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧ student(y) → ¬failed (x,
representation for this:

Mathematics)].
Free and Bound Variables:
The quantifiers interact with variables which appear in a suitable way. There are two types of
variables in First-order logic which are given below:
 Free Variable: A variable is said to be a free variable in a formula if it occurs outside the
scope of the quantifier.
Example: ∀x ∃(y)[P (x, y, z)], where z is a free variable.
 Bound Variable: A variable is said to be a bound variable in a formula if it occurs within
the scope of the quantifier.
Example: ∀x [A (x) B( y)], here x and y are the bound variables.

Probabilistic reasoning in Artificial intelligence:


Uncertainty:
Till now, we have learned knowledge representation using first-order logic and propositional
logic with certainty, which means we were sure about the predicates. With this knowledge
representation, we might write A→B, which means if A is true then B is true, but consider a
situation where we are not sure about whether A is true or not then we cannot express this
statement, this situation is called uncertainty.
So to represent uncertain knowledge, where we are not sure about the predicates, we need
uncertain reasoning or probabilistic reasoning.
Causes of uncertainty:
Following are some leading causes of uncertainty to occur in the real world.
1. Information occurred from unreliable sources.
2. Experimental Errors
3. Equipment fault
4. Temperature variation
5. Climate change.
Probabilistic reasoning:
Probabilistic reasoning is a way of knowledge representation where we apply the concept of
probability to indicate the uncertainty in knowledge. In probabilistic reasoning, we combine
probability theory with logic to handle the uncertainty.
 We use probability in probabilistic reasoning because it provides a way to handle the
uncertainty that is the result of someone's laziness and ignorance.
 In the real world, there are lots of scenarios, where the certainty of something is not
confirmed, such as "It will rain today," "behavior of someone for some situations," "A
match between two teams or two players." These are probable sentences for which we
can assume that it will happen but not sure about it, so here we use probabilistic
reasoning.
Need of probabilistic reasoning in AI:
 When there are unpredictable outcomes.
 When specifications or possibilities of predicates becomes too large to handle.
 When an unknown error occurs during an experiment.
In probabilistic reasoning, there are two ways to solve problems with uncertain knowledge:
 Bayes' rule
 Bayesian Statistics
Note: We will learn the above two rules in later chapters.
As probabilistic reasoning uses probability and related terms, so before understanding
probabilistic reasoning, let's understand some common terms:
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.
1. 0 ≤ P(A) ≤ 1, where P(A) is the probability of an event A.
1. P(A) = 0, indicates total uncertainty in an event A.
1. P(A) =1, indicates total certainty in an event A.
We can find the probability of an uncertain event by using the below formula.

 P(¬A) = probability of a not happening event.


 P(¬A) + P(A) = 1.
Event: Each possible outcome of a variable is called an event.
Sample space: The collection of all possible events is called sample space.
Random variables: Random variables are used to represent the events and objects in the real
world.
Prior probability: The prior probability of an event is probability computed before observing
new information.
Posterior Probability: The probability that is calculated after all evidence or information has
taken into account. It is a combination of prior probability and new information.
Conditional probability:
Conditional probability is a probability of occurring an event when another event has already
happened.
 Let's suppose, we want to calculate the event A when event B has already occurred, "the
probability of A under the conditions of B", it can be written as:

Where P(A⋀B)= Joint probability of a and B


P(B)= Marginal probability of B.
If the probability of A is given and we need to find the probability of B, then it will be given as:

It can be explained by using the below Venn diagram, where B is occurred event, so sample
space will be reduced to set B, and now we can only calculate event A when event B is already
occurred by dividing the probability of P(A⋀B) by P( B ).

Example:
In a class, there are 70% of the students who like English and 40% of the students who likes
English and mathematics, and then what is the percent of students those who like English also
like mathematics?
Solution:
Let, A is an event that a student likes Mathematics
B is an event that a student likes English.

Hence, 57% are the students who like English also like Mathematics.
Bayes' theorem in Artificial intelligence:
Bayes' theorem:
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.
 Bayes' theorem was named after the British mathematician Thomas Bayes.
The Bayesian inference is an application of Bayes' theorem, which is fundamental to
Bayesian statistics.
 It is a way to calculate the value of P(B|A) with the knowledge of P(A|B).
 Bayes' theorem allows updating the probability prediction of an event by observing new
information of the real world.
Example: If cancer corresponds to one's age then by using Bayes' theorem, we can determine the
probability of cancer more accurately with the help of age.
 Bayes' theorem can be derived using product rule and conditional probability of event A
with known event B:

1.P(A ⋀ B)= P(A|B) P(B) or


As from product rule we can write:

2.P(A ⋀ B)= P(B|A) P(A)


Similarly, the probability of event B with known event A:

Equating right hand side of both the equations, we will get:

The above equation (a) is called as Bayes' rule or Bayes' theorem. This equation is basic of
most modern AI systems for probabilistic inference.
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.
In the equation (a), in general, we can write P (B) = P(A)*P(B|Ai), hence the Bayes' rule can be
written as:

Where A1, A2, A3,........, An is a set of mutually exclusive and exhaustive events.
Applying Bayes' rule:
Bayes' rule allows us to compute the single term P(B|A) in terms of P(A|B), P( B), and P(A). This
is very useful in cases where we have a good probability of these three terms and want to
determine the fourth one. Suppose we want to perceive the effect of some unknown cause, and
want to compute that cause, then the Bayes' rule becomes:

Example-1:
Question: what is the probability that a patient has diseases meningitis with a stiff neck?
Given Data:
A doctor is aware that disease meningitis causes a patient to have a stiff neck, and it occurs 80%
of the time. He is also aware of some more facts, which are given as follows:
 The Known probability that a patient has meningitis disease is 1/30,000.
 The Known probability that a patient has a stiff neck is 2%.
Let a be the proposition that patient has stiff neck and b be the proposition that patient has
meningitis. , so we can calculate the following as:
P(a|b) = 0.8
P(b) = 1/30000
P(a)= .02

Hence, we can assume that 1 patient out of 750 patients has meningitis disease with a stiff neck.
Example-2:
Question: From a standard deck of playing cards, a single card is drawn. The probability
that the card is king is 4/52, then calculate posterior probability P(King|Face), which means
the drawn face card is a king card.
Solution:

P(king): probability that the card is King= 4/52= 1/13


P(face): probability that a card is a face card= 3/13
P(Face|King): probability of face card when we assume it is a king = 1
Putting all values in equation (i) we will get:

Application of Bayes' theorem in Artificial intelligence:


Following are some applications of Bayes' theorem:
 It is used to calculate the next step of the robot when the already executed step is given.
 Bayes' theorem is helpful in weather forecasting.
 It can solve the Monty Hall problem.
Bayesian Belief Network in artificial intelligence:
Bayesian belief network is key computer technology for dealing with probabilistic events and to
solve a problem which has uncertainty. We can define a Bayesian network as:
"A Bayesian network is a probabilistic graphical model which represents a set of variables and
their conditional dependencies using a directed acyclic graph."
It is also called a Bayes network, belief network, decision network, or Bayesian model.
Bayesian networks are probabilistic, because these networks are built from a probability
distribution, and also use probability theory for prediction and anomaly detection.
Real world applications are probabilistic in nature, and to represent the relationship between
multiple events, we need a Bayesian network. It can also be used in various tasks
including prediction, anomaly detection, diagnostics, automated insight, reasoning, time
series prediction, and decision making under uncertainty.
Bayesian Network can be used for building models from data and experts opinions, and it
consists of two parts:
 Directed Acyclic Graph
 Table of conditional probabilities.
The generalized form of Bayesian network that represents and solve decision problems under
uncertain knowledge is known as an Influence diagram.
A Bayesian network graph is made up of nodes and Arcs (directed links), where:

 Each node corresponds to the random variables, and a variable can


be continuous or discrete.
 Arc or directed arrows represent the causal relationship or conditional probabilities
between random variables. These directed links or arrows connect the pair of nodes in the
graph.
These links represent that one node directly influence the other node, and if there is no
directed link that means that nodes are independent with each other
 In the above diagram, A, B, C, and D are random variables represented by
the nodes of the network graph.
 If we are considering node B, which is connected with node A by a directed
arrow, then node A is called the parent of Node B.
 Node C is independent of node A.
Note: The Bayesian network graph does not contain any cyclic graph. Hence, it is known as
a directed acyclic graph or DAG.
The Bayesian network has mainly two components:
 Causal Component
 Actual numbers
Each node in the Bayesian network has condition probability distribution P(Xi |Parent(Xi) ),
which determines the effect of the parent on that node.
Bayesian network is based on Joint probability distribution and conditional probability. So let's
first understand the joint probability distribution:
Joint probability distribution:
If we have variables x1, x2, x3,....., xn, then the probabilities of a different combination of x1,
x2, x3.. xn, are known as Joint probability distribution.
P[x1, x2, x3,....., xn], it can be written as the following way in terms of the joint probability
distribution.
= P[x1| x2, x3,....., xn]P[x2, x3,....., xn]
= P[x1| x2, x3,....., xn]P[x2|x3,....., xn]....P[xn-1|xn]P[xn].
In general for each variable Xi, we can write the equation as:
P(Xi|Xi-1,........., X1) = P(Xi |Parents(Xi ))
Explanation of Bayesian network:
Let's understand the Bayesian network through an example by creating a directed acyclic graph:
Example: Harry installed a new burglar alarm at his home to detect burglary. The alarm reliably
responds at detecting a burglary but also responds for minor earthquakes. Harry has two
neighbors David and Sophia, who have taken a responsibility to inform Harry at work when they
hear the alarm. David always calls Harry when he hears the alarm, but sometimes he got
confused with the phone ringing and calls at that time too. On the other hand, Sophia likes to
listen to high music, so sometimes she misses to hear the alarm. Here we would like to compute
the probability of Burglary Alarm.
Problem:
Calculate the probability that alarm has sounded, but there is neither a burglary, nor an
earthquake occurred, and David and Sophia both called the Harry.
Solution:
 The Bayesian network for the above problem is given below. The network structure is
showing that burglary and earthquake is the parent node of the alarm and directly
affecting the probability of alarm's going off, but David and Sophia's calls depend on
alarm probability.
 The network is representing that our assumptions do not directly perceive the burglary
and also do not notice the minor earthquake, and they also not confer before calling.
 The conditional distributions for each node are given as conditional probabilities table or
CPT.
 Each row in the CPT must be sum to 1 because all the entries in the table represent an
exhaustive set of cases for the variable.
 In CPT, a boolean variable with k boolean parents contains 2 K probabilities. Hence, if
there are two parents, then CPT will contain 4 probability values
List of all events occurring in this network:
 Burglary (B)
 Earthquake(E)
 Alarm(A)
 David Calls(D)
 Sophia calls(S)
We can write the events of problem statement in the form of probability: P[D, S, A, B, E], can
rewrite the above probability statement using joint probability distribution:
P[D, S, A, B, E]= P[D | S, A, B, E]. P[S, A, B, E]
=P[D | S, A, B, E]. P[S | A, B, E]. P[A, B, E]
= P [D| A]. P [ S| A, B, E]. P[ A, B, E]
= P[D | A]. P[ S | A]. P[A| B, E]. P[B, E]
= P[D | A ]. P[S | A]. P[A| B, E]. P[B |E]. P[E]
Let's take the observed probability for the Burglary and earthquake component:
P(B= True) = 0.002, which is the probability of burglary.
P(B= False)= 0.998, which is the probability of no burglary.
P(E= True)= 0.001, which is the probability of a minor earthquake
P(E= False)= 0.999, Which is the probability that an earthquake not occurred.
We can provide the conditional probabilities as per the below tables:
Conditional probability table for Alarm A:
The Conditional probability of Alarm A depends on Burglar and earthquake:

Conditional probability table for David Calls:


The Conditional probability of David that he will call depends on the probability of Alarm.

Conditional probability table for Sophia Calls:


The Conditional probability of Sophia that she calls is depending on its Parent Node "Alarm."

From the formula of joint distribution, we can write the problem statement in the form of
probability distribution:
P(S, D, A, ¬B, ¬E) = P (S|A) *P (D|A)*P (A|¬B , ¬E) *P (¬B) *P (¬E).
= 0.75* 0.91* 0.001* 0.998*0.999
= 0.00068045.
Hence, a Bayesian network can answer any query about the domain by using Joint
distribution.
The semantics of Bayesian Network:
There are two ways to understand the semantics of the Bayesian network, which is given below:
1. To understand the network as the representation of the Joint probability distribution.
It is helpful to understand how to construct the network.
2. To understand the network as an encoding of a collection of conditional independence
statements.
It is helpful in designing inference procedure.

Constraint Propagation:
Artificial Intelligence (AI) encompasses a variety of methods and techniques to solve complex
problems efficiently. One such technique is constraint propagation, which plays a crucial role in
areas like scheduling, planning, and resource allocation. This article explores the concept of
constraint propagation, its significance in AI, and how it is applied in various domains.
Introduction to Constraint Propagation:
Constraint propagation is a fundamental concept in constraint satisfaction problems (CSPs). A
CSP involves variables that must be assigned values from a given domain while satisfying a set
of constraints. Constraint propagation aims to simplify these problems by reducing the domains
of variables, thereby making the search for solutions more efficient.
Key Concepts:
1. Variables: Elements that need to be assigned values.
2. Domains: Possible values that can be assigned to the variables.
3. Constraints: Rules that define permissible combinations of values for the variables.
How Constraint Propagation Works:
Constraint propagation works by iteratively narrowing down the domains of variables based on
the constraints. This process continues until no more values can be eliminated from any domain.
The primary goal is to reduce the search space and make it easier to find a solution.
Steps in Constraint Propagation:
1. Initialization: Start with the initial domains of all variables.
2. Propagation: Apply constraints to reduce the domains of variables.
3. Iteration: Repeat the propagation step until a stable state is reached, where no further
reduction is possible.
Example:
Consider a simple CSP with two variables, X and Y, each with domains {1, 2, 3}, and a
constraint X ≠ Y. Constraint propagation will iteratively reduce the domains as follows:
 If X is assigned 1, then Y cannot be 1, so Y's domain becomes {2, 3}.
 If Y is then assigned 2, X cannot be 2, so X's domain is reduced to {1, 3}.
 This process continues until a stable state is reached.
Applications of Constraint Propagation:
Constraint propagation is widely used in various AI applications. Some notable areas include:
Scheduling
In scheduling problems, tasks must be assigned to time slots without conflicts. Constraint
propagation helps by reducing the possible time slots for each task based on constraints like
availability and dependencies.
Planning
AI planning involves creating a sequence of actions to achieve a goal. Constraint propagation
simplifies the planning process by reducing the possible actions at each step, ensuring that the
resulting plan satisfies all constraints.
Resource Allocation
In resource allocation problems, resources must be assigned to tasks in a way that meets all
constraints, such as capacity limits and priority rules. Constraint propagation helps by narrowing
down the possible assignments, making the search for an optimal allocation more efficient.
Algorithms for Constraint Propagation
Several algorithms are used for constraint propagation, each with its strengths and weaknesses.
Some common algorithms include:
Arc Consistency
Arc consistency ensures that for every value of one variable, there is a consistent value in
another variable connected by a constraint. This algorithm is often used as a preprocessing step
to simplify CSPs before applying more complex algorithms.
Path Consistency
Path consistency extends arc consistency by considering triples of variables. It ensures that for
every pair of variables, there is a consistent value in the third variable. This further reduces the
domains and simplifies the problem.
k-Consistency
k-Consistency generalizes the concept of arc and path consistency to k variables. It ensures that
for every subset of k-1 variables, there is a consistent value in the kth variable. Higher levels of
consistency provide more pruning but are computationally more expensive.

Dempster Shafer Theory in Artificial Intelligence:


Introduction
In recent times, the scientific and engineering community has come to realize the significance of
incorporating multiple forms of uncertainty. This expanded perspective on uncertainty has been
made feasible by notable advancements in computational power within the field of artificial
intelligence. As computational systems become more adept at handling intricate analyses, the
limitations of relying solely on traditional probability theory to encompass the entirety of
uncertainty have become apparent.
Traditional probability theory falls short in its ability to effectively address consonant, consistent,
or arbitrary evidence without the need for additional assumptions about probability distributions
within a given set. Moreover, it fails to express the extent of conflict that may arise between
different sets of evidence. To overcome these limitations, Dempster-Shafer theory has emerged
as a viable framework, blending the concept of probability with the conventional understanding
of sets. Dempster-Shafer theory provides the means to handle diverse types of evidence, and it
incorporates various methods to account for conflicts when combining multiple sources of
information in the context of artificial intelligence.
What Is Dempster – Shafer Theory (DST)?
Dempster-Shafer Theory (DST) is a theory of evidence that has its roots in the work of Dempster
and Shafer. While traditional probability theory is limited to assigning probabilities to mutually
exclusive single events, DST extends this to sets of events in a finite discrete space. This
generalization allows DST to handle evidence associated with multiple possible events, enabling
it to represent uncertainty in a more meaningful way. DST also provides a more flexible and
precise approach to handling uncertain information without relying on additional assumptions
about events within an evidential set.
 Where sufficient evidence is present to assign probabilities to single events, the
Dempster-Shafer model can collapse to the traditional probabilistic formulation.
Additionally, one of the most significant features of DST is its ability to handle different
levels of precision regarding information without requiring further assumptions. This
characteristic enables the direct representation of uncertainty in system responses, where
an imprecise input can be characterized by a set or interval, and the resulting output is
also a set or interval.
 The incorporation of Dempster Shafer theory in artificial intelligence allows for a more
comprehensive treatment of uncertainty. By leveraging the unique features of this theory,
AI systems can better navigate uncertain scenarios, leveraging the potential of multiple
evidentiary types and effectively managing conflicts. The utilization of Dempster Shafer
theory in artificial intelligence empowers decision-making processes in the face of
uncertainty and enhances the robustness of AI systems. Therefore, Dempster-Shafer
theory is a powerful tool for building AI systems that can handle complex uncertain
scenarios.
The Uncertainty in this Model:
At its core, DST represents uncertainty using a mathematical object called a belief function. This
belief function assigns degrees of belief to various hypotheses or propositions, allowing for a
nuanced representation of uncertainty. Three crucial points illustrate the nature of uncertainty
within this theory:
1. Conflict: In DST, uncertainty arises from conflicting evidence or incomplete
information. The theory captures these conflicts and provides mechanisms to manage and
quantify them, enabling AI systems to reason effectively.
2. Combination Rule: DST employs a combination rule known as Dempster's rule of
combination to merge evidence from different sources. This rule handles conflicts
between sources and determines the overall belief in different hypotheses based on the
available evidence.
3. Mass Function: The mass function, denoted as m(K), quantifies the belief assigned to a
set of hypotheses, denoted as K. It provides a measure of uncertainty by allocating
probabilities to various hypotheses, reflecting the degree of support each hypothesis has
from the available evidence.
Example:
Consider a scenario in artificial intelligence (AI) where an AI system is tasked with solving a
murder mystery using Dempster–Shafer Theory. The setting is a room with four individuals: A,
B, C, and D. Suddenly, the lights go out, and upon their return, B is discovered dead, having
been stabbed in the back with a knife. No one entered or exited the room, and it is known that B
did not commit suicide. The objective is to identify the murderer.
To address this challenge using Dempster–Shafer Theory, we can explore various possibilities:
1. Possibility 1: The murderer could be either A, C, or D.
2. Possibility 2: The murderer could be a combination of two individuals, such as A and C,
C and D, or A and D.
3. Possibility 3: All three individuals, A, C, and D, might be involved in the crime.
4. Possibility 4: None of the individuals present in the room is the murderer.
To find the murderer using Dempster–Shafer Theory, we can examine the evidence and assign
measures of plausibility to each possibility. We create a set of possible conclusions (P)(P) with
individual elements {p1,p2,...,pn}{p1,p2,...,pn}, where at least one element (p)(p) must be true.
These elements must be mutually exclusive.
By constructing the power set, which contains all possible subsets, we can analyze the evidence.
For instance, if P={a,b,c}P={a,b,c}, the power set would be {o,{a},{b},{c},{a,b},{b,c},{a,c},
{a,b,c}}{o,{a},{b},{c},{a,b},{b,c},{a,c},{a,b,c}}, comprising 23=823=8 elements.
Mass function m(K):
In Dempster–Shafer Theory, the mass function m(K) represents evidence for a hypothesis or
subset K. It denotes that evidence for {K or B} cannot be further divided into more specific
beliefs for K and B.
Belief in K:
The belief in K, denoted as Bel(K), is calculated by summing the masses of the subsets that
belong to K. For example, if K={a,d,c},Bel(K) would be calculated as m(a)+m(d)+m(c)+m(a,d)
+m(a,c)+m(d,c)+m(a,d,c)
Plausibility in K:
Plausibility in KK, denoted as Pl(K), is determined by summing the masses of sets that intersect
with K. It represents the cumulative evidence supporting the possibility of K being true. Pl(K) is
computed as m(a)+m(d)+m(c)+m(a,d)+m(d,c)+m(a,c)+m(a,d,c)
 By leveraging Dempster–Shafer Theory in AI, we can analyze the evidence, assign
masses to subsets of possible conclusions, and calculate beliefs and plausibilities to infer
the most likely murderer in this murder mystery scenario.
Characteristics of Dempster Shafer Theory:
Dempster Shafer Theory in artificial intelligence (AI) exhibits several notable characteristics:
1. Handling Ignorance: Dempster Shafer Theory encompasses a unique aspect related to
ignorance, where the aggregation of probabilities for all events sums up to 1. This
peculiar trait allows the theory to effectively address situations involving incomplete or
missing information.
2. Reduction of Ignorance: In this theory, ignorance is gradually diminished through the
accumulation of additional evidence. By incorporating more and more evidence,
Dempster Shafer Theory enables AI systems to make more informed and precise
decisions, thereby reducing uncertainties.
3. Combination Rule: The theory employs a combination rule to effectively merge and
integrate various types of possibilities. This rule allows for the synthesis of different
pieces of evidence, enabling AI systems to arrive at comprehensive and robust
conclusions by considering the diverse perspectives presented.
By leveraging these distinct characteristics, Dempster Shafer Theory proves to be a valuable tool
in the field of artificial intelligence, empowering systems to handle ignorance, reduce
uncertainties, and combine multiple types of evidence for more accurate decision-making.
Advantages and Disadvantages:
Dempster Shafer Theory in Artificial Intelligence (AI) Offers Numerous Benefits:
1. Firstly, it presents a systematic and well-founded framework for effectively managing
uncertain information and making informed decisions in the face of uncertainty.
2. Secondly, the application of Dempster–Shafer Theory allows for the integration and
fusion of diverse sources of evidence, enhancing the robustness of decision-making
processes in AI systems.
3. Moreover, this theory caters to the handling of incomplete or conflicting information,
which is a common occurrence in real-world scenarios encountered in artificial
intelligence.
Nevertheless, it is Crucial to Acknowledge Certain Limitations Associated with the
Utilization of Dempster Shafer Theory in Artificial Intelligence:
1. One drawback is that the computational complexity of DST increases significantly when
confronted with a substantial number of events or sources of evidence, resulting in
potential performance challenges.
2. Furthermore, the process of combining evidence using Dempster–Shafer Theory
necessitates careful modeling and calibration to ensure accurate and reliable outcomes.
3. Additionally, the interpretation of belief and plausibility values in DST may possess
subjectivity, introducing the possibility of biases influencing decision-making processes
in artificial intelligence.
Conclusion
This article taught us:
 Dempster Shafer Theory in artificial intelligence empowers AI systems to handle
uncertainty effectively and make more accurate decisions.
 By leveraging its unique characteristics, AI systems can navigate uncertain scenarios,
combine diverse evidence sources, and enhance their overall performance.
 The distinctive characteristics of Dempster Shafer Theory, such as its ability to aggregate
probabilities to 1, gradual reduction of ignorance through accumulating evidence, and
utilization of a combination rule for merging possibilities, contribute to its effectiveness
in addressing uncertainty in AI.
 The advantages of Dempster Shafer Theory in AI include providing a principled
framework for uncertain information management, facilitating robust decision-making
through evidence fusion, and accommodating incomplete or conflicting information.
 Dempster Shafer Theory stands as a valuable tool in the field of artificial intelligence,
contributing to the advancement of intelligent systems capable of handling complex and
uncertain environments.

Rule-Based System in AI:


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.
History of Rule-Based Systems in AI:
The concept of rule-based systems in artificial intelligence can be traced back to the 1970s, when
researchers sought to replicate human decision-making processes. The earliest AI systems were
built on logical rules, inspired by how experts in various fields, such as medicine and law, used
their knowledge to make decisions. These systems, often referred to as expert systems, became
the foundation of AI during its initial development.
The most famous example of an early expert system is MYCIN, developed at Stanford
University in the 1970s. MYCIN was designed to diagnose bacterial infections and recommend
treatments based on a set of predefined rules. Although MYCIN was never used in practice due
to ethical concerns, it demonstrated the potential of rule-based systems in AI and laid the
groundwork for future developments.
Components of a Rule-Based System:
A typical rule-based system comprises several key components:
[Link]: 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."
[Link] 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.
[Link] 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.
[Link] 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.
[Link] Interface: In many rule-based systems, the user interface allows users to interact with the
system, input data, and receive outputs or recommendations.

Rule Based System in AI


How Rule-Based Systems Work?
The operation of a rule-based system involves several stages:
[Link] 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.
[Link] 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.
[Link] 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.
[Link] 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.
[Link] 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.
Types of Rule-Based Systems:
There are several types of rule-based systems, each tailored to different applications:
[Link] Chaining Systems: These systems start with the available data and apply rules to
infer new data until a goal is reached. Forward chaining is often used in problem-solving and
diagnostic systems.
[Link] Chaining Systems: These systems start with a goal and work backward to
determine which rules and data can achieve that goal. Backward chaining is commonly used in
expert systems where the goal is to reach a specific diagnosis or conclusion.
[Link] Systems: Some systems combine forward and backward chaining to leverage the
strengths of both approaches. Hybrid systems are useful in complex scenarios where both data-
driven and goal-driven reasoning are required.
Applications of Rule-Based Systems:
Rule-based systems have a broad range of applications, including:
1. Expert Systems:
Expert systems are designed to emulate the decision-making abilities of human experts. They use
a large set of rules to make inferences or recommendations.
Applications include:
Medical Diagnosis: Systems like MYCIN, an early expert system, assist in diagnosing diseases
and recommending treatments based on patient data and medical knowledge.
Financial Services: Expert systems can assess credit risks, detect fraud, and provide investment
advice.
2. Decision Support Systems:
These systems aid decision-making processes by providing relevant information and
recommendations based on predefined rules. Examples include:
Customer Support: Automated customer support systems use rules to handle common queries
and problems, providing quick and consistent responses.
Manufacturing: Rule-based systems help in managing production schedules, inventory control,
and quality assurance.
3. Control Systems:
In control systems, rules govern the operation of machinery and equipment. Examples include:
Automated Traffic Lights: Rules determine the timing and sequencing of traffic lights based on
traffic flow and other factors.
Home Automation: Smart home systems use rules to control lighting, heating, and security
systems based on user preferences and sensor data.
Benefits of Rule-Based Systems:
[Link]: Rule-based systems are highly transparent because the rules governing their
decisions are explicit and understandable. This clarity makes it easier to trace and debug the
system’s behavior.
[Link] of Implementation: For well-defined problems with clear rules, rule-based systems are
relatively easy to implement. They do not require extensive data for training, unlike machine
learning models.
[Link]: Rule-based systems provide consistent responses and decisions as they follow
predefined rules. This consistency is crucial in applications where uniformity is essential.
[Link] of Updating: Rules can be updated or added to adapt to new knowledge or changes in the
domain. This flexibility allows the system to evolve with the changing requirements.
Limitations of Rule-Based Systems:
[Link]: As the number of rules grows, rule-based systems can become cumbersome and
difficult to manage. The complexity of the rule base may lead to inefficiencies and increased
maintenance efforts.
[Link] of Learning Capability: Rule-based systems do not learn from new data. They rely on
predefined rules and cannot adapt or improve based on experience, unlike machine learning
systems that can learn and optimize over time.
[Link]: Rule-based systems are inflexible when dealing with ambiguous or incomplete
information. They perform best when all conditions are clearly defined, but they struggle with
uncertainty and variability.
[Link] Handling Complex Problems: For complex problems with interrelated factors and
nuances, rule-based systems may be insufficient. They may not handle intricate patterns or
relationships as effectively as advanced AI techniques.
Modern Developments and Integration:
Despite their limitations, rule-based systems continue to be relevant, especially when integrated
with modern AI technologies. Hybrid systems that combine rule-based approaches with machine
learning or fuzzy logic can address some of the shortcomings of pure rule-based systems. For
instance:
[Link] AI (XAI): Rule-based systems contribute to the explainability of AI systems by
providing clear reasoning behind decisions, complementing more opaque models like deep
learning.
[Link] Graphs: Combining rule-based systems with knowledge graphs can enhance the
ability to manage and infer complex relationships in data.
Conclusion:
Rule-based systems represent a foundational approach in AI, characterized by their reliance on
explicit rules and logical reasoning. They offer transparency, consistency, and ease of
implementation, making them valuable in various applications, from expert systems to control
systems. While they face challenges in scalability, learning capability, and handling complexity,
their integration with modern AI techniques can extend their utility and effectiveness.

Common questions

Powered by AI

The four primary approaches to knowledge representation in artificial intelligence are simple relational knowledge, inheritable knowledge, inferential knowledge, and procedural knowledge. Simple relational knowledge organizes facts in relational tables, commonly used in databases. Inheritable knowledge involves a hierarchy allowing inheritance, typically implemented using frames. Inferential knowledge uses formal logics to derive new facts and ensures accuracy. Procedural knowledge entails small programs detailing how to achieve specific tasks, employing rules like the 'if-then' rule. These approaches vary based on their use of logical structures, computational methods, and suitability for different types of knowledge representation .

The combination rule of Dempster-Shafer Theory enhances the robustness of AI systems by effectively merging evidence from different sources to form a unified belief. This rule, known as Dempster's rule, manages conflicting information and determines overall belief based on available evidence, allowing AI systems to integrate numerous perspectives for a comprehensive understanding. By handling conflicts and consolidating various data inputs, this rule supports more accurate and informed decision-making, even in complex and uncertain scenarios, contributing to AI systems' advanced reasoning and adaptability .

The Dempster-Shafer Theory offers significant advantages in AI decision-making by providing a principled framework for managing uncertainty, integrating diverse evidence, and accommodating incomplete or conflicting information. It is particularly useful for scenarios with uncertainty and variability. However, its disadvantages include computational complexity with many events or sources and the subjective interpretation of belief and plausibility values that could introduce biases. Additionally, combining evidence accurately requires careful modeling and calibration, which can be challenging .

Dempster-Shafer Theory (DST) plays a significant role in AI by providing a framework for managing and representing uncertainty. Unlike traditional probabilistic methods that need precise input, DST allows flexibility with imprecise or incomplete information by using belief functions that assign degrees of belief to hypotheses. This capability helps AI systems handle conflicts and incomplete data effectively, facilitating robust decision-making in uncertain scenarios. However, the complexity of combining evidence in DST and the need for careful calibration may present challenges. Despite these drawbacks, DST enhances AI's ability to draw inferences and make informed decisions when dealing with uncertain data .

Procedural knowledge differs from declarative knowledge in AI in that it describes how to perform tasks and includes rules, strategies, and procedures, known as imperative knowledge. It is directly applicable to tasks and focuses on the "how" of activities . In contrast, declarative knowledge involves knowing about concepts, facts, and objects, expressed in descriptive sentences. Procedural knowledge is crucial for executing algorithms and instructions in AI, such as coding languages like LISP and Prolog, where specific actions are performed based on the "if-then" rules .

Structural knowledge is fundamental in artificial intelligence for problem-solving as it describes relationships between various concepts, like 'kind of', 'part of', and 'grouping of'. This form of knowledge lays out how concepts or objects interrelate, aiding AI systems in understanding complex relationships within a domain. For instance, knowing that 'a guitar is part of the string instrument family' helps AI systems classify and interact with musical instruments more intelligently. By mapping these relationships, AI systems can generate logical and relevant solutions to problems by leveraging the interconnectedness of knowledge components .

Inferential knowledge in AI refers to representing knowledge through formal logic, allowing the derivation of new facts from existing information. This form of knowledge uses logical propositions to ensure correctness and can generate additional insights, aiding decision-making by deducing new conclusions from known relationships. For instance, given the propositions 'Marcus is a man' and 'All men are mortal,' one can infer 'Marcus is mortal.' This logical reasoning is important because it enhances AI's capability to expand its knowledge base, making inferences and enabling more dynamic interaction with new information .

In AI, knowledge is fundamental to demonstrating intelligence. An AI agent's ability to exhibit intelligent behavior originates from its knowledge of real-world information. Knowledge equips AI systems to act accurately on inputs through understanding, just as humans do. If an AI lacks knowledge about a particular input, its ability to respond intelligently is compromised, similar to humans facing an unfamiliar language. Therefore, knowledge representation and reasoning are crucial for enabling AI's intelligent behavior, as they provide the necessary framework for perceiving, learning, planning, and executing actions based on the knowledge about the environment .

Knowledge representation and reasoning (KRR) play a critical role in artificial intelligence by enabling AI systems to understand, reason about, and use real-world information to solve complex problems. KRR involves representing information in a way that computers can use to mimic intelligent human behavior, like diagnosing medical conditions or communicating in natural language. It is not just about storing data but involves learning from experiences to behave intelligently like humans .

Rule-based systems in AI contribute significantly to decision-making by using predefined rules and logic to arrive at conclusions. Despite the rise of advanced methodologies like machine learning, rule-based systems remain important due to their transparency, ease of understanding, and interpretability. These systems form decisions by following explicit, human-crafted rules, which can be particularly useful in structured domains like law or medicine. However, compared to modern AI methodologies, they lack adaptability and the ability to learn from data, which may limit their effectiveness in dynamic or unstructured environments. Modern approaches, using vast amounts of data, excel in adapting to new situations and discovering hidden patterns .

You might also like