Ai Notes
Ai Notes
Syllabus:
Outcomes:
Introduction:
The field of artificial intelligence, or AI, attempts to understand intelligent entities.
Computers with human-level intelligence (or better) would have a huge impact on our everyday
lives and on the future course of civilization.
Computers have unlimited potential for intelligence.
AI currently encompasses a huge variety of subfields, from general-purpose areas such as
perception and logical reasoning, to specific tasks such as playingchess, proving
mathematical theorems, writing poetry, and diagnosing diseases.
The Turing Test, proposed by Alan Turing (1950), was designed to provide a satisfactory
operational definition of intelligence.
Turing defined intelligent behaviour as the ability to achieve human-level performance in all
cognitive tasks, sufficient to fool an interrogator.
The test he proposed is that the computer should be interrogated by a human via a
teletype, and passes thetest if the interrogator cannot tell if there is a computer or a
human at the other end.
The computer would need to possess the following capabilities:
natural language processing to enable it to communicate successfully in English
(or some other human language);
knowledge representation to store information provided before or during the
interrogation;
automated reasoning to use the stored information to answer questions and to
draw new conclusions
machine learning to adapt to new circumstances and to detect and extrapolate
patterns.
and the
Turing's test deliberately avoided direct physical interaction between the interrogator
computer, because physical simulation of a person is unnecessary for intelligence.
To say that a given program thinks like a human, we must have some way of determining
how humans think. We need to get inside the actual workings of human minds.
There are two ways for this:
through introspection—trying to catch our own thoughts as they go by.
through psychological experiments
Once we have a sufficiently precise theory of the mind, it becomes possible to express the
theory as a computer program. If the program's input/output and timing behaviour
matches human behaviour, that is evidence that some of the program's mechanisms may
also be operating in humans.
The Greek philosopher Aristotle was one of the first to attempt to codify "right thinking," that
is, irrefutable reasoning processes.
His famous syllogisms provided patterns for argument structures that always gave correct
conclusions given correct premises. For example, "Socrates is a man; all men are mortal;
therefore Socrates is mortal."
These laws of thought were supposed to govern the operation of the mind, and initiated the
field of logic.
There are two main obstacles to this approach.
First, it is not easy to take informal knowledge and state it in the formal terms
required by logical notation, particularly when the knowledge is less than 100%
certain.
Second, there is a big difference between being able to solve a problem "in
principle" and doing so in practice.
Acting rationally: The rational agent approach:
Acting rationally means acting so as to achieve one's goals, given one's beliefs.
An agent is just something that perceives and acts.
In the ‘laws of
In this approach, AI is viewed as the study and construction of rational agents.
thought" approach to AI, the whole emphasis was on correct inferences.
Making correct inferences is sometimes part of being a rational agent, because one way to
act rationally is to reason logically to the
conclusion that a given action will achieve one's
goals, and then to act on that conclusion.
inference is only a useful mechanism for achieving rationality, and not a necessary
Correct
one.
Foundations of Artificial Intelligence:
AI itself is ayoung field; it has inherited many ideas, viewpoints, and techniques from other
disciplines.
Over 2000 years of tradition in philosophy, theories of reasoning and learning have
emerged, along with the viewpoint that the mind is constituted by the operation of a
physical system.
From over 400 years of mathematics, we have formal theories of logic, probability, decision
making, and computation.
From psychology, we have the tools with which to investigate the human mind, and a
scientific language within which to express the resulting theories.
From linguistics, we have theories of the structure and meaning of language.
From computer science, we have the tools with which to make AI a reality.
Philosophy (428 B.C.-present)
of (at least part of) the mind,
We have the idea of a set of rules that can describe the working
the next step is to consider the mind as a physical system.
Mental processes and consciousness are therefore part of the physical world, but inherently
unknowable; they are beyond rational understanding.
Some philosophers critical of AI have adopted exactly this position.
Barring these possible objections to the aims of AI, philosophy had thus established a
tradition in which the mind was conceived of asa physical device operating principally by
reasoning with the knowledge that it contained.
All knowledge can be characterized by logical theories connected, ultimately, to observation
sentences that correspond to sensory inputs.
Confirmation theory of Rudolf Carnap and Carl Hempel attempted to establish the nature
more general theories—
of the connection between the observation sentences and the
understand how knowledge can be acquired from experience.
Mathematics (c. 800-present)
AI used mathematical formalization in three main areas: computation, logic, and probability.
First-order logic is used today as the most basic knowledge representation system.
Theory of reference that shows how to relate the objects in a logic to objects in the real world.
There are some functions on the integers that cannot be represented by an algorithm— that is,
they cannot be computed.
This motivated Alan Turing (1912-1954) to try to characterize exactly which functions are
capable of being computed.
Church-Turing thesis, which states that the Turing machine (Turing, 1936) is capable of
computing any computable function, is generally accepted as providing a sufficient
definition.
Psychology (1879-present)
The view that the brainpossesses and processes information, is the principal characteristic of
cognitive psychology,
The three key steps of a knowledge-based agent:
For artificial intelligence to succeed, we need two things: intelligence and an artifact.
The computer has been unanimously acclaimed as the artifact with the best chance of
demonstrating intelligence.
AI also owes a debt to the software side of computer science, which has supplied the
operating systems, programming languages, and tools needed to write modern programs.
AI has pioneered many ideas that have made their way back to "mainstream" computer
science, including time sharing, interactive interpreters, the linked list data type,
automatic storage management, and some of the key concepts of object-oriented
programming and integrated program development environments with graphical user
interfaces.
Linguistics (1957-present)
Understanding language requires an understanding of the subject matter and context, not just
an understanding of the structure of sentences.
Much of the early work in knowledge representation (the study of how to put knowledge
into a form that a computer can reason with) was tied to language and informed by
research in linguistics, which was connected in turn to decades of work on the
philosophical analysis of language.
Modern linguistics and AI were "born" at about the same time, so linguistics does not
play a large foundational role in the growth of AI. Instead, the two grew up together,
intersecting in a hybrid field called computational linguistics or natural language
processing, which concentrates on the problem of language use.
The History of Artificial Intelligence
The gestation of artificial intelligence (1943-1956)
AI was done by Warren McCulloch and
The first work that is now generally recognized as
Walter Pitts (1943). They drew on three sources:
knowledge of the basic physiology
function of neurons in the brain
the formal analysis of propositional logic
Turing's theory of computation: They proposed a model of artificial neurons in which
each neuron is characterized as being "on" or "off," with a switch to "on" occurring in
response to stimulation by a sufficient number of neighbouring neurons.
Claude Shannon (1950) and Alan Turing(1953) were writing chess programs for von
Neumann-style conventional computers.
Marvin
At the same time, two graduate students in the Princeton mathematics department,
Minsky and Dean Edmonds, built the first neural network computer in 1951.
Early enthusiasm, great expectations (1952-1969)
Newell and Simon's early success was followed up with the General Problem Solver, or
GPS. Unlike Logic Theorist,this program was designed from the start to imitate human
problem-solving protocols.
Within the limited class of puzzles it could handle, it turned out that the order in which
the program considered subgoals and possible actions was similar to the way humans
approached the same problems. Thus, GPS was probably the first program to embody the
"thinking humanly" approach.
Prover. Like the Logic Theorist,
Herbert Gelernter (1959) constructed the Geometry Theorem
it proved theorems using explicitly represented axioms.
too many possible reasoning paths to follow, most of
Gelernter soon found that there were
which turned out to be dead ends.
Arthur Samuel wrote a series of programs for checkers (draughts) that eventually learned
to play tournament-level checkers. Along the way, he disproved the idea that computers
can only do what they are told to, as his program quickly learned to play a better game
than its creator.
McCarthy defined the high-level language Lisp, which was to become the dominant AI
programming language.
Rosenblatt proved the famous perceptron convergence theorem, showing that his learning
algorithm could adjust the connection strengths of a perceptron to match any input data.
A dose of reality (1966-1974)
Most of the early AI programs worked by representing the basic facts about a problem
and trying out a series ofsteps to solve it, combining different combinations of steps until
the right one was found.
The early programs were feasible only because micro worlds contained very few objects.
Before the theory of NP-completeness was developed, it was widely thought that "scaling up"
to larger problems was simply a matter of faster hardware and larger memories.
Resolution theorem proving, was soon dampened when researchers failed to prove theorems
involving more than a few dozen facts.
A two-input perceptron could not be trained to recognize when its two inputs were different.
Althoughtheir results did not apply to more complex, multilayer networks, solved the
problem.
The new back-propagation learning algorithms for multilayer networks that were to cause an
enormous resurgence in neural net research.
General-purpose search mechanism performs elementary reasoning steps to find complete
solutions. Such approaches are called weak methods, because they use weak information
about the domain.
The only way around this is to use knowledge more suited to making larger reasoning steps
and to solving typically occurring cases in narrow areas of expertise.
The DENDRAL program solves the problem of inferring molecular structure from the
information provided by a mass spectrometer.
The input to the program consists of the elementary formula of the molecule, and the
mass spectrum giving the masses of the various fragments of the molecule generated
when it is bombarded by an electron beam.
The naive version of the program generated all possible structures consistent with the
formula, and then predicted what mass spectrum would be observed for each.
The significance of DENDRAL was that it is the first successful knowledge-intensive
System.
MYCIN diagnoses blood infections. With about 450 rules, MYCIN was able to perform as
well as some experts, and considerably better than junior doctors.
It also contained two major differences from DENDRAL.:
First, unlike the DENDRAL rules, no general theoretical model existed from
which the MYCIN rules could be deduced. They had to be acquired from
extensive interviewing of experts, who in turn acquired them from direct
experience of cases.
Second, the rules had to reflect the uncertainty associated with medical
knowledge. MYCIN incorporated a calculus of uncertainty called certainty factors.
In 1981, the Japanese announced the "Fifth Generation" project, a 10-year plan to build
intelligent
computers running Prolog in much the same way that ordinary computers run
machine code.
It has the ability to make millions of inferences per second.
to achieve full-scale natural language understanding, among other
The project proposed
ambitious goals.
The booming AI industry also included companies such as Carnegie Group, Inference,
Intellicorp, and Teknowledge that offered the software tools to build expert systems, and
hardware companies such as Lisp Machines Inc., Texas Instruments, Symbolics, and
Xerox that were building workstations optimized for the development of Lisp programs.
The return of neural networks (1986-present)
Back-propagation learning was applied to many learning problems in computer science and
psychology, and the widespread dissemination of the results in Parallel Distributed
Processing.
In recent years, approaches were based on hidden Markov models (HMMs) which are
based on a rigorous mathematical theory. These are generated by a process of training on
a large corpus of real speech data.
Intelligent Systems
Intelligence:The ability of a system to calculate, reason, perceive relationships and
analogies, learn from experience, store and retrieve information from memory, solve
problems, comprehend complex ideas, use natural language fluently, classify, generalize,
and adapt new situations.
Intelligent systems
are technologically advanced machines that perceive and respond to the
world around them.
An intelligent system is a computer-based system that can represent reason about, and
interpret data.
An intelligent system is a system with artificial intelligence.
Reasoning − It is the set of
processes that enables us to provide basis for judgement, making
decisions, and prediction.
Learning − It is the activity of gaining
knowledge or skill by studying, practising, being
taught, or experiencing something.
Problem solving- It is the process of selecting the best suitable alternative out of multiple
alternatives to reach the desired goal are available.
Perception − It is the process of acquiring, interpreting, selecting, and organizing sensory
information. Perception presumes sensing. In humans, perception is aided by sensory
organs. In the domain of AI, perception mechanism puts the data acquired by the sensors
together in a meaningful manner.
Linguistic Intelligence − It is one’s ability to use, comprehend, speak,
and write the verbal
and written language. It is important in interpersonal communication.
Applications of AI
Air Operations Division (AOD) - uses AI for the rule based expert systems.
The AOD has use for artificial intelligence for surrogate operators for combat and
training simulators, mission management aids, support systems for tactical
decision making, and post processing of the simulator data into symbolic
summaries.
Airplane simulators are using artificial intelligence in order to process the data
taken from simulated flights.
Simulated aircraft warfare computers are able to come up with the best success
scenarios in these situations
have created many tools to solve the most difficult
Computer Science: AI researchers
problems in computer science.
time sharing ,
interactive interpreters,
graphical user interfaces and the computer mouse,
rapid development environments,
the linked list data structure,
automatic storage management,
symbolic programming,
functional programming,
dynamic programming
object-oriented programming
Education: Number of companies that create robots to teach subjects to children ranging
from biology to computer science.
Intelligent tutoring systems: An ITS called SHERLOCK teaches Air Force
technicians to diagnose electrical systems problems in aircraft. Another example
is DARPA, Defense Advanced Research Projects Agency, which used AI to
develop a digital tutor to train its Navy recruits in technical skills in a shorter
amount of time.
Finance: Algorithmic Trading involves the use of complex AI systems to make trading
decisions at speeds several orders of magnitudes greater than any human is capable of,
often making millions of trades in a day without any human intervention. Such trading is
called High-frequency Trading. Many banks, funds, and proprietary trading firms now
have entire portfolios which are managed purely by AI systems.
Hospitals and medicine: used as clinical decision support systems for medical diagnosis.
Computer-aided interpretation of medical images help scan digital images, e.g.
from computed tomography, for typical appearances and to highlight conspicuous
sections, such as possible diseases. A typical application is the detection of a
tumor.
Heart sound analysis
Companion robots for the care of the elderly
Mining medical records to provide more useful information.
Design treatment plans.
Assist in repetitive jobs including medication management.
Provide consultations.
Drug creation[27]
Using avatars in place of patients for clinical training[28]
Predict the likelihood of death from surgical procedures
Predict HIV progression
Media and E-commerce: Typical use case scenarios include:
analysis of images using object recognition or face recognition techniques,
analysis of video for recognizing relevant scenes, objects or faces.
facilitation of media search,
creation of a set of descriptive keywords for a media item,
media content policy monitoring (such as verifying the suitability of content for a
particular TV viewing time),
speech to text for archival or other purposes, and the detection of logos,
products or celebrity faces for the placement of relevant advertisements
AI is also widely used in E-commerce Industry for applications like Visual
search, Visually similar recommendation, Chatbots, Automated product
tagging etc
Music: At Sony CSL Research Laboratory, their Flow Machines software has created pop
songs by learning music styles from a huge database of songs. By analyzing unique
combinations of styles and optimizing techniques, it can compose in any style.
News, publishing and writing: Artificial intelligence is used to turn structured data into
intelligent comments and recommendations in natural language. We can be able to write
financial reports, executive summaries, personalized sales or marketing documents and
more at a speed of thousands of pages per second and in multiple languages including
English, Spanish, French & German.
Online and telephone customer service: Artificial intelligence is implemented in
automated online assistants which uses natural language processing.
Sensors: Artificial Intelligence has been combined with many sensor technologies, such
as Digital Spectrometry TM which enables many applications such as at home water
quality monitoring.
Telecommunications maintenance: Many telecommunications companies make use of
heuristic search in the management of their workforces, for example BT Group has
deployed heuristic search in a scheduling application that provides the work schedules of
20,000 engineers.
Toys and games: AI has been applied to video games, for example video game bots, which
are designed to stand in as opponents where humans aren't available or desired.
Transportation: Fuzzy Logic controllers have been developed for automatic gearboxes
in automobiles. For example, the 2006 Audi TT, feature the DSP transmission which
utilizes Fuzzy Logic.
A familiar application of AI in everyday life is seen with services like Netflix or
Amazon, wherein ML algorithms analyze the user’s activity and compare it with
that of other users to determine which shows or products to recommend. The
algorithms are becoming intelligent with time—to the extent of understanding that
a user may want to buy a product as a gift and not for him/her, or that different
family members have different watching preferences.
Finance:
Financial services companies use AI-based natural language processing tools to
analyze brand sentiment from social media platforms and provide actionable
advice.
Investment companies like Aidya and Nomura Securities use AI algorithms to
conduct trading autonomously and robo-traders to conduct high-frequency trading
for greater profits, respectively.
Fintech firms like Kensho and ForwardLane use AI-powered B2C robo-advisors
to augment rebalancing decisions and portfolio management performed by human
analysts. Wealthfront uses AI algorithms to track account activity and help
financial advisors customize their advice.
Chatbots, powered by natural language processing, can serve banking customers
quickly and efficiently by answering common queries and providing information
promptly.
Fraud detection is an important application of AI in financial services. For
example, Mastercard uses Decision Intelligence technology to analyze various
data points to detect fraudulent transactions, improve real-time approval accuracy,
and reduce false declines.
Data security:
Cyber attacks are becoming a growing reality with the move to a digital world.
There are also concerns about AI programs themselves turning against systems.
Automatic exploit generation (AEG) is a bot that can determine whether a
software bug, which may cause security issues, is exploitable. If a vulnerability is
found, the bot automatically secures it. AEG systems help develop automated
signature generation algorithms that can predict the likelihood of cyberattacks.
PatternEx and MIT’s Computer Science and Artificial Intelligence Laboratory
(CSAIL) have developed an AI platform called AI2 which claims to predict cyber
attacks better than existing systems. The platform uses Active Contextual
Modeling, a continuous feedback loop between a human analyst and the AI
system, to provide an attack detection rate that is better than ML-only solutions by
a factor of 10.
Deep Instinct, an institutional intelligence company, says that malware code varies
between 2%-10% in every iteration and that its AI model is able to handle the
variations and accurately predict which files are malware.
Manufacturing:
Assume ,
Player 1 - X
Player 2 – O
Board's Data Structure:
The cells could be represent as Center square, Corner,Edge as like below:
Assignment-Cum-Tutorial Questions
I) Objective Questions
2. Illustrate the capabilities that a computer must possess to pass Turing Test?
3. Explain the areas from which Artificial Intelligence laid its foundation?
We have to write a very large number of rules since there have to be a
separate rule for each of the 10120 possible board positions. Using so
many rules poses two serious practical difficulties:
No person could ever supply a complete set of such rules. It would
take too long and could certainly not be done without mistakes.
No program could easily handle all those rules. Although
hashing scheme could be used to find the relevant rules for
each move fairly quickly, just storing that many rules poses
serious difficulties.
We should write the rules describing the legal moves in as general a
way possible. The convenient notation for describing patterns and
substitutions is as follows:
A problem can be defined in a “State Space”, where each state
corresponds to a legal position of the board.
We can start at an initial state using a set of rules to move from
one state to another, and attempting to end up in one of a set of
final states.
The state space representation forms the basis of most of the Al
methods. Its structure
corresponds to the structure of problem solving
in two important ways:
Artificial Intelligence Unit-II
The first step toward the design of a program to solve a problem must be
the creation of a formal and manipulable description of the problem itself.
We should be able to write programs that can themselves produce such
formal descriptions from informal ones. This process is called
Operationalization.
In order to provide a formal description of a problem, we must do the
following:
Define a state space that contains all the possible configurations
of the relevant objects (and perhaps some impossible ones). It is, of
course, possible to define this space without explicitly enumerating
all of the states it contains.
Specify one or more states within that space that describes
possible situations from which the problem-solving process may
start. These states are called the Initial states.
Specify one or more states that would be acceptable as solutions to
the problem. These states are called goal states.
Specify a set of rules that describe the actions (operators) available.
The problem can then be solved by using the rules, in combination
with an appropriate Control Strategy, to move through the problem
space until a path from an initial state to a goal state is found. Thus
the process of search is fundamental to the problem-solving process.
Control Strategies
It is important to decide which rule to apply next during the process of
when more
searching for a solution to a problem. This question arises
than one will have its left side match the current state.
The decisions made will have a crucial impact on how quickly a problem
is finally solved.
The following are the requirements of a control strategy:
The first requirement of a good control strategy is that it causes
motion. Consider again the water jug problem. Suppose we
implemented the simple control strategy of starting each time at
the top of the list of rules and choosing the first applicable one.
If we did that, we would never solve the problem. We would
continue indefinitely filling the 4-gallon jug with water. Control
strategies that do not cause motion will never lead to a solution.
The second requirement of a good control strategy is that it be
systematic. Let us consider a simple control strategy for the water
jug problem. On each cycle, choose at random from among the
applicable rules. This strategy is better than the first. It
Artificial Intelligence Unit-II
causes motion. It will lead to a solution eventually. Sometimes
we arrive at the same state several times during the process
and to use many more steps than are necessary. Because the
control strategy is not systematic, we may explore a particular
useless sequence of operators several times before we finally
find a solution. The requirement that a control strategy be
systematic corresponds to the need for global motion (over the
course of several steps) as well as for local motion (over the
course of a single step).
Breadth First Search
For each leaf node, generate all its successors by applying all the rules
that are appropriate. Continue this process until some rule produces
a goal state. This process, called Breadth-First search.
Algorithm: Breadth-First Search
1. Create a variable called NODE-LIST and set it to the initial state.
2. Until a goal state is found or NODE-LIST is empty do:
(a) Remove the first element from NODE-LIST and call it E. If
(b) For each way that each rule can match the state described in
E do:
i. Apply the rule to generate a new state.
ii. If the new state is a goal state, quit and return this state.
iii. Otherwise, add the new state to the end of' NODE-LIST.
Example-Blocks World Problem: Assume that the following operators
are available-
Applying the technique of problem decomposition to this simple blocks
world example would lead to a solution tree such as that shown below:
Artificial Intelligence Unit-II
In the figure, goals are underlined. States that have been achieved are
not underlined. The idea of this solution is to reduce the problem of
getting B on C and A on B to two separate problems.
The first of these new problems, getting B on C. is simple, given the
start state. Simply put B on C. The second sub goal is not quite so
simple. Since the only operators we have allow us to pick up single
C before we can
blocks at a time, we have to clear off B by removing
pick up A and put it on B This can easily be done.
However, if we now try to combine the two sub solutions into one
we do first, we will not
solution, we will fail. Regardless of which one
be able to do the second as we had planned.
In this problem, the two sub problems are not independent. They
interact and those interactions must be considered in order to arrive at
a solution for the entire problem.
2. Can Solution Steps Be Ignored or Undone?
Theorem Proving: We proceed by first proving lemma that we think will
be useful. Eventually, we realize that the lemma is no help at all.
true. Any rules that
Everything we need to prove the theorem is still
could have been applied can still be applied.
All we have lost
We can just proceed as we should have in the first place.
is the effort that was spent exploring the blind alley.
The 8-Puzzle: The 8-puzzle is a square tray in which are placed eight
square tiles. The remaining ninth square is uncovered. Each tile has a
number on it. A tile that is adjacent to the blank space can he slid into
that space. A game consists of a starting position and a specified goal
position. The goal is to transformthe starting position into a goal
position by sliding the tiles around.
Artificial Intelligence Unit-II
In attempting to solve the 8-puzzle, we might make a stupid move. We
might start by sliding tile 5 into the empty space. Having done that,
we cannot change our mind and immediately slide tile 6 into the
empty space since the empty space will essentially have moved.
But we can backtrack and undo the first move, sliding tile 5 back to
where it was. Then we can move tile 6. Mistakes can still be recovered
from but not quite easily.An additional step must be performed to
undo each incorrect step,
The control mechanism for an 8.puzzle solver must keep track of the
order in which operations are performed so that the operations can be
undone one at a time if necessary.
Chess: Now consider again the problem of playing chess. Suppose a
chess-playing program makes a stupid move and realizes it a couple
of moves later. It cannot simply play as though it had never made the
stupid move. Nor can it simply back up and start the game over from
that point. All it can do is totry to make the best of the current
situation and go on from there.
The three problems—theorem proving, the 8-puzzle, and chess—
illustrate the differences between three important classes of problems:
• Ignorable(e.g... theorem proving), in which solution steps can be
ignored
• Recoverable(e.g... 8-puzzle), in which solution steps can be undone.
• Irrecoverable(e.g... chess), in which solution steps cannot be
undone
The recoverability of a problem plays an important role in
determining the complexity of the control structure necessary for the
problem's solution.
Ignorable problems can be solved using a simple control structure
that never backtracks. Such a control structure is easy to
implement.
Recoverable problems can be solved by a slightly more complicated
control strategy that does sometimes make mistakes. Backtracking
will be necessary to recover from such mistakes, so the control
structure must be implemented using a push-down stack, in which
decisions are recorded in case they need to be undone later.
Irrecoverable problems, on the other hand, will need to be solved
by a system that expends a great deal of effort making each
decision since the decision must be final
3. Is the Universe Predictable?
8-puzzle: Every time we make a move, we know exactly what will
happen. This means that it is possible to plan an entire sequence of
moves and be confident that we know what the resulting state will be.
Artificial Intelligence Unit-II
We can use planning to avoid having to undo actual moves, although
it still be necessary to backtrack past those moves one at a time
during the planning process. Thus a control structure that allows
backtracking will be necessary.
Play Bridge: One of the decisions we will have to make is which card
to play on the first trick. What we would like to do is to plan the entire
hand before making that first play. But now it is not possible to do
such planning with certainty since we cannot know exactly where all
the cards are what the other players will do on their turns. The best
we can do is to investigate several plans and use probabilities of the
various outcomes to choose a plan that has the highest estimated
probability of leading to a good score on the hand.
Certain–outcome problems (e.g... 8-puzzle): The open-loop approach
will work fine since the result of an action can he predicted perfectly.
Thus, planning can be used to generate a sequence of operators that
is guaranteed to lead to a solution.
Uncertain–outcome problems (e.g... Bridge): Planning can at best
generate a sequence of operators that has a good probability of leading to
a solution. To solve such problems, we need to allow for a process of plan
revision to take place as the plan is carried out and the necessary
feedback is provided. In addition to providing no guarantee of art actual
solution, planning for uncertain -outcome problems has the drawback
that it is often very expensive since the number of solution paths that
need to be explored increases exponentially with the number of points
at which the outcome cannot be predicted.
4. Is a Good Solution Absolute or Relative?
Simple facts problem: Consider the problem of answering questions
based on a database of simple facts, such as the following:
1. Marcus was a man.
2. Marcus was a Pompeian.
3. Marcus was born in 40 A.D.
4. All men are mortal.
5. All Pompeians died when the volcano erupted in 79 A.D.
6 No mortal lives longer than 150 years.
7.11 is now 1991 A.D.
Suppose we ask the question 'Is Marcus alive?'. By representing each
of these facts in a formal language such as predicate logic, and then
using formal inference methods we can fairly easily derive an answer
to the question. Since all we are interested in is the answer to the
que7sion, it does not matter which path we follow. If we do follow one
path successfully to the answer, there is no reason
to go back and see
it some other path might also lead to a solution.
Artificial Intelligence Unit-II
Travelling salesman problem: Our goal is to find the shortest route
that visits each city exactly once. Supposethe cities to be visited and
the distances between them are as shown:
One place the salesman could start is Boston. In that case, one path
that might be followed is shown, which is 8850 miles long. But is this
the solution to the problem? The answer is that we cannot be sure
unless we also try all other paths to make sure that none of them is
shorter. In this case,the first path is definitely not the solution to the
salesman's problem.
Artificial Intelligence Unit-II
Best-path problems: These are, in general, computationally harder
than Any-path problems. No heuristic that could possibly miss the
best solution can be used.
Any-path problems: can often be solved in a reasonable amount of time
by using heuristics that suggest good paths to explore. If the heuristics
are not perfect, the search for a solution may not be as direct as
possible. So a much more exhaustive search will be performed.
5. Is the Solution a State or a Path?
Consistent interpretation for the sentence (NLU): There are several
components of this sentence,each of which, in isolation, may have
more than one interpretation.
“The Bank president ate a dish of pasta salad with the fork”
Some of the sources of ambiguity in this sentence are the following:
The word "bank" may refer either to a financial institution or to
a side of a river. But only one of these may have a president.
The word "dish" is the object of the verb "eat." It is possible that
a dish was eaten. But it is more likely that the pasta salad in
the dish was eaten.
Pasta salad is a salad containing pasta. But there are other
ways meanings can be formed from pair of nouns. For example,
dog food does not normally contain dog.
Some search may be required to find a complete interpretation for the
sentence. But to solve the problem of finding the interpretation we
need to produce only the interpretation itself. No record of the
processing by which the interpretation was found is necessary.
Water Jug Problem: It is not sufficient to report that we have solved the
problem and that the final state (2, 0). For this kind of problem, what we
found to that
really must report is not the final state but the path that we
state. Thus a statement of a solution to this problem must
Artificial Intelligence Unit-II
be a sequence of operations called a “plan” that produces the final
state.
The difference between these problems is:
Generic control strategy-Classification: The task here is to examine
an input and then decide which of a set of known classes the input is
an instance of. Most diagnostic tasks, including medical diagnosis as
of faults in mechanical devices are examples of
well as diagnosis
classification.
Propose and Refine: Many design and planning problems can be
attacked with this strategy.
Heuristic Search Techniques
and several
A framework for describing search methods is provided
general-purpose search techniques are discussed.
There are many varieties of heuristic search. They can be described
independently of any particular task or problem domain. But when
highly dependent on
applied to particular problems, their efficacy is
the way they exploit domain-specific knowledge
Over last three decades of AI research, these techniques continue to
provide the framework into which domain-specific knowledge can be
learning. Thus they
placed, either by hand or as a result of automatic
continue to form the core of most Al systems.
Best-First Search
of both depth-
Best-first search, is a way of combining the advantages
first and breadth-first search into a single method.
Depth-first search is good because it allows a solution to be found
without all competing branches having to be expanded. Breadth-first
search is good because it does not get trapped on dead-end paths.
One way of combining the two is to follow a single path at a time, but
switch paths whenever some competing path looks more promising
than the current one does.
At each step of the best-first search process, we select the most
promising of the nodes we have generated so far. This is done by
applying an appropriate heuristic function to each of them, We then
expand the chosen node by using the rules to generate its successors.
are
If one of them is a solution, we can quit. If not, all those new nodes
added to the set of nodes generated so far. Again the most promising
Artificial Intelligence Unit-II
node is selected and the process continues. A bit of depth first
searching occurs as the most promising branch is explored.
But eventually, it a solution is not found, that branch will start to look
less promising than one of the top-level branches that had been
ignored. At that point, the now more promising, previously ignored
branch will be explored. But the old branch is not forgotten, Its last
node remains in the set of generated but unexpanded nodes. The
search can return to it whenever all
the others get bad enough, that it
is again the most promising path.
Initially, there is only one node, so it will be expanded. Doing so
generates three new nodes. The heuristic function, is an estimate of
the cost of gettingto a solution from a given node, is applied to each of
these new nodes.
Since node D is the most promising, it is expanded next, producing two
successor nodes, E and F. Now the heuristic function is applied to them.
Now another path that going through node B looks more promising, so
it is pursued, generating nodes G and H. But again when these new
nodes are evaluated they look less promising than another path, so
attention is returned tothe path through D to E. E is then expanded,
yielding nodes I and J.
At the next step, J will be expanded, since it is
the most promising. This
process can continue until a solution is found.
Artificial Intelligence Unit-II
In best-first search, one move is selected, but the others are kept
around so that they can be revisited later if the selected path becomes
less promising.
Further, the best available state is selected in best first search, even it
that is lower than the value of the state that
that state has a value
was just explored.
In a best-first search of a tree, it is sometimes important tosearch a
graph instead so that duplicate paths will not be pursued.
An algorithm to do this will operate by searching a directed graph in
which each node represents a point in the problem space. Each node
will contain, in addition to a description of the problem state it
represents, an indication of how promising it is; a parent link that
points back to the best node from which it came, and a list of the
nodes that were generated from it.
The parent link will make it possible to recover the path to the goal
once the goal is found. The list of successors will make it possible, if a
better path is found to an already existing node, to propagate the
improvement down to its successors.
each of its branches
We will call a graph of this sort an OR graph, since
represents an alternative problem-solving path.
To implement such a graph-search procedure, we will need to use two
lists of nodes:
OPEN—nodes that have been generated and have had the heuristic
function applied to them but which have not yet been examined
(i.e.. had their successors generated) OPEN is actually a priority
queue in which the elements with the highest priority are those
with the most promising value of the heuristic function.
CLOSED— -nodes that have already been examined. We need to
keep these nodes in memory if we want to search a graph rather
than a tree, since whenever a new node is generated; we need to
check whether it has been generated before.
We will also need a heuristic function that estimates the merits of
each node we generate. The function f1 that gives the true evaluation
of the node.
We define this function as the sum of two components: g and h1.
The function g is ameasure of the cost of getting from the initial state
to the current node.
The function h1 is an estimate of the additional cost of getting from the
current node to a goal state.
The combined function f1 represents an estimate of the cost of getting
from the initial state to a goal state along the path that generated the
Artificial Intelligence Unit-II
current node. If more than one path is generated the node, then the
algorithm will record the best one.
This process can be summarized as follows:
Algorithm: Best-First Search
1. Start with OPEN containing just the initial state.
2. Until a goal is found or there are no nodes left on OPEN do:
(a) Pick the best node on OPEN.
(b) Generate its successors.
(c) For each successor do:
i. If it has not been generated before, evaluate it, add it to
OPEN, and record its parent.
ii. If it has been generated before, change the parent if this new
path is, better than the previous one. In that case, update the
cost of getting to this node and to any successors that this node
may already have.
The best first search algorithm is a simplification of an algorithm called
A* .
same f1, g, and h1 functions, as well as the lists
This algorithm uses the
OPEN and CLOSED.
Iterative Deepening:
A number of ideas for searching two-player game trees have led to new
algorithm for single-agent heuristic search. One such idea is
“iterative deepening” originally used in CHESS.
Rather than searching to a fixed depth in the game tree, CHESS first
searched only a single ply, applying its static evaluation function to
the result of each of its possible moves.
This was
It then initiated a new minimax search, to a depth of two ply.
followed by a three-ply search, then a four-ply search etc.
The name "iterative deepening" derives from the fact that on each
iteration, the tree is searched one level deeper.
Since it is impossible to know in advance how long a fixed-depth tree
search will take, a program may find itself running out of time. With
iterative deepening, the current search can be aborted at anytime and
the best move found by the previous iteration can be played.
can also be used in improve the performance of the A*
Iterative deepening
search algorithm.
Algorithm: Iterative-Deepening-A*
1. Set THRESHOLD = the heuristic evaluation of the start state.
2. Conduct a depth-first search, pruning any branch when its total
cost function (g + h1) exceeds THRFSHOLD. If a solution path is found
during the search, return it.
Artificial Intelligence Unit-II
3. Otherwise, increment THRESHOLD by the minimum amount it was
exceeded during the previous step, and then go to Step 2.
Iterative-Deepening-A* (IDA*) is guaranteed to find an optimal solution
provided that h1 is an admissible heuristic.
Problem Reduction: AND-OR Graphs
AND-OR graph (or tree), is useful for representing the solution of
problems that can be solved by decomposing them into a set of
smaller problems, all of which must then he solved.
This decomposition, or reduction, generates arcs that we call AND
arcs. One AND arc may point to any number of successor nodes all of
which must be solved in order for the arc to point to a solution.
Several arcs may emerge from a single node, indicating a variety of ways
in which the original problem might be solved. This is why the structure
is called not simply an AND graph but rather an AND-OR graph. AND
arcs are indicated with a line connecting all the components.
In order to find solutions in an AND-OR graph, we need an algorithm
with the ability to handle the AND arcs appropriately. This algorithm
should find a path from the starting node of the graph to a set of
nodes representing solution states.
The top node, A, has been expanded, producing two arcs, one leading to
B and one leading to C and D. The numbers at each node represent the
value of f1 at that node. Assume, that every operation has a uniform
cost, so each arc with a single successor has a cost of I and each AND
arc with multiple successors has a cost of 1 for each of its components.
1
for expansion the one with the
If we look just at the nodes and choose
lowest; f value, we must select C.
But using the information now available, it would be better to explore
the path going through B since to use C we must also use D. (for a
9 (C+D+2) compared to the cost of 6 that we get by going
total cost of
through B.
The problem is that the choice of which node to expand next must
1
depend not only on the f value of that node but also on whether that
node is part of the current best path from the initial node.
Artificial Intelligence Unit-II
1
The most promising single node is (G with an f value of 3). It is even
part of the most promising arc G-H, with a total cost of 9. But that are
is not part of the current best path since to use it we must also use
the arc I-J with a cost of 27.
The path from A through B, to E and F is better, with a total cost of
18. So we should not expand G next: rather we should examine either
E or F.
In order to describe an algorithm for searching an AND-OR graph, we
need to exploit a value called FULILITY. If the estimated cost of a
solution becomes greater than the value of FUTILITY, then we
abandon the search.
FUTILITY should be chosen to correspond to a threshold such that any
solution with a cost above it is too expensive to be practical, even if it is
found.
At step 1, A is the only node, so it is at the end of the current best
path. It is expanded, yielding nodes B, C and D. The arc to D is
labelled as the most promising one emerging from A, since it costs 6
compared to B and C, which costs 9. (Marked arcs are indicated in the
figures by arrows.)
In step 2, node D is chosen for expansion. This process produces one
new arc, the AND arc to E and F, with a combined cost estimate of 10.
So we update the f1 value of D to 10.
Going back one more level, we can see that this makes the AND arc B-
C better than the arc to D, so it is labelled as the current best path.
At step 3, we traverse that arc from A and discover the unexpanded
nodes B and C. If we want to find a solution along this path, we will
have to expand both B and C eventually, so let's choose to explore B
first. This generates two new arcs, the ones to G and to H.
Propagating their f1 values backward, we update f1 of B to 6.
This
requires updating the cost of the AND arc B-C to 12 (6+4+2).
After doing that, the arc to D is again the better path from A, so we
record and either node E or node F will
that as the current best path
be chosen for expansion at step 4.
This process continues until either a solution is found or all paths have
led to dead ends, indicating that there is no solution.
Constraint Satisfaction
Many problems in Al can be viewed as problems of Constraint
Satisfaction in which goal is to discover some problem state that
satisfies a given set of constraints.
Examples of this sort of problem include crypt arithmetic puzzles.
Design tasks can also be viewed as Constraint Satisfaction problems
must be created within fixed limit, on time, cost,
in which a design
and materials.
By viewing a problem as one of constraint satisfaction, its often
possible to reduce substantially the amount of search that, is required
as compared with a method that attempts to form partial solutions.
A constraint satisfaction approach to solving this problem avoids
making guesses on particular assignments of numbers to letters.
Instead, the initial set of constraints, which says that each number
may correspond to only one letter and that the sums of the digits
must be as they are given in the problem, is first augmented to
include restrictions that can be inferred from the rules of arithmetic.
may still be required, the number of allowable
Then, although guessing
guesses is reduced.
Constraint satisfaction is a search procedure that operates in a space of
Constraint sets.
The initial state contains the constraints that are originally given in the
problem description. A goal state is any state that has been constrained -
enough." where "enough' must be defined for cacti problem.
Constraint satisfaction is a two-step process. First, constraints are
discovered and propagated as far as possible throughout the system.
Then, if there is still not a solution, search begins. A guess about
something is made and added as a new constraint. Propagation can
then occur with this new constraint, and so forth.
The first step, propagation, arises from the fact that there are usually
dependencies among the constraints. These dependencies occur
because many constraints involve more than one object and many
objects participate in more than one constraint.
So, for example, assume we start with one constraint: N = E + I. Then,
if we added the constraint N = 3, we could propagate that to get a
stronger constraint on E, namely that E = 2.
Constraint propagation terminates for one of two reasons.
First, a contradiction may be detected. If this happens, then there
is no solution consistent with all the known constraints. If the
contradiction involves only those constraints that were given as
part of the problem specification (as opposed to ones that were
guessed during problem solving), then no solution exists.
Artificial Intelligence Unit-II
1. Propagate available constraints. To do this, first set OPEN to the set of all
objects that must have values assigned to them in a complete solution. Then
do until an inconsistency is detected or until OPEN is empty:
(a) Select an object OB from OPEN. Strengthen as much as possible the
set of constraints that apply to OB.
(b) If this set is different from the set that was assigned the last time OB
was examined or if this is the first time OB has been examined, then add
to 0PEN all objects that share any constraints with OB.
(c) Remove OB from OPEN.
2. If the union of the Constraints discovered above defines a solution,
then quit and report the solution.
3. If the union of the constraints discovered above defines a contradiction
then return failure.
4. If neither of the above occurs, then it is necessary to make a guess at
something in order to proceed. To do this, loop until a solution is found
or all possible solutions have been eliminated:
(a) Select an object whose value is not yet determined and select a way
of strengthening the constraints on that object.
(b) Recursively inv006Fke constraint satisfaction with the current set of
constraints augmented by the strengthening constraint just selected.
Artificial Intelligence Unit-II
The goal slate is problem state in which all letters have been assigned a
digit in such a way that all the initial constraints are satisfied.
proceeds in cycles. At each cycle, two significant
The solution process
things are done :
Constraints are propagated by using rules that correspond to
the properties of arithmetic.
A value is guessed for some letter whose value is not yet
determined.
In the first step, it does not usually matter a great deal what order the
propagation is done in, since all available propagations will be
performed before the step ends.
In the second step, the order in which guesses are tried may have a
substantial impact on the degree of search that is necessary.
A few useful heuristics can help to select the best guess to try first.
For example, if there is a letter that has only two possible values and
other with possible values, there is a better chance of guessing right
on the first than on the second.
Another useful heuristic is that if there is a letter that participates in
many constraints then it is a good idea to prefer it to a letter that
participates in a few. A guess on such a highly constrained letter will
usually lead quickly either to a contradiction (if it’s wrong) or to the
generation of many additional constraints (if it is right). A guess on a
less constrained letter, on the other hand, provides less information.
Let Cl, C2, C3, and C4 indicate the carry bits out of the columns,
numbering from the right. Initially, rules forpropagating constraints
generate the following additional constraints:
Artificial Intelligence Unit-II
• M 1, since two single-digit numbers plus a carry cannot total more
than 19; S=8 or 9, since S+M+C3>9 (to generate the carry) and M=1,
S+l+C3>9. So S + C3 > 8 and C3 is at most 1.
• O=0, since S + M(l)+C3(<= 1) must be at least 10 to generate a carry
and it can be at most 11. But M is already 1. So O must be 0.
• N = E or E+1, depending on the value of C2. But N cannot have the
same value as E. So, N=E+l and C2 is 1.
• In order for C2 to be1, the sum of N+ R+CI must be greater than 9,
so N+ R must be greater than 18.
• N + R cannot be greater than 18, even with a carry in, so E cannot
be 9.
At this point, let us assume that no more constraints can be generated.
Then, to make progress from here, we must guess. Suppose E is assigned
the value 2. (We chose to guess a value for E because it occurs three
Now the next cycle
times and thus interacts highly with the other letters.)
begins. The constraint propagator now observes that:
• N =3, since N = E+ 1.
• R= 8 o 9, s ince R+ N (3)+C1 (1 or 0)=2 or 12. But since N is already
3, the sum of these non negative numbers cannot be less than 3.
Thus R + 3 + (0 or 1)= 12 and R = 8 or 9.
• 2 + D= Y or 2 + D = 10 + Y, from the sum in the rightmost column.
Game Playing
Charles Babbage, the nineteenth-century computer architect, thought
about programming his Analytical Engine to play chess and later of
building a machine to play tic-tac-toe.
Claude Shannon wrote a paper in which he described mechanisms
that could be used in a program to play chess.
Alan Turing described a chess-playing program, but he never built it.
Arthur Samuel, succeeded in building the first significant,
operational game-playing program. His program played checkers and,
in addition to simply playing
the game, could learn from its mistakes
and improve its performance.
There were two reasons that games appeared to be a good domain in
which to explore machine intelligence:
They provide a structured task in which it is very easy to measure
success or failure.
They did not obviously require large amounts of Knowledge. They were
thought to be solvable by straightforward search from the starting
state to a winning position.
A program that simply does a straightforward search of the game tree
will not be able to select even its first move during the lifetime
of its
opponent. Some kind of heuristic search procedure is necessary.
Artificial Intelligence Unit-II
We use Generate-and-Test procedures in which the testing is done after
varying amounts of work by the generator.
At one extreme, the generator generates entire proposed solutions,
which the tester then evaluates.
At the other extreme, the generator generates individual moves in
the search space, each of which is then evaluated by the tester and
the most promising one is chosen.
To improve the effectiveness of a search-based problem-solving
program, two things can be done:
Improve the generate procedure so that only good moves (or paths)
are generated.
Improve the test procedure so that the best moves (or paths) will be
recognized and explored first.
The ideal way to use a search procedure to find a solution to a
problem is to generate moves through the problem space until a goal
state is reached.
In order to choose the best move, the resulting board positions must
be compared to discover which is most advantageous. This is done
using a static evaluation function, which uses whatever information
it has to evaluate so that the best next move can be chosen.
The Minimax Search Procedure
The minimax search procedure is a depth-first, depth-limited search
procedure.
The idea is to start at the current position and use the plausible-move
generator to generate the set of possible successor positions.
We apply the static evaluation function to those positions and simply
choose the best one. Then we can back that value up to the starting
position to represent our evaluation of it.
Our goal is to maximize the value of the static evaluation function of
the next board position.
Assume a static evaluation function that returns values ranging from -
10 to 10, with 10 indicating awin for us, and -10 a win for the
opponent, and 0 an even match.
Since our goal is to maximize the value of the heuristic function, we
choose to move to B. Backing B's value up to A, we can conclude that
A’s value is 8.
Artificial Intelligence Unit-II
After our move, the situation would appear to be very good. But, if we
look one move ahead, we will see that one of our pieces also gets
captured and so the situation is not as favourable as it seemed.
So we would like to look ahead to see what will happen to each of the
new gamepositions at the next move which will be made by the
opponent.
Instead of applying the static evaluation function to each of the
positions that we just generated, we apply the plausible-move
generator, generating a set of successor positions for each position.
Artificial Intelligence Unit-II
But now we must take into account that the opponent gets to choose
which successor moves to make and thus which terminal value
should he backed up to the next level.
Suppose we made move B. Then the opponent must choose among
moves E, F, and G. The opponents goal is to minimize the value of the
evaluation function, so he or she can be expected to choose move F.
This means that if we make move B, the actual position in which we
will end up one move later is very bad for us. If node E is selected, it is
very good for us. Since at this level we are not the ones to move, we
will not get to choose it.
At the opponent's choice, the minimum value was chosen and backed
up. At the level representing our choice, the maximum value was
chosen.
Once the values from the second ply are backed up, it becomes clear
that the correct move for us to make at the first level, given the
the opponent can do from
information, is C, since there is nothing
there to produce a value worse than –2.
This process can he repeated for as many ply as time follows, and
more accurate evaluations that are produced can be used to choose
the correct move at the top level.
The alternation of maximizing and minimizing at alternate ply when
evaluations are being pushed back up corresponds to the opposing
strategies of the two players and hence this method is called. minimax.
The recursive procedure that relieson two auxiliary procedures that are
specific to the game being played:
MOVEGEN(Position,Player) -The plausible-move generator, which
returns the list of nodes representing the moves that can be made
by player in Position. We call the two players PLAYER-ONE and
PLAYER-TWO. In a chess program, we might use the names
BLACK and WRITE instead.
Artificial Intelligence Unit-II
After examining node F, we know that the opponent is guaranteed a
score of —5 or less at C (since the opponent is the minimizing player).
But we also know that we are guaranteed a score of 3 or greater at
node A, which we can achieve if we move to B.
Any other move that produces a score of less than 3 is worse than the
move to B, and we can ignore it.
Artificial Intelligence Unit-II
After examining only F, we are sure that a move to C is worse (it will
be less than or equal to —5) regardless of the score of node G. Thus
we need not bother to explore node G at all.
Alpha Value: In searching the tree, the entire sub tree headed by B is
searched, and we discover that at A we can expect a score of at least
is passed down to F, it will enable us to skip
3. When this alpha value
the exploration of L.
The reason is as follows: After K is examined; we see that I is
guaranteed a maximum score of 0, which means that F is guaranteed
a minimum of 0. But this is less than alpha's value of 3, no more
branches of I need be considered.
The maximizing player already knows not to choose to move to C and
then to I since, if that move is made, the resulting score will be no better
than 0 and a score of 3 can be achieved by moving to B instead. Nov,
Beta Value: After cutting off further exploration of I, J is examined
yielding a value of 5, which is assigned as the value of F. This value
becomes the value of beta at node C. It indicates that C is guaranteed
to get a 5 or less.
Artificial Intelligence Unit-II
Now, we must expand G. First M is examined and it has a value of 7,
which is passed back to G as its tentative value. But now 7 is
compared to beta (5). It is greater, and the player whose turn it is at
node C is trying to minimize. So this player will not choose G, which
would lead to a score of at least 7, since there is in alternative move to
F, which will lead to a score of 5. Thus it is not necessary to explore
any of the other branches of G.
The function MINIMAX-A-B, which requires four arguments: Position,
Depth, Use-Thresh, and Pass-Thresh.
a move for PLAYER-ONE from the position
The initial call, to choose
CURRENT should be
MINIMAX-A-
B(CURRENT 0,
PLAYER-ONE,
maximum value STATIC can compute
minimum value STATIC can compute)
The initial values for Use-Thresh and Pass-Thresh represent the worst
values that each side could achieve.
I) Objective Questions
9. _________is the list of nodes that have been generated and have had
the heuristic function applied to them but which have not yet been
examined.
[ ]
(a) OPEN (b) CLOSED (c) NODES (d) none
10. The function ___ is a measure of the cost of getting from the initial
state to the current node. [ ]
all of which must then he solved. [ ] (a) OR graph (b) AND graph (c)
AND-OR graph (d) none
12. ____________ function uses whatever information it has to
evaluate so that the best next move can be chosen. [ ]
(a) static evaluation (b) dynamic evaluation
assigned called __________. [ ] (a) alpha (b) beta (c) gamma (d) none
16. An upper bound on the value that a minimizing node may be assigned
3.1 Introduction
One particular way of representing facts is the language of logic.
The logical formalism is appealing because it immediately suggests a
powerful way of deriving new knowledge from old called as
“mathematical deduction”.
In this formalism, we can conclude that a new statement is true by
proving that it follows from the statements that are already known.
The way of demonstrating the truth of an already believed proposition
can be extended to include deduction as a way of deriving answers to
questions and solutions to problem.
we use the following standard logic
symbols: (Implication)
¬ (Not)
Λ (And)
V (Or)
∃ (there exists) ∀ (For All)
A set of labelled formulae including the one above the line may be
developed by replacing that formula with the one or more formulae
below the line. A vertical bar separating two sets below the line,
indicates that there are two successor nodes, so the branch of the
tableau splits into two at that point.
A contradiction in a tableau branch causes that branch to die: it gets
closed off and no more growth happens from its tip. If every branch
dies, the tree dies; in that case we know there was no way the tested
formulas could all have had the truth values they were initially
supposed to have.
If, on the other hand, we get to a state
in which every subformula has been
processed in every branch in which it
occurs and some branch is left alive or
"open", we have found an
interpretation on which all of the
original formulas are true.
Conventionally we mark a dead or
"closed" branch by writing a cross
under it.
AI 5
∀(x):
man(x)person(x)
3.7 Resolution:
Resolution is such a procedure, which gains its efficiency from the
fact that it operates on statements that have been converted to a very
convenient standard form.
Resolution produces proofs by refutation. To prove a statement (to
show that it is valid), resolution attempts to show that the negation of
the statement produces a contradiction with the known statements
(i.e.. that it is unsatisfiable).
Resolution is a technique for proving theorems in the propositional or
predicate calculus that has been a part of AI problem-solving.
Resolution describes a way of finding contradictions in a database of
clauses with minimum use of substitution. Resolution refutation
proves a theorem by negating the statement to be proved and adding
this negated goal to the set of axioms that are known (have been
assumed) to be true.
It then uses the resolution rule of inference to show that this leads to
a contradiction. Once the theorem prover shows that the negated goal
is inconsistent with the given set of axioms, it follows that the original
goal must be consistent. This proves the theorem.
AI 11
4. Move all quantifiers to the left of the formula without changing their
relative order. This is possible since there is no conflict among variable
names. Performing this, we get:
∀x:∀y:∀z:[¬Roman(X)V¬know(x,Marcus)]V[hate(x,Caesar)V(¬hate(y, z)Vthinkcrazy(x, y))]
At this point, the formula is known as Prenex normal form. It consists of a
prefix of quantifiers followed by a matrix, which is quantifier-free.
AI 12
The value of' y that satisfies father-of depends on the particular value of x,
we must generate functions with the same number of arguments as the
number of universal quantifiers in whose scope the expression occurs. So
this would be transformed into:
∀x: father-of(S2(x), x))
Since each clause is a separate conjunct and since all the variables are
universally quantified, there is no relationship between the variables of two
clauses, even if they were generated from the same wff.
3.9 The Basis of Resolution
The resolution procedure is a simple iterative process: at each step
two clauses, called the parent clauses, are compared (resolved),
yielding a new clause that has been inferred from them. The new
AI 13
clause represents ways that the two parent clauses interact with each
other. Suppose there are two clauses in the system:
winter V summer
¬winter V cold
Now we observe that precisely one of winter and ¬winter will be true
at any point.
If winter is true, then cold must be true to guarantee the truth of the
second clause.
If ¬winter is true, then summer must be true to guarantee the truth of
the first clause.
Thus we see that from these two clauses we can deduce:
summer V cold
Resolution operates by taking two clauses that each contains the
same literal, in this example, winter. The literal must occur in positive
form in one clause and in negative form in the other. The resolvent is
obtained by combining all of the literals of the two parent clauses
except the ones that cancel.
If the clause that is produced is the empty clause, then a
contradiction has been found. For example. the two clauses:
Winter
¬winter
will produce the empty clause.
In predicate logic, the situation is more complicated since we must
consider all possible ways of substituting values for the variables.
(c) If the resolvent is the empty clause, then a contradiction has been
found. If it is not, then add it to the set of clauses available to the
procedure.
Suppose we are given the axioms shown below and we want to prove
R. First we convert the axioms to clause form. Then we negate R.
producing ¬R, which is already in clause form.
Then we begin selecting pairs of clauses to resolve together. Although
any pair of clauses can be resolved, only those pairs that contain
complementary literals will produce a resolvent that is likely to lead to
the goal of producing the empty clause.
We begin by resolving with the clause ¬R .
One way of viewing the resolution process is that it takes a set of
clauses that are all assumed to be true and, based on information
provided by the others, it generates new clauses that represent
restrictions on the way each of those original clauses can be made
true.
A contradiction occurs when a clause when there is no way it can be
true. This is indicated by the generation of the empty clause.
AI 15
(a) Call Unify with the ith argument of LI and ith argument of L2,
putting result in S.
(b) If contains FAIL, then return {FAIL}.
(c) If S not equal to NIL then:
i. Apply S to the remainder of both L1 and L2.
ii. SUBST= APPEND(S, SUBST).
6. Return SUBST.
and the other contains ¬T2 and if T1 and T2 are unifiable, then
neither T1 nor T2 should appear in the resolvent. We call T1 and T2
Complementary Literals. Use the substitution produced by the
unification to create the resolvent. If there is more than one pair of
complementary literals, only one pair should be omitted from the
resolvent.
(c) If the resolvent is the empty clause, then a contradiction has been
found. If it is not, then add it to the set of c1auses available to the
procedure.
There are systematic strategies for making the choice of clauses to
resolve together each step so that we will find a contradiction if one
exists. This can speed up the process considerably.
Only resolve pairs of clauses that contain complementary
literals, since only such resolutions produce new clauses that
are harder to satisfy than their parents. To facilitate this, index
clauses by the predicates they contain, combined with an
indication of whether the predicate is negated Then, given a
particular clause, possible resolvent that contain a
complementary occurrence of one of its predicates can be
located directly.
Eliminate certain clauses as soon as they are generated so that
they cannot participate in later resolutions. Two kinds of
clauses should be eliminated:
Tautologies (which can never be unsatisfied) and
Clauses that are subsumed by other clauses. For example, P⋁Q can be subsumed by P.
Whenever possible, resolve either with one of- the clauses that
is part of the statement we are trying to refute or with a clause
generated by a resolution with such a clause. This is called the
“set-of-support strategy”.
Whenever possible, resolve with clauses that have a single
literal. Such resolutions generate new clauses with fewer literals
than the larger of their parent clauses and thus are probably
closer to the goal of a resolvent with zero terms. This method is
called the “unit-preference-strategy”.
AI 19
Example 1:
Resolution Proof:
AI 20
Example 2:
AI 21
Resolution Proof:
Unit- III
Artificial Intelligence: Logic Concepts
(Open Elective –I)
Assignment-Cum-Tutorial Questions
Objective Questions
1. List standard logic symbols.
2. Represent “It is RAINING” in propositional logic.
3. Real-world facts written as logical propositions are called ______________.
4. Represent “Marcus was a man” in propositional and predicate logic.
5. In _________________ logic decision procedure does not exist. [ ]
(a) Propositional (b) Predicate (c) First order (d) none
winter V summer
¬winter V cold
13. The resultant clause after resolution is called______________. [ ]
(a) Implicant (b) Resolvent (c) fact (d) instance
15. Resolving clauses that have a single literal first is called _______________
strategy.
16. Resolving either with one of- the clauses that is part of the statement we
are trying to refute or with a clause generated by a resolution with such
a clause- This is called the ____________ strategy.
2. Answer the question: Was Marcus loyal to Caesar? using the above
facts.
3. Represent the following facts using isa and instance attributes:
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. All Romans were either loyal to Caesar or hated him.
4. Enumerate the steps in the process of resolution.
5. Explain the steps of converting a fact to Clause form.
6. Convert the following fact into clause form:
All Romans who know Marcus either hate Caesar or think that anyone
who hates anyone is crazy.
7. Explain the algorithm for Propositional resolution.
8. Explain Unification Algorithm.
9. Explain the algorithm for resolution in predicate logic.
10. Determine the possible substitutions for unifying the following facts:
hate (x, y)
hate (Marcus, z)
11. Perform resolution in predicate logic:
AI 25
Outcomes:
Student will be able to:
is as a set of relations
The simplest way to represent declarative facts
of the same sort used in database systems.
The reason that this representation is simple is that standing alone
it provides very weak inferential capabilities, but knowledge
represented in thisform may serve as the input to more powerful
inference engines.
The relational knowledge corresponds to a set or attributes and
that together describe the objects of the
associated values
knowledge base.
knowledge is what database
Providing support for relational
systems are designed to do.
Inheritable Knowledge
Knowledge about objects, their attributes, and their
values need not
be as simple as that shown in relational knowledge.
In particular, it is possible to augment the basic representation
with inference mechanisms that operate on the structure of the
representation.
For this to be effective, the structure must be
designed to correspond
to the inference mechanisms that are desired.
One of the most useful forms of inference is property inheritance,
and values
in which elements of specific classes inherit attributes
from more general classes in which they are included.
In order to support property inheritance, objects must be organized
and classes must be arranged in a generalization
into classes
hierarchy.
Lines represent attributes. Boxed nodes represent objects and
values of attributes of objects. The arrows on the lines point from
an object to its value along the corresponding attribute line. The
structure called slot-and-filler structure.
AI Unit-4
Each individual frame represents the collection of attributes and values
associated with a particular node. This structure is called a
Semantic network or a collection of Frames.
Inferential Knowledge
traditional logic is necessary to describe the inferences that
The power of
are needed.
This knowledge is useless unless there is also an inference procedure
that can exploit it The required inference procedure is one that
implements the standard logical rules of inference.
The procedures, may reason forward from given facts to conclusions,
or may reason backward from desired conclusions to given facts. One
of the most commonly used of these procedures is Resolution, which
exploits a proof by contradiction strategy.
Procedural Knowledge
This kind of knowledge is operational.
Procedural knowledge specifies what to do and when to do.
Procedural knowledge can be represented in programs in many ways.
The most common way is simply as code (in some programming
language such as LISP) for doing something. The machine uses the
knowledge when it executes the code to perform a task.
procedural knowledge gets low scores for
But, this way of representing
the following properties:
AI Unit-4
Semantic Nets
The main idea behind semantic nets is that the meaning of a concept
comes from the ways in which it is connected to other concepts.
In a semantic net, information is represented as a set of nodes
connected to each other by a set of labeled arcs, which represent
relationships among the nodes.
This network contains examples of both the isa and instance relations,
and domain-specific relations like team and uniform-color. In this
network, we could use inheritance to derive the additional relation:
has-part (Pee- Wee-Reese, Nose)
Earlier, semantic nets were used to find relationships among objects
by spreading activation out from each of two nodes and seeing where
the activation met. This process is called intersection search.
Using this process, it is possible to use the network to answer
questions such as "What is the connection between the Brooklyn
Dodgers and blue?" This kind of reasoning exploits one of the
important advantages that slot-and-filler structures have over purely
logical representations because it takes advantage of the entity-
based organization
of knowledge that slot-and-filler representations
provide.
AI Unit-4
Representing Non binary Predicates:
Semantic nets are a natural way to represent relationships that would
appear as ground instances of binary predicates in predicate logic.
Some of the arcs can be represented in logic as:
isa(Person, mammal)
instance(Pee-Wee-Reese, Person)
team( Pee-Wee-Reese, Brooklyn- Dodgers)
uniform color(Pee-Wee-Reese, Blue)
Unary predicates in logic can be thought of as binary predicates using
general-purpose predicates, such as isa and instance. For example:
The sentence: John gave the book to Mary could be represented by
the network as follows:
AI Unit-4
There should be a difference between a link that defines a new entity and
one that relates two existing entities. Consider the net:
Both nodes represent objects that exist independently of their
relationship to each other.
Suppose we want to represent the fact that: John is taller than Bill,
using the net:
The nodes HI and 112 are new concepts representing John's height
and Bill's height, respectively. They are defined by their relationships
to the nodes John and Hill.
Sometimes it is useful to introduce the arc value to make this
distinction clear. Thus we might use the following net to represent the
fact that John is 6 feet tall and that he is taller than Bill.
AI Unit-4
Consider the sentence:
In this case, g has two ∀ links: one pointing to d, which represents any dog, and one pointing to m, representing any mail carrier.
Set theory provides a good basis for understanding frame systems.
Each framerepresents either a class (a set) or an instance (an element
of a class).
Consider the following frame system:
AI Unit-4
The frames Person, Adult-Male, ML-Baseball Player (corresponding to
major league baseball players), Pitcher, and ML-Baseball-Team (for major
Brooklyn-Dodgers are instances.
league baseball team) are all classes. The frames Pee-Wee-Reese and
The set of adult males is a subset of the set of people. The set of major
league baseball players is a subset of the set of adult males, and so forth.
The instance relation corresponds to the relation “element-of”. Pee Wee
Reese is an element of the set of fielders. Thus he is also an element of all
people.
of the supersets of fielders, including major league baseball players and
A are two kinds of attributes that can be
class represents a set; there
associated with it. They are:
attributes about the set itself, and
attributes that are to be inherited-by each element of the set
We indicate the difference between these two by prefixing the latter with
an asterisk (*).For example, consider the class ML-Basebalf-Player.
It is important to distinguish between regular classes, whose elements
are individual entities, and metaclasses, which are special classes whose
elements are themselves classes. A class is now an element of (instance)
some class (or classes) as well as a subclass (isa) of one or more classes.
A class inherits properties from the class of which it is an instance, just
as any instance does. In addition, a class passes inheritable properties
down from its super classes to its instances.
AI Unit-4
The most basic metaclass is the class Class. It represents the set of
all classes. All classes are instances of it, either directly or through
one of its subclasses. In the example, Team is a subclass (subset) of
Class and ML-Baseball-Team is a subclass of Team. The class Class
introduces the attribute cardinality, which is to be inherited by all
instances of Class (including itself).
Conceptual Dependency
Semantic networks and frame systems may have specialized links and
inference procedures, but there are no hard and fast rules about what
kinds of objects and links arc good in general for knowledge
representation.
ConceptualDependency specifies what types of objects and relations are
permitted.
Conceptual Dependency (CD) is a theory of how to represent the kind
of knowledge about events that is usually contained in natural
sentences. The goal is to represent the knowledge in a way
language
that:
Facilitates drawing inferences from the sentences.
Is independent of the language in which the sentences were
originally stated.
The CD representation of a sentence is built not out of primitives
corresponding to the words used in the sentence, but rather out of
conceptual primitives that can becombined to form the meanings of
words in any particular language.
Semantic nets provide only a structure into which nodes representing
information at any level can be placed. Conceptual dependency
provides both a structure and a specific set of primitives, at a
particular level of granularity out of whichrepresentations of
particular pieces information can be constructed.
Consider a Simple Conceptual Dependency Representation of : I gave
the man a book, where the symbols have the following meanings:
Arrows indicate direction of dependency.
Double arrow indicates two way links between actor and action.
p indicates past tense.
ATRANS is one of the primitive acts used by the theory. It indicates
transfer of possession.
O indicates the object case relation.
R indicates the recipient case relation.
In CD, representations of actions are built from a set of primitive acts:
AI Unit-4
The set of CD building blocks is the set of allowable dependencies
among the conceptualizations described in a sentence. There are tour
primitive conceptual categories from which dependency structures
can be built. These are:
ACTS Actions
PPs Objects (picture producers)
AAs Modifiers of actions (action aiders)
PAs Modifiers of PPs (picture aiders)
The Dependencies of CD:
Rule 1 describes the relationship between an actor and the event he
or she causes. This is a two-way dependency since neither actor
nor event can be considered primary. The letter p above the
dependency link indicates past tense.
Rule 2 describes the relationship between a PP and a PA that is
being asserted to describe it.
Rule 3 describes the relationship between two PPs, one of which
belongs to the set defined by the other.
Rule 4 describes the relationship a PP and an attribute that has
already been predicated of it. The direction of the arrow is toward
the PP being described.
Rule 5 describes the relationship between two PPs, one of which
provides a particular kind of information about the other. The three
most common types of information to be provided in this way are:
possession (shown as POSSBY)
location (shown as LOC), and
physical containment (shown as CONT)
The direction of is again toward the concept being described
AI Unit-4
Scripts
CD is a mechanism for representing and reasoning about events. A
script is a structure
that describes a stereotyped sequence of events in
a particular context.
Script is a mechanismfor representing knowledge about common
sequences of events.
A script consists of a set of slots. Associated with each slot may be
some information about what kinds of values it may contain as well as
a default value to be used if no other information is available.
Consider the following example of a restaurant script:
The important components of a script are:
AI Unit-4
Assignment-Cum-Tutorial Questions
I) Objective Questions
1. The two different kinds of entities in AI are _____________ and ______________.
2. The __________ mappings exist between facts and representations.
(a) One-way (b) two-way (c) no mapping (d) both (a) & (b) [ ]
4. The ability to represent all of the kinds of knowledge that are needed in that
domain is called ______________.
11. The most commonly used technique for representing procedural knowledge in
Al Programs is the use of _____________.
(a) Production rules (b) symbols (c) facts (d) both (b) & (c) [ ]
14. ___________ theory provides a good basis for understanding frame systems.
15. The classes whose elements are themselves classes are called _______.
(a) Sub class (b) Base class (c) Meta class (d) Parent class [ ]
7. Justify the statement- “Set theory provides a good basis for understanding
frame systems”.
8. List the ways in which classes are related to each other in frames, with
suitable example?
9. List the set of primitives and conceptual tenses used in Conceptual
Dependency.
10. Explain the rules used in Conceptual Dependency.
1. Non-Monotonic Reasoning
Simply excludes the possibility of non-teaching university professors and thus cannot
be used to represent rules with exceptions. Of course, we can refine the sentence to
∀x ((prof (x) ∧ ¬abnormal (x)) ⊃ teaches (x)).
AI Unit-5
However, to apply this rule, say to Professor Jones, we need to know whether
Professor Jones is exceptional (for instance, professors who are department Chairs do
not teach). Even if we assume that the unary predicate abnormal (.) can be defined
precisely, which is rarely the case in practice as the list of possible exceptions is hard
if not impossible?
To complete, we will most often lack information to derive t hat Professor
Jones is not exceptional. We want to apply the rule even if all we know about Dr.
Jones is that she is a professor at a university. If we later learn she is a department
Chair — well, then we have to retract our former conclusion about her teaching
classes. Such scenarios can only be handled with a non-monotonic reasoning
formalism.
Each statement having at least one valid justification is made a part of the
current belief set. When a contradiction is found, the statement(s)
responsible for the contradiction are identified and the records are
appropriately updated. This process is called dependency-directed
backtracking.
Inference Truth
Engine Maintenance
system
TMS GOALS
AI Unit-5
1.Provide justification for conclusions
2.Recognise inconsistencies
3support default resoning
4.Remember derivations computed previously
5support dependency driven back tracking
JTMS nodes
Each belief represented by a TMS node
Nodes are associated 1:1 with assertions
The label of a node represents the belief
Status of the corresponding problem solv
AI Unit-5
Fact
The relationships between beliefs are
Expressed by the justifications it participates
In
JTMS Labels:
JTMS Justifications:
Assumption
Environments
Labels
Justifications:
Minimal - The label does not contain possible worlds that are less
general than one of the other possible worlds it contains (i.e.
environments that are supersets of other environments in the label):
Complete - The label of each node, other than the nogood node, describes
all possible worlds in which that node can be inferred:
1. Nonmonotonic Logic .
2. Default Logic
The stack is used in an algorithm to hold the action and satisfy the goal. A
knowledge base is used to hold the current state, actions.
Goal stack is similar to a node in a search tree, where the branches are
created if there is a choice of an action.
The important steps of the algorithm are as stated below:
i. Start by pushing the original goal on the stack. Repeat this until the
stack becomes empty. If stack top is a compound goal, then push its
unsatisfied subgoals on the stack.
ii. If stack top is a single unsatisfied goal then, replace it by an action and
push the action’s precondition on the stack to satisfy the condition.
iii. If stack top is an action, pop it from the stack, execute it and change
the knowledge base by the effects of the action.
iv. If stack top is a satisfied goal, pop it from the stack.
The top of the stack is a single unsatisfied goal. We push the action
which
would achieve it, and its preconditions.
Goal stack planning 2
On(A, Table)
Clear(B)
Clear(A)
On(A, Table) ∧ Clear(A) ∧ Clear(B)
MOVE(A,x, B)
On(A, B)
On(B,C)
OnTable(C)
On(A, B) ∧ On(B, C) ∧ OnTable(C)
KB={On(C,A),OnTable(A),OnTable(B),Clear(B),Clear(C)} plan = [ ]
The top of the stack is a satisfied goal. We pop the stack (twice).
MOVE(A,Table, B)
On(A, B)
On(B,C)
OnTable(C)
On(A, B) ∧ On(B, C) ∧ OnTable(C)
KB={On(C,A),OnTable(A),OnTable(B),Clear(B),Clear(C)}
plan = [ ]
AI Unit-5
The top of the stack is an unsatisfied goal. We push the action which
would achieve it, and its preconditions.
5. Hierarchical planning:
Hierarchy of actions
Example:
c. Major Steps :
i. Hotel Booking
v. Coming Back
d. Minor Steps :
Motivation
Reduces the size of search space
AI Unit-5
Example:
180 overs : 15 spells (12 overs each)
5 bowlers : 3 categories (2 pacer/2 spinner/1 pacer&1 spinner)
Top level possibilities : 315
Total possibilities < 3*315 (much less than 5180)
attempts to solve mere details, until major steps are in
Postpone
place.
Higher level plan may run into difficulties at a lower level, causing the
need to return
to higher level again to produce appropriately ordered
sequence.
Planner:
Identify a hierarchy of conditions
Construct a plan in levels, postponing details to the next level
Patch higher levels as details become visible
Demonstrated using ABSTRIPS
ABSTRIPS:
Abstraction-Based STRIPS
Modified version of STRIPS that incorporates hierarchical planning
AI Unit-5
Hierarchy in ABSTRIPS:
reflect the intrinsic difficulty of achieving
Hierarchy of conditions
various conditions.
Indicated by criticality value.
Criticality:
achievable, i.e.,
A operation having minimum criticality can be trivially
the operations having very less or no precondition.
Example : Opening makemytrip.com
many preconditions to satisfy will
Similarly operation having
have higher criticality.
Patching in ABSTRIPS:
Each level starts with the goal stack that includes the plan obtained
in the higher levels.
The last item in the goal stack being the main goal.
Artificial Intelligence Unit-6
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 −
Advising
Instructing and assisting human in decision making
Demonstrating
Deriving a solution
Diagnosis
Explaining
Interpreting input
Predicting results
Justifying the conclusion
Suggesting alternative options to a problem
They are incapable of :
Substituting human decision makers
Possessing human capabilities
Producing accurate output for inadequate knowledge base
Artificial Intelligence Unit-6
Knowledge Base:
It contains domain-specific and high-quality knowledge.
Knowledge is required to exhibit intelligence. The success of any ES
majorly depends
upon the collection of highly accurate and precise
knowledge.
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.
Artificial Intelligence Unit-6
Inference Engine:
Inference Engine is
Use of efficient procedures and rules by the
essential in deducting a correct solution.
In case of knowledge-based ES, the Inference Engine acquires and
manipulates the knowledge
from the knowledge base to arrive at a
particular solution.
In case of rule based ES, it −
Applies rules repeatedly to the facts, which are obtained from
earlier rule application.
Adds new knowledge into the knowledge base if required.
Resolves rules conflict when multiple rules are applicable to a
particular case.
To recommend a solution, the Inference Engine uses the following
strategies −
Forward Chaining
Artificial Intelligence Unit-6
Backward Chaining
Forward Chaining: It is a strategy of
an expert system to answer the
question, “What can happen next?”
Here, the Inference Engine follows the chain of conditions and
derivations and finally deduces the outcome. It considers all the
facts and rules, and sorts them before concluding to a solution.
This strategy is followed for working on conclusion, result, or
effect. For example, prediction of share market status as an effect
of changes in interest rates.
system finds out the
Backward Chaining: With this strategy, an expert
answer to the question, “Why this happened?”
On the basis of what has already happened, the Inference Engine
tries to find out which conditions could have happened in the past for
this result. This strategy is followed for finding out cause or reason.
For example, diagnosis of blood cancer in humans.
Artificial Intelligence Unit-6
User Interface:
User interface provides interaction between user of the ES and the ES
itself. It is generally Natural Language Processing so as to be used by
the user who is well-versed in the task domain. The user of the ES
need not be necessarily an expert in Artificial Intelligence.
It explains how the ES has arrived at a particular recommendation.
The explanation may appear in the following forms −
Natural language displayed on screen.
Verbal narrations in natural language.
Listing of rule numbers displayed on the screen.
The user interface makes it easy to trace the credibility of the
deductions.
Requirements of Efficient ES User Interface:
It should help users to accomplish their goals in shortest possible
way.
It should be designed to work for user’s existing or desired work
practices.
Its technology should be adaptable to user’s requirements; not the
other way round.
It should make efficient use of user input.
Application Description
o Large databases.
Steady response − They work steadily without getting motional,
tensed or fatigued.
Rule-based Systems
The most common RBS modes of operation are:
Backward Chaining: The backward chaining mode of operation
means that the systems begins with a goal and successively
examines any rules with matching consequents. These candidate
rules are considered one at a time. The unmet conditions are in
turn reintroduced as new goals. The control procedure then shifts
attention recursively toward the new goal. The effort terminates
when the top goal is finally satisfied.
In a Rule-based System:
The domain knowledge is represented by a set of IF-THEN
production rules
Data is represented by a set of facts about the current situation.
The inference engine compares each rule stored in the
knowledge base with facts contained in the database.
When the IF (condition) part of the rule matches a fact, the rule
is fired and its THEN (action) part is executed.
Artificial Intelligence Unit-6
Blackboard System
A blackboard system is an artificial intelligence approach based on the
blackboard architectural model, where a common knowledge base, the
"blackboard", is iteratively updated by a diverse group of specialist
knowledge sources, starting with a problem specification and ending
with a solution.
Each knowledge source updates the blackboard with a partial solution
when its internal constraints match the blackboard state. In this way,
the specialists work together to solve the problem.
The blackboard model was designed to handle complex, ill-defined
problems, where the solution is the sum of its parts.
A blackboard-system application consists of three major components:
The software specialist modules, which are called knowledge
sources (KSs). Like the human experts at a blackboard, each
knowledge source provides specific expertise needed by the
application.
The blackboard, a shared repository of problems, partial solutions,
suggestions, and contributed information. The blackboard can be
thought of as a dynamic "library" of contributions to the current
problem that have been recently "published" by other knowledge
sources
Artificial Intelligence Unit-6
The advantages of a blackboard include separation of knowledge into
independent modules with each module being free to use the
appropriate technology to arrive at the best solution with the most
efficiency.
Artificial Intelligence Unit-6
There are many other forms of models that may be used. Models might be quantitative (for
instance, based on mathematical equations) or qualitative (for instance, based on cause/effect
models.) They may include representation of uncertainty. They might represent behaviour over
time. They might represent "normal" behaviour, or might only represent abnormal behaviour, as
in the case of the examples above. Model types and usage for model-based reasoning are
discussed in
Reuse: Map the solution from the previous case to the target problem. This
may involve adapting the solution as needed to fit the new situation. In the
pancake example, Fred must adapt his retrieved solution to include the
addition of blueberries.
Revise: Having mapped the previous solution to the target situation, test the
new solution in the real world (or a simulation) and, if necessary, revise.
Suppose Fred adapted his pancake solution by adding blueberries to the
batter. After mixing, he discovers that the batter has turned blue – an
undesired effect. This suggests the following revision: delay the addition of
blueberries until after the batter has been ladled into the pan.
Retain: After the solution has been successfully adapted to the target
problem, store the resulting experience as a new case in memory. Fred,
accordingly, records his new-found procedure for making blueberry
pancakes, thereby enriching his set of stored experiences, and better
preparing him for future pancake-making demands.
Rule-based expert systems (RBES) -- which you create with Jess -- are
very good at making decisions where the domain knowledge is very well
structured and defined. Because of this, RBES can be used to reason from
first principles to arrive at a general conclusion. RBES tend not to perform
well when the domain knowledge is ill-conditioned, poorly-structured, or
sparse.
Applications:
MYCIN
MYCIN was an backward chaining expert system that used artificial
intelligence to identify bacteria causing severe infections, such as
bacteremia and meningitis, and to recommend antibiotics, with the
dosage adjusted for patient's body weight .
MYCIN was developed over five or six years in the early 1970s
at Stanford University. It was written in Lisp.
MYCIN operated using fairly simple inference engine, and a knowledge
base of ~600 rules. It would query the physician running the program
via a long series of simple yes/no or textual questions.
At the end, it provided a list of possible culprit bacteria ranked from
high to low based on the probability of each diagnosis,
its confidence in each diagnosis' probability, the reasoning behind
each diagnosis.
Mycin is a program that diagnoses infectious diseases. It reasons
backward from its goal of determining the cause of a patient illness.
It attempts to solve its goal of recommending a therapy for a particular
patient by first finding the cause of the patient’s illness.
It uses its production rules to reason backward from goals to clinical
observations.
Artificial Intelligence Unit-6
DENDRAL
Dendral was a project in artificial intelligence (AI) of the 1960s, and
the computer software expert system that it produced. Its primary
aim was to study hypothesis formation and discovery in science.
For that, a specific task in science was chosen: help organic
chemists in identifying unknown organic molecules, by analyzing
their mass spectra and using knowledge of chemistry.
The software program Dendral is considered the first expert system
because it automated the decision-making process and problem-
solving behaviour of organic chemists.
It was written in the LISP programming language, which was
considered the language of AI because of its flexibility.
Dendral is a program that uses mass spectra or other experimental
data together with knowledge base of chemistry, to produce a set of
possible chemical structures that may be responsible for producing
the data.
A mass spectrum of a compound is produced by a mass
spectrometer, and is used to determine its molecular weight, the
sum of the masses of its atomic constituents.
For example, the compound water (H2O), has a molecular weight of
18 since hydrogen has a mass of 1.01 and oxygen 16.00, and its
mass spectrum has a peak at 18 units.
Dendral uses input mass and the knowledge of atomic mass
numbers and valence rules, to determine the possible
combinations of atomic constituents whose mass would add up to
18.
Artificial Intelligence Unit-6
complex, the
As the weight increases and the molecules become more
number of possible compounds increases drastically.
Systems that fall into this class analyze a set of one or more potentially complex
and interacting goals in order to determine a set of actions to achieve those goals,
and/or provide a detailed temporal ordering of those actions, taking into account
personnel, materiel, and other constraints. This class has great commercial
potential, which has been recognized. Examples involve airline scheduling of
flights, personnel, and gates; manufacturing job-shop scheduling; and
manufacturing process planning.
The financial services industry has been a vigorous user of expert system
techniques. Advisory programs have been created to assist bankers in determining
whether to make loans to businesses and individuals. Insurance companies have
used expert systems to assess the risk presented by the customer and to determine a
price for the insurance. A typical application in the financial markets is in foreign
exchange trading.
5.Knowledge Publishing
This is a relatively new, but also potentially explosive area. The primary function
of the expert system is to deliver knowledge that is relevant to the user's problem,
in the context of the user's problem. The two most widely distributed expert
systems in the world are in this category. The first is an advisor which counsels a
user on appropriate grammatical usage in a text. The second is a tax advisor that
accompanies a tax preparation program and advises the user on tax strategy,
tactics, and individual tax policy.
Artificial Intelligence Unit-6
Systems falling in this class analyze real-time data from physical devices with the
goal of noticing anomalies, predicting trends, and controlling for both optimality
and failure correction. Examples of real-time systems that actively monitor
processes can be found in the steel making and oil refining industries.
These systems assist in the design of physical devices and processes, ranging from
high-level conceptual design of abstract entities all the way to factory floor
configuration of manufacturing processes.
8.R1
9.PROSPECTOR
PROSPECTOR is an expert system designed for decision-making
problems in mineral exploration. It aids geologists in evaluating the
site or region for occurrences of ore
favourability of an exploration
deposits of particular types.
Once a site has been identified, PROSPECTOR can also be used for
drilling-site selection.
PROSPECTOR is written in INTERLISP, an advanced dialect of the
LISP language.
PROSPECTOR can reach a conclusion about a particular ore deposit.
It gives a certainty value of the ore deposit. It as well provides the
explanation text for the conclusion.
When PROSPECTOR is used for the drilling site selection, it could also
produce the favourability map of the site.
Assignment-Cum-Tutorial Questions
I) Objective Questions
1. Define the term “Expert System”.
2. The components of expert system are _________________,
__________________and _________________.
3. Knowledge comprises of _____________.
(ii) DENDRAl
(iii) R1