Document Sample
AI3 Powered By Docstoc

           02221AO569                   02221A0563
     111/IV B.Tech.               111/IV B.Tech.
          (CSE)                              (CSE)


                   B.V.C.ENGG COLLEGE.

                                                        “Artificial intelligence (AI)” is the
study of

how to make computers do things which,at the moment,people do better.

Artificial intelligence focused on the sort of problem solving that we do every day

when we decide how to get to work in the morning, often called commonsense

reasing.It includes reasoning about physicial objects and their relastionships to each

other (e.g., an object can be in only one place at a time),as well as reasoning about

actions and their consequences .To investigate this sort of reasoning ,newell,shaw,and

simion built the general problem slover(GPS),which they applied to several

commonsense tasks as well as to problem of performing symbolic manipulations of

logical expressions .Only quite simple tasks were selected. As AI research progressed

and techniques for handling large amounts of world knowledge were developed.These

include perception (vision,speech) ,natural language understanding ,and problem

solving in specialized domains such as medical diagnosis and chemichal analysis.

                                             Expert Systems are complex AI programs. Expert

slove problems that are normally solved by human “experts”.To slove Expert_level

problems , Expert systems need acess to a substainal domain knowledge base,witch

must be built as efficiently as possible. They also need to exploit one are more

reasoning mechanisms to apply their knowledge to the problems they are given.then

they need a mechanism for explaining what they have done to the users who rely on

them.One way to look at Expert systems is that they represent applied AI in very

broad sense. The problem that expert systems deal with are highly diverse.

There are now thousands of programs called Expert systems in day to day operation
through out all areas of industry and government.each of these systems attempt to solve

part,or perhaps all,of a practical,significant problem that previously required scarce

human expertise.

                            The tasks that are specified below are the targets of work in AI.

                                        MUNDANE TASKS:

                                    1    Perception

                                    2    Natural language
                                    3     Commonsense reasoning
                                    4    Robot control

                                            FORMAL TASKS :

                                1       Games
                                                            -back gammon
                                2       Mathematics
                                                            -integral calculus
                                                            -proving properties of programs

                                            EXPERT TASKS :

                                3       Engineerig
                                                         -fault finding
                                                         -manufacturing planning
                              4   Scientific analysis
                              5   Medical diagnosis
                              6   Financial analysis

                                       We are forced to conclude that an AI technique is a
method that explits knowledge that should be represented in such way that:

          1   The knowledge captures generalizations. In other words,it is not necessary to
              represent separately each individual situation.instead,situations that share
              important properties are grouped togehter .If knowledge does not have this
              property,inordinte amounts of memory and updating will be required.So we
              usually call something without this property “data” rather than knowledge.

          2   It can easily be modified to correct errors and to reflect changes in the world and
              in our world view.

          3   It can be used in a great many situations even if it is not totally accurate or

          4   It can be used to help ovr come its own sheer bulk by helping to narrow the range
              of possibilities that must usually be considered.

                        A problem that uses ARTIFICIAL INTELIGENCE technique to slove
problems in an efficient manner is called AI problem.

          Examples for AI problems:
        1   Game playing : -we have to develop an algorithm such that the computer not
            only played games with opponents but also use its experience at those games
            to improve its later performance. eg.,CHESS.

        2   Proving mathematical theorems: -The computer would perform well at those
            tasks simply by being fast at exploring a large number of solution paths and
            selecting the best one.                                  eg.,proving the rank of
            the matrix.

        3   Commonsense reasoninig: -It includes reasoninig about physical objects ans
            their relastionships with each other.As well as reasoning about their actions and
            their consequences .                                   eg.,distinction between
            humans and animals.

    To build a system to slove a particular problem, we need to do four things:

               i. Define problem precisely

               ii.      Analyze the problem.

               iii.      Isolate and represent the task knoeledge that is necessary to solve

               iv.       Choose the best problem-solving techniques ans apply it to the
                 particular problem.

            In order to choose the most appropriate method for a particular problem, it is
             necessary to analyze the problem along several key dimensions:
    1   Is the problem decomposable into a set of independent easier or smaller sub
    2   Can solutions steps be ignored or at least undone if they prove unwise?
    3   Is the problem’s universe predictable?
          4   Is a good solution to the problem obvious without comparison to all other possible
          5   Is the desired solution a state of a world or a path of the state?

            Production system provide structures that are useful tostructure AI program in a way
that facilitates describing and performing the search process.

 A productin consists of :

   1 A set of rules,each consisting of a left side that determines the applicability of the rule
     and a right side that describes the operation to be performed if the rule is applied.

   2 One por more knowledge/databases that contain whatever information is appropriate for
     the particular task. Some parts of the database may be parment,while other parts of it may
     pertain only to the solution of current problem. The information in these databases may
     be structured in any approrppriate way.

   3 A control strategy that specifies the order in which the rules will be compared to the
     database and a way of resolving the conflicts that arise when several rules matched at

   4 Arule applier.

         When more than one rule will have its left side match the current state then we have a
problem that how to decide which rule to applynext during the process of searching for a solution
to a problem.

   1 The first requirement of good control strategy is that it cause motion.

   2 The second requirement of good control strategy is that it be a systematic.

                           A Heuristic is a search technique that improves the efficiency of the
search process,possibly by sacrificing claims of its completeness.Heuristics are like tour example of a good general purpose of aHeuristic that is useful for a variety of
combinatorial problems is the nearest neighbor heuristic.
            There are two major ways in which domain-specific,heuristic knowledge can be
incorporated into a rule based search procedure:
           1 In the rules themselves.
           2 As a heuristic function that evaluates individual problem states and determines
               how desirably they are.
A heuristic function is a function that maps from problem state descriptions to measures.
 The purpose of a Heuristic function is to guide the search process in the most profitable
direction by suggesting which path to follow first when more than is available.

                                     These techniques can be described independently of any
particular task or domain.But when applied to particular problems ,their efficacy is highly
dependent on the way they exploit domain specific knowledge.These are unable to over come the
combinatorial explosion to which search processes are vulnerable.For this reason,these
techniques often called “WEAK METHODS”.
                     The search strategies are:
                              1 Depth first search
                               Breadth first search
                              2 Generate and test
                              3 Hill climbing
                              4 Best first search
                              5 Problem reduction
                              6 Constraint satisfaction
                              7 Means ends Analysis

 Depth-First Search:
     1. If the initial state is a goal state,quit and return success
     2. Otherwise,do the following until success or failure is signald :
        (a)Generate a successor,E,of the initial state .If there are no more
                  successors signal failure
          (b) Call Derth-First Search with E as the initial state.
          (c) If success is returned,signal success.Otherwise continue in this loop

 Breadth-First Search:
1.      Create a variable called NODE-LIST and set it to 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 NODE-LIST was empty,quit.
    (b) For each way that each rule can match the state described in E do:
         (1)                                             Apply the rule to generate a new state.
         (2)                                             If the new state is a gole state ,quit and
         (3)                                             Othewise,add the new state to the end of

Generate and test :
    1. Generate a possible solution.For some problems,this means generating a particular point
       in the problem space.For others, it means generating a path from a stste.
    2. Test to see if this is actually a solution by comparing the choosen point or yhe end point
       of the choon path to the set of acceptable goal atates.
    3. If solution has been found,quit .Otherwise,return to step 1.

HILL Climbing:
   Hill climbing is a variant of generate-and-test algorithm in which feedback from the test
procedure is used to help the generator beside which direction to move in the search space .In a
pure generate-and-test procedure,the test function responds with only a yes or no.But if the test
function augmented with a heuristic function that provides an estimate of how close a given state
is to a goal state.

     1. Evaluate the initial state .If it is also a goal state,then return it and
         quit.Otherwise,continue with the initial state as the current state.
     2. Loop until a solution is found or until there are no new operators left to be applied in the
         current state.
                      (a) select an operator that has not yet been applied to the current state and
                   apply it to produce a new state.
                      (b) if it is not a goal state but it is better than the current state,then make it
the current state.
                       (c) if it is not better than the current state,then continue in the loop.

 Steepest- Ascent Hill Climbing:
 Evalute the initial state. If it is also a goal stath, then return it and
  quit.Otherwise, continue with the initial state as the current state.
  Loop until a solution is found or until a complete iteration produces no change to
   current state:
            (a) Let SUCC be a state such that any possible successer of the current state will be
                batter than SUCC.
            (b) For each operator that applies to the current state do:
                      (1) apply operator and generate a new state.
                      (2) Evaluate the new state.IF it is agoal state, then return it and quit.
                          If not, compare it to SUCC. If it is better,then set SUCC to this state. If it
                          is not better, leave SUCC alone.
            (c) IF the SUCC is better than current state, then set current state to SUCC.

Best-First Search:
Best-First search is a way of combining the advantages of both depth-first and breadth-first serch
into a single method.
                 (1) Start with OPEN contaning 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 it’s successors
               (c) For each successor do:
                        (1) If it has not been generated before, evaluate it, add it to OPEN, and
                            record it’s parent
                        (2) 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 .
 Problem Reduction:
     In this we have considered search strategies for OR graphs through which we want to find
     a single path to a goal state.such structures represents the fact that we will know how to get
     from a node to a goal state if we discover how to get from that node to goal state along any
     one of branches leaving it.

Constraint satisfaction:
 In which the goal is to discover some problem state that satisfies a given set of constraints.By
viewing a problem as one of constraint satisfaction,it is often possible to reduce substantially the
amount of search that is required as compare with a method that attempts to form partial
solutions directly by choosing specific values for components of the eventual solution.
Example: cryptarithmetic problem.

For a problem serch strategies that can reason one direction or other must be choosen
.Often,however a mixture of the two directions is appropriate.Such a mixed stratigy would make
it possible to solve the major parts of a problem and then go back and solve this small problems
that arise “gluing”the big pieces togther .A technique known as means-end-analysis.

                         1      Representing and using Domain knowledge
                            Expert System Shells
                            Explanations
                            Knowledge Acquisitions


                                             Expert Systems are complex AI programs.The most

used way of representing domain knowledge in Expert system is as a set of production

rules,which are often coupled with a frame system that defines the objects that occur

in the rules. “MYCIN” is an example of Expert system,since it performs a task

normally done by a human expert.mycinn represents most of its diagnostic knowledge

as a set of rules.Each rule has associated with it a certainity factor,which is a measure

of extent to which the evidence that is described by the antecedent of the rule supports

the conclusion that is given in the rules consequent.The programs are usually written

primarly as rule_based systems.MYCIN used backward chaining to discover what

organisms were present.All the rules we show are English versions of the actual rules

that the systems use.A typical MYCIN RULE looks like

         If: (1) the stain of the organism is gram positive,and
       (2) the morphology of the organism is coccus, and
       (3) the growth confirmation of the organism is clumps, then there is suggestive evidence (0.7) that the
identity of the organism is staphylococcus
  This is the form in which the rules stated to the user.They are actually represented
internally in an easy to manipulate LISP list structure. The rule would be represented

internally as

                              (SAME CNTXT MORPH COCCUS)
                              (SAME CNTXT CONFORM CLUMPS)


                                            Initially,each expert system that was built was created

scarch,usually in LISP.But,after several systems had been built this way,it became

clear that these systems often had a lot in common.In particular,since the systems

were constructed as a set of declarative representations(mostly rules)combined with

an interpreter for those representations,it was possible to separate the interpreter from

the domain specic knowledge and thus to create a system that could be used to

construct new expert system by adding new knowledge corresponding to the new

problem domain. The resulting interpreters are called SHELLS.One influential

example of such a SHELL is EMYCIN (for empty MYCIN),which was derived from

MYCIN.There are now several available SHELLS that serve as basis for many of the

expert system currently being build.these SHELLS provide much greater flexibility in

representing knoweledge and in reasoning with it than MYCIN did.They typically

support rules,frames,truth maitenance systems,and a variety of other reason

mechanisms.Early expert system Shells provides mechanisms for knowledge

representations,reasoning and explanation.But as experience with using these systems
to solve real world problems grew,it became clear that expert system shells needed to

do something else as well.They needed to make it easy to integrate expert systems

with othr kinds of programs.Expert Systema cannot operate in vacuum,any more than

their human counter parts can.They need access to corporate data bases,and access to

them needs to be controlled just as it does for other systems.They are often Embedded

with in larger application programs that use primarily conventional programming

techniques.So one of the important features that “a SHELL must provide is an easy to

use interface between an expert system that is written with the SHELL and a

Larger,probably more conventional,programming environment.”

                                                          In order for an Expert System to be an

 tool,people must be able to interact with it easily.The Expert System must have the

 following two capabilities in addition to perform its underlying task:

     1 Explain its reasoning.In many of the domains in which Expert Systems

              operate,peoplewill not accept results unless they have been convinced of the

            accuracy of the reasoningprocess that produced those results.This is particularly

            true,for example,in medicine,where a doctor must accept ultimate responsibility

       for a diagnosis ,even if that diagnosis was arrived at with considerable helpfrom

       a program.

     2 Acquire new knowledge and modifications of old knowledge.Since Expert

            Systems drive their power from the richness of the knowledge bases they exploit,

       it is extremely important that those knowledge bases be as complete and as
        accurate as possible.But often there exists no standard codification of that

        knowledge;rather it exists only inside the heads of human experts.One way to get

        this knowledge into a program is through inter action with the human

        expert.Another way is to have the program learn Expert behavior from raw data.

            TEIRESIAS was the first program to support explanation and knowledge

            acquisition.TEIRESIAS served as a front end for the MYCIN Expert system.

        The program has asked for a piece of information that it needs in order to

        continue its reasoning.The doctor wants to know why the program wants the

        information,and        laterasks how the program arrived at a conclusion that it

        claimed it had reached. An important premise underlying teiresias’s approach to

        explanation is that the        behavior of a program can be explained simply by

        referring to a trace of the programs       execution.MYCIN attempts to solve its goal

        of recommending a theraphy for a particular patient by first finding the cause of

              the patient’s illness.

                                                Typically,a knowledge engineer interviews a domain
expert to

elucidate expert knowledge,which is then translated into rules.After the initial system is

built,it must be iteratively refined until it approximates expert level performance.this

process is expensive and time consuming.while no totally automatic knowledge

acquisition systems yet exists, there are many programs that interact with domain experts

to extract expert knowledge efficiently.These programs provide support for the following


     3 Entering knowledge
     4 Maintaining knowledge base consistency
     5 Ensuring knowledge base completeness

                           The most useful knowledge acquisition programs are those that are

 restricted to a particular problem-solving paradigm,e.g.,diagnosis or design.For

 example,if the paradigm is diagnosis,then the program can structure its knowledge base

around symptoms, hypotheses and causes.It can identify symptoms for which the expert

has nopt provided causes. “MOLE” is a knowledge acquisyion system for heuristic

classification problems such as diagnosing diseases.Mole interacts with a domain expert

to produce a knowledge base that a system called MOLE-P uses to slove problems.The

acquisition proceeds through several steps:

           5   Initial knowledge base constructin. “MOLE” asks the expert to

list,symptoms.For each symptom,MOLE prompts for a list of possible explanations.

Whenever a event has multiple explanations,MOLE tries to determine the conditions

under which one explanation is correct.The ex pert provides covering knowledge,that

is,the knowledge that a hypothesized event might be the cause of a certain

symptom.MOLE then tries to infer anticipatory knowledge, which says that if the

hypothesized event does occur,then the symptom will definitely appear.This allows the

system to rule out certain hypotheses on the basis that specific symptoms are absent.

           6   Refinement of the knowledge base . MOLE now tries to identify the

weakness of the knowledge base.One approach is to find holes and prompt the expert to

fill them.It is difficult ,in general,to know whether a knowledge base is complete,so

instead MOLE lets the expert watch MOLE –p solving sample problems.When ever

MOLE –p makes an incorrect diagnosis,the expert adds new knowledge.MOLE has been
used to build systems that diagnose problems with car engines,problems in steel-rolling

mills,and inefficiencies in coal burning power plants.One problem solving method useful

for design tasks is called propose and revise.propose and revise systems build up

solutions incrementally.


         1. Brittleness: -Because expert systems only have access to haihhly spefic

                 domain knowledge,they cannot fall back on more general knowledge when

                 the need arises

         2. Lack of meta knowledge: -Expert systems do not have very sophisticated

                 knowledge about their own operation.

         3. Knowledge acquisition: -Despite the development of the tools,acquisition

                still remains a major bottleneck in applying expert systems technology to

              new domains.

         4. Validation: -Measuring the performance of an expert system is difficult

                  because we don’t know how to quantify the use of knowledge.
      There are two important classes of AI techniques:

           7   Methods for representing and using knowledge.

           8   Methods for constructing heauristic search.

       These two aspects interact heavily with each other.The choice of knowledge
representation frame work determines the kind of problem solving method that can be applied.

                The first technique is to define what can be done to solve a problem and to
specify what it means to have solve the problem.we can call knowledge that does this essential
knowledge . The second is to provide advice on how best to go above solvong a problem
efficiently.We can call such knowledge heuristic knowledge .


                  1 ELAINE RICH
                        KEVIN KNIGHT

Shared By: