Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 38

What is Artificial Intelligence?

Is the theory and development of computer systems that are able to perform tasks normally requiring human
intelligence, such as visual perception, speech recognition, and translation between languages, decision-making and
common sense.
AI is study of making computers smart, making computers to perform tasks that normally require human intelligence,
and finally building computers tat simulate humans literally.
AI is accomplished by studying how human brain thinks, and how humans learn, decide, and work while trying to
solve a problem, and then using the outcomes of this study as a basis of developing intelligent software and systems.
Philosophy of AI
While exploiting the power of the computer systems, the curiosity of human, lead him to wonder, Can a machine
think and behave like humans do?
Thus, the development of AI started with the intention of creating similar intelligence in machines that we find and
regard high in humans.
Goals of AI
To Create Expert Systems The systems which exhibit intelligent behavior, learn, demonstrate, explain, and
advice its users.

To Implement Human Intelligence in Machines Creating systems that understand, think, learn, and
behave like humans.

What is AI Technique?
In the real world, the knowledge has some unwelcomed properties

Its volume is huge, next to unimaginable.

It is not well-organized or well-formatted.

It keeps changing constantly.

AI Technique is a manner to organize and use the knowledge efficiently in such a way that

It should be perceivable by the people who provide it.

It should be easily modifiable to correct errors.

It should be useful in many situations though it is incomplete or inaccurate.

AI techniques elevate the speed of execution of the complex program it is equipped with.
Applications of AI
AI has been dominant in various fields such as

Gaming AI plays crucial role in strategic games such as chess, poker, tic-tac-toe, etc., where machine can
think of large number of possible positions based on heuristic knowledge.

Natural Language Processing It is possible to interact with the computer that understands natural language
spoken by humans.

Expert Systems There are some applications which integrate machine, software, and special information to
impart reasoning and advising. They provide explanation and advice to the users.

Vision Systems These systems understand, interpret, and comprehend visual input on the computer. For
example,
o

A spying aeroplane takes photographs, which are used to figure out spatial information or map of the
areas.

Doctors use clinical expert system to diagnose the patient.

Police use computer software that can recognize the face of criminal with the stored portrait made by
forensic artist.

Speech Recognition Some intelligent systems are capable of hearing and comprehending the language in
terms of sentences and their meanings while a human talks to it. It can handle different accents, slang words,
noise in the background, change in humans noise due to cold, etc.

Handwriting Recognition The handwriting recognition software reads the text written on paper by a pen or
on screen by a stylus. It can recognize the shapes of the letters and convert it into editable text.

Intelligent Robots Robots are able to perform the tasks given by a human. They have sensors to detect
physical data from the real world such as light, heat, temperature, movement, sound, bump, and pressure.
They have efficient processors, multiple sensors and huge memory, to exhibit intelligence. In addition, they
are capable of learning from their mistakes and they can adapt to the new environment.

Task Domains of AI:


AI has a major role in the automations of every aspects of life. The 4 major task domains of AI can be seen as:
Real Life Applications of AI Research Areas
There is a large array of applications where AI is serving common people in their day-to-day lives
Sr.No.

Research Areas

Expert Systems
1

Examples Flight-tracking systems, Clinical systems.

Natural Language Processing


2

Examples: Google Now feature, speech recognition, Automatic voice output.

Neural Networks
3

Examples Pattern recognition systems such as face recognition, character


recognition, handwriting recognition.

Example

Robotics
4

Examples Industrial robots for moving, spraying, painting, precision


checking, drilling, cleaning, coating, carving, etc.

Fuzzy Logic Systems


5

Examples Consumer electronics, automobiles, etc.

Task Classification of AI
The domain of AI is classified into Formal tasks, Mundane tasks, and Expert tasks.
Task Domains of Artificial Intelligence (BCA, MCA, Msc I.T.) Lecture by Dr. Madhu Sharma.

Task Domains of Artificial Intelligence


Mundane (Ordinary) Tasks

Formal Tasks

Expert Tasks

Perception

Mathematics

Engineering

Geometry

Fault Finding

Computer Vision
Speech, Voice

Natural Language Processing

Logic

Manufacturing

Integration and Differentiation

Monitoring

Games

Understanding

Go

Language Generation

Chess (Deep Blue)

Language Translation

Ckeckers

Scientific Analysis

Common Sense

Verification

Financial Analysis

Reasoning

Theorem Proving

Medical Diagnosis

Planing

Creativity

Robotics

Locomotive

Humans learn mundane (ordinary) tasks since their birth. They learn by perception, speaking, using language, and
locomotives. They learn Formal Tasks and Expert Tasks later, in that order.
For humans, the mundane tasks are easiest to learn. The same was considered true before trying to implement
mundane tasks in machines. Earlier, all work of AI was concentrated in the mundane task domain.
Later, it turned out that the machine requires more knowledge, complex knowledge representation, and complicated
algorithms for handling mundane tasks. This is the reason why AI work is more prospering in the Expert Tasks
domain now, as the expert task domain needs expert knowledge without common sense, which can be easier to
represent and handle.

A heuristic function, or simply a heuristic, is a function that ranks alternatives in search algorithms at each
branching step based on available information to decide which branch to follow. I.e. in chess, a Huristic
Function can eliminate possible moves that will lead to a worse position (or even loss) for a player and not
further analyze the following moves since the result will not get any better.
Doing so the function can search more moves in a shorter time period since it doesn't waste time looking at
bad moves.

---------------------------------------------------------------------

AI - Popular Search Algorithms


Searching is the universal technique of problem solving in AI. There are some single-player games such as tile games,
Sudoku, crossword, etc. The search algorithms help you to search for a particular position in such games.
State Space Representation:
It means how to represent a problem that should be solved on computer. It is a universal representation technology.
In fact, many problem solving algorithms use state-space representation.

State space
Before an AI problem can be solved it must be represented as a state space. The state space is then searched to find a
solution to the problem.
A state space essentially consists of a set of nodes representing each state of the problem, arcs connecting these nodes
representing the legal moves from one state to another, an initial state and a goal state. Each state space takes the form
of a tree or a graph.
Depth-First Search
It is implemented in recursion with LIFO stack data structure. It creates the same set of nodes as Breadth-First
method, only in the different order.
As the nodes on the single path are stored in each iteration from root to leaf node, the space requirement to store nodes
is linear. With branching factor b and depth as m, the storage space is bm.

Advantages
1. The advantage of depth-first Search is that memory requirement is only linear with respect
to the search graph. This is in contrast with breadth-first search which requires more space.
The reason is that the algorithm only needs to store a stack of nodes on the path from the
root to the current node.
2. The time complexity of a depth-first Search to depth d is O(b^d) since it generates the
same set of nodes as breadth-first search, but simply in a different order. Thus practically
depth-first search is time-limited rather than space-limited.
3. If depth-first search finds solution without exploring much in a path then the time and
space it takes will be very less.
Disadvantages
1. The disadvantage of Depth-First Search is that there is a possibility that it may go down the
left-most path forever. Even a finite graph can generate an infinite tree. One solution to this
problem is to impose a cutoff depth on the search. Although the ideal cutoff is the solution
depth d and this value is rarely known in advance of actually solving the problem. If the
chosen cutoff depth is less than d, the algorithm will fail to find a solution, whereas if the
cutoff depth is greater than d, a large price is paid in execution time, and the first solution
found may not be an optimal one.
2. Depth-First Search is not guaranteed to find the solution.
3. And there is no guarantee to find a minimal solution, if more than one solution exists.

Complexity Analysis
Time complexity: As there can be infinite loops, in the worst case, the simple depth-first algorithm will never stop. So
we are going to analyse depth-bounded depth-first search instead.
Exponential Complexity: In general, in Computer Science, anything exponential is considered bad news. Indeed, our
simple search techniques will usually not work very well (or at all) for larger problem instances.Suppose the
branching factor is b = 4 and suppose it takes us 1 millisecond to check one node. What kind of depth bound would
be feasible to use in depth-first search?

Space Complexity:
The good news is that depth-first search is very efficient in view of its memory requirements:
At any point in time, we only need to keep the path from the root to the current node in memory, and depending on
the exact implementation possibly also all the sibling nodes for each of the nodes in that path.

Breadth-First Search
The problem with (unbounded) depth-first search is that we may get lost in an infinite branch, while there could be
another short branch leading to a solution. It starts from the root node, explores the neighboring/adjecent nodes first
and moves towards the next level neighbors. Such problems can be overcome by using breadth-first search, where
we explore (right-hand) siblings before children.It generates one tree at a time until the solution is found. It can be
implemented using FIFO queue data structure. This method provides shortest path to the solution.
We have to keep track of which nodes we have already visited and how do we identify the next node to go to.

Disadvantage Since each level of nodes is saved for creating next one, it consumes a lot of memory space. Space
requirement to store nodes is exponential.
Complexity Analysis of Breadth-first Search

Time complexity: In the worst case, we have to search through the entire tree for any search algorithm. As both
depth-first and breadth-first search visit each node exactly once, time complexity will be the same.
Space complexity: Big difference; now we have to store every path visited before, while for depth-first we only had
to keep a single branch in memory
So there is a trade-off between memory-requirements on the one hand and completeness/optimality considerations on
the other.

Heuristic Search

A heuristic is a method that

might not always find the best solution

but is guaranteed to find a good solution in reasonable time.

By sacrificing completeness it increases efficiency.

Useful in solving tough problems which


o could not be solved any other way.
o solutions take an infinite time or very long time to compute.

The classic example of heuristic search methods is the travelling salesman problem. Heuristics help to
reduce the number of alternatives from an exponential number to a polynomial number.
Heuristic: involving or serving as an aid to learning, discovery, or problem-solving by experimental and especially
trial-and-error methods.
Heuristic technique improves the efficiency of a search process, possibly by sacrificing claims of completeness or
optimality.
DFS and BFS may require too much memory to generate an entire state space - in these cases heuristic search is used.
Heuristics help us to reduce the size of the search space. An evaluation function is applied to each goal to assess how
promising it is in leading to the goal.

Generate-and-test
Hill climbing
Best-first search

Heuristic Search techniques


Heuristic search algorithms have exponential time and space complexities as they store complete
information of the path including the explored intermediate nodes. Hence many applications involving heuristic search
techniques to find optimal solutions tend to be expensive. Despite of these, the researchers have strived to find optimal
solution in best possible time. In this paper we have considered major algorithms which are applied to find the shortest
path: hill climbing, steepest ascent, best first and A*.
various techniques are..
Depth first search
Breadth first search
Generate and test
Hill Climbing
Steepest Ascent Hill Climbing
Best first search
A* algorithm
Constraint Satisfaction
Means ends analysis
Hill Climbing:

In simple hill climbing, the first closer node is chosen, whereas in steepest ascent hill climbing all successors
are compared and the closest to the solution is chosen.
Steepest ascent hill climbing is similar to best-first search, which tries all possible extensions of the current
path instead of only one.
This method is a result of variation in hill climbing. Here, instead of moving the immediate best node, all the
reachable nodes from current node are considered and among these the best one is chosen. In case of simple
hill climbing, the first successor node which is better, is selected, due to this we may omit the best one. On
the contrary steepest ascent hill climbing method not only reaches to the better state but also climbs up the
steepest slope.
The variation in algorithm will be only in finding the best successors node from all the possible
successor nodes from all possible successor, and not just the first best node.
Best-first search
So far we know how to implement graph depth-first and breadth-first search. These two approaches are crucial in
order to understand graph traversal algorithms. However they are just explaining how we can walk through in breadth
or depth and sometimes this isnt enough for an efficient solution of graph traversal.

Best-first search in its most general form is a simple heuristic search algorithm.The name best-first refers to the
method of exploring the node with the best score first. An evaluation function is used to assign a score to each
candidate node. The algorithm maintains two lists, one containing a list of nodes yet to explore (OPEN), and one
containing a list of visited nodes (CLOSED). Since all unvisited nodes of every visited node are included in the OPEN
list, the algorithm is not restricted to only exploring nodes of the most recently visited node. In other words, the
algorithm always chooses the best of all unvisited nodes, rather than being restricted to only a small subset, such as
immediate neighbours. Other search strategies, such as depth-first and breadth-first, have this restriction. The
advantage of this strategy is that if the algorithm reaches a dead-end node, it will continue to try other nodes.

Examples of best-first search algorithms include the A* search algorithm. Best-first algorithms are often used for path
finding.
A* search algorithm

In computer science, A* is a computer algorithm that is widely used in pathfinding and graph traversal, the
process of plotting an efficiently traversable path between multiple points, called nodes. Noted for its
performance and accuracy, it enjoys widespread use. Stanford Research Institute first described the
algorithm in 1968. A* achieves better performance by using heuristics to guide its search. In 1968, AI
researcher Nils Nilsson was trying to improve the path planning done by Shakey the Robot, a prototype
robot that could navigate through a room containing obstacles. Starting from a specific node of a graph, it
constructs a tree of paths starting from that node, expanding paths one step at a time, until one of its paths
ends at the predetermined goal node.
The central idea in the so-called A* algorithm is to guide best-first search both by
a. the estimate to the goal as given by the heuristic function h and
b. the cost of the path developed so far.
Let n be a node, g(n) the cost of moving from the initial node to n along the current path, and h(n) the
estimated cost of reaching a goal node from n. Define f (n) as follows:
f (n) = g(n) + h(n)
This is the estimated cost of the cheapest path through n leading from the initial node to a goal node. A* is
the best-first search algorithm that always expands a node n such that f (n) is minimal.
A* is commonly used for the common pathfinding problem in applications such as video games, but was
originally designed as a general graph traversal algorithm.
Generate and Test

Means-ends analysis
Means-Ends Analysis[1] (MEA) is a problem solving technique used commonly in Artificial Intelligence
(AI) for limiting search in AI programs.
The MEA technique is a strategy to control search in problem-solving. Given a current state and a goal state,
an action is chosen which will reduce the difference between the two. The action is performed on the current
state to produce a new state, and the process is recursively applied to this new state and the goal state.

Explain the process of state space representation for an Eight puzzle problem?
The 8-puzzle is a square board with 9 positions, filled by 8 numbered tiles and one gap. At any point, a tile
adjacent to the gap can be moved into the gap, creating a new gap position. In other words the gap can be
swapped with an adjacent (horizontally and vertically) tile. The objective in the game is to begin with an
arbitrary configuration of tiles, and move them so as to get the numbered tiles arranged in ascending order
ordered from left to right, with 1 in the top left-hand position. An example scenario is shown below.

Initial State

Goal State

In this problem each tile configuration is a state. For the 8-puzzle, a straight forward description is a 3X3
array of matrix of numbers. A move transforms one problem state into another state. The 8-puzzle is
conveniently interpreted as having the following for moves. Move empty space (blank) to the left, move
blank up, move blank to the right and move blank down,. These moves are modelled by production rules that
operate on the state descriptions in the appropriate manner.
The problem goal condition forms the basis for the termination condition of the production system. The
control strategy repeatedly applies rules to state descriptions until a description of a goal state is produced .
it also keep track of rules that have been applied so that it can compose them into sequence representing the
problem solution. A solution to the 8-puzzle problem is given in the following figure.
Example:- Depth First Search traversal and Breadth - First - Search traversal
for 8 puzzle problem is shown in following diagrams.

Discuss AI problems with seven 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.
Is the problem decomposable ?
A very large and composite problem can be easily solved if it can be broken into smaller problems and recursion could
be used. Suppose we want to solve.
Ex:- x2 + 3x+sin2x cos 2x dx

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.
2. Can solution steps be ignored or undone?
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(Lemma a minor result whose sole purpose is to help in proving a theorem. It is a
stepping stone on the path to proving a theorem). 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.
1. Ignorable problems Ex:- theorem proving
In which solution steps can be ignored.
2. Recoverable problems Ex:- 8 puzzle
In which solution steps can be undone
3. Irrecoverable problems Ex:- Chess
In which solution steps cant be undone
A knowledge of these will help in determining the control structure.
3.. Is the Universal Predictable?
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 just 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).
4. Is good solution absolute or relative ?
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.

6 Is the solution a state or a path ?

7 What is the role of Knowledge?


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 rules 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.
Ex:- 1. Playing chess 2. News paper understanding

7. Does the task requires interaction with the person.


The problems can again be categorized under two heads.
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.
Ex:- theorem proving (give basic rules & laws to computer)
2. Conversational, in which there will be intermediate communication between a person and the computer, wither to
provide additional assistance to the computer or to provide additional informed information to the user, or both
problems such as medical diagnosis fall under this category, where people will be unwilling to accept the verdict of
the program, if they can not follow its reasoning.
Ex:- Problems such as medical diagnosis.
Analyze each of them with respect to the seven problem characteristics
Chess
Problem characteristic
Satisfied
Reason
Is the problem decomposable?

No

One game have Single solution

Can solution steps be ignored or


undone?

No

In actual game(not in PC) we cant undo previous


steps

Is the problem universe predictable?

No

Is a good solution absolute or relative?

absolute

Is the solution a state or a path?

Path

Problem Universe is not predictable as we are


not sure about move of other player(second
player)
Absolute solution : once you get one 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
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
lot of knowledge helps to constrain the search for
a solution.

What is the role of knowledge?


Does the task require humaninteraction?
2.

No

Conversational
In chess additional assistance is not required

Problem characteristic

Satisfied

Reason

Is the problem decomposable?

No

One Single solution

Can solution steps be ignored or


undone?

Yes

Is the problem universe predictable?

Yes

Is a good solution absolute or relative?

absolute

Is the solution a state or a path?

Path

Water jug

What is the role of knowledge?


Does the task require humaninteraction?

3.

Problem Universe is predictable bcz to slove this


problem it require only one person .we can
predict what will happen in next step
Absolute solution , water jug problem may have
number of solution , bt once we found one
solution,no need to bother about other solution
Bcz it doesnt effect on its cost
Path to solution
lot of knowledge helps to constrain the search for
a solution.

Yes

additional assistance is required. Additional


assistance, like to get jugs or pump

Satisfied

Reason

Is the problem decomposable?

No

One game have Single solution

Can solution steps be ignored or


undone?

Yes

We can undo the previous move

Is the problem universe predictable?

Yes

Is a good solution absolute or relative?

absolute

Problem Universe is predictable bcz to slove this


problem it require only one person .we can
predict what will be position of blocks in next
move
By considering this 8 puzzle is absolute

Is the solution a state or a path?

Path

So In 8 puzzle winning state(goal state) describe


path to state
lot of knowledge helps to constrain the search for
a solution.

No

In 8 puzzle additional assistance is not required

8 puzzle
Problem characteristic

What is the role of knowledge?


Does the task require humaninteraction?

4.

Travelling Salesman (TSP)


Problem characteristic

Satisfied

Reason

Is the problem decomposable?

No

One game have Single solution

Can solution steps be ignored or


undone?

Yes

Is the problem universe predictable?

Yes

Is a good solution absolute or relative?

absolute

Is the solution a state or a path?

Path

What is the role of knowledge?

Does the task require humaninteraction?

In TSP (goal state) describe path to state


Playing Chess
Knowledge is important only to constrain the
search for a solution.
Reading Newspaper
Knowledge is required even to be able to
recognize a solution.

No
In chess additional assistance is not required

A production system
consists of a set of rules that are in if-then form. That is given a particular situation, what are
the actions to be performed. For example, if it is raining then take umbrella.
Production system also contains knowledge base, control strategy and a rule applier.
To solve a problem, a system will compare the present situation with the left hand side of the
rules. If there is a match then the system will perform the actions described in the right hand
side of the corresponding rule.

A production system (or production rule system) is a computer program typically used to
provide some form of artificial intelligence, which consists primarily of a set of rules about
behavior. These rules, termed productions, are a basic representation found useful in
automated planning, expert systems and action selection. A production system provides the
mechanism necessary to execute productions in order to achieve some goal for the system.
Productions consist of two parts: a sensory precondition (or "IF" statement) and an action (or
"THEN"). If a production's precondition matches the current state of the world, then the
production is said to be triggered. If a production's action is executed, it is said to have fired.
A production system also contains a database, sometimes called working memory, which
maintains data about current state or knowledge, and a rule interpreter. The rule interpreter
must provide a mechanism for prioritizing productions when more than one is triggered.
Matching
The rules of a production consist of a condition and action in the form: (if x then y). The lefthand-side conditions (x and y may be arbitrarily complex conjunctions of expressions) are
compared against the elements of working memory to determine if the conditions are
satisfied. Matching is an computationally intense procedure although the RETE algorithm of
OPS5 is significantly more efficient than a simple condition-by-condition matcher.
Conflict Resolution
At any point in processing, several productions may match to the elements of working
memory simultaneously. Since production systems are normally implemented on serial
computers, this results in a conflict: there is a non-unique choice about which action to take
next. Most conflict resolution schemes are very simple, dependent on the number of
conditions in the production, the time stamps (ages) of the elements to which the conditions
matched, or completely random. One of the advantages of production systems is that the
computational complexity of the matcher, while large, is deterministically finite and the
conflict resolution scheme is trivial. This is in contrast to logicist systems in which declarative
knowledge may be accessed instantly but the time required to use the knowledge (in a
theorem prover, for instance) can not be pre-determined.
The major components of an AI production system are
i. A global database/knowledge base
ii. A set of production rules and
iii. Control Strategy: to specify the order of rule application
iv. Rule applier
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.
Four classes of production systems:1. A monotonic production system
2. A non monotonic production system
3. A partially commutative production system
4. A commutative production system.
Advantages of production systems:1. Production systems provide an excellent tool for structuring AI programs.
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.
Disadvantages of Production Systems: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 dont 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. i.e rules should be independent.
In monolithic systems, anything that could be concluded before a clause is added can still be concluded after it is
added; When new statements are added the previously drawn conclusions never become invalid.
Non monotonic system are harder to deal with than monotonic systems. This is because when a statement is deleted as
no more valid, other related statements have to be backtracked and they should also be either deleted or new proofs
have to be found for them. Thus non monotonic systems require more storage space as well as more processing time
than monotonic systems.

Partially commutative production system:A Partially commutative production system has a property that if 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. These production systems are useful
for solving ignorable problems. Ex: Theorem proving.

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 , Non monotonic production systems

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.

Production System Characteristics


Production systems are important in building intelligent matches which can provide us a good
set of production rules, for solving problems.
There are four types of production system characteristics, namely
1. Monotonic production system
2. Non-monotonic production system

3. Commutative law based production system, and lastly


4. Partially commutative law based production system
1. Monotonic Production System (MPS): The Monotonic production system (MPS) is a system in
which the application of a rule never prevents later application of the another rule that could
also have been applied at the time that the first rule was selected
2. Non-monotonic Production (NMPS): The non-monotonic production system is a system in
which the application of a rule prevents the later application of the another rule which may
not have been applied at the time that the first rule was selected, i.e. it is a system in which
the above rule is not true, i.e. the monotonic production system rule not true.
3. Commutative Law Based Production System (CBPS): Commutative law based production
systems is a system in which it satisfies both monotonic & partially commutative.
4. Partially Commutative Production System (PCPS): The partially commutative production
system is a system with the property that if the application of those rules that is allowable &
also transforms from state x to state y.
Laws (Characteristics) Monotonic (Characteristics) Non-monotonic
Partially commutative Theorem proving Robot navigation
Non-partial commutative Chemical synthesis Bridge game
Well the question may arise here such as:
- can the production systems be described by a set of characteristics?
- Also, can we draw the relationship between problem types & the types of production
systems, suited to solve the problems, yes, we can by using above rules.

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

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:IF the initial state is a goal state THEN quit.
The major components of an AI production system are
A global database
A set of production rules and
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.
Four classes of production systems:1. A monotonic production system
2. A non-monotonic production system

3. A partially commutative production system


4. A commutative production system.
Advantages of production systems:1. Production systems provide an excellent tool for structuring AI programs.
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.
Disadvantages of Production Systems: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 dont 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.
Partially commutative production system: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.
Types of knowledge
Procedural knowledge
Procedural knowledge is compiled or processed form of information. Procedural knowledge is related to the
performance of some task. For example, sequence of steps to solve a problem is procedural knowledge. Long-term
retention.
Declarative knowledge
Declarative knowledge is passive knowledge in the form of statements of facts about the world. Knowledge is
specified but the use is not given. Need a program that specifies what is to be done the knowledge and how. It is

expressed in factual statements; for example, mark statement of a student is declarative knowledge. Paris is the capital
of France. It is the part of knowledge which describes how things are. Domain experts tell the knowledge engineers
about the facts which is nothing but declarative knowledge and is very important in the initial stage of knowledge
acquisition.

Knowledge Representation Schemes

A proposition or statement is a sentence which is either true or false. Sentences considered in propositional logic are
not arbitrary sentences (based on random choice) but are the ones that are either true or false, but not both. This kind
of sentences are called propositions.
If a proposition is true, then we say it has a truth value of "true"; if a proposition is false, its truth value is "false".
For example, "Grass is green", and "2 + 5 = 5" are propositions.
The first proposition has the truth value of "true" and the second "false".
But "Close the door", and "Is it hot outside ?"are not propositions.
Also "x is greater than 2", where x is a variable representing a number, is not a proposition,

because unless a specific value is given to x we can not say whether it is true or false, nor do we know what x
represents.
Simple sentences which are true or false are basic propositions. Larger and more complex sentences are constructed
from basic propositions by combining them with connectives. Thus propositions and connectives are the basic
elements of propositional logic. Though there are many connectives, we are going to use the following five basic
connectives here:
NOT, AND, OR, IF_THEN (or IMPLY), IF_AND_ONLY_IF.
They are also denoted by the symbols:
,

respectively.

Forward Chaining:
For example, suppose that the goal is to conclude the color of a pet named Fritz, given that he croaks and eats flies,
and that the rule base contains the following four rules:
1. If X croaks and X eats flies - Then X is a frog
2. If X chirps and X sings - Then X is a canary
3. If X is a frog - Then X is green
4. If X is a canary - Then X is yellow
Let us illustrate forward chaining by following the pattern of a computer as it evaluates the rules. Assume the
following facts:

Fritz croaks

Fritz eats flies

With forward reasoning, the inference engine can derive that Fritz is green in a series of steps:
1. Since the base facts indicate that "Fritz croaks" and "Fritz eats flies", the antecedent of rule #1 is satisfied by
substituting Fritz for X, and the inference engine concludes:
Fritz is a frog
2. The antecedent of rule #3 is then satisfied by substituting Fritz for X, and the inference engine concludes:
Fritz is green
The name "forward chaining" comes from the fact that the inference engine starts with the data and reasons its way to
the answer, as opposed to backward chaining, which works the other way around.
For example, suppose a new pet, Fritz, is delivered in an opaque box along with two facts about Fritz:

Fritz croaks

Fritz eats flies

The goal is to decide whether Fritz is green, based on a rule base containing the following four rules:
Backward Chaining:
1. If X croaks and X eats flies Then X is a frog
2. If X chirps and X sings Then X is a canary
3. If X is a frog Then X is green
4. If X is a canary Then X is yellow
With backward reasoning, an inference engine can determine whether Fritz is green in four steps. To start, the query is
phrased as a goal assertion that is to be proved: "Fritz is green".
1. Fritz is substituted for X in rule #3 to see if its consequent matches the goal, so rule #3 becomes:
If Fritz is a frog Then Fritz is green
Since the consequent matches the goal ("Fritz is green"),the rules engine now needs to see if the antecedent ("If Fritz
is a frog") can be proved. The antecedent therefore becomes the new goal:
Fritz is a frog
2. Again substituting Fritz for X, rule #1 becomes:
If Fritz croaks and Fritz eats flies Then Fritz is a frog
What is inheritable knowledge?
It is a knowledge representation scheme in which knowledge is represented using objects, their attributes and
corresponding value of the attributes. The relation between different objects is defined using a isa property. For
example if two entities Adult male and Person are represented as objects then the relation between the two is that
Adult male isa person.

Logic programming is a programming paradigm based on formal logic.

Two good languages for AI programming are Lisp, as programs can be treated as data and Prolog, which uses
declarative programming.
Imperative/procedural programs say what should be done and how, so computation consists of doing what it says.
Declarative/non-procedural programs say what needs to be done, but not how. Computation is performed by an
interpreter that must decide how to perform the computation.
The idea of Logic programming is Say what you want, not how you want it done. You will no longer be directly
writing how to solve a problem, but rather expressing it in terms of facts and rules. Logic programming excels in
scenarios where an exhaustive search is needed, as it basically builds in backtracking for your problems automatically.
Major logic programming language families include Prolog, Answer set programming (ASP) and Datalog.
Prolog Relations
Relations are defined by means of clauses and lucky us, we only have two types of clauses: facts and rules!
Prolog Facts
Facts are nothing more than statements, they are the truths of our program and have a very simple syntax. They always
start with a lowercase letter and end with a period.
sunny.
logic_programming_is_cool.
tomorrow_will_rain.
So far everything that Prolog knows is that its sunny, that logic programming is cool and that tomorrow will rain.
Facts can also have arguments in the form relation(argument1, argument2, ... argumentN).
likes(alice,bob).
likes(bob,carol).
likes(james,mary).
likes(mary,james).
The first line is for example a relationship that links Alice and Bob. We are free to pick the interpretation of our
relationships, as long as we are consistent. This means you cant change the interpretation from one line to another! In
our case we will read it as Alice likes Bob, Bob likes Carol, etc.
Prolog Shell and Queries
So, to start doing something interesting, we need to learn how to start writing our queries. If you write a file called
facts.pl containing the four clauses above, you can load it on your shell by calling
consult('facts.pl').
We can ask Prolog if alice likes bob.
?- likes(alice,bob). /* our first query! */
true. /* Prolog matches it with the known fact that alice likes bob. */
where ?- is the Prolog Shell. Lets make some more queries.
?- likes(bob,alice).
false. /* poor alice isn't liked by bob :( */
?- likes(mary,john).
false. /* we don't even have a John on our list! */
Rules
Now that we have learned how to express facts and how to query them using variables, we can take a look at rules.
Rules are a key concept in Prolog and allow us to make conclusions about our world. A rule has the form
conclusion(arg1, arg2, ... argN) :- relation1, relation2, ... relationN.
The conclusion is only valid if all the relations are also true. Commas work exactly like the logical and. So this can be
read as conclusion is true if everything that comes after the :- can also be proven true. We call what comes before the

:- head, and what comes after, body. The next examples will help understanding this new concept, so dont worry if
you didnt get this.
Suppose we want to create a matchmaking agency, so lets write a nice rule called love_compatible using the facts we
already defined above
love_compatible(X, Y) :- likes(X, Y), likes(Y, X).
This can be read as: X and Y are a love_compatible if X likes Y and Y likes X. An equivalent intepretation would be:
to prove that X and Y are love_compatible, prove that X likes Y and that Y likes X. Now lets make some queries
?- love_compatible(james,Who). /* Is james compatible with someone? */
Who = mary. /* james and mary sitting on a tree, K-I-S-S-I-N-G */

Control Knowledge
When there are many possible paths of reasoning, it is very important that useless ones are not be taken. Knowledge
about which paths are most likely to lead quickly to a goal state is normally called Control Knowledge.
There are several forms of control knowledge:

Knowledge about which states are more preferable to others.


Knowledge about which rule to apply in a given situation.
Knowledge about the order in which to pursue sub goals.
Knowledge about useful sequences of rules to apply.

A number of AI systems represent their knowledge with control rules. SOAR and PRODIGY are two of these AI
systems.

Automated Reasoning
Reasoning is the ability to make inferences, and automated reasoning is concerned with the building of computing
systems that automate this process. Automated reasoning is the art and science of getting computers to apply logical
reasoning to solve problems, for example, to prove theorems, solve puzzles, design circuits, verify or synthesize
computer programs. Since reasoning usually requires intelligence (when humans do it), this subject can be thought of
as part of artificial intelligence (AI), but it has many specialized methods and (so far at least) does not use many of the
techniques of AI, so it not usually thought of as a branch of AI. In any case, there is no restriction that in automated
reasoning a program should work like a human would. Usually, programs try to take advantage of the computers
superior ability to search through thousands or millions of possibilities.

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. Examples of
simple problems that can be modeled as a constraint satisfaction problem include:

Eight queens puzzle

Map coloring problem

Crosswords, Sudoku

Example: consider the crypt arithmetic problems.

SEND
+ MORE
---------MONEY
---------Assign decimal digit to each of the letters in such a way that the answer to the problem is correct to the same
letter occurs more than once , it must be assign the same digit each time . no two different letters may be
assigned the same digit. Consider the crypt arithmetic problem.
CONSTRAINTS:1. no two letters can be assigned same digit.
2. Assumption can be made at various levels such that they do not contradict each other.
3. The problem can be decomposed into secured constraints. A constraint satisfaction approach may be used.
4. Any of search techniques may be used.
5. Backtracking may be performed as applicable us applied search techniques.
6. Rule of arithmetic may be followed.
Initial state of problem.
D=?
E=?
Y=?
N=?
R=?
O=?
S=?
M=?
C1=?
C2=?
C1 ,C 2, C3 stands for the carry variables respectively.
Goal State: the digits to the letters must be assigned in such a manner so that the sum is satisfied.
Solution Process:
We are following the depth-first method to solve the problem.

Expert Systems
Expert systems (ES) are one of the prominent research domains of AI. It is introduced by the researchers at Stanford
University, Computer Science Department. The expert systems are the computer applications developed to solve
complex problems in a particular domain, at the level of extra-ordinary human intelligence and expertise.
Characteristics of Expert Systems

High performance

Understandable

Reliable

Highly responsive

Capabilities of Expert Systems


The expert systems are capable of

1.

Advising

2.

Instructing and assisting human in decision making

3.

Deriving a solution

4.

Diagnosing

5.

Explaining

6.

Interpreting input

7.

Predicting results

8.

Justifying the conclusion

9.

Suggesting alternative options to a problem

Components of Expert Systems


The components of ES include

Knowledge Base

Interface Engine

User Interface

Let us see them one by one briefly

Expert System Shell


The E.S shell simplifies the process of creating a knowledge base. It is the shell that actually processes the information
entered by a user and it relates it to the concepts contained in the knowledge base and provides an assessment or
solution for a particular problem. Thus E.S shell provides a layer between the user interface and the computer O.S to
manage the input and output of the data. It also manipulates the information provided by the user in conjunction with
the knowledge base to arrive at a particular conclusion.
Knowledge Base
It contains domain-specific and high-quality knowledge which is collected from the domain expert by the knowledge
engineers and is fed to the knowledge base because, Knowledge is required to exhibit intelligence.

What is Knowledge?
The data is collection of facts. The information is organized as data and facts about the task domain. Data,
information, and past experience combined together are termed as knowledge.
Components of Knowledge Base
The knowledge base of an ES is a store of both, factual and heuristic knowledge.

Factual Knowledge It is the information widely accepted by the Knowledge Engineers and scholars in the
task domain.

Heuristic Knowledge heuristic (pronounced hyu-RIS-tik and from the Greek "heuriskein" meaning "to
discover") pertains to the process of gaining knowledge or some desired result by intelligent guesswork rather
than by following some preestablished formula.

What is symbolic reasoning? "


symbolic reasoning" means using symbols to aid in solving (reasoning) problems.
For example:
1. After learning addition and substraction, first graders are asked, "What number must be added to 2 to make it equal
5?" They can understand something like this
2+?=5

Non-monotonic reasoning
Often available knowledge is incomplete. However, to model common sense reasoning, it is necessary to be able to
jump to reasonable or probable conclusions from the given knowledge.
To draw probable conclusions it is necessary to make assumptions.
The choice of assumptions is not blind: most of the knowledge on the world is given by means of general rules which
specify typical properties of objects. For instance, "birds fly" means: birds typically fly, but there can be exceptions
such as penguins, ostriches, ..
Non monotonic reasoning deals with the problem of deriving probable conclusions, but they are not never failing;
from a knowledge base (a set of formulas). Since the conclusions are not certain, it must be
Possible to retract some of them if new information shows that they are wrong.
In a nonmonotonic system:
The addition of new facts can reduce the set of logical conclusions.
C is a conclusion of Fact f1, but is not necessarily a conclusion of F1+newfact. Humans use nonmonotonic reasoning
constantly!
To understand what nonmonotonic logic means simple consider a standard example:
"all birds fly",
"Tweety is a bird",
"Does Tweet fly?".
The obvious answer is yes, however what if later you learned that Tweety is an Ostrich, then the answer becomes no,
then what if you learned that tweet was an airplane pilot, or had a jet pack, the answer can change again.
The important point is that as new information is added the answers change.

You might also like