Beruflich Dokumente
Kultur Dokumente
com
What is AI?
Artificial intelligence (AI) is the intelligence exhibited by machines or
software. It is also the name of the academic field of study which studies how
to create computers and computersoftware that are capable of intelligent
behavior. The central problems (or goals) of AI research
include reasoning, knowledge, planning, learning, natural language
processing (communication), perception and the ability to move and
manipulate objects.
Example
Cleverbot
Cleverbot is a chatterbot that’s modeled after human behavior and able to
hold a conversation. It does so by remembering words from conversations.
The responses are not programmed. Instead, it finds keywords or phrases that
matches the input and searches through its saved conversations to find how it
should respond to the input.
MySong
MySong is an application which can help people who has no experience in
write a song or even can not play any instrument, to create original music by
themselves. It will automatically choose chords to accompany the vocal
melody that you have just inputed by microphone. In the other hand, MySong
can help songwriters to record their new ideas and melodies no matter where
and when they are. But MySong is not a professional application which can
produce or edit your song, then it means you have to use other tools or
software to really develop a song.
Artificial Intelligence in Video Games
The AI components used in video games is often a slimmed down version of
a true AI implementation, as the scope of a video game is often limited (ie
Console memory capacity). The most innovative use of AI is garnered on
Personal Computers, whose memory capabilities are adjustable beyond the
capacity of modern gaming consoles.
Some examples of AI components typically used in video games are Path
Finding, Adaptiveness (learning), perception, and planning (decision
making).
The present state of video games can offer a variety of "worlds" for AI
concepts to be tested in, such as a static or dynamic environment,
deterministic or non-deterministic transitioning, and fully or partially known
game worlds. The real-time performance constraint of AI in video game
processing must also be considered, which is another contributing factor to
why video games may choose to implement a "simple" AI, ie: finite state
machine as AI, which may not even be considered Artifical Intelligence at
heart.
Artificial Intelligence in Mobile System
As smartphone come into our daily life, we need to the make our device even
more clever. Recently, researchers are trying to apply traditional AI
techniques into mobile environment. Those techniques, including speech
recognition, machine learning, classification and natural language processing
give us a more powerful application, such as SIRI on iOS, kinect from
Microsoft. AI on mobile device introduces some new challenges, such as
limited computation resource and energy consumption etc.
History of AI
Cybernetics and early neural networks
Turing's test
Game AI
Symbolic reasoning and the Logic Theorist
AI
Problem Formulation
States possible world states accessibility the agent can determine via its
sensors in which state it is consequences of actions the agent knows the
results of its actions levels problems and actions can be specified at various
levels constraints conditions that influence the problem-solving process
Performance measures to be applied costs utilization of resources
Problem Types
single-state problem
multiple-state problem
contingency problem
exploration problem
Single-State Problem
Exact prediction is possible state is known exactly after any sequence of
actions accessibility of the world all essential information can be obtained
through sensors consequences of actions are known to the agent goal
for each known initial state, there is a unique goal state that is guaranteed to
be reachable via an action sequence simplest case, but severely restricted
Multiple-State Problem
Semi-exact prediction is possible state is not known exactly, but limited to a
set of possible states after each action accessibility of the world not all
essential information can be obtained through sensors reasoning can be used
to determine the set of possible states consequences of actions are not always
or completely known to the agent; actions or the environment might exhibit
randomness goal due to ignorance, there may be no fixed action sequence
that leads to the goal less restricted, but more complex.
Contingency Problem
Exact prediction is impossible state unknown in advance, may depend on the
outcome of actions and changes in the environment accessibility of the world
some essential information may be obtained through sensors only at
execution time consequences of actions may not be known at planning time
goal instead of single action sequences, there are trees of actions contingency
branching point in the tree of actions agent design different from the previous
two cases: the agent must act on incomplete plans
Exploration Problem
Effects of actions are unknown state the set of possible states may be
unknown accessibility of the world some essential information may be
obtained through sensors only at execution time consequences of actions may
not be known at planning time goal can’t be completely formulated in
advance because states and consequences may not be known at planning time
discovery what states exist experimentation what are the outcomes of actions
learning remember and evaluate experiments
MATCHING
Clever search involves choosing from among the rules that can
be applied at a particular point, the ones that are most likely to
lead to a solution. We need to extract from the entire collection
of rules, those that can be applied at a given point. To do so
requires some kind of matching between the current state and
the preconditions of the rules.
How should this be done?
One way to select applicable rules is to do a simple search
through all the rules comparing one’s preconditions to the
current state and extracting all the ones that match . this requires
indexing of all the rules. But there are two problems with these
simple solutions:
A. It requires the use of a large number of rules. Scanning
through all of them would be hopelessly inefficeint.
B. It is not always immediately obvious whether a rule’s
preconditions are satisfied by a particular state.
Sometimes , instead of searching through the rules, we can use
the current state as an index into the rules and select the
matching ones immediately. In spite of limitations, indexing in
some form is very important in the efficient operation of rules
based systems.
A more complex matching is required when the preconditions of
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
Heuristic Search
All of the search methods in the preceding section are
uninformed in that they did not take into account the goal. They
do not use any information about where they are trying to get to
unless they happen to stumble on a goal. One form of heuristic
information about which nodes seem the most promising is a
heuristic function h(n), which takes a node n and returns a non-
negative real number that is an estimate of the path cost from
node n to a goal node. The function h(n) is an underestimate if
h(n) is less than or equal to the actual cost of a lowest-cost path
from node n to a goal.
The heuristic function is a way to inform the search about the
direction to a goal. It provides an informed way to guess which
neighbor of a node will lead to a goal.
There is nothing magical about a heuristic function. It must use
only information that can be readily obtained about a node.
Typically a trade-off exists between the amount of work it takes
to derive a heuristic value for a node and how accurately the
heuristic value of a node measures the actual path cost from the
node to a goal.
A standard way to derive a heuristic function is to solve a
simpler problem and to use the actual cost in the simplified
problem as the heuristic function of the original problem.
The straight-line distance in the world between the node and the
goal position can be used as the heuristic function. The
examples that follow assume the following heuristic function:
h(mail) = 26 h(ts) = 23 h(o103) = 21
PROBLEM CHARACTERISTICS
Heuristic search is a very general method applicable to a large class of problem . It includes
a variety of techniques. In order to choose an appropriate method, it is necessary to analyze
the problem with respect to the following considerations.
This can be done by breaking it into three smaller problems and solving each by applying
specific rules. Adding the results the complete solution is obtained.
Problem fall under three classes ignorable , recoverable and irrecoverable. This
classification is with reference to the steps of the solution to a problem. Consider thermo
proving. We may later find that it is of no help. We can still proceed further, since nothing
is lost by this redundant step. This is an example of ignorable solutions steps.
Now consider the 8 puzzle problem tray and arranged in specified order. While moving
from the start state towards goal state, we may make some stupid move and consider
theorem proving. We may proceed by first proving lemma. But we may backtrack and
undo the unwanted move. This only involves additional steps and the solution steps are
recoverable.
Lastly consider the game of chess. If a wrong move is made, it can neither be ignored nor
be recovered. The thing to do is to make the best use of current situation and proceed. This
is an example of an irrecoverable solution steps.
Problems can be classified into those with certain outcome (eight puzzle and water jug
problems) and those with uncertain outcome ( playing cards) . in certain – outcome
problems, planning could be done to generate a sequence of operators that guarantees to a
lead to a solution. Planning helps to avoid unwanted solution steps. For uncertain out come
problems, planning can at best generate a sequence of operators that has a good
probability of leading to a solution. The uncertain outcome problems do not guarantee a
solution and it is often very expensive since the number of solution and it is often very
expensive since the number of solution paths to be explored increases exponentially with
the number of points at which the outcome can not be predicted. Thus one of the hardest
types of problems to solve is the irrecoverable, uncertain – outcome problems ( Ex:-
Playing cards).
There are two categories of problems. In one, like the water jug and 8 puzzle problems, we
are satisfied with the solution, unmindful of the solution path taken, whereas in the other
category not just any solution is acceptable. We want the best, like that of traveling sales
man problem, where it is the shortest path. In any – path problems, by heuristic methods
we obtain a solution and we do not explore alternatives. For the best-path problems all
possible paths are explored using an exhaustive search until the best path is obtained.
In some problems the knowledge base is consistent and in some it is not. For example
consider the case when a Boolean expression is evaluated. The knowledge base now
contains theorems and laws of Boolean Algebra which are always true. On the contrary
consider a knowledge base that contains facts about production and cost. These keep
varying with time. Hence many reasoning schemes that work well in consistent domains are
not appropriate in inconsistent domains.
Though one could have unlimited computing power, the size of the knowledge base
available for solving the problem does matter in arriving at a good solution. Take for
example the game of playing chess, just the rues for determining legal moves and some
simple control mechanism is sufficient to arrive at a solution. But additional knowledge
about good strategy and tactics could help to constrain the search and speed up the
execution of the program. The solution would then be realistic.
Consider the case of predicting the political trend. This would require an enormous
amount of knowledge even to be able to recognize a solution , leave alone the best.
1. Solitary in which the computer will be given a problem description and will produce an
answer, with no intermediate communication and with he demand for an explanation of
the reasoning process. Simple theorem proving falls under this category . given the basic
rules and laws, the theorem could be proved, if one exists.
8. Problem Classification
Actual problems are examined from the point of view , the task here is examine an input
and decide which of a set of known classes.
In this definition, a node can be anything. All this definition does is constrain arcs to be ordered
pairs of nodes. There can be infinitely many nodes and arcs. We do not assume that the graph is
represented explicitly; we require only a procedure that can generate nodes and arcs as needed.
The arc ⟨n1,n2⟩ is an outgoing arc from n1 and an incoming arc to n2.
A node n2 is a neighbor of n1 if there is an arc from n1 to n2; that is, if ⟨n1,n2⟩∈A. Note that being
a neighbor does not imply symmetry; just because n2 is a neighbor of n1 does not mean that n1 is
necessarily a neighbor of n2. Arcs may be labeled, for example, with the action that will take the
agent from one state to another.
A path from node s to node g is a sequence of nodes ⟨n0, n1,..., nk⟩ such that s=n0, g=nk, and ⟨ni-
1,ni⟩∈A; that is, there is an arc from ni-1 to ni for each i. Sometimes it is useful to view a path as
the sequence of arcs, ⟨no,n1⟩, ⟨n1,n2⟩,..., ⟨nk-1,nk⟩ , or a sequence of labels of these arcs.
A cycle is a nonempty path such that the end node is the same as the start node - that is, a cycle is
a path ⟨n0, n1,..., nk⟩ such that n0=nk and k≠0. A directed graph without any cycles is called a
directed acyclic graph (DAG). This should probably be an acyclic directed graph, because it
is a directed graph that happens to be acyclic, not an acyclic graph that happens to be directed,
but DAG sounds better than ADG!
A tree is a DAG where there is one node with no incoming arcs and every other node has exactly
one incoming arc. The node with no incoming arcs is called the root of the tree and nodes with
no outgoing arcs are called leaves.
To encode problems as graphs, one set of nodes is referred to as the start nodes and another set
is called the goal nodes. A solution is a path from a start node to a goal node.
Sometimes there is a cost - a positive number - associated with arcs. We write the cost of arc
⟨ni,nj⟩ as cost(⟨ni,nj⟩). The costs of arcs induces a cost of paths.
Given a path p = ⟨n0, n1,..., nk⟩, the cost of path p is the sum of the costs of the arcs in the path:
An optimal solution is one of the least-cost solutions; that is, it is a path p from a start node to a
goal node such that there is no path p' from a start node to a goal node where cost(p')<cost(p).
Figure 3.2: A graph with arc costs for the delivery robot domain
Production System
Types of Production Systems.
A Knowledge representation formalism consists of collections of condition-action
rules(Production Rules or Operators), a database which is modified in accordance with the rules,
and a Production System Interpreter which controls the operation of the rules i.e The 'control
mechanism' of a Production System, determining the order in which Production Rules are fired.
A system that uses this form of knowledge representation is called a production system.
A production system consists of rules and factors. Knowledge is encoded in a declarative from
which comprises of a set of rules of the form
Situation ------------ Action
SITUATION that implies ACTION.
Example:-
i. A global database
ii. A set of production rules and
iii. A control system
The goal database is the central data structure used by an AI production system. The production
system. The production rules operate on the global database. Each rule has a precondition that is
either satisfied or not by the database. If the precondition is satisfied, the rule can be applied.
Application of the rule changes the database. The control system chooses which applicable rule
should be applied and ceases computation when a termination condition on the database is
satisfied. If several rules are to fire at the same time, the control system resolves the conflicts.
2. Production Systems are highly modular because the individual rules can be added, removed or
modified independently.
3. The production rules are expressed in a natural form, so the statements contained in the
knowledge base should the a recording of an expert thinking out loud.
One important disadvantage is the fact that it may be very difficult analyse the flow of control
within a production system because the individual rules don’t call each other.
Production systems describe the operations that can be performed in a search for a solution to the
problem. They can be classified as follows.
Monotonic production system :- A system in which the application of a rule never prevents the
later application of another rule, that could have also been applied at the time the first rule was
selected.
A production system in which the application of a particular sequence of rules transforms state X
into state Y, then any permutation of those rules that is allowable also transforms state x into
state Y.
Theorem proving falls under monotonic partially communicative system. Blocks world and 8
puzzle problems like chemical analysis and synthesis come under monotonic, not partially
commutative systems. Playing the game of bridge comes under non monotonic , not partially
commutative system.
For any problem, several production systems exist. Some will be efficient than others. Though it
may seem that there is no relationship between kinds of problems and kinds of production
systems, in practice there is a definite relationship.
Partially commutative , monotonic production systems are useful for solving ignorable problems.
These systems are important for man implementation standpoint because they can be
implemented without the ability to backtrack to previous states, when it is discovered that an
incorrect path was followed. Such systems increase the efficiency since it is not necessary to
keep track of the changes made in the search process.
Monotonic partially commutative systems are useful for problems in which changes occur but
can be reversed and in which the order of operation is not critical (ex: 8 puzzle problem).
Production systems that are not partially commutative are useful for many problems in which
irreversible changes occur, such as chemical analysis. When dealing with such systems, the order
in which operations are performed is very important and hence correct decisions have to be made
at the first time itself.
Selecting rules; keeping track of those sequences of rules that have already been tried and the
states produced by them.
Goal state provides a basis for the termination of the problem solving task.
3- ACTION STAGE
Applying the action part of the rule => changing the content of the workspace
=>new patterns,new matches => new set of rules eligible for execution
Search Strategies
Uninformed Search Strategies have no additional information about states beyond that
provided in the problem definition.
Strategies that know whether one non goal state is ―more promising‖ than another are
called Informed search or heuristic search strategies.
There are five uninformed search strategies as given below.
o Breadth-first search
o Uniform-cost search
o Depth-first search
o Depth-limited search
o Iterative deepening search
Problem characteristics
Analyze each of them with respect to the seven problem characteristics
Chess
Water jug
8-puzzle
Traveling salesman
Missionaries and cannibals
Tower of Hanoi
1. Chess
Problem characteristic Satisfied Reason
Is a good solution absolute or absolute Absolute solution : once you get one
relative? solution you do need to bother about
other possible solution.
Relative Solution : once you get one
solution you have to find another
possible solution to check which solution
is best(i.e low cost).
By considering this chess is absolute
Is the solution a state or a path? Path Is the solution a state or a path to a
state?
– For natural language understanding,
some of the words have different
interpretations .therefore sentence may
cause ambiguity. To solve the problem
we need to find interpretation only
, the workings are not necessary (i.e path
to solution is not necessary)
So In chess winning state(goal state)
describe path to state
What is the role of knowledge? lot of knowledge helps to constrain the
search for a solution.
2. Water jug
3. 8 puzzle
Problem characteristic Satisfied Reason
Can solution steps be ignored or Yes We can undo the previous move
undone?
Is a good solution absolute or absolute Absolute solution : once you get one
relative? solution you do need to bother about
other possible solution.
Relative Solution : once you get one
solution you have to find another
possible solution to check which solution
is best(i.e low cost).
By considering this 8 puzzle is absolute
Is the solution a state or a path? Path Is the solution a state or a path to a
state?
– For natural language understanding,
some of the words have different
interpretations .therefore sentence may
cause ambiguity. To solve the problem
we need to find interpretation only
, the workings are not necessary (i.e path
to solution is not necessary)
So In 8 puzzle winning state(goal state)
describe path to state
What is the role of knowledge? lot of knowledge helps to constrain the
search for a solution.
Is a good solution absolute or absolute Absolute solution : once you get one
relative? solution you do need to bother about
other possible solution.
Relative Solution : once you get one
solution you have to find another
possible solution to check which solution
is best(i.e low cost).
By considering this TSP is absolute
Is the solution a state or a path? Path Is the solution a state or a path to a
state?
– For natural language understanding,
some of the words have different
interpretations .therefore sentence may
cause ambiguity. To solve the problem
we need to find interpretation only
, the workings are not necessary (i.e path
to solution is not necessary)
So In TSP (goal state) describe path to
state
What is the role of knowledge? lot of knowledge helps to constrain the
search for a solution.
Is a good solution absolute or absolute Absolute solution : once you get one
relative? solution you do need to bother about
other possible solution.
Relative Solution : once you get one
solution you have to find another
possible solution to check which solution
is best(i.e low cost).
By considering this Tower of Hanoi
isabsolute
Is the solution a state or a path? Path Is the solution a state or a path to a
state?
– For natural language understanding,
some of the words have different
interpretations .therefore sentence may
cause ambiguity. To solve the problem
we need to find interpretation only
• Time
- Instructions take time.
- How fast does the algorithm perform?
- What affects its runtime?
• Space
- Data structures take space
- What kind of data structures can be used?
- How does choice of data structure affect the
runtime?
1
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
• What can we say about the work done for list of any length?
i = 0;
if (i <MAX)
printf ( “Yes, target is there \n” );
else
printf( “No, target isn’t there \n” );
2
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
3
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
LOOP 1:
grandTotal = 0;
for (k=0; k<n-1; ++k) {
rows[k] = 0;
for (j = 0; j <n-1; ++j){
rows[k] = rows[k] + matrix[k][j];
grandTotal = grandTotal + matrix[k][j];
}
}
LOOP 2:
grandTotal =0;
for (k=0; k<n-1; ++k)
rows[k] = 0;
for (j = 0; j <n-1; ++j)
rows[k] = rows[k] + matrix[k][j];
grandTotal = grandTotal + rows[k];
}
4
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
Big-O Notation
We want to understand how the performance of an
algorithm responds to changes in problem size. Basically
the goal is to provide a qualitative insight. The Big-O
notation is a way of measuring the order of magnitude of a
mathematical expression
O(n) means on the Order of n
Consider
n4 + 31n2 + 10 = f (n)
Let g(n) = n4
5
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
Now 2 n2 + 3 n + 1 < = c n2
Or 2 + (3/n) + ( 1 / n2 ) < = c
6
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
Example 1:
Use big-O notation to analyze the time efficiency of the
following fragment of C code:
7
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
.
.
}
}
Example 2:
8
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
9
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
• What can we say about the work done for list of any length?
i = 0;
if (i <MAX)
printf ( “Yes, target is there \n” );
else
printf( “No, target isn’t there \n” );
10
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
Order Notation
How much work to find the target in a list containing N
elements?
Note: we care here only about the growth rate of work.
Thus, we toss out all constant values.
11
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
12
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
Order Notation
13
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
26 =64
then we can write
log264 = 6
2k = n
or in other words
log2n = k
Example 3:
k = n;
while (k > 1)
{
.
14
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
.
k = k/2;
}
Since the loop variable is cut in half each time through the
loop, the number of times the statements inside the loop
will be executed is log2n.
Thus, an algorithm that halves the data remaining to be
processed on each iteration of a loop will be an O(log2n)
algorithm.
15
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
N O(LogN) O(N2)
16 4 256
64 6 4K
256 8 64K
1,024 10 1M
16,384 14 256M
131,072 17 16G
262,144 18 6.87E+10
524,288 19 2.74E+11
1,048,576 20 1.09E+12
1,073,741,824 30 1.15E+18
16
Get useful study materials from www.rejinpaul.com
www.rejinpaul.com
Constraint Satisfaction
Constraint satisfaction is the process of finding a solution to a
set of constraints that impose conditions that the variables must
satisfy. A solution is therefore a set of values for the variables
that satisfies all constraints—that is, a point in the feasible
region.
The techniques used in constraint satisfaction depend on the
kind of constraints being considered. Often used are constraints
on a finite domain, to the point that constraint satisfaction
problems are typically identified with problems based on
constraints on a finite domain. Such problems are usually solved
via search, in particular a form of backtracking or local search.
Constraint propagation are other methods used on such
problems; most of them are incomplete in general, that is, they
may solve the problem or prove it unsatisfiable, but not always.
Constraint propagation methods are also used in conjunction
with search to make a given problem simpler to solve. Other
considered kinds of constraints are on real or rational numbers;
solving problems on these constraints is done via variable
elimination or the simplex algorithm.
Complexity
Solving a constraint satisfaction problem on a finite domain is
an NP complete problem with respect to the domain size.
Research has shown a number of tractable subcases, some
limiting the allowed constraint relations, some requiring the
scopes of constraints to form a tree, possibly in a reformulated
version of the problem. Research has also established
UNIT 02
GAME PLAYING
Introduction
Game playing has been a major topic of AI since the very beginning. Beside the attraction of the
topic to people, it is also because its close relation to "intelligence", and its well-defined states
and rules.
The most common used AI technique in game is search. In some other problem-solving
activities, state change is solely caused by the action of the system itself. However, in multi-
player games, states also depend on the actions of other players (systems) who usually have
different goals.
A special situation that has been studied most is two-person zero-sum game, where the two
players have exactly opposite goals, that is, each state can be evaluated by a score from one
player's viewpoint, and the other's viewpoint is exactly the opposite. This type of game is
common, and easy to analyze, though not all competitions are zero-sum!
There are perfect information games (such as Chess and Go) and imperfect information games
(such as Bridge and games where dice are used). Given sufficient time and space, usually an
optimum solution can be obtained for the former by exhaustive search, though not for the latter.
However, for most interesting games, such a solution is usually too inefficient to be practically
used.
Minimax Procedure
For two-person zero-sum perfect-information game, if the two players take turn to move, the
minimax procedure can solve the problem given sufficient computational resources. This
algorithm assumes each player takes the best move in each step.
First, we distinguish two types of nodes, MAX and MIN, in the state graph, determined by the
depth of the search tree.
Minimax procedure: starting from the leaves of the tree (with final scores with respect to one
player, MAX), and go backwards towards the root (the starting state).
At each step, one player (MAX) takes the action that leads to the highest score, while the other
player (MIN) takes the action that leads to the lowest score.
All nodes in the tree will all be scored, and the path from root to the actual result is the one on
which all nodes have the same score.
Example:
Because of computational resources limitation, the search depth is usually restricted, and
estimated scores generated by a heuristic function are used in place of the actual score in the
above procedure.
Example: Tic-tac-toe, with the difference of possible win paths as the henristic function.
Alpha-Beta Pruning
Very often, the game graph does not need to be fully explored using Minimax.
Based on explored nodes' score, inequity can be set up for nodes whose children haven't been
exhaustively explored. Under certain conditions, some branches of the tree can be ignored
without changing the final score of the root.
In Alpha-Beta Pruning, each MAX node has an alpha value, which never decreases; each MIN
node has a beta value, which never increases. These values are set and updated when the value of
a child is obtained. Search is depth-first, and stops at any MIN node whose beta value is smaller
than or equal to the alpha value of its parent, as well as at any MAX node whose alpha value is
greater than or equal to the beta value of its parent.
Examples: in the following partial trees, the other children of node (5) do not need to be
generated.
ITERATIVE DEEPENING
While still an unintelligent algorithm, the iterative deepening search combines the positive
elements of breadth-first and depth-first searching to create an algorithm which is often an
improvement over each method individually.
An iterative deepening search operates like a depth-first search, except slightly more constrained-
-there is a maximum depth which defines how many levels deep the algorithm can look for
solutions. A node at the maximum level of depth is treated as terminal, even if it would
ordinarily have successor nodes. If a search "fails," then the maximum level is increased by one
and the process repeats. The value for the maximum depth is initially set at 0 (i.e., only the initial
node).
Visited
Nodes
Current
Node
An interesting observation is that the nodes in this search are first checked in the same order they
would be checked in a breadth-first-search; however, since nodes are deleted as the search
progresses, much less memory is used at any given time.
The drawback to the iterative deepening search is clear from the walkthrough--it can be painfully
redundant, rechecking every node it has already checked with each new iteration. The algorithm
can be enhanced to remember what nodes it has already seen, but this sacrifices most of the
memory efficiency that made the algorithm worthwhile in the first place, and nodes at the
maximum level for one iteration will still need to be re-accessed and expanded in the following
iteration. Still, when memory is at a premium, iterative deepening is preferable to a plain depth-
first search when there is danger of looping or the most efficient solution is desired.
Knowledge Representation
Typically, a problem to solve or a task to carry out, as well as what constitutes a solution, is only
given informally, such as "deliver parcels promptly when they arrive" or "fix whatever is wrong
with the electrical system of the house."
Knowledge is the information about a domain that can be used to solve problems in that domain.
To solve many problems requires much knowledge, and this knowledge must be represented in
the computer. As part of designing a program to solve problems, we must define how the
knowledge will be represented. A representation scheme is the form of the knowledge that is
used in an agent. A representation of some piece of knowledge is the internal representation of
the knowledge. A representation scheme specifies the form of the knowledge. A knowledge
base is the representation of all of the knowledge that is stored by an agent.
amenable to efficient computation, which usually means that it is able to express features
of the problem that can be exploited for computational gain and able to trade off accuracy
and computation time.
able to be acquired from people, data and past experiences.
Many different representation schemes have been designed. Many of these start with some of
these objectives and are then expanded to include the other objectives. For example, some are
designed for learning and then expanded to allow richer problem solving and inference abilities.
Some representation schemes are designed with expressiveness in mind, and then inference and
learning are added on. Some schemes start from tractable inference and then are made more
natural, and more able to be acquired.
Some of the questions that must be considered when given a problem or a task are the following:
Predicate Calculus
First-order logic
• Whereas propositional logic assumes the
world contains facts,
• first-order logic (like natural language)
assumes the world contains
• Objects: people, houses, numbers, colors,
baseball games, wars, …
• Relations: red, round, prime, brother of,
bigger than, part of, comes between, …
Atomic sentences
Atomic sentence = predicate (term1,...,termn)
or term1 = term2
Complex sentences
• Complex sentences are made from atomic
sentences using connectives
•
S, S1 S2 , S1 S2 , S1 S2, S1 S2 ,
E.g. Sibling(TaoiseachJohn,Richard)
Sibling(Richard,TaoiseachJohn)
>(1,2) ≤ (1,2)
>(1,2) >(1,2)
Universal quantification
• <variables> <sentence>
•
Everyone at DIT is smart:
x At(x,DIT) Smart(x)
Existential quantification
• <variables> <sentence>
• Someone at DIT is smart:
• x At(x,DIT) Smart(x)$
•
• x P is true in a model m iff P is true with x being some
possible object in the model
•
Properties of quantifiers
• x y is the same as y x
•
• x y is the same as y x
•
Equality
• term1 = term2 is true under a given interpretation
if and only if term1 and term2 refer to the same
object
•
Using FOL
The kinship domain:
• “Sibling” is symmetric
•
x,y Sibling(x,y) Sibling(y,x)
Summary
• First-order logic:
•
– objects and relations are semantic primitives
– syntax: constants, functions, predicates,
equality, quantifiers
–
Universal Quantifier
• The value for
Existential Quantifier
• The value for
Some Definitions
• A predicate calculus expressions S1 is
satisfied.
• Definition If there exists an Interpretation I
and a variable assignment under I which
returns a value T for S1 then S1 is said to be
satisfied under I.
Some Definitions
Some Definitions
• A predicate calculus expressions S1 is satisfied.
• Definition If there exists an Interpretation I and a variable
assignment under I which returns a value T for S1 then S1 is
said to be satisfied under I.
• A set of predicate calculus expressions S is satisfied.
•
• Definition For any interpretation I and variable assignment
where a value T is returned for every element in S the the set
S is said to be satisfied,
Soundness
• An inference rule is sound.
• If all predicate calculus expressions X
produced using the inference rule from a
set of expressions, S logically follow from
S then the inference rule is said to be
sound.
Completeness
• An inference Rule is complete if given a
set S of predicate calculus expressions, it
can infer every expression that logically
follows from S
Equivalence
• Recall that :
• See attached word
document
Predicate Calculus
First-order logic
• Whereas propositional logic assumes the
world contains facts,
• first-order logic (like natural language)
assumes the world contains
• Objects: people, houses, numbers, colors,
baseball games, wars, …
• Relations: red, round, prime, brother of,
bigger than, part of, comes between, …
Atomic sentences
Atomic sentence = predicate (term1,...,termn)
or term1 = term2
Complex sentences
• Complex sentences are made from atomic
sentences using connectives
•
S, S1 S2 , S1 S2 , S1 S2, S1 S2 ,
E.g. Sibling(TaoiseachJohn,Richard)
Sibling(Richard,TaoiseachJohn)
>(1,2) ≤ (1,2)
>(1,2) >(1,2)
Universal quantification
• <variables> <sentence>
•
Everyone at DIT is smart:
x At(x,DIT) Smart(x)
Existential quantification
• <variables> <sentence>
• Someone at DIT is smart:
• x At(x,DIT) Smart(x)$
•
• x P is true in a model m iff P is true with x being some
possible object in the model
•
Properties of quantifiers
• x y is the same as y x
•
• x y is the same as y x
•
Equality
• term1 = term2 is true under a given interpretation
if and only if term1 and term2 refer to the same
object
•
Using FOL
The kinship domain:
• “Sibling” is symmetric
•
x,y Sibling(x,y) Sibling(y,x)
Summary
• First-order logic:
•
– objects and relations are semantic primitives
– syntax: constants, functions, predicates,
equality, quantifiers
–
Universal Quantifier
• The value for
Existential Quantifier
• The value for
Some Definitions
• A predicate calculus expressions S1 is
satisfied.
• Definition If there exists an Interpretation I
and a variable assignment under I which
returns a value T for S1 then S1 is said to be
satisfied under I.
Some Definitions
Some Definitions
• A predicate calculus expressions S1 is satisfied.
• Definition If there exists an Interpretation I and a variable
assignment under I which returns a value T for S1 then S1 is
said to be satisfied under I.
• A set of predicate calculus expressions S is satisfied.
•
• Definition For any interpretation I and variable assignment
where a value T is returned for every element in S the the set
S is said to be satisfied,
Soundness
• An inference rule is sound.
• If all predicate calculus expressions X
produced using the inference rule from a
set of expressions, S logically follow from
S then the inference rule is said to be
sound.
Completeness
• An inference Rule is complete if given a
set S of predicate calculus expressions, it
can infer every expression that logically
follows from S
Equivalence
• Recall that :
• See attached word
document
Predicate Logic
The first of these, predicate logic, involves using standard forms of logical
symbolism which have been familiar to philosophers and mathematicians for many
decades. Most simple sentences, for example, ``Peter is generous'' or ``Jane gives a
painting to Sam,'' can be represented in terms of logical formulae in which a
predicate is applied to one or more arguments (the term `argument' as used in
predicate logic is similar to, but not identical with, its use to refer to the inputs to a
procedure in POP-11):
PREDICATE ARGUMENTS
generous (peter)
while the sentence ``Jane has at least one friend who is generous'' can be expressed
as follows:
The expressions `For any X' and `For some X' are known as quantifiers. We can
now use quantification to exhibit the ambiguity of the sentence about the
respectable villagers. The first reading of it can be represented as
It is thus possible to show in a clear way that the original sentence can express (at
least) two quite distinct propositions. It is possible to infer from the first, but not
from the second, that if Margaret and Neil are two respectable villagers, then they
both worship the same entity. (In the interests of ecumenical peace, however, it is
sometimes better to refrain from letting such ambiguities come out into the open!)
Predicate logic has a long pedigree. Its roots go back at least as far as Aristotle,
although in its current form it was developed starting in the late nineteenth century.
Associated with it are techniques for the analysis of many conceptual structures in
our common thought. Because these analytical techniques are well-understood, and
because it is relatively easy to express the formulae of predicate logic in AI
languages such as LISP or POP-11, it has been a very popular knowledge
representation symbolism within AI. Predicate logic also embodies a set of
systematic procedures for proving that certain formulae can or cannot be logically
derived from others and such logical inference procedures have been used as the
backbone for problem-solving systems in AI. Predicate logic is in itself an
extremely formal kind of representation mechanism. Its supporters believe,
however, that it can be used to fashion conceptual tools which reproduce much of
the subtlety and nuance of ordinary informal thinking.
RESOLUTION
Problem Definition
Input
1. Database containing formally represented facts: First-order
logic sentences converted into clause form.
2. Inference rule: Resolution principle (MP & MT)
Requirements:
1. Soundness – every sentence produced by the procedure will
be “true”.
2. Completeness – every “true” sentence can be produced by
the procedure
Definitions
• Terms:
– Constants (e.g. “c1”, “c2”)
– Variables (e.g. “x1”, “x2”)
– Functions (e.g. “f(x1, x2)”)
Definitions
• Formulae - Recursively defined:
– Every Atom is a formula
– If w1, w2 are formulae, then so are:
• We can conclude:
– (Φ – {φ}) U (Ψ – {¬φ})
• We can conclude:
– ((Φ – {φ}) U (Ψ – {¬ψ})) | g
Intuition
• If all DB sentences are true, and assuming ¬C
creates a contradiction then C must be inferred
from DB.
•
2. Distribute negations:
– Replace ¬¬A with A
– A B with A B
– …
x brick x y on y, x brick y
y, z on x, y on x, z equal y, z
• Remove implications:
y on x, y bigger y, x
x brick x y on y, x brick y
y, z on x, y on x, z equal y, z
y, z on x, y on x, z equal y, z
y, z on x, y on x, z equal y, z
y, z on x, y on x, z equal y, z
• Rename variables:
on x, support x bigger support x , x
x brick x y on y, x brick y
w, z on x, w on x, z equal w, z
w, z on x, w on x, z equal w, z
• Convert to CNF:
brick x on x, support x
brick x bigger support x , x
brick x on y, x brick y
brick x on x, w on x, z equal w, z
Simple Example
• The problem:
– “Heads I win, tails you lose.”
– Use resolution to show I always win.
• Facts representation:
1. H Win Me
2. T Loose You
3. H T
4. Loose You Win Me
Goal : Win Me
Simple Example
• Proof:
1. H ,Win Me
2. T , Loose You
3. H ,T
4. Loose You ,Win Me
5. Win Me
6. T ,Win Me 2, 4
7. T ,Win Me 1, 3
8. Win Me 6, 7
9. {} 5,8
A good system for the representation of structured knowledge in a particular domain should
posses the following four properties:
(i) Representational Adequacy:- The ability to represent all kinds of knowledge that are needed
in that domain.
(ii) Inferential Adequacy :- The ability to manipulate the represented structure and infer new
structures.
(iii) Inferential Efficiency:- The ability to incorporate additional information into the knowledge
structure that will aid the inference mechanisms.
(iv) Acquisitional Efficiency :- The ability to acquire new information easily, either by direct
insertion or by program control.
The techniques that have been developed in AI systems to accomplish these objectives fall under
two categories:
1. Declarative Methods:- In these knowledge is represented as static collection of facts which are
manipulated by general procedures. Here the facts need to be stored only one and they can be
used in any number of ways. Facts can be easily added to declarative systems without changing
the general procedures.
In practice most of the knowledge representation employ a combination of both. Most of the
knowledge representation structures have been developed to handle programs that handle natural
language input. One of the reasons that knowledge structures are so important is that they
provide a way to represent information about commonly occurring patterns of things . such
descriptions are some times called schema. One definition of schema is
“Schema refers to an active organization of the past reactions, or of past experience, which must
always be supposed to be operating in any well adapted organic response”.
By using schemas, people as well as programs can exploit the fact that the real world is not
random. There are several types of schemas that have proved useful in AI programs. They
include
Frames and scripts are used very extensively in a variety of AI programs. Before selecting any
specific knowledge representation structure, the following issues have to be considered.
(i) The basis properties of objects , if any, which are common to every problem domain must be
identified and handled appropriately.
(iii) Mechanisms must be devised to access relevant parts in a large knowledge base.
◊ Logic ◊ Rules
◊ Frames ◊ Semantic Net
• Knowledge Progression
Organizing Interpretation Understanding
Data Information Knowledge Wisdom
Analyzing Evaluation Principles
04
Wisdom
Understanding
principles
Knowledge
Understanding
patterns
Information
Understanding
relations Degree of
Data
Fig. Knowledge Model Understanding
05
The map shows two types of knowledge - Tacit and Explicit knowledge.
Tacit knowledge comes from "experience", "action", "subjective" , "insight"
Explicit knowledge comes from "principle", "procedure", "process",
"concepts", via transcribed content or artifact of some type.
Doing
Experience (action) Principles Procedure
Tacit Explicit
Knowledge Knowledge Process
Context
Information
Facts
www.rejinpaul.com
• Knowledge Type
www.rejinpaul.com
KR -Introduction
Knowledge
Start
No Yes
Has been Can not be Implicit
articulated articulated
Yes No
Explicit Tacit
Facts and Motor Skill
things (Manual)
Solve
Problem Solution
Formal
Compute
Representation Output
10
In simple words, we :
− need to know about things we want to represent , and
− need some means by which things we can manipulate.
Reasoning
programs
Internal
Facts
Representation
English English
understanding generation
English
Representation
Facts Representations
Desired real
Initial reasoning Final
Facts Facts
Forward Backward
representation representation
mapping mapping
Internal English
Representation Operated by Representation
program
‡ The doted line on top indicates the abstract reasoning process that
a program is intended to model.
13
Note : To date no single system can optimizes all of the above properties .
14
◊ Relational Knowledge :
provides a framework to compare two objects based on equivalent
attributes.
any instance in which two different objects are compared is a
relational type of knowledge.
◊ Inheritable Knowledge
− is obtained from associated objects.
− it prescribes a structure in which new objects are created which may
inherit all or a subset of attributes from existing objects.
◊ Inferential Knowledge
− is inferred from objects through relations among objects.
− e.g., a word alone is a simple syntax, but with the help of other
words in phrase the reader may infer more from a word; this
inference within linguistic is called semantics.
◊ Declarative Knowledge
− e.g. laws, people's name; these are facts which can stand alone, not
dependent on other knowledge;
Procedural Knowledge
16
instance instance
www.rejinpaul.com
4. Else, move to the node corresponding to that value and look for a
value for the attribute A; If one is found, report it.
5. Else, do until there is no value for the “isa” attribute or
until an answer is found :
(a) Get the value of the “isa” attribute and move to that node.
(b) See if there is a value for the attribute A; If yes, report it.
− batting–average(Three-Finger-Brown) =
0.106 − height (Pee-Wee-Reese) = 6.1
− bats (Three Finger Brown) = right
[For explanation - refer book on AI by Elaine Rich & Kevin Knight, page 112]
18
Example :
knowledge.
− given a set of relations and values, one may infer other values or
relations.
Note : If more information is made available about these objects and their
relations, then more knowledge can be inferred.
19
Declarative knowledge :
Here, the knowledge is based on declarative facts about axioms and
domains .
Procedural knowledge:
Here, the knowledge is a mapping process between domains that specify
“what to do when” and the representation is of “how to make it” rather than
phrase may contain articles, adjectives and nouns. It thus accordingly call
routines that know how to process articles, adjectives and nouns.
20
The issues that arise while using KR techniques are many. Some of these
are explained below.
◊ Important Attributes :
Any attribute of objects so basic that they occur in almost every
problem domain ?
◊ Choosing Granularity :
At what level of detail should the knowledge be represented ?
◊ Set of objects :
How sets of objects be represented ?
Note : These issues are briefly explained, referring previous example, Fig.
Inheritable KR. For detail readers may refer book on AI by Elaine Rich & Kevin
Knight- page 115 – 126.
21
There are two attributes "instance" and "isa", that are of general
importance. These attributes are important because they support property
inheritance.
◊ Inverses :
This is about consistency check, while a value is added to one
attribute. The entities are related to each other in many different ways.
The figure shows attributes (isa, instance, and team), each with a
directed arrow, originating at the object being described and
terminating either at the object or its value.
There are two ways of realizing this:
‡ first, represent two relationships in a single representation; e.g., a
logical representation, team(Pee-Wee-Reese, Brooklyn–Dodgers),
22
23
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 ?
24
− asserting some property that holds for individual elements of the set ,
means, any thing that is an elephant is large .
25
26
In the previous section much has been illustrated about knowledge and KR
related issues. This section, illustrates :
How knowledge can be represented as “symbol structures” that characterize
bits of knowledge about objects, concepts, facts, rules, strategies;
Assumptions about KR :
− Intelligent Behavior can be achieved by manipulation of symbol structures.
− KR languages are designed to facilitate operations over symbol structures,
have precise syntax and semantics;
Syntax tells which expression is legal ?,
e.g., red1(car1), red1 car1, car1(red1), red1(car1 & car2) ?; and
To satisfy these assumptions about KR, we need formal notation that allow
automated inference and problem solving. One popular choice is use of logic.
27
◊ Semantic :
Specifies how to assign a truth value to a sentence based on its
meaning in the world. It Specifies what facts a sentence refers to.
A fact is a claim about the world, and it may be TRUE or FALSE.
◊ Inference Procedure :
Specifies methods for computing new sentences from the existing
sentences.
Note
Facts : are claims about the world that are True or False.
Representation : is an expression (sentence), stands for the objects and
relations.
Sentences : can be encoded in a computer program.
28
29
◊ Logic defines ways of putting symbols together so that user can define
legal sentences in the language that represent TRUE facts.
◊ Sentences - either TRUE or false but not both are called propositions.
In this section, first Propositional Logic (PL) is briefly explained and then
the Predicate logic is illustrated in detail.
30
Example :
Sentence Truth value Proposition (Y/N)
"Grass is green" "true" Yes
"2 + 5 = 5" "false" Yes
"Close the door" - No
"Is it hot out side ?" - No
"x > 2" where x is variable - No
(since x is not defined)
"x = x" - No
(don't know what is "x" and "=";
"3 = 3" or "air is equal to air" or
"Water is equal to water"
has no meaning)
31
These and few more related terms, such as, connective, truth value,
contingencies, tautologies, contradictions, antecedent, consequent,
argument are explained below.
◊ Statement
Simple statements (sentences), TRUE or FALSE, that does not
contain any other statement as a part, are basic propositions;
lower-case letters, p, q, r, are symbols for simple statements.
Large, compound or complex statement are constructed from basic
propositions by combining them with connectives.
◊ Connective or Operator
The connectives join simple statements into compounds, and joins
compounds into larger compounds.
Table below indicates, the basic connectives and their symbols :
negation ¬p ~ ! NOT
"p is false"
if and only if "p and q are either both true or both false"
equivalence ↔ ≡ ⇔
32
p q ¬p ¬q p ∧ q p v q p→ q p ↔ q q→ p
T T F F T T T T T
T F F T F T F F T
F T T F F T T F F
F F T T F F T T T
[The next slide shows the truth values of a group of propositions, called
tautology, contradiction, contingency, antecedent, consequent. They form
argument where one proposition claims to follow logically other
proposition]
33
◊ Contradictions
A proposition that is always false is called a "contradiction".
e.g., (P ∧ ¬P) is always false regardless of the truth value of
the proposition P.
◊ Contingencies
A proposition is called a "contingency" , if that proposition is
neither a tautology nor a contradiction .
e.g., (P v Q) is a contingency.
◊ Antecedent, Consequent
These two are parts of conditional statements.
In the conditional statements, p → q , the
1st statement or "if - clause" (here p) is called antecedent ,
2nd statement or "then - clause" (here q) is called consequent.
34
Take all the premises, conjoin them, and make that conjunction
the antecedent of a conditional and make the conclusion the
consequent. This implication statement is called the corresponding
conditional of the argument.
‡ An argument is valid
"if and only if" its corresponding conditional is a tautology.
"if and only if" the statement of their equivalence using " ≡ " is a
tautology.
The propositional logic, is not powerful enough for all types of assertions;
Example : The assertion "x > 1", where x is a variable, is not a proposition
because it is neither true nor false unless value of x is defined.
Consider example :
“ All men are mortal.
Socrates is a man.
Then Socrates is mortal” ,
36
Example :
A sentence "Judy {runs}".
37
Logic operators :
Examples of disjunction (OR) and conjunction (AND).
Consider the expression with the respective logic symbols || and &&
x < y || ( y < z && z < x)
38
Generally, a predicate with variables (is called atomic formula) that can
be made a proposition by applying one of the following two operations
to each of its variables :
1. Assign a value to the variable; e.g., x > 1, if 3 is assigned to x
becomes 3 > 1 , and it then becomes a true statement, hence a
proposition.
2. Quantify the variable using a quantifier on formulas of predicate
logic (called wff well-formed formula), such as x > 1 or P(x), by
using Quantifiers on variables.
‡ Variable x
* x > 5 is not a proposition, its truth depends upon the value of
variable x
* to reason such statements, x need to be declared
‡ Declaration x : a
* x:a declares variable x
*x:a read as “x is an element of set a”
Note : The next few slide tells more on these two Quantifiers.
39
− About a property that holds for natural numbers but not for real
numbers, it is necessary to qualify what the allowable values of x
and y are.
40
*a is universe of discourse
*x is a member of the domain of discourse.
* p is a statement about x
‡ In propositional form it is written as : x P(x)
* p is a statement about x
x P(x)
‡ In propositional form it is written as :
* x P(x)
where P(x) is predicate tells : „ x loves you ‟
x is variable for object „ someone ‟ that populate
universe of discourse
42
‡ Terms
Defined recursively as variables, or constants, or functions like
f(t1, . . . , tn), where f is an n-ary function symbol, and t1, . . . , tn
are terms. Applying predicates to terms produces atomic formulas.
‡ Atomic formulas
An atomic formula (or simply atom) is a formula with no deeper
propositional structure, i.e., a formula that contains no logical
connectives or a formula that has no strict sub-formulas.
− Atoms are thus the simplest well-formed formulas of the logic.
The ways these two attributes "instance" and "isa", are logically expressed
are shown in the example below :
0,1
X
-1,0 1,0
Fig. A Triangular Function
Production rules, sometimes called IF-THEN rules are most popular KR.
48
Three types of rules are mostly used in the Rule-based production systems.
■ Meta rules
These are rules for making rules. Meta-rules reason about which rules
should be considered for firing.
Example :
IF the rules which do not mention the current goal in their premise, AND
there are rules which do mention the current goal in their premise, THEN
the former rule should be used in preference to the latter.
• Obscure • Explicit
• Simple data type can be used • May require high level data type
51
• For one task many lines of code • For one task one SQL statement
− Statement
A grand-parent is a parent of a parent.
53
‡ Constants:
‡ Variables:
Denote a single but unspecified element; symbols for variables
begin with an uppe ase letter or an underscore.
‡ Compound terms:
Comprise a functor and sequence of one or more compound
terms called arguments.
► Functor: is characterized by its name and number of
arguments; name is an atom, and number of arguments is
arity.
ƒ/n = ƒ( t1 , t2, . . . t n )
◊ Atoms
‡ a lower-case letter, possibly followed by other letters of either
◊ Numbers
‡ applications involving heavy numerical calculations are rarely
written in Prolog.
‡ integer representation: e.g. 0 -16 33 +100
◊ General Structures
◊ Special Structures
‡ In Prolog an ordered collection of terms is called a list .
58
literal literal
clause
(X is grand parent of Z)
61
63
Models of Computation :
While, these two are not models of computation, but they rank in
importance with computational models.
64
Functional models are developed over many years. The notations and
methods form the base upon which problem solving methodologies rest.
66
‡ Explanation :
* The 1st line is the statement "Socrates is a man." *
The 2nd line is a phrase "all human are mortal"
into the equivalent "for all X, if X is a man then X is mortal".
* The 3rd line is added to the set to determine the mortality of Socrates.
* The 4th line is the deduction from lines 2 and 3. It is justified by the
inference rule modus tollens which states that if the conclusion of a
rule is known to be false, then so is the hypothesis.
Given a set of rules, there are essentially two ways to generate new
knowledge: one, forward chaining and the other, backward chaining.
■ Example 2
Rule R1 : IF hot AND smoky THEN ADD fire
Rule R2 : IF alarm_beeps THEN ADD smoky
Rule R3 : IF fire THEN ADD switch_on_sprinklers
Fact F1 : alarm_beeps [Given]
Fact F2 : hot [Given]
70
71
Rule
User
Base
Repeat
‡ Collect the rule whose condition matches a fact in WM.
‡ Do actions indicated by the rule.
(add facts to WM or delete facts from WM)
Repeat
73
Conflict set is the set of rules that have their conditions satisfied by
working memory elements.
Conflict resolution normally selects a single rule to fire.
The popular conflict resolution mechanisms are :
Refractory, Recency, Specificity.
◊ Refractory
‡ a rule should not be allowed to fire more than once on the
same data.
‡ discard executed rules from the conflict set.
‡ prevents undesired loops.
◊ Recency
‡ rank instantiations in terms of the recency of the elements in
the premise of the rule.
‡ rules which use more recent data are preferred.
◊ Specificity
‡ rules which have a greater number of conditions and are
therefore more difficult to satisfy, are preferred to more
general rules with fewer conditions.
‡ more specific rules are „better‟ because they take more of the
data into account.
74
‡ Example of meta-knowledge
‡ Prove goal G
alarm_beeps
Smoky hot
fire
switch_on_sprinklers
Encoding of rules
Rule R1 : IF hot AND smoky THEN fire
76
• Many types of Reasoning have long been identified and recognized, but
many questions regarding their logical and computational properties still
remain controversial.
1.1 Definitions :
04
These three areas of reasoning, are in every human being, but the
ability level depends on education, environment and genetics.
05
of rules called
Logic is a language for reasoning. It is a collection
Logic arguments, we use when doing logical reasoning.
rules of inference.
The study of logic is divided into formal and informal logic. The
formal logic is sometimes called symbolic logic.
Sentences are derived using the system's axioms and rules of derivation are
called theorems.
06
The Formal logic is the study of inference with purely formal content,
ie. where content is made explicit.
System Elements
‡ A set of theorems.
a collection
A formal language may be viewed as being analogous to
of words or a collection of sentences.
‡ If A is words
then the set A is called alphabet of L, and
the elements of F are called words.
‡ If A is sentence
then the set A is called the lexicon or vocabulary of F, and
the elements of F are then called sentences.
‡ In mid 1970s, Marvin Minsky and John McCarthy pointed out that
pure classical logic is not adequate to represent the commonsense
nature of human reasoning. The reason is, the human reasoning is
non-monotonic in nature. This means, we reach to conclusions from
certain premises that we would not reach if certain other sentences are
included in our premises.
www.rejinpaul.com
■ Deduction
‡ Example: "When it rains, the grass gets wet. It rains. Thus, the
grass is wet."
This means in determining the conclusion; it is using rule and its
precondition to make a conclusion.
‡ Applying a general principle to a special case.
‡ Using theory to make predictions
‡ Usage: Inference engines, Theorem provers, Planning.
■ Induction
‡ Example: "The grass has been wet every time it has rained. Thus,
when it rains, the grass gets wet."
This means in determining the rule; it is learning the rule after
numerous examples of conclusion following the precondition.
‡ Deriving a general principle from special cases
‡ From observations to generalizations to knowledge
‡ Usage: Neural nets, Bayesian nets, Pattern recognition
14
■ Analogy
‡ Example: "An atom, with its nucleus and electrons, is like the solar
system, with its sun and planets."
Means analogous; it is illustration of an idea by means of a more
familiar idea that is similar to it in some significant features. and
thus said to be analogous to it.
‡ finding a common pattern in different cases
‡ usage: Matching labels, Matching sub-graphs, Matching
transformations.
Note: Deductive reasoning and Inductive reasoning are the two most
commonly used explicit methods of reasoning to reach a conclusion.
15
■ Deduction Example
Reason from facts and general principles to other facts.
Guarantees that the conclusion is true.
‡ Modus Ponens : a valid form of argument affirming the antecedent .
◊ If it is rainy, John carries an umbrella
It is rainy
----------------- (doted line read as "therefore")
John carries an umbrella.
◊ If p then q
p
-------
q
‡ Modus Tollens : a valid form of argument denying the consequent.
It is not rainy
◊ If p then q
not q
-------
not p
16
‡ Good Movie
Fact You have liked all movies starring Mery.
Inference You will like her next movie.
‡ Birds
Facts: Woodpeckers, swifts, eagles, finches have four
toes on each foot.
Inductive Inference All birds have 4 toes on each foot.
(Note: partridges have only 3).
‡ Objects
Facts Cars, bottles, blocks fall if not held up.
Inductive Inference If not supported, an object will fall.
(Note: an unsupported helium balloon will rise.)
‡ Medicine
Noted People who had cowpox did not get smallpox.
‡ Dating
‡ Smoking house
‡ Diagnosis
‡ Incompleteness
‡ Incorrectness
‡ “Best Guesses”
‡ Conflict Resolution
20
■ Note : What ever may be the reasoning method, the AI model must be
able to reason under conditions of uncertainty mentioned before.
21
‡ Symbolic reasoning
‡ Statistical reasoning
22
The basis for intelligent mathematical software is the integration of the "power
of symbolic mathematical tools" with the suitable "proof technology".
23
■ Default reasoning
■ Ci umscription
24
■ Non-monotonic logic
It has already been defined. It says, "the truth of a proposition may
change when new information (axioms) are added and a logic may be
build to allows the statement to be retracted."
Example :
25
‡ The rule says that given the prerequisite, the consequent can be
inferred, provided it is consistent with the rest of the data.
‡ Default Theory
It consists of a set of premises W and a set of default rules D.
An extension for a default theory is a set of sentences E which can
be derived from W by applying as many rules of D as possible
(together with the rules of deductive inference) without generating
inconsistency.
Note : D the set of default rules has a unique syntax of the form
γ (x)
E β (x)
is the consistency test of the default rule
γ (x)
is the consequent of the default rule
27
Example :
A Default Rule says " Typically an American adult owns a car ".
This default rule is applicable if we can prove from our beliefs that
John is an American and an adult, and believing that there is some
car that is owned by John does not lead to an inconsistency.
If these two sets of premises are satisfied, then the rule states that
we can conclude that John owns a car.
28
Observe that the rule ∀ x(Bird(x) & ¬ Abnormal(x) → Flies)) does not
allow us to infer that "Tweety flies", since we do not know that he is
abnormal with respect to flying ability.
29
■ Recognize inconsistencies
The Inference Engine (IE) may tell the TMS that some sentences are
contradictory. Then, TMS may find that all those sentences are believed
true, and reports to the IE which can eliminate the inconsistencies by
determining the assumptions used and changing them appropriately.
Example : A statement that either Abbott, or Babbitt, or Cabot is guilty
together with other statements that Abbott is not guilty, Babbitt is not
guilty, and Cabot is not guilty, form a contradiction.
The solutions offered, considering the reasoning processes into two parts :
one, a problem solver that uses whatever mechanism it happens to
have to draw conclusions as necessary, and
second, a truth maintenance system whose job is to maintain
consistency in knowledge representation of a knowledge base.
32
3. Statistical Reasoning :
.
However, it is often useful to represent the fact that we believe such that
something is probably true, or true with probability (say) 0.65.
This is useful for dealing with problems where there is randomness and
unpredictability (such as in games of chance) and also for dealing with problems
where we could, if we had sufficient information, work out exactly what is true.
33
.
• Recall glossary of terms
■ Probabilities :
■ Event :
One or more outcomes of a probability experiment .
■ Probability Experiment :
Process which leads to well-defined results call outcomes.
■ Sample Space :
Set of all possible outcomes of a probability experiment.
■ Independent Events :
Two events, E1 and E2, are independent if the fact that E1 occurs
does not affect the probability of E2 occurring.
■ Disjoint Events :
Another name for mutually exclusive events.
34
■ Empirical Probability :
Determined analytically, using knowledge about the nature of the
experiment rather than through actual experimentation.
■ Conditional Probability :
The probability of some event A, given the occurrence of some other
event B. Conditional probability is written P(A|B), and read as "the
probability of A, given B ".
■ Joint probability :
The probability of two events in conjunction. It is the probability of
both events together. The joint probability of A and B is written P(A ∩
B) ; also written as P(A, B).
■ Marginal Probability :
The probability of one event, regardless of the other event. The
marginal probability of A is written P(A), and the marginal probability
of B is written P(B).
35
■ Example 1
Classical Probability
Table below illustrates frequency and distribution for the above sums.
Sum 2 3 4 5 6 7 8 9 10 11 12
Frequency 1 2 3 4 5 6 5 4 3 2 1
Relative frequency 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 1/36 1/36
Empirical Probability
The empirical probability of an event is the relative frequency of a
frequency distribution based upon observation P(E) = f / n
36
B B' Marginal
A 0.00 0.20 0.20
A' 0.70 0.10 0.80
Marginal 0.70 0.30 1.00
B B' Marginal
A 0.15 0.05 0.20
A' 0.55 0.25 0.80
Marginal 0.70 0.30 1.00
37
Factorial
38
Permutation
The permutation is arranging elements (objects or symbols) into
distinguishable sequences. The ordering of the elements is important.
Each unique ordering is a permutation.
Number of permutations of „ n ‟ different things taken „ r ‟ at a time is
n n!
given by =
P r (n –r)!
n
(for convenience in writing, here after the symbol P r is written as
nPr or P(n,r) )
Example 1
Consider a total of 10 elements, say integers {1, 2, ...,
10}. A permutation of 3 elements from this set is (5, 3, 4).
Here n = 10 and r = 3.
The number of such unique sequences are calculated as P(10,3) = 720.
Example 2
Find the number of ways to arrange the three letters in the word
CAT in to two-letter groups like CA or AC and no repeated letters.
This means permutations are of size r = 2 taken from a set of
size n = 3. so P(n, r) = P(3,2) = 6.
The ways are listed as CA CT AC AT TC TA.
39
Combinations
Combination means selection of elements (objects or
symbols). The ordering of the elements has no importance.
Number of Combination of „ n ‟ different things, taken „ r ‟ at a time is
n n n!
Cr = r = r!(n –r)! here
Example
Find the number of combinations of size 2 without repeated letters that
can be made from the three letters in the word CAT, order doesn't
matter; AT is the same as TA.
This means combinations of size r =2 taken from a set of size n = 3,
so C(n , r) = C(3 , 2) = 3 . The ways are listed as CA CT CA .
Using the formula for finding the number of combinations of
r objects from a set of n objects is:
n! 3! 3x2x1 6
C(n, r) = C(3,2) = = = = =3
r! (n-r)! 2! X 1! 2 x 1 X (1!) 2
10 x 9 x 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1
=
4 x 3 x 2 x 1 (6 x 5 x 4 x 3 x 2 x 1)
40
Probability Rules :
‡ All probabilities are between 0 and 1 inclusive 0 <= P(E) <= 1.
‡ The sum of all the probabilities in the sample space is 1.
‡ The probability of an event which must occur is 1.
‡ The probability of the sample space is 1.
‡ The probability of any event which is not in the sample space is zero.
‡ The probability of an event not occurring is P(E') = 1 - P(E)
41
42
There are 6 outcomes for which the first die is a 6, and of these, there
are 4 outcomes that total more than 8 are (6,3; 6,4; 6,5; 6,6).
The probability of a total > 8 given that first die is 6 is
therefore 4/6 = 2/3 .
This probability is written as: P(total>8 | 1st die = 6) = 2/3
event condition
Read as "The probability that the total is > 8 given that die one
is 6 is 2/3."
43
Draw a card from a deck, not replacing it, draw another card.
Find probability that both cards are Aces ie the 1st card is Ace
(event A) and the 2nd card is also Ace (event B).
Since 4 of 52 cards are Aces, therefore probability P(A) = 4/52
= 1/13.
Of the 51 remaining cards, 3 are aces. so, probability of 2nd
card is also Ace (event B) is P(B|A) = 3/51 = 1/17.
Therefore, P(A and B) = p(A) x p(B|A) = 1/13 x 1/17 = 1/221
44
given A.
Example 1: P(A or B) if events A or B are mutually exclusive
Rolling a die.
Find probability of getting either, event A as 1 or event B as 6?
Since it is impossible to get both, the event A as 1 and event B
as 6 in same roll, these two events are mutually exclusive.
The probability P(A) = P(1) = 1/6 and P(B) = P(6) = 1/6
Hence probability of either event A or event B is :
P(A or B) = p(A) + p(B) = 1/6 + 1/6 = 1/3
Example 2: P(A or B) if events A or B are not mutually exclusive
Find probability that a card from a deck will be either an
Ace or a Spade?
probability P(A) is P(Ace) = 4/52 and P(B) is P(spade) = 13/52.
Only way in a single draw to be Ace and Spade is Ace of
Spade; which is only one, so probability P(A and B) is
P(Ace and Spade) = 1/52.
Therefore, the probability of event A or B is :
P(A or B) = P(A) + P(B) – P(A and B)
= P(ace) + P(spade) - P(Ace and Spade)
= 4/52 + 13/52 - 1/52 = 16/52 = 4/13
45
.
• Bayes’ Theorem
47
■ Bayes' Theorem
P(Ak).P(B|A k)
P(Ak|B) =
P(A1).P(B|A1) + P(A2 ).P(B|A2 )+ - - - - + P(A n).P(B|A n)
48
◊ P(B|A1) = 0.9 [When it rains, the weatherman predicts rain 90% time.]
◊ P(B|A2) = 0.1 [When it does not rain, weatherman predicts rain 10% time.]
We want to know P(A1|B), the probability that it will rain on the day of
Marie's wedding, given a forecast for rain by the weatherman.
The answer can be determined from Bayes' theorem, shown below.
P(A1).P(B|A1) (0.014)(0.9)
P(A1|B) = =
P(A1).P(B|A1)+P(A2).P(B|A2) [(0.014)(0.9)+(0.986)(0.1)]
= 0.111
P(E1 ∩ E) 4 / 15
P(E1|E) = = =4/7
P(E1 ∩ E) + P(E2 ∩ E) (4 / 15) + (3 / 15)
P(E1).P(E|E1) 8 / 15 x 4 / 8
P(E1|E) = = =4/7
P(E1).P(E|E1) + P(E2).P(E|E2) (8/15 x 4/8) + (7/15 x 3/15)
iv)
Finally, work out P(¬H|¬P)
It is just 1 - P(H|¬P) = 1- 0.008923 = 0.99107
51
The certainty-factor model was one of the most popular model for
the representation and manipulation of uncertain knowledge in the
early (1980s) Rule-based expert systems.
52
.
• Rule Based Systems
another assertion.
Example : Trouble shooting of water pumps
■ There are many schemes for treating uncertainty in rule based systems.
Note : Depending on the scheme, there are different algebras for such
a combination of uncertainty. But all these algebras in many cases
come to incorrect conclusions because combination of uncertainty is
not a local phenomenon, but it is strongly dependent on the entire
situation (in principle a global matter).
55
Bayesian Networks are also called : Bayes nets, Bayesian Belief Networks
(BBNs) or simply Belief Networks. Causal Probabilistic Networks (CPNs).
The effects are not completely deterministic (e.g. disease -> symptom).
56
If the patient does not have the virus, the test is +ve with probability 0.02.
‡ Find P(P1 ∩ P2 )
The next slide : a case where one tests is +ve and other is -ve.
This means, an error on one of the tests but we don‟t know which one;
it may be any one.
P(H| P1 ∩ ¬P2).
‡ We need to calculate
Following same steps for the case of two +ve tests,
write Bayes Theorem
P(P1 ∩ ¬P2 |H) P(H)
P(H| P1 ∩ ¬P2) =
P(P1 ∩ ¬P2)
‡ Now work out P(P1 ∩ ¬P2 |H) and P(P1 ∩ ¬P2) using the fact that
P1 and P2 are independent given H ,
‡ Note :
Belief in H, the event that the patient has virus, has increased.
Prior belief was 0.15 but it has now gone up to 0.299.
This appears strange because we have been given two
contradictory pieces of data. But looking closely we see that
probability of an error in each case is not equal.
‡ The probability of a +ve test when patient is actually -ve is 0.02.
The probability of a -ve test when patient is actually +ve is 0.05.
Therefore we are more inclined to believe an error on the second
test and this slightly increases our belief that the patient is +ve.
www.rejinpaul.com
.
• More Complicated Bayesian Networks
The previous network was simple contained three nodes. Let us look at a
slightly more complicated one in the context of heart disease.
■ Here smoking and bad diet are regarded as causes of heart disease.
The heart disease in turn is a cause of high blood pressure and an
abnormal electrocardiogram.
[continued in the next slide]
60
D E E = abnormal electrocardiogram
Example :
Let A represent the proposition "Moore is attractive". Then
the axioms of probability insist that P(A) + P(¬A) = 1.
Now suppose that Andrew does not even know who "Moore" is, then
‡ We cannot say that Andrew believes the proposition if he has no
idea what it means.
62
Suppose a system has five members, say five independent states, and
exactly one of which is actual. If the original set is called S, | S | = 5, then
S
the set of all subsets (the power set) is called 2 .
If each possible subset as a binary vector (describing any member is
5
present or not by writing 1 or 0 ), then 2 subsets are possible, ranging
from the empty subset ( 0, 0, 0, 0, 0 ) to the "everything" subset ( 1, 1,
1, 1, 1 ).
The "empty" subset represents a "contradiction", which is not true in
any state, and is thus assigned a mass of one ;
The remaining masses are normalized so that their total is 1.
The "everything" subset is labeled as "unknown"; it represents the
state where all elements are present one , in the sense that you cannot
tell which is actual.
S
Note : Given a set S, the power set of S, written 2 , is the set of all subsets of S,
including the empty set and S.
63
Plausibility is 1 minus the sum of the masses of all sets whose intersection
with the hypothesis is empty. It is an upper bound on the possibility that the
hypothesis could possibly happen, up to that value, because there is only so
much evidence that contradicts that hypothesis.
Example :
A proposition say "the cat in the box is dead."
Suppose we have belief of 0.5 and plausibility of 0.8 for the proposition.
Suppose we have belief of 0.5 and plausibility of 0.8 for the proposition.
65
In the previous slides, two specific examples of Belief and plausibility have
been stated. It would now be easy to understand their generalization.
Summarize :
The confidence interval is that interval of probabilities within which
the true probability lies with a certain confidence based on the
belief "B" and plausibility "PL" provided by some evidence "E" for a
proposition "P".
The belief brings together all the evidence that would lead us to
believe in the proposition P with some certainty.
The plausibility brings together the evidence that is compatible with
the proposition P and is not inconsistent with it.
If "Ω" is the set of possible outcomes, then a mass probability "M"
Ω
is defined for each member of the set 2 and takes values in
Ω
the range [0,1] . The Null set, "ф", is also a member of 2 .
Example
Ω
Then 2 is the set {ф, {F}, {C}, {P}, {F, C}, {F, P}, {C, P}, {F, C, P}}
Confidence interval is then defined as [ B(E), PL(E) ] where
B(E) = ∑A M , where A⊆ E i.e., all evidence that makes us believe
in the correctness of P, and
PL(E) = 1 – B(¬E) = ∑¬A M , where ¬A ⊆ ¬E i.e., all the evidence
that contradicts P.
67
68
We have discussed only binary valued logic and classical set theory like :
Fuzzy logic was suggested by Zadeh as a method for mimicking the ability of
human reasoning using a small number of rules and still producing a smooth
output via a process of interpolation.
69
.
• Description of Fuzzy Logic
0 0
1.8 M height x 1.8 M height x
Binary valued logic {0, 1} Fuzzy logic [0, 1]
A fuzzy logic system is one that has at least one system component
that uses fuzzy logic for its internal knowledge representation.
Tumblers
0.5
Tumblers
72
1.1 E Expert systems have a number of major system components and interface
x with individuals who interact with the system in various roles. These are
p
e illustrated below.
User
Domain
Expert
Knowledge Inference
Engineer Engine
Encoded
Expertise
Knowledge Working
Base Storage
The individual components and their roles are explained in next slides.
04
Depending on the size of the system, the knowledge engineer and the
system engineer might be the same person.
06
07
■ Domain-Specific
‡ A particular system caters a narrow area of specialization;
e.g., a medical expert system cannot be used to find faults in an
electrical ci uit.
‡ Quality of advice offered by an expert system is dependent on the
amount of knowledge stored.
‡ Best suited for those dealing with expert heuristics for solving
problems.
‡ Not a suitable choice for those problems that can be solved using
purely numerical techniques.
Problem : prove
11
The data driven approach, or Forward chaining, uses rules similar to those
used for backward chaining. However, the inference process is different.
The system keeps track of the current state of problem solution and looks
for rules which will move that state closer to a final solution. The
Algorithm proceeds from a given situation to a desired goal, adding new
assertions found.
Problem : prove
If A and B true Then D is true
13
The IF-THEN rules, Semantic networks, and Frames are the most
commonly used representation schemes.
14
Given that the system knows which rules were used during the
inference process, the system can provide those rules to the user
as means for explaining the results.
16
17
■
Protocol-generation techniques
Include many types of interviews (unstructured, semi-structured
and structured), reporting and observational techniques.
■
Protocol analysis techniques
Used with transcripts of interviews or text-based information to
identify basic knowledge objects within a protocol, such as goals,
decisions, relationships and attributes. These act as a bridge between
the use of protocol-based techniques and knowledge modeling
techniques.
18
■ Matrix-based techniques
Used for capturing the way people compare and order concepts; it
may reveal knowledge about classes, properties and priorities.
■ Diagram-based techniques
20
Transferring knowledge from the human expert to a computer is often the most
difficult part of building an expert system.
The knowledge acquired from the human expert must be encoded in such a
way that it remains a faithful representation of what the expert knows, and it
can be manipulated by a computer.
The first two methods were illustrated in the earlier lecture slides on knowledge
representation therefore just mentioned here. The frame based representation
is described more.
21
If a1 , a2 , . . . . . , an
Then b1 , b2 , . . . . . , bn where
22
The most common form of semantic networks uses the links between
nodes to represent IS-A and HAS relationships between objects.
The Fig. below shows a car IS-A vehicle; a vehicle HAS wheels.
hiera
This kind of relationship establishes an inheritance hy in the
network, with the objects lower down in the network inheriting
properties from the objects higher up.
HAS
Vehicle Wheels
Is - A
HAS
Engine
CAR
HAS
Battery
Is - A Is - A
Honda Nissan
Civic Sentra
HAS
Power
Steering
23
Two frames, their slots and the slots filled with data type are shown.
Value 2 Value
Value 5 Value
Value 4 Value
25
‡ Every problem in a domain has some unique data associated with it.
‡ Fig. below shows how Working memory is closely related to user interface
of the expert system.
User
User Interface
Working Memory
(Task specific data)
Inference Engine
Knowledge Base
26
‡ Just a knowledge base alone is not of much use if there are no facilities for
navigating through and manipulating the knowledge to deduce something
from knowledge base.
These techniques were talked in the earlier lectures on Problem Solving : Sea
h and Control Strategies, and Knowledge Representation. However they are
relooked in the context of expert system.
27
‡ Data Driven
www.rejinpaul.com
AI – Expert system – Inference Engine
[Continued from previous slide]
■ Solution :
(i) ‡ Start with input given A, B is true and then
‡ start at Rule 1 and go forward/down till a rule
“fires'' is found.
First iteration :
(ii) ‡ Rule 3 fires : conclusion E is true
‡ new knowledge found
(iii) ‡ No other rule fires;
‡ end of first iteration.
(iv) ‡ Goal not found;
‡ new knowledge found at (ii);
‡ go for second iteration
Second iteration :
(v) ‡ Rule 2 fires : conclusion G is true
‡ new knowledge found
(vi) ‡ Rule 4 fires : conclusion D is true
‡ Goal found;
‡ Proved
29
‡ The algorithm proceeds from desired goal, adding new assertions found.
‡ Goal Driven
■ Solution :
(i) ‡ Start with goal ie D is true
‡ go backward/up till a rule "fires'' is found.
First iteration :
(ii) ‡ Rule 4 fires :
‡ new sub goal to prove G is true
‡ go backward
(iii) ‡ Rule 2 "fires''; conclusion: A is true
‡ new sub goal to prove E is true
‡ go backward;
(iv) ‡ no other rule fires; end of first iteration.
‡ new sub goal found at (iii);
‡ go for second iteration
Second iteration :
(v) ‡ Rule 3 fires :
■ Depth-First Sea h
‡ Then starts with node A and looks at the first node below it,
and so on.
■ Breadth-First Sea h
32
Knowledge
Engineer
■ Reasoning Engine
Case-Based reasoning.
■ Explanation subsystem
A subsystem that explains the system's actions. The explanation can
range from how the final or intermediate solutions were arrived at
justifying the need for additional data.
■ User Interface
34
Most expert systems have explanation facilities that allow the user to ask
questions - why and how it reached some conclusion.
The questions are answered by referring to the system goals, the rules
being used, and existing problem solving. The rules typically reflect
empirical, or "compiled" knowledge. They are codes of an expert's
rules of thumb, not the expert's deeper understanding.
Example :
Dialog with an expert system designed to give advice on car problems.
System Does the car start ?
User No.
Note : The rule gives the correct advice for a flooded car, and knows the
questions to be ask to determine if the car is flooded, but it does not contain
the knowledge of what a flooded car is and why waiting will help.
Types of Explanation
There are four types of explanations commonly used in expert systems.
‡ Rule trace reports on the progress of a consultation;
‡ Explanation of how the system reached to the given conclusion;
‡ Explanation of why the system did not give any conclusion.
‡ Explanation of why the system is asking a question;
www.rejinpaul.com
The Expert systems have found their way into most areas of knowledge
work. The applications of expert systems technology have widely proliferated
and comme ial problems, and
to industrial even helping NASA to plan
the maintenance of a space shuttle for its next flight. The main applications
are stated in next few slides.
‡ Knowledge Publishing
This is relatively new, but also potentially explosive area. Here the
primary function of the Expert system is to deliver knowledge that
is relevant to the user's problem. The two most widely known
Expert systems are : one, an advisor on appropriate grammatical
usage in a text; and the other, is a tax advisor on tax strategy,
tactics, and individual tax policy.
37