You are on page 1of 81

Module – 2

AI & ML
Chapter - 4

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 1
Chickballapur
Knowledge representation issues,
Predicate logic, Representation
knowledge using rules.
Concept Learning: Concept learning
task, Concept learning as search, Find-S
algorithm, Candidate Elimination
Algorithm, Inductive bias of Candidate
Elimination Algorithm.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 2
Chickballapur
Knowledge Representation Issues

1.Representation and Mappings


2.Approaches to knowledge Representation
3.Issues in Knowledge Representation
4.The Frame Problem

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 3
Chickballapur
Knowledge Definition
• Knowledge is a collection of “facts” from some domain.
• “The fact or condition of knowing something with familiarity
gained through experience or association.
”(Webster’sDictionary,1988) (Knowing something via seeing,
hearing, touching, feeling, and tasting.)
• “The fact or condition of being aware of something”.
(Ex. Sun is hot, balls are round, sky is blue,…)
• Knowledge is understanding of a subject area.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 4
Chickballapur
Difference between Data, Information and
Knowledge
■Data: is viewed as collection of disconnected facts. Example: name of
novels available in a library, It is raining.
■Information(Analyzed data.) emerges when relationships among facts
are established and understood; Provides answers to "who", "what",
"where", and "when". Example: The temperature dropped 15 degrees and
then it started raining.
■Knowledge(Analyzed Information) emerges when relationships among
patterns are identified and understood; Provides answers as "how".
Example: If the humidity is very high and the temperature drops
substantially, then atmospheres is unlikely to hold the moisture, so it rains.
■Wisdom is the pinnacle of understanding, uncovers the principles of
relationships that describe patterns. Provides answers as "why". Example:
Encompasses understanding of all the interactions that happen between
raining, evaporation, air currents, temperature gradients, changes, and
raining Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 5
Chickballapur
Types Of Knowledge

• Procedural Knowledge
• Declarative Knowledge
• Meta –Knowledge
• Heuristic Knowledge
• Structural Knowledge
• Inexact and Uncertain Knowledge
• Commonsense Knowledge
• Ontological Knowledge
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 6
Chickballapur
1.Representations and Mappings
•In order to solve the complex problems encountered in AI one
needs both a large amount of knowledge to create solutions to
new problem.
•Following two kinds of entities are important for representing
the knowledge
1.Facts : Truths in the relevant world
2.Representation of the Facts :
•Two Levels of Structuring these entities :
1.The Knowledge Level at which facts are described
2.The Symbol Level at which representation of objects at the
knowledge level are defined in terms of symbols that can be
manifested by programs.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 7
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 8
Chickballapur
Mapping between Facts and Representation

Figure: Mapping between Facts and Representation


Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 9
Chickballapur
Forward and Backward Representation

The dotted line on top indicates the abstract reasoning process that a program
is intended to model
The solid line on bottom indicates the concrete reasoning process that the
program performs.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 10
Chickballapur
2. Approaches To Knowledge Representations

A good system for the representation of knowledge in a particular


domain should possess the following four properties
1.Representational Adequacy : The ability to represent all of the kinds of
knowledge that are needed in that domain.
2.Inferential Adequacy : The ability to manipulate the representational
structures in such a way as to derive new structures corresponding to new
knowledge inferred from old.
3.Inferential Efficiency : The ability to incorporate into the knowledge
structure additional information that can be used to focus the attention of
the inference mechanisms in the most promising direction.
4.Aquisitional Efficiency : The ability to acquire new information easily .
The simplest case involves the direct insertion by a person of new
knowledge into the data base.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 11
Chickballapur
1. Simple Relational Knowledge
Used to associate elements of one domain with the elements of another
domain or set of design constrains.
− Relational knowledge is made up of objects consisting of attributes and
their corresponding associated values.
− The results of this knowledge type is a mapping of elements among
different domains.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 12
Chickballapur
2.Inheritable Knowledge
• Elements inherit attributes from their parents
•It is often useful to provide are presentation structure that directly supports
inference mechanisms.
•The KR in hierarchical structure, shown below, is called “semantic
network” or a collection of “frames” or “slot-and-filler structure". It
shows property inheritance and way for insertion of additional knowledge.
•Property Inheritance is a common inference mechanism.
–Objects belong to classes.
–Classes have properties that are inherited by objects that belong to the
class

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 13
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 14
Chickballapur
Semantic Nets

A semantic net is a graph, in which the nodes


represent concepts and the arcs represent
binary relationships between concepts.
Nodes represent objects, attributes and values
Links represent attributes and relationships
between nodes
Labels attached to links: the name of the
corresponding attribute or relation.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 15
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 16
Chickballapur
Frames
• Frame is a type of schema in which all the information relevant to a
particular concept is stored.
•Frames support inheritance.
•Frames can be viewed as a structural representation of semantic nets.

• Components of Frame Entity Name-correspond to a node /links in a


semantic net. Slots : Represents the attributes Fillers : Represents the values
of attributes
•Each slot can also be another frame.(nested Frames )

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 17
Chickballapur
Examples

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 18
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 19
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 20
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 21
Chickballapur
Issues in Knowledge Representation

• A. Important Attributes
• B. Relationships among Attributes
• C. Granularity of Representation
• D. Representing Sets of Objects
• E. Finding the Right Structures as Needed

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 22
Chickballapur
A. Important Attributes
• There are two attributes "instance" and "is a", that are of general
significance. These attributes are important because they support property
inheritance.

B. Relationships among Attributes


• The attributes we use to describe objects are themselves entities that were
present. The relationship between the attributes of an object, independent of
specific knowledge they encode, may hold properties like:
• i. Inverses,
• ii. Existence in an is a hierarchy,
• iii.Techniques for reasoning about values and
• iv. Single valued attributes.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 23
Chickballapur
i. Inverses
•The relationships in the Semantic net is represented using the
attributes like is a, instance and team.
•The different views of the relationship can be achieved using
the following two approaches
1.Representing two relationships in a single logical
representation .
Example : Team(John, India)
2.Using attribute that focus on a single entity but to use them
in pairs one the inverse of the other :
Example : Team = India
Team_Member = John

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 24
Chickballapur
ii.Existence in an isa hierarchy

•This is about generalization-specialization of


attributes .
•Just Like, classes of objects can be
specialized into subsets of those classes, there
are generalized attributes and specialization of
attributes.
•Example, the attribute height is a
specialization of general attribute physical-size
which is, in turn, a specialization of physical-
attribute.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 25
Chickballapur
iii. Techniques for reasoning about values

• Several kinds of information are used in reasoning,


like,
• Information about the type of the value Ex: height
must be a number measured in a unit of length
• Constraints on the value, Ex: age of person can not be
greater than the age of person's parents.
• Rules for computing the value . Ex: Backward Rules
or If needed Rules
• Rules that describe actions that should be taken if a
value ever become known . Ex: Forward Rules / If
added Rules.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 26
Chickballapur
iv. Single valued attributes

• It is a specific attribute that is guaranteed to take a


unique value. Example, a baseball player can at time
have only a single height and be a member of only
one team.
• KR systems take different approaches to provide
support for single valued attributes , including :
• 1.Explicit notation for Temporal interval : The value
remains same during the temporal interval.
• 2.No Explicit Support : The value cannot be changed

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 27
Chickballapur
C. Choosing Granularity of Representation

• Regardless of the KR formalism, it is


necessary to know :
• –At what level should the world be represented
and what should be the primitives ?."
• –Should there be a small number or should
there be a large number of low-level primitives
or High-level facts covering a range of
granularities.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 28
Chickballapur
Example of Granularity
− Suppose we are interested in following facts: John spotted
Sue.
− This could be represented as Spotted (agent(John), object
(Sue))
− Such a representation would make it easy to answer
questions such are : Who spotted Sue ?
− Suppose we want to know :
Did John see Sue ?
− Given only one fact, we cannot discover that answer.
− We can add other facts, such as
Spotted (x , y) → saw (x , y)
− We can now infer the answer to the question.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 29
Chickballapur
Further

• saw(agent(John), object(Sue),time
span(briefly))
• In this representation we have broken the idea
of spotting apart into more primitive concepts
of seeing and time span.
• Using this representation , the fact that John
saw Sue is immediately accessible.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 30
Chickballapur
D. Representing Sets of Objects
• Certain properties of objects are true as member of a set but
not as individual;
• There are three ways in which sets may be represented by

• (a)Name, as in the example of Inheritable KR, the node-


Baseball-Player and the predicates as Ball and Batter in logical
representation.
• (b)Extensional definition is to list the numbers
Ex: An extensional description of the set of sun’s planets on
which people live is{Earth}
• (c)Intensional definition is to provide a rule, that returns true
or false depending on whether the object is in the set or not.
• Ex:{x:Sun-planet(x)Λhuman-inhabited(x)}
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 31
Chickballapur
E. Finding the Right Structures as Needed
This is about access to right structure for describing a particular situation.
This requires, selecting an initial structure and then revising the choice.
While doing so, it is necessary to solve following problems :
1.How to perform an initial selection of the most appropriate structure.
2.How to fill in appropriate details from the current situations.
3.How to find a better structure if the one chosen initially turns out not to
be appropriate.
4.What to do if none of the available structures is appropriate.
5.When to create and remember a new structure.

There is no good, general purpose method for solving all these problems.
Some knowledge representation techniques solve some of them.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 32
Chickballapur
4. Frame Problem
• The problem of representing the facts that change as
well as those that do not change in the world of robot
is known as the frame problem.
• In the confined world of a robot, surroundings are not
static. Many varying forces or actions can cause
changes or modifications to it. The problem of
forcing a robot to adapt to these changes is the basis
of the frame problem in artificial intelligence.
• The Frame Problem can be solved by applying Frame
Axioms suitably.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 33
Chickballapur
Chapter – 5
Using Predicate Logic
1.Representation of Simple Facts in Logic
2.Representing Instance and ISA
Relationships
3.Computable Functions and Predicates
4.Resolution
5.Natural Deduction

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 34
Chickballapur
What is Logic ?
• Logic is a language for reasoning, a collection of rules used while
doing logical reasoning. Logic is studied as KR languages in
artificial intelligence.
• Logic is a formal system in which the formulas or sentences have
true or false values.
• Logics are of different types : Propositional logic, Predicate logic,
Temporal logic, Modal logic, Description logic etc; They represent
things and allow more or less efficient inference.
• Propositional logic and Predicate logic are fundamental to all logic.
–Propositional Logic is the study of statements and their
connectivity.
A proposition is a statement, which in English would be a
declarative sentence. Every proposition is either TRUE or FALSE.
–Predicate Logic is the study of individuals and their properties.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 35
Chickballapur
REPRESENTING SIMPLE FACTS IN LOGIC

Propositional logic is a way of representing the world


knowledge that an AI system need.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 36
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 37
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 38
Chickballapur
Example
Let's now explore the use of predicate logic as a way of
representing knowledge by looking at a specific example.
Consider the following set of sentences:
1 .Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. All Romans were either loyal to Caesar or hated him.
6. Everyone is loyal to someone.
7. People only try to assassinate rulers they are not loyal to.
8. Marcus tried to assassinate Caesar.
The facts described by these sentences can be represented as a set
of (well framed formula’s) wff's
Harshavardhana in predicate
Doddamani Assistant logic as follows:
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 39
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 40
Chickballapur
Now suppose that we want to use these
statements to answer the question :

Question : Was Marcus loyal to Caesar?

Answer : ¬ Ioyalto(Marcus, Caesar)

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 41
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 42
Chickballapur
REPRESENTING INSTANCE AND ISA
RELATIONSHIPS

• These two attributes "instance“ and "is a“


support property inheritance and play
important role in knowledge representation
• used to express, namely class membership and
class inclusion
• class-instance relationship

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 43
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 44
Chickballapur
COMPUTABLE FUNCTIONS AND
PREDICATES
• It may be necessary to compute functions as part of a fact. In
these cases a computable predicate isused. A computable
predicate may include computable functions such as +, -, *,
etc.
• For example gt(x-y,10)→bigger(x) contains the computable
predicate gt which performs the greater than function. Note
that this computable predicate uses the computable function
subtraction.
• Computable Functions are used in predicate logic to express
the knowledge in terms of computable predicates

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 45
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 46
Chickballapur
Example
1.Marcus was a man.
2.Marcus was Pompeian.
3.Marcus was born in 40 A.D.
4.All men are mortal.
5.All Pompeians died when the volcano
erupted in 79 A.D.
6.No mortal lives longer than 150 years.
7.It is now 1991.
8.Alive means not dead.
Harshavardhana Doddamani Assistant
9.If someone dies, he is dead at all later times.
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T.,
Chickballapur
47
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 48
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 49
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 50
Chickballapur
Resolution in Predicate Logic

• Resolution proves facts and answers queries


by refutation. This involves assuming the
fact/query is untrue and reaching a
contradiction which indicates that the
opposite must be true.
• The wffs must firstly be firstly converted to
clause form before using resolution.
• The algorithm for converting wffs to clause
form and the resolution algorithm are listed
below.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 51
Chickballapur
Algorithm: Converting wffs to Clause Form

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 52
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 53
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 54
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 55
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 56
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 57
Chickballapur
The Unification Algorithm
• The process of finding variable bindings to
make expressions identical is called
unification.
• The unification problem in first-order logic can
be expressed as follows :Given two terms
containing some variables, find, if it exists, the
simplest substitution (i.e., an assignment of
some term to every variable)which makes the
two terms equal.
• The resulting substitution is called the most
general unifier.
12/8/2021
Harshavardhana Doddamani Assistant
Professor Dept. Of C.S.E., S.J.C.I.T., 58
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 59
Chickballapur
Chapter – 6
Representing Knowledge Using Rules
1. Procedural versus Declarative Knowledge
2. Logic Programming
3. Forward VS Backward Reasoning
4. Matching
5. Control Knowledge

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 60
Chickballapur
6.1 Procedural versus Declarative Knowledge

• Procedural Knowledge :knowing 'how to do'


–Includes : Rules, strategies, agendas, procedures, models.
–These explains what to do in order to reach a certain conclusion.
–e.g., Rule: To determine if Peter or Robert is older, first find their
ages.
•Declarative Knowledge :knowing 'what', knowing 'that'
–Includes : Concepts, objects, facts, propositions, assertions,
models.
–It is knowledge about facts and relationships, that − can be
expressed in simple and clear statements, − can be added and
modified without difficulty.
–e.g., A car has four tyres; Peter is older than Robert.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 61
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 62
Chickballapur
6.2 Logic Programming
• Logic programming is a programming language
in which logical assertions are viewed as
programs
• There are several logic programming systems in
use today , the most popular of which his Prolog .
A prolog program is described as series of logical
assertions each of which is Horn Clause.
• A Horn Clause is clause that has at most one
positive literal . Thus P , ¬PVQ and P→Q are
all Horn Clauses.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 63
Chickballapur
Why the PROLOG programs are composed only of
Horn Clauses.

Reason has two consequences


1.Because of the uniform representation a
simple and efficient interpreter can be written .
2.The logic of Horn Clause systems is
decidable. (Unlike that of Full First order
predicate Logic )

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 64
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 65
Chickballapur
6.3 Forward Vs Backward Reasoning

What is Reasoning ?
• The mental ability found in humans which is able to
generate conclusions from assumptions or premises
can be termed as reasoning.
• It is a means by which rational beings propose a
specific reasons or explanation of cause and effect.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 66
Chickballapur
• Forward Reasoning
In a Forward Reasoning Systems you start with the
initial facts and keeping using the rules to draw new
conclusion( or take certain actions) given those facts.
Forward reasoning systems are primarily data driven.

• Backward Reasoning
In an backward reasoning systems we start with some
hypothesis (or goal) to prove and keep looking for
rules that will allow us to conclude that hypothesis
perhaps setting new sub goals to prove as we go.
Backward reasoning systems are goal driven.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 67
Chickballapur
What are the factors that influence the question of
whether it is better to reason forward or
backward?
Four factors
1.Are there more possible starts states or goal
states?
2.In which direction is the branching factor
greater?
3.Will the program be asked to justify its
reasoning process to be a user?
4.What kind of event is going to trigger a
problem solving episode?
12/8/2021
Harshavardhana Doddamani Assistant
Professor Dept. Of C.S.E., S.J.C.I.T., 68
Chickballapur
Bidirectional Search

• We can also search both forward from the start


state and backward from the goal
simultaneously until two paths meet
somewhere in between. This strategy is
called bidirectional search.
• Empirical result suggests that for blind search
bidirectional search is effective .
• But for Heuristic bidirectional search is
ineffective .
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 69
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 70
Chickballapur
Usefulness of Forward and Backward
• Although in principle the same set of rules can
be used for both forward and backward
reasoning in practice it has proved useful to
define two clauses of rules each of which
encodes a particular kind of knowledge
• –Forward rules which encode knowledge
about how to respond to certain input
configuration
• –Backward rules which encode knowledge
about how to achieve particular goals.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 71
Chickballapur
Backward Chaining Rule Systems
• Example : PROLOG , MYCIN
• Query System Application uses backward
chaining system

Forward Chaining Rule Systems


• Directed by incoming data
• For example suppose you sense searing heat
near your hand. You are likely to jerk your
hand away.
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 72
Chickballapur
• Combined Forward and Backward Reasoning
• Depending upon the suitability of the Rules
/assertions one must combine the forward and
backward reasoning.
• Example : Medical Diagnosis Problem.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 73
Chickballapur
6.4 Matching
Matching is used to extract the rules from
the collection of rules those that can be applied
at a given point.
It is a process of matching the current state and
precondition of the rules
Some of the matching proposal are :
1.Indexing
2.Matching With Variables
3.Complex and Approximate Matching
4.Conflict Resolution
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 74
Chickballapur
1. Indexing
Here the current state is used as an index into the rules base
and select the matching ones immediately
Any reasonable hashing function can be used to treat the
number as an index into the rules.

2. Matching with variables


•Here the matching is many –many matching in which many
rules are matched against many elements in the state
description simultaneously.
•RETE algorithm is one efficient many match algorithm ,
which gains efficiency from three major sources :

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 75
Chickballapur
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 76
Chickballapur
The Rate Algorithm

• A rete is a directed, a cyclic, rooted graph (a tree).


• A path from the root node to a leaf represents the left
hand side of a rule.
• Each node stores details of which facts have been
matched so far.
• As facts are changed, the changes are propagated
through the tree.
• This makes an efficient way for expert systems to
deal with environments which change often.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 77
Chickballapur
Complex and Approximate Matching

• A more complex matching process is required when


the preconditions of a rule specify required properties
that are not stated explicitly in the description of the
current state.
• In this case a separate set of rules must be used to
describe how some properties can be inferred from
others.
• For example a speech understanding program must
contain rules that map from a description of the
physical wave form to phones (instances of English
Phonemes such as p or d ) .
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 78
Chickballapur
4. Conflict Resolution
• Conflict resolution strategy is used to decide
which rule to use when more than one rule
fires at once.
• There are three basic approaches to the
problem of conflict resolution in a production
system
• 1.Assign a preference based on the rule that matched
• 2.Assign a preference based on the objects that matched.
• 3.Assign a preference based on the action/states that the
matched rule would perform.

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 79
Chickballapur
6.5 Control Knowledge
Knowledge about which paths are most likely to lead quickly
to a goal state is often called search control knowledge. It can
take many forms:
1.Knowledge about which states are more preferable to others
.
2.Knowledge about which rule to apply in a given situation
3.Knowledge about the order in which to pursue subgoals
4.Knowledge about useful sequence of rules to apply .
•Search Control knowledge is also known as meta knowledge
because it can be used to represent knowledge about
knowledge.
•A number of AI systems represent their control knowledge
with rules. Example : SOAR and PRODIGY
Harshavardhana Doddamani Assistant
12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 80
Chickballapur
End of Artificial Intelligence

Harshavardhana Doddamani Assistant


12/8/2021 Professor Dept. Of C.S.E., S.J.C.I.T., 81
Chickballapur

You might also like