Sunteți pe pagina 1din 26

Chapter 5 Prolog: PROLOG, which is an acronym of PROgramming in LOGic, is commonly used for handling this class of reasoning problems.

Prolog is a declarative language that focuses on logic. Programming in Prolog involves specifying rules and facts and allowing Prolog to derive a solution. This differs from typical declarative programming, where a solution is coded. Building a Prolog application typically involves describing the landscape of the problem (using rules and facts), and then using goals to invoke execution. However, LISP is well suited for handling lists, whereas PROLOG is designed for Logic Programming. Prolog provides logic variables instead of normal variables. A logic variable is bound by unification rather than by assignment. Once bound, a logic variable can never change. Thus, they are more like the variables of mathematics. The existence of logic variables and unification allow the logic programmer to state equations that constrain the problem (as in mathematics), without having to state an order of evaluation (as with assignment statements). Prolog provides automatic backtracking. In Lisp each function call returns a single value (unless the programmer makes special arrangements to have it return multiple values, or a list of values). Prolog has been successful as an AI programming language for the following reasons: 1. The syntax and semantics of prolog are very close to formal logic. By this time, must be clear to us that most AI program reason using logic. 2. Prolog language has in it a built in inference engine and automatic backtracking facility. This helps in efficient implementation of various search strategies. 3. This language has high productivity and ease of program maintenance. 4. Prolog language is based on the universal formalism of Horn Clause. 5. Because of the inherent AND parallelism, prolog language can be implemented with ease on parallel machines. 6. The clauses of prolog have a procedural and declarative meaning. Because of this understanding of the language is easier. 7. In prolog, each clause can be executed separately as though it is a separate program Hence modular programming and testing is possible. STRUCTURE OF PROLOG PROGRAMS The main part of a prolog program consists of a collection of knowledge about a specific subject. This collection is called a database and this database is expressed in facts and rules. Turbo prolog permits you to describe facts as symbolic relationships. Example: The right speaker is dead.

This same fact can be expressed in turbo prolog as Is (right_speaker, dead). This factual expression in prolog is called a clause. In this example, right speakers and dead are objects. The word is is the relation in this example. Relation is a name that defines the way in which objects are related. The entire expression before the period in each case is called a predicate. A predicate is a function with a value of true or false predicates express a property or relationship, the word before the parenthesis is name of relation. The elements with in the parenthesis are the arguments of the predicate, which may be objects or variables. Facts The simplest kind of entry in the database is a fact. (A fact is a term, followed by a period and a white-space character.) Likes (nelly, Florence). Likes (nelly, Albert). Likes (nelly, henry). Likes (Florence, Albert). This Prolog program has 4 facts and this defines a predicate likes, with arity 2 (There are 2 arguments. Arity is expressed as likes/2.). Likes/2 defines a relationship (likes) between two entities* (e.g. nelly and Florence) * We assume nelly, Florence, etc. are people but Prolog does not know this, unless we tell it explicitly. It is important that we read facts consistently Consider child (rajat, sunita). Does this mean rajat has a child called sunita or rajat is a child of sunita? To avoid confusion, add comments. Examples: % Reading: child (A, B) = A is a child of B /* This is another way to write comments that stretch over more than one line / Rules A rule is an expression that indicates the truth of a particular fact depends upon one or more other facts. Example If there is a body stiffness or pain in the joints. AND there is sensitivity to infections. Then there is probably a vitamin C deficiency.

This rule could be, expressed as the following turbo prolog clause. Hypothesis (vitc_deficiency) if Symptom (arthritis) and symptom (infection sensitivity) It gives Prolog the ability to pursue its decision-making process. Notice the general -form of the prolog rule. The conclusion is stated first and is followed by the word if. Every rule has a conclusion is stated and antecedent rules are important part any programming short hand-has been developed for expressing rules. In this abbreviated form, the previous rule becomes: Hypothesis (vitc_deficiency): Symptom (arthritis) Symptom (infection Sensitivity) The :- operator is called a break a comma expression and relationship and semicolon expresses an or relationship. The process of using rules and facts to solve a problem is called formal reasoning. Query Action of asking the program about information contained within its data base. After a program is loaded, you will receive the query prompt, ?We can ask the program a question such as ?- It is sunny And it will respond with the answer Yes ?Variables: - must begin with an upper case letter Constants: - must begin with lowercase letter, or enclosed in single quotes Prolog Program A Prolog program consists of a series of facts (concrete relationships) among data objects and a set of rules. Write the program in simple text editor & save it as .pl On the terminal, type gprolog. To load a file, [filename]. The process of using rules and facts to solve a problem is called formal reasoning.

Features of Prolog Pro log is comprised of two fundamental elements, the database and the interpreter. The database contains the facts and rules that are used to describe the problem. The interpreter provides the control in the form of a deduction method. The main body of the program, the clause section contains the clause and consists of facts and rules. The relationships used in the clauses of the clause section are defined in the predicate section. It defines the type of each object. 6 basic object types are available to the user. Character single character (enclosed between single quotation marks) Integer-integer from -32768 to 32767 Real- floating point number (1E307 to I E308) String character sequence (enclosed between double quotation marks) Symbol- character sequences of letters numbers and under series with the first character a lower case letter File-symbolic file name. Variables: A variable name must begin with a capital letter and may be from 1 to 250 characters long. Except for the first character in the name we may use uppercase or lower case letters, digits o the under line character. Names should be meaningful. Bound & free variables: If a variable has a value at a particular time it is said to be bound or instantiated. If a variable does not have a value at a particular time is said to be free or uninstantiated. Anonymous variables: - The anonymous variable stands for all values while in a goal it is satisfied if at least one value corresponds to it. Data Representation Prolog doesnt include data types; it includes lexical elements (or sequences of characters in legal combinations). Some of the important lexical elements of Prolog include atoms, numbers, variables, and lists. An atom is a string made up of characters (lower and upper case), digits, and the underscore. Numbers are simply sequences of digits with an optional preceding minus sign. Variables have the same format as atoms, except that the first character is always capitalized. A list is represented as a comma delimited set of elements, surrounded by brackets.

Expert Systems Shell A shell is a complete development environment for building and maintaining knowledgebased applications. It provides a step-by-step methodology, and ideally a user-friendly interface such as a graphical interface, for a knowledge engineer that allows the domain experts themselves to be directly involved in structuring and encoding the knowledge. The shell will provide the inference engine (and knowledge representation scheme), a user interface, an explanation system and sometimes a knowledge base editor. Given a new kind of problem to solve (say, car design), we can usually find a shell that provides the right sort of support for that problem, so all we need to do is provide the expert knowledge. There are numerous commercial expert system shells, each one appropriate for a slightly different range of problems. (Expert systems work in industry includes both writing expert. system shells and writing expert systems using shells.) Using shells to write expert systems generally greatly reduces the cost and time of development (compared with writing the expert system from scratch). The expert system shell simplifies the process of creating a knowledge base. It is the shell that actually processes the information entered by a user; relates it to the concepts contained in the knowledge base; and provides an assessment or solution for a particular problem. Thus, an expert system shell provides a layer between the user interface and computer operating system to manage the input and output of data. It. also manipulates the information provided by the user in conjunction with the knowledge base to arrive at a particular conclusion. The structure of the shell is very similar to that of an interpreter or a front-end to a database program. The shell also manages the user interface, performing functions that range from the validation of numeric values entered on the screen to management of the mouse and the representation of graphical objects

Expert System Shell STUDY OF EXISTING EXPERT SYSTEMS: 1. TIERES:Human experts communicate using TEIRESIAS with the performance program MYCJN to discover how well MYC1N is doing in responding to the requests for help that it receives. Through using TEIRESIAS the expert can coach MYCIN into producing better responses so that an element of learning is introduced. TEIRESIAS recognizes that some of the knowledge required for the knowledge base is inexact or rough and it succeeds in offering advice for its correction. It also provides method for extracting the best performance out of an expert system such as MYCIN. TEIRESIAS was the first program to support explanation and knowledge acquisition. TEIRESIAS served as a front-end for the MYCIN expert system. TEIRESIASs approach to explanation is that the behavior of a program can be explained simply by referring to a trace of the programs execution. There are ways in which this assumption limits the kinds of explanations that can be produced, but it does minimize the overhead involved in generating each explanation. To understand how TEIRESIAS generates explanations of MYCINs behavior, we need to know how that behavior is structured. MYCIN attempts to solve its goal of recommending a therapy for a particular patient by first finding the cause of the patients illness. It uses its production rules to reason

backward from goals to clinical observations. To solve the top-level diagnostic goal, it looks for rules whose right sides suggest diseases. It then uses the left sides of those rules (the preconditions) to set up sub-goals whose success would enable the rules to be invoked. These sub-goals are again matched against rules, and their preconditions are used to set up additional sub-goals. Whenever a precondition describes a specific piece of clinical evidence, MYCIN uses that evidence if it already has access to it. Otherwise, it asks the user to provide the information In order that MYCINs requests for information will appear coherent to the user, the actual goals that MYCIN sets up are often more general than they need be to satisfy the preconditions of an individual rule. For example, if a precondition specifies that the identity of an organism is X, MYCIN will set up the goal infer identity. This approach also means that if another rule mentions the organism-1s identity, no further work will be required, since the identity will be known. TEIRESIAS s approach is to make use of the expert s ability to correct incorrect or partially correct responses to common questions and then to focus the experts reply as follows what do you know that the program doesnt know that makes your expert diagnosis different in this case? Interactive transfer of expertise between an expert and an expert system begins when the expert identifies an error in the performance of the program and invokes TEIRESIAS to help track down and correct the error. The expert can spot errors when the program produces responses that the expert would not have made or lines of reasoning appear inappropriate. Typical errors might be the wrong identification of a bacterium, or when MYCIN asks a question that in the experts view would not assist in the identification of the bacterium. Both kinds of error indicate a bug in the knowledge base of MYCIN and transfer of knowledge occurs when TEIRESIAS is called in to correct the deficit. TEIRESIAS fixes bugs by 1. Stopping the performance program when the human expert identifies an error; 2. Working backwards through the steps in the performance program that led to the error until the bug is found;

3. Helping the expert fix the bug by modifying the knowledge base. The expert can find faulty reasoning by using how and why Command to ask TEIRESIAS to back up through previous steps explaining why the steps were taken. This process can be used even if there is no apparent bug in the program as it often helps the user understand the mechanisms of the performance program. TEIRESIASs techniques for generating explanations are based upon two assumptions The two assumptions used are 1. That a recapitulation of program actions can be an effective explanation as long as the correct level of detail is given. 2. That there is some shared framework for viewing the programs actions that will make them understandable to the user. These assumptions are valid for MYCIN but there are expert systems in which this is not the case. The first assumption simplifies the task because it requires only the ability to record and play back the history of events. But what level of detail is needed If a program reasons symbolically repeating the arguments may be beneficial but if there are numerical calculations then it is quite different. The repetition must be Detailed enough to enable each operation cited to be understandable. High enough in conceptual level to enable each operation cited to be meaningful. Complete enough to allow the operations cited to be sufficient to account for all behavior. 2. AM: THEORY DRIVEN DISCOVERY: AM (Automated Mathematician) is an artificial program which can be considered as a significant successful example in discovery learning (Ginsberg, 1993). AM program was developed by Doug Lenat as his doctoral thesis at Stanford (Ginsberg, 1993). According to Rich and Knight (1991), AM can be considered as a theory-driven discovery. Theoretically, AM required two inputs:-

1. Firstly, a description of some concepts of set theory was translated to the function written in LISP language. 2. Secondly, the mathematics theory was required. The main purpose of AM is to develop interesting mathematics concepts. In practice, AM discovered a number of mathematics concepts namely integers, addition, multiplication, prime numbers, Goldbachs conjecture and maximally divisible. The reason that AM was successful is because of a close connection between LISP language and mathematics. Secondly, AM consists of a huge collection of heuristics concerning what constitute interesting things. However, there are two limitations that affect a growth of AM program. Firstly, the performance of AM is limited by the static nature of its heuristics. Consequently, the ability to discover new mathematics would decrease as the concepts become more involved. Secondly, AM can work successfully within only mathematics domain. AM was a program to propose interesting mathematical theorems. Not to prove them: The artificial intelligence field is rife with programs that try to prove theorems, almost all of them uninteresting. AM had no concept of proof, it simply proposed theorems, more or less on intuition. AM ran on a PDP-1O (the standard lisp machine) and started with a small nucleus of concepts, plus a set of rules for specializing and generalizing concepts, and deciding how interesting they are. It kept a prioritized list of interesting things to investigate, and cyclically tried one of the most interesting and then added to the list any further ideas resulting. Perhaps most interestingly, it would invent the opposite of prime numbers maximally divisible numbers and trot off to propose theorems about them. AM discovered: 1. Integers It is possible to count the elements of this set and this is an the image of this counting function the integers Interesting set in its own right.

2. Addition The union of two disjoints sets and their counting function.

3. Multiplication Having discovered addition and multiplication as laborious set-theoretic operations more effective descriptions were supplied by hand. 4. Prime Numbers Factorization of numbers and numbers with only one factor were discovered.

5. Goldbachs Conjecture Even numbers can be written as the sum of 2 primes. E.g. 28 = 17 + 11.

6. Maximally Divisible Numbers Numbers with as many factors as possible. A number k is maximally divisible is k has more factors than any integer less than k. E.g. 12 has six divisors 1,2,3,4,6,12. How does AM work? AM employs many general-purpose Al techniques: A frame based representation of mathematical concepts. o AM can create new concepts (slots) and fill in their values Heuristic search employed o 250 heuristics represent hints about activities that might lead to interesting discoveries. o How to employ functions, create new concepts, generalization etc Hypothesis and test based search. Agenda control of discovery process.

3. MYCIN:Mycin was one of the earliest expert systems, and its design has strongly influenced the design of commercial expert systems and expert system shells. Mycin was an expert system developed at Stanford in the 1970s. Its job was to diagnose and recommend treatment for certain blood infections. To do the diagnosis properly involves growing cultures of the infecting organism. Unfortunately this takes around 48 hours, and if doctors waited until this was complete their patient might be dead. So, doctors have to come up with quick guesses about likely problems from the available data, and use these guesses to provide a covering treatment where drugs are given which should deal with any possible problem. Mycin was developed partly in order to explore how human experts make these rough (but important) guesses based on partial information. However, the problem is also a potentially important one in practical terms - there are lots of junior or non-specialized doctors who sometimes have to make such a rough diagnosis, and if there is an expert tool available to help them then this might allow more effective treatment to be given. In fact, Mycin was never actually used in practice. This wasnt because of any weakness in its performance - in tests it outperformed members of the Stanford medical school. It was as much because of ethical and legal issues related to the use of computers in medicine - if it gives the wrong diagnosis, who do you sure? Anyway Mycin represented its knowledge as a set of IF-THEN rules with certainty factors. The following is an English version of one of Mycins rules: IF the infection is primary-bacteremia AND the site of the culture is one of the sterile sites AND the suspected portal of entry is the gastrointestinal tract THEN there is suggestive evidence (0.7) that infection is bacteroid. The 0.7 is roughly the certainty that the conclusion will be true given the evidence. If the evidence is uncertain the certainties of the bits of evidence will be combined with the certainty of the rule to give the certainty of the conclusion. Mycin was written in Lisp, and its

rules are formally represented as Lisp expressions. The action part of the rule could just be a conclusion about the problem being solved, or it could be an arbitrary Lisp expression. This allowed great flexibility, but removed some of the modularity and clarity of rule-based systems, so using the facility had to be used with care. Mycin is a goal-directed system, using the basic backward chaining reasoning strategy. However, Mycin used various heuristics to control the search for a solution (or proof of some hypothesis). These were needed both to make the reasoning efficient and to prevent the user being asked too many unnecessary questions. One strategy is to first ask the user a number of more or less preset questions that are always required and which allow the system to rule out totally unlikely diagnoses. Once these questions have been asked the system can then focus on particular, more specific possible blood disorders, and go into full backward chaining mode to try and prove each one. These rules out of a lot of unnecessary search and also follow the pattern of human patient-doctor interviews. The other strategies relate to the way in which rules are invoked. The first one is simple: given a possible rule to use, Mycin first checks all the premises of the rule to see if any are known to be false. If so theres not much point using the rule. The other strategies relate more to the certainty factors. Mycin will first look at rules that have more certain conclusions, and will abandon a search once the certainties involved get below 0.2.

Basic MYCIN Structure A dialogue with Mycin is somewhat like the mini dialogue, but of course longer and somewhat more complex. There are three main stages to the dialogue. In the first stage, initial data about the case is gathered so the system can come up with a very broad diagnosis. In the second more directed questions are asked to test specific hypotheses. At the end of this section a diagnosis is proposed. In the third section questions are asked to determine an appropriate treatment, given the diagnosis and facts about the patient. This obviously concludes with a treatment recommendation. At any stage the user can ask why a question was asked or how a conclusion was reached, and when treatment is recommended the user can ask for alternative treatments if the first is not viewed as satisfactory. Mycin, though pioneering much expert system research, also had a number of problems which were remedied in later, more sophisticated architectures. One of these was that the rules often mixed domain knowledge, problem solving knowledge and screening conditions (conditions to avoid asking the user silly or awkward questions - e.g., checking patient is not child before asking about alcoholism). A later version called NEOMYCIN attempted to deal with these by having an explicit disease taxonomy (represented as a frame system) to represent facts about different kinds of diseases The basic problems solving strategy was to go down the disease tree, from general classes of diseases to very specific ones, gathering information to differentiate between two disease subclasses (i.e., if disease 1 has subtypes disease2 and disease3, and you know that the patient has the disease l, and subtype disease2 has symptom l but not disease 3, then ask about symptom l.) MYCIN operated using a 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 (that is, MYCIN would also list the questions and rules which led it to rank a diagnosis a particular way), and its recommended course of drug treatment. Despite MYCINs success, it sparked debate about the use of its ad hoc, but principled, uncertainty framework known as certainty factors. The developers performed studies showing that MYCINs performance was minimally affected by perturbations in the uncertainty metrics associated with individual rules, suggesting that the power in the system,

was related more to its knowledge representation and reasoning scheme than to the details of its numerical uncertainty model. There were many other developments from the. MYCIN project. For example, EMYCIN was really the first expert shell developed from Mycin. A new expert system called PUFF was developed using EMYCIN in the new domain of heart disorders and system called NEOMYCIN was developed for training doctors, which would take them through various example cases, checking their conclusions and explaining where they went wrong. DENDRAL:An early expert system developed beginning in 1965 by the artificial intelligence (Al) researcher Edward Feigenbaum and the geneticist Joshua Lederberg, both of Stanford University in California. Heuristic DENDRAL (later shortened to DENDRAL) was a chemical-analysis expert system. The substance to be analyzed might, for example, be a complicated compound of carbon, hydrogen, and nitrogen Starting from spectrographic data obtained from the substance, DENDRAL would hypothesize the substances molecular structure. DENDRALs performance rivaled that of chemists expert at this task, and the program was used in industry and in academia. Many systems were derived from Dendral, including MYCIN, MOLGEN, MACSYMA, PROSPECTOR, XCON, and STEAMER. The name Dendral is a portmanteau of the term Dendritic Algorithm.

Important points to remember Q1. Explain Prolog. PROLOG, which is an acronym of PROgramming in LOGic, is commonly used for handling this class of reasoning problems. Prolog is a declarative language that focuses on logic. Programming in Prolog involves specifying rules and facts and allowing Prolog to derive a solution. This differs from typical declarative programming, where a solution is coded. Building a Prolog application typically involves describing the landscape of the problem (using rules and facts), and then using goals to invoke execution. However, LISP is well suited for handling lists, whereas PROLOG is designed for Logic Programming. Prolog provides logic variables instead of normal variables. A logic variable is bound by unification rather than by assignment. Once bound, a logic variable can never change. Thus, they are more like the variables of mathematics. The existence of logic variables and unification allow the logic programmer to state equations that constrain the problem (as in mathematics), without having to state an order of evaluation (as with assignment statements). Prolog provides automatic backtracking. Q 2. Explain the structure of prolog programs The main part of a prolog program consists of a collection of knowledge about a specific subject. This collection is called a database and this database is expressed in facts and rules. Turbo prolog permits you to describe facts as symbolic relationships. Example: The right speaker is dead. This same fact can be expressed in turbo prolog as Is (right_speaker, dead). This factual expression in prolog is called a clause. In this example, right speakers and dead are objects. The word is is the relation in this example. Relation is a name that defines the way in which objects are related. The entire expression before the period in each case is called a predicate. A predicate is a function with a value of true or false predicates express a property or relationship, the word before the parenthesis is name of relation. The elements with in the parenthesis are the arguments of the predicate, which may be objects or variables. Facts The simplest kind of entry in the database is a fact. (A fact is a term, followed by a period and a white-space character.) child (rajat, sunita).

Does this mean rajat has a child called sunita or rajat is a child of sunita? To avoid confusion, add comments. Examples: % Reading: child (A, B) = A is a child of B /* This is another way to write comments that stretch over more than one line / Rules A rule is an expression that indicates the truth of a particular fact depends upon one or more other facts. Example If there is a body stiffness or pain in the joints. AND there is sensitivity to infections. Then there is probably a vitamin C deficiency. This rule could be, expressed as the following turbo prolog clause. Hypothesis (vitc_deficiency) if Symptom (arthritis) and symptom (infection sensitivity) Hypothesis (vitc_deficiency): Symptom (arthritis) Symptom (infection Sensitivity) The :- operator is called a break a comma expression and relationship and semicolon expresses an or relationship. The process of using rules and facts to solve a problem is called formal reasoning. Query Action of asking the program about information contained within its data base. After a program is loaded, you will receive the query prompt, ?We can ask the program a question such as ?- It is sunny And it will respond with the answer Yes ?Variables: - must begin with an upper case letter Constants: - must begin with lowercase letter, or enclosed in single quotes Prolog Program

A Prolog program consists of a series of facts (concrete relationships) among data objects and a set of rules. Write the program in simple text editor & save it as .pl On the terminal, type gprolog. To load a file, [filename]. The process of using rules and facts to solve a problem is called formal reasoning. Q3. Write about Features of Prolog Pro log is comprised of two fundamental elements, the database and the interpreter. The database contains the facts and rules that are used to describe the problem. The interpreter provides the control in the form of a deduction method. The main body of the program, the clause section contains the clause and consists of facts and rules. The relationships used in the clauses of the clause section are defined in the predicate section. It defines the type of each object. 6 basic object types are available to the user. Character single character (enclosed between single quotation marks) Integer-integer from -32768 to 32767 Real- floating point number (1E307 to I E308) String character sequence (enclosed between double quotation marks) Symbol- character sequences of letters numbers and under series with the first character a lower case letter File-symbolic file name. Variables: A variable name must begin with a capital letter and may be from 1 to 250 characters long. Except for the first character in the name we may use uppercase or lower case letters, digits o the under line character. Names should be meaningful. Bound & free variables: If a variable has a value at a particular time it is said to be bound or instantiated. If a variable does not have a value at a particular time is said to be free or uninstantiated. Anonymous variables: - The anonymous variable stands for all values while in a goal it is satisfied if at least one value corresponds to it. Data Representation Prolog doesnt include data types; it includes lexical elements (or sequences of characters in legal combinations). Some of the important lexical elements of Prolog include atoms, numbers, variables, and lists.

An atom is a string made up of characters (lower and upper case), digits, and the underscore. Numbers are simply sequences of digits with an optional preceding minus sign. Variables have the same format as atoms, except that the first character is always capitalized. A list is represented as a comma delimited set of elements, surrounded by brackets. Q4. Explain about Expert Systems Shell A shell is a complete development environment for building and maintaining knowledgebased applications. It provides a step-by-step methodology, and ideally a user-friendly interface such as a graphical interface, for a knowledge engineer that allows the domain experts themselves to be directly involved in structuring and encoding the knowledge. The expert system shell simplifies the process of creating a knowledge base. It is the shell that actually processes the information entered by a user; relates it to the concepts contained in the knowledge base; and provides an assessment or solution for a particular problem. Thus, an expert system shell provides a layer between the user interface and computer operating system to manage the input and output of data. It. also manipulates the information provided by the user in conjunction with the knowledge base to arrive at a particular conclusion. The structure of the shell is very similar to that of an interpreter or a front-end to a database program. The shell also manages the user interface, performing functions that range from the validation of numeric values entered on the screen to management of the mouse and the representation of graphical objects

Expert System Shell Q6. Write a short note on TIERES Human experts communicate using TEIRESIAS with the performance program MYCJN to discover how well MYC1N is doing in responding to the requests for help that it receives.

Through using TEIRESIAS the expert can coach MYCIN into producing better responses so that an element of learning is introduced. TEIRESIAS recognizes that some of the knowledge required for the knowledge base is inexact or rough and it succeeds in offering advice for its correction. It also provides method for extracting the best performance out of an expert system such as MYCIN. TEIRESIAS was the first program to support explanation and knowledge acquisition. TEIRESIAS served as a front-end for the MYCIN expert system. TEIRESIASs approach to explanation is that the behavior of a program can be explained simply by referring to a trace of the programs execution. There are ways in which this assumption limits the kinds of explanations that can be produced, but it does minimize the overhead involved in generating each explanation. To understand how TEIRESIAS generates explanations of MYCINs behavior, we need to know how that behavior is structured. TEIRESIAS fixes bugs by 1. Stopping the performance program when the human expert identifies an error; 2. Working backwards through the steps in the performance program that led to the error until the bug is found; 3. Helping the expert fix the bug by modifying the knowledge base. The expert can find faulty reasoning by using how and why Command to ask TEIRESIAS to back up through previous steps explaining why the steps were taken. This process can be used even if there is no apparent bug in the program as it often helps the user understand the mechanisms of the performance program. TEIRESIASs techniques for generating explanations are based upon two assumptions The two assumptions used are 1. That a recapitulation of program actions can be an effective explanation as long as the correct level of detail is given. 2. That there is some shared framework for viewing the programs actions that will make them understandable to the user.

These assumptions are valid for MYCIN but there are expert systems in which this is not the case. The first assumption simplifies the task because it requires only the ability to record and play back the history of events. But what level of detail is needed If a program reasons symbolically repeating the arguments may be beneficial but if there are numerical calculations then it is quite different. The repetition must be Detailed enough to enable each operation cited to be understandable. High enough in conceptual level to enable each operation cited to be meaningful. Complete enough to allow the operations cited to be sufficient to account for all behavior. Q 7. Write a short note on AM? AM (Automated Mathematician) is an artificial program which can be considered as a significant successful example in discovery learning (Ginsberg, 1993). AM program was developed by Doug Lenat as his doctoral thesis at Stanford (Ginsberg, 1993). According to Rich and Knight (1991), AM can be considered as a theory-driven discovery. Theoretically, AM required two inputs:1. Firstly, a description of some concepts of set theory was translated to the function written in LISP language. 2. Secondly, the mathematics theory was required. The main purpose of AM is to develop interesting mathematics concepts. In practice, AM discovered a number of mathematics concepts namely integers, addition, multiplication, prime numbers, Goldbachs conjecture and maximally divisible. The reason that AM was successful is because of a close connection between LISP language and mathematics. Secondly, AM consists of a huge collection of heuristics concerning what constitute interesting things. However, there are two limitations that affect a growth of AM program. Firstly, the performance of AM is limited by the static nature of its heuristics. Consequently, the

ability to discover new mathematics would decrease as the concepts become more involved. Secondly, AM can work successfully within only mathematics domain. AM was a program to propose interesting mathematical theorems. Not to prove them: The artificial intelligence field is rife with programs that try to prove theorems, almost all of them uninteresting. AM had no concept of proof, it simply proposed theorems, more or less on intuition. AM ran on a PDP-1O (the standard lisp machine) and started with a small nucleus of concepts, plus a set of rules for specializing and generalizing concepts, and deciding how interesting they are. It kept a prioritized list of interesting things to investigate, and cyclically tried one of the most interesting and then added to the list any further ideas resulting. Perhaps most interestingly, it would invent the opposite of prime numbers maximally divisible numbers and trot off to propose theorems about them. AM discovered: 1. Integers It is possible to count the elements of this set and this is an the image of this counting function the integers Interesting set in its own right.

2. Addition The union of two disjoints sets and their counting function.

3. Multiplication Having discovered addition and multiplication as laborious set-theoretic operations more effective descriptions were supplied by hand. 4. Prime Numbers Factorization of numbers and numbers with only one factor were discovered.

5. Goldbachs Conjecture

Even numbers can be written as the sum of 2 primes. E.g. 28 = 17 + 11.

6. Maximally Divisible Numbers Numbers with as many factors as possible. A number k is maximally divisible is k has more factors than any integer less than k. E.g. 12 has six divisors 1,2,3,4,6,12. How does AM work? AM employs many general-purpose Al techniques: A frame based representation of mathematical concepts. o AM can create new concepts (slots) and fill in their values Heuristic search employed o 250 heuristics represent hints about activities that might lead to interesting discoveries. o How to employ functions, create new concepts, generalization etc Hypothesis and test based search. Agenda control of discovery process. Q8. Write a short note on MYCIN Mycin was one of the earliest expert systems, and its design has strongly influenced the design of commercial expert systems and expert system shells. Mycin was an expert system developed at Stanford in the 1970s. Its job was to diagnose and recommend treatment for certain blood infections. To do the diagnosis properly involves growing cultures of the infecting organism. Unfortunately this takes around 48 hours, and if doctors waited until this was complete their patient might be dead. So, doctors have to come up with quick guesses about likely problems from the available data, and use these guesses to provide a covering treatment where drugs are given which should deal with any possible problem. Mycin was developed partly in order to explore how human experts make these rough (but important) guesses based on partial information. However, the problem is also a potentially

important one in practical terms - there are lots of junior or non-specialized doctors who sometimes have to make such a rough diagnosis, and if there is an expert tool available to help them then this might allow more effective treatment to be given. In fact, Mycin was never actually used in practice. This wasnt because of any weakness in its performance - in tests it outperformed members of the Stanford medical school. It was as much because of ethical and legal issues related to the use of computers in medicine - if it gives the wrong diagnosis, who do you sure? Anyway Mycin represented its knowledge as a set of IF-THEN rules with certainty factors. The following is an English version of one of Mycins rules: IF the infection is primary-bacteremia AND the site of the culture is one of the sterile sites AND the suspected portal of entry is the gastrointestinal tract THEN there is suggestive evidence (0.7) that infection is bacteroid. The 0.7 is roughly the certainty that the conclusion will be true given the evidence. If the evidence is uncertain the certainties of the bits of evidence will be combined with the certainty of the rule to give the certainty of the conclusion. Mycin was written in Lisp, and its rules are formally represented as Lisp expressions. The action part of the rule could just be a conclusion about the problem being solved, or it could be an arbitrary Lisp expression. This allowed great flexibility, but removed some of the modularity and clarity of rule-based systems, so using the facility had to be used with care. Mycin is a goal-directed system, using the basic backward chaining reasoning strategy. However, Mycin used various heuristics to control the search for a solution (or proof of some hypothesis). These were needed both to make the reasoning efficient and to prevent the user being asked too many unnecessary questions. One strategy is to first ask the user a number of more or less preset questions that are always required and which allow the system to rule out totally unlikely diagnoses. Once these questions have been asked the system can then focus on particular, more specific possible blood disorders, and go into full backward chaining mode to try and prove each one. These rules out of a lot of unnecessary search and also follow the pattern of human patient-doctor interviews.

The other strategies relate to the way in which rules are invoked. The first one is simple: given a possible rule to use, Mycin first checks all the premises of the rule to see if any are known to be false. If so theres not much point using the rule. The other strategies relate more to the certainty factors. Mycin will first look at rules that have more certain conclusions, and will abandon a search once the certainties involved get below 0.2.

Basic MYCIN Structure A dialogue with Mycin is somewhat like the mini dialogue, but of course longer and somewhat more complex. There are three main stages to the dialogue. In the first stage, initial data about the case is gathered so the system can come up with a very broad diagnosis. In the second more directed questions are asked to test specific hypotheses. At the end of this section a diagnosis is proposed. In the third section questions are asked to determine an appropriate treatment, given the diagnosis and facts about the patient. This obviously concludes with a treatment recommendation. At any stage the user can ask why a question was asked or how a conclusion was reached, and when treatment is recommended the user can ask for alternative treatments if the first is not viewed as satisfactory. Mycin, though pioneering much expert system research, also had a number of problems which were remedied in later, more sophisticated architectures. One of these was that the rules often mixed domain knowledge, problem solving knowledge and screening conditions (conditions to avoid asking the user silly or awkward questions - e.g., checking

patient is not child before asking about alcoholism). A later version called NEOMYCIN attempted to deal with these by having an explicit disease taxonomy (represented as a frame system) to represent facts about different kinds of diseases The basic problems solving strategy was to go down the disease tree, from general classes of diseases to very specific ones, gathering information to differentiate between two disease subclasses (i.e., if disease 1 has subtypes disease2 and disease3, and you know that the patient has the disease l, and subtype disease2 has symptom l but not disease 3, then ask about symptom l.) MYCIN operated using a 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 (that is, MYCIN would also list the questions and rules which led it to rank a diagnosis a particular way), and its recommended course of drug treatment. Despite MYCINs success, it sparked debate about the use of its ad hoc, but principled, uncertainty framework known as certainty factors. The developers performed studies showing that MYCINs performance was minimally affected by perturbations in the uncertainty metrics associated with individual rules, suggesting that the power in the system, was related more to its knowledge representation and reasoning scheme than to the details of its numerical uncertainty model. There were many other developments from the. MYCIN project. For example, EMYCIN was really the first expert shell developed from Mycin. A new expert system called PUFF was developed using EMYCIN in the new domain of heart disorders and system called NEOMYCIN was developed for training doctors, which would take them through various example cases, checking their conclusions and explaining where they went wrong. Q9. Write a short note on DENDRAL An early expert system developed beginning in 1965 by the artificial intelligence (Al) researcher Edward Feigenbaum and the geneticist Joshua Lederberg, both of Stanford University in California. Heuristic DENDRAL (later shortened to DENDRAL) was a chemical-analysis expert system. The substance to be analyzed might, for example, be a complicated compound of carbon, hydrogen, and nitrogen Starting from spectrographic data

obtained from the substance, DENDRAL would hypothesize the substances molecular structure. DENDRALs performance rivaled that of chemists expert at this task, and the program was used in industry and in academia. Many systems were derived from Dendral, including MYCIN, MOLGEN, MACSYMA, PROSPECTOR, XCON, and STEAMER. The name Dendral is a portmanteau of the term Dendritic Algorithm.

S-ar putea să vă placă și