0 ratings 0% found this document useful (0 votes) 6 views 11 pages Unit Iii
The document discusses various approaches to knowledge representation in artificial intelligence, including simple relational knowledge, inheritable knowledge, inferential knowledge, and procedural knowledge. It also covers logic programming, Bayes' theorem, Dempster-Shafer theory, semantic networks, and constraint propagation, highlighting their applications and challenges in AI. Additionally, it emphasizes the importance of effective knowledge representation and the issues of incompleteness in real-world scenarios.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
ARTIFICIAL INTELLIGENCE UNIT-IIT
Approaches to Knowledge Representation:
There are different Kinds of Knowledge representation
Simple Relational Knowledge
This type of knowledge uses relational methods to store facts, such as tables or
graphs
The simplest way to represent declarative facts is a set of relations of the same sort
used in the database system.
The table below shows a simple way to store facts.
Player Height Bats-Throws
Hank Aaron 6-0 Right-Right
Willie Mays 5-10 Right-Right
Babe Ruth 6-2 Left-Left
Ted Williams 3 Lefi-Right
player_info(*hank aaron’, °6-0", 180,right-right).
Fig. 4.4 Simple Relational Knowledge and a sample fact in Prolog
* Also, The facts about a set of objects are put systematically in columns.
© This representation provides little opportunity for inference
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 fiom 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:
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
Peter
3. Inferential knowledge:
© Inferential knowledge approach represents knowledge in the form of formal logics.
© This type of knowledge refers to knowledge that can be derived from other
‘knowledge using logical reasoning, such as logic or ontologies.
© This approach can be used to derive more facts:
© It guaranteed correctness.
Example: Let's suppose there are two statements:
a Mareus is a man
b.— Allmenare mortal
Then it represent as
a.man(Mareus)
b. Wx :man (x) > mortal (x)
4, Procedural knowledge:
© Procedural knowledge approach uses sunall 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.
Py mimi
Logic Programming is the combination of two words, logic and programming. Logic
Programming is a programming paradigm in which the problems are expressed as facts and
rules by program statements but within a system of formal logic.
Facts
Actually, every logic program needs facts to work with so that it can achieve the given goal
Facts basically are true statements about the program and data.
For example, Delhi is the capital of India,
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
Rules
‘Actually, rules are the constraints which allow us to make conclusions about the problem
domain. Rules basically written as logical clauses to express various facts.
For example, if we are building any game then all the rules must be defined.
Rules are very important to solve any problem in Logie Programming. Rules are basically
logical conclusion which can express the facts.
¥ There are several logic programming system today, the most popular of which is
PROLOG.
The facts that PROLOG programs are represented on Hom Clause for two reasons,
1, Because of a uniform representation, a simple and efficient interpreter can write.
2. The logic of Horn Clause decidable.
(Comte) — (Trot
Cm) Cur
=
|
Logical Programming
> Typical prolog query can be asked as :
Query 1 : 2- singer(somu).
Output : Yes.
Explauation : As our knowledge base coutains
the above fact, so output was 'Yes’, otherwise
it would have been 'No’.
Query 2 : 2- odd_mumber(7),
Output : No
Explanation : As our knowledge base does not
contain the above fact, so output was ‘No!
Prolog uses uppercase letters for varinbles and lowercase for constants
Clauses are written with the head preceding the body: ": -" is used for left
implication, commas separate literals in the body, and a period marks the end of a
sentence
‘Syntactic difference between the logic and PROLOG Representation
* In Logic programming, Variable are explicitly quantified. In PROLOG, Variables are
implicitly quatified. The distinction between variables and constants is made in
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
PROLOG by having all variables begin with upper case letters and all constants begin
with lower case letters or numbers
In Logic programming, there are explicit symbols for and( , ) and or. In PROLOG,
there is an explicit symbol for and(,),but there is none for or. Instead, disjunetion must
be represented as a list of altemative statements any one of which may provide the
basis for a conclusion.
Tn Logic programming, implications of form “p implies Q” are written as pq. In
PROLOG, the same implication is written “backward” as q :- p . his form is natural in
PROLOG because the interpreter always works backwards from a goal, and this form
causes every rule to begin with the component that mest therefore be matched first
This first component is called the head of the rule.
Consider the following example
1. Logical representation
Vx : pet(x) & small (x) + apartmentpet(x)
x : cat(x) © dog(x) — pet(x)
x: poodle (x) —» dog (x) 4 small (x)
poodle (flufiy)
Prolog representation
apartmentpet (x) : pet(x), small (x),
pet (x): cat (x).
pet (x): dog(x).
dog(x): poodle (x).
small (x): poodle(x)
poodle (Alufiy).
>Bayves Probal ferference:
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(BJA) with the knowledge of P(A/B)
where,
P(A) is the probability that event A occurs
PB) defines the probability that event B occurs.
P(A\B) is the probability of the occurrence of event A given that event B has already
occurred.
P(BIA) can now be read as: Probability of event B occurring given that event A
occurred.
‘PIANB) is the probability events A and B will happen together.
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
In probability theory, Bayes” theorem talks about the relation of the conditional probability of
event A with known event B:
P(ANB)= P(AIB)*P(B)---—-(1)
Similarly.the probability of event B with known event A:
P(AnB)= P(BIA)*P(A)-—-(2)
Now, we have two expressions for P(ANB), since both expressions are equal to P(ANB),
we can set them equal to each other:
PAIB)-P(B)= PAA) PCA)
PAIB)=P(BA)-A)/P(B)
P(BIA)= AIB)-B)/P(A) this is Bayes theorem.
>DempsterShafer Theory with Example.
The Dempster-Shafer Theory (DST) is a mathematical framework used in artificial
intelligence to handle uncertainty and combine evidence fiom different sources. It was
developed by Arthur P. Dempster and Glenn Shafer. Unlike traditional probability theory,
which assigns probabilities to single events, DST allows for the assignment of probabilities to
sets of events, making it more flexible in representing uncertainty.
Here are some key aspects of DST:
Belief Functions: These fimetions represent the degree of belief in a particular event
based on available evidence.
Plausibility: This measures how plausible an event is, considering all the evidence
that does not contradict it
Combination Rules: DST provides rules for combining evidence from different
sources, even if they are conflicting
The frame of discernment and we'll write it as @. @ is set of all possible mutually
exclusive hypothesis means at most one has to be true.
For example, in a simplified diagnosis problem,
consist of the set 0= {All, Flu, Cold, Peu}
All: Allergy
Fh: Flu
Cold: Cold
Pheu: Pneumonia
The key fimetion we use is a probability density function, which we denotes asm.
The function m is defined not just elements of @ but all subsets of it
The quantity m(p)measure the amount of belief that currently assigned exactly the set
p of hypothesis.
© contains n elements, then there are 2° elements of subsets
‘The sum of all belief value is 1
‘The diagnosis problem
We have no information on evidence to choose between four hypotheses.
A: Allergy
F:Flu
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
©: Cold
P: Pneumonia
{©}=1->the doctor have confidence that disease lie @ only.
Step 2:Evidence 1(je the patient is suffering from fever {fever,cold,pnew}=0.6)
{E.CP}=0.6
{ O}=0.4 } ml
Step 3:Evidence 2(ie the patient is suffering from runny nose {Allergy, fever, cold }— 0.8)
{AFC }-0.8
{0}-0.2 } m2
Step 4:
We identify two belief functions m1 & m2,Let X be the set of subset © to which ml assign a
nonzero value and Y be the Corresponding set of m2, We define the combination m3 of ml
and m2 to be
Then we can compute their combination m3 using following table, which we can derive using
the numerator of the combination rule:
the value of m3 that the combination rule associated with each of them is computed by
multiplying the values of ml and m2 associated with the elements from which they were
derived. We produce m3
{F.C}=0.48
{AFC}
AF.CP}=0.12 m3
{0}=0.08
Step 5:Now, let m4 cortespond to our belief given just the evidence that the problem goes
away when the patient goes on a trip:
{A}=0.9
{0}=0.1 m4
We can apply the numerator of the combination rule to produce(where @ denotes the
empty set)
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
If any Empty set(@)occurs in table the denominator part we calculated
=0.54(denominator is 1-9=1-0.54=0.46)
{A}=0.288+0.072=0.36/0.46=0.783
{F.C}=0.104
{AF,C}=0.07
{F.CP}=0.026
{}=0.017
Knowledge representation issues
Semantic nets.
‘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 ares which describe the
relationship between those objects.
‘Nodes are sometimes referred to as objects. Nodes are to represent physical objects,
concepts, or situation.
Ares as links or edges. The links are used to express relationships.
It is also known as associative net due to the association of one node with other.
‘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) A-Kind-of relation (AKO)
a) IS-A relation:
TS-A means "is an instance of" and refers to a specific member of a class.
A class is related to the mathematical concept of a set in that it refers toa group of
objects.
Ex: (bat, blue, t-shirt, art)
b) A-Kind-of relation:
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
* The AKO relation is used to relate one class to another:
* AKO relates generic nodes to generic nodes while the IS-A relates an instance or
individual to a generic class.
Simple Example of Semantic net
Following are some statements which we need to represent in the form of nodes and ares,
‘Statements:
1) Jemyis a cat
2) Jerry is a mammal.
3) Jerry is owned by Jay.
4) Jerry is white colored.
5) All Mammals are animal.
6) Jerry likes cheese.
¢ is-owned
is-colored
In the above diagram, we have represented the different type of knowledge in the form of
nodes and ares. Each object is connected with another object by some relation
Constraint Propagation
Constraint propagation is a fimdamental technique used in solving Constraint Satisfaction
Problems (CSPs). CSPs are problems where you need to find values for a set of variables that
satisfy a given set of constraints.
Constraint satisfaction problems (CSPs) to systematically reduce the possible values for
variables by enforcing constraints. It helps to simplify problems by eliminating inconsistent
possibilities before an explicit search.
© Define Constraints: Establish rules that must be followed (e.g., in Sudoku, each row
must contain unique numbers).
Eliminate Invalid Values: Remove values that violate the constraints
Iterate Until Stability: Keep applying constraints until no more values can be
eliminated
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
Examples of Constraint Propagation
1. Sudoku Solving: If number can only fit in one cell in a row, it umst be placed there.
2. Scheduling Problems: If a person is unavailable at a certain time, that slot is
eliminated from their options
Map Coloring: If a country must have a different color from its neighbors, invalid
color choices are removed. 6
+ Variables are regions - WA, NT, Q, NSW, V, SA, T
+ Domain for each variable — {red, green, blue}
+ Constraints — Eg. for WA and NT be
{(red, green), (red, blue), (green,red), (green,blue), v
(bine,red),{bhue,green)}
Multiple solutions, ¢.g. — {WA=blue, NT=green,
Q-blue, NSW=green, SA-red, T=green, V-blue}
Representing knowledge using rules.
For the purpose of solving complex problems encountered in AT, we need both a large
amount of knowledge and some mechanism for manipulating that knowledge to create
solutions to new problems. A variety of ways of representing knowledge (facts) have been
exploited in AI programs.
Inall variety of knowledge representations , we deal with two kinds of entities.
© Facts: Truths in some relevant world. These are the things we want to represent
+ Representations of facts in some chosen formalism. These are things we will actually
be able to manipulate.
One way to think of structuring these entities is at two levels :
‘© the knowledge level, at which facts are described, and
* the symbol level, at which representations of objects at the knowledge level are
defined in terms of symbols that can be manipulated by programs.
The facts and representations are linked with two-way mappings. This link is called
representation mappings.
‘© The forward representation mapping maps from facts to representations.
* The backward representation mapping goes the other way, fiom representations to
facts.
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
Reasoning
programs
‘internal
Representations
Engtish
generation
English
Representation
Fig. 4.1 Mappings between Facts and
Representations
Knowledge representation issues
Knowledge Representation (KR) is a core aspect of artificial intelligence (AL) that deals with
how knowledge is structured, stored, and processed. However, several challenges arise in
representing knowledge effectively.
1. Incompleteness
+ Itis impossible to represent all real-world knowledge
+ Example: A medical diagnosis system may not have data on rare diseases.
2. Ambiguity
+ Some words or phrases have multiple meanings,
+ Example: "Bank" can refer to a financial institution or a riverbank.
3. Inconsistency
+ Conflicting knowledge can exist within the same system.
+ Example: One rule says "Ifit rains, then the ground is wet," but another says "IFit is
hot, the ground is dry."
4. Scalability
+ Large knowledge bases require efficient processing,
+ Example: The internet has vast amounts of knowledge, but retrieving relevant
information quickly is challenging.
5. Expressiveness vs. Computabilit
+ A highly expressive system may be difficult to compute efficiently
+ Example: First-order logic is expressive but computationally expensive
‘Common Sense Knowledge
© Machines struggle with common sense reasoning.
+ Example: AT may not understand that "Water is wet" or "People eat food.”
Dynamic Knowledge
+ Knowledge changes over time and must be updated.
+ Example: Scientific discoveries may invalidate previous knowledge.
8. Uncertainty
+ Notall knowledge is definite; probabilities may be needed
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.ARTIFICIAL INTELLIGENCE UNIT-IIT
+ Example: "It will rain tomorrow" is uneertain and requires probabilistic reasoning.
Pavani Paladugu, Dept of Computer Science
Sir C RReddy College,Eluru.