1、Ch8Expert SystemDr.Bernard Chen Ph.D.University of Central ArkansasSpring 2019Outline nExpert System introductionnRule-Based Expert SystemnGoal Driven ApproachnData Driven ApproachnModel-Based Expert SystemExpert System Introduction nHuman experts are able to perform at a successful level because th
2、ey know a lot about their areas of expertise nAn Expert System use knowledge specific to a problem domain to provide“expert quality”performance in that application areanAs with skilled humans,expert systems tend to be specialists,focusing on a narrow set of problemsExpert System IntroductionnBecause
3、 of their heuristic,knowledge intensive nature,expert systems generally:nSupport inspection of their reasoning processes nAllow easy modification in adding and deleting skills from knowledge basenReason heuristically,using knowledge to get useful solutionsExpert System IntroductionnExpert systems ar
4、e built to solve a wide range of problems in domain such as medicine,math,engineering,chemistry,geology,computer science,business,low,defense and educationnThese programs address a variety of problems,the following list is a summary of general expert system problem categories:Expert System Introduct
5、ionnInterpretation-forming high-level conclusions from collections of raw datanPrediction-projecting probable consequences of given situationsnDiagnosis-determining the cause of malfunctions based on observable symptoms Expert System IntroductionnDesign-finding a configuration of system components t
6、hat meets performance goals while satisfying a set of design constrains nPlanning-devising a sequence of actions that will achieve a set of goals given starting conditions and runtime constrainsThe Design of Rule-Based Expert System architecture of a typical expert system for a particular problem do
7、main.The Design of Rule-Based Expert SystemnThe hear of the expert system is the knowledge base,which contains the knowledge of a particular application domainnIn a rule-based expert system,this knowledge is most often represented in the form of ifthennIn the figure,the knowledge base contains both
8、general and case-specific informationThe Design of Rule-Based Expert SystemnThe inference engine applies the knowledge to the solution of actual problemsnIt is important to maintain this separation of the knowledge and inference engine because:nMakes it possible to represent knowledge in a more natu
9、ral fashionnExpert system builder can focus on capturing and organizing problem-solving knowledge than the details of code implementationnAllow change to be made easilynAllows the same control and interface software to be used in different systemsSelecting a problemnExpert System involve a considera
10、ble investment of money and human effortnResearchers have developed guidelines to determine whether a problem is appropriate for expert system solution:nThe need for the solution justifies the cost and efforts of building an expert systemnHuman expertise is not available in all situation where it is
11、 neededSelecting a problemnThe problem domain is well structured and does not require common sense reasoningnThe problem may not be solved using traditional computing methodsnCooperative and articulate experts existnThe problem is proper size and scope NASA ExamplenNASA has supported its presence in
12、 space by developing a fleet of intelligent space probes that autonomously explore the solar systemnTo achieve success through years in the harsh conditions of space travel,a craft needs to be able to radically reconfigure its control regime in response to failures and then plan around these failure
13、s during it remaining flightNASA ExamplenFinally,NASA expects that the set of potential failure scenarios and possible responses will be much too large to use software that supports preflight enumeration of all contingencies nLivingstone is an implemented kernel for a model-based reactive self-confi
14、guring autonomous systemNASA ExamplenA long-held vision of model-based reasoning has been to use a single centralized model to support a variety of engineering tasksnThe tasks include nkeeping-track of developing plansnConfirming hardware modesnReconfiguring hardwarenDetecting anomaliesnDiagnosisnFa
15、ult recoveryNASA ExampleNASA ExamplenIt consist of na helium tanknRegulatorsnPropellant tanksnA pair of main engine nLatch valvesnPyro valvesNASA ExamplenThe helium tank pressurizes the two propellant tanks,with the regulators acting to reduce the high helium pressurenWhen propellant path to a main
16、engine are open,the pressurized tank forces fuel and oxidizer into the main engine to produce thrustnThe pyro valve is to isolate parts of the main engine subsystem until they are needed,or to permanently isolate failed components nThe latch valve are controlled using valve drivers and the accelerom
17、eter NASA ExamplenThrust can be provided by either of the main engines and there are a number of ways of opening propellant paths to either main engine NASA ExamplenSuppose the main engine subsystem has been configured to provide thrust from the left engine by opening the latch valves leading to itn
18、And suppose this engine fails(overheating),so that is fails to provide the required thrustnTo ensure that the desire thrust is provided,the spacecraft must be transitioned to a new configuration in which thrust is now provided by the main engine on the right side Selecting a problemnThe primary peop
19、le involved in building an expert system are the knowledge engineer,domain expert,and end usernThe domain expert is primarily responsible for spelling out skills to knowledge engineer nIt is often useful for knowledge engineer to be a novice in the problem domain Exploratory development cycle Explor
20、atory development cyclenIt is also understood that the prototype may be thrown away if it becomes to cumbersome or if the designers decide to change their basic approach to the problemnAnother major feature of expert system is that the program need never be considered“finished”Outline nExpert System
21、 introductionnRule-Based Expert SystemnGoal Driven ApproachnData Driven ApproachnModel-Based Expert SystemStrategies for state space searchnIn data driven search,also called forward chaining,the problem solver begins with the given facts of the problem and set of legal moves for changing state nThis
22、 process continues until(we hope!)it generates a path that satisfies the goal condition“tic-tac-toe”state space graph Strategies for state space searchnAn alternative approach(Goal Driven)is start with the goal that we want to solvenSee what rules can generate this goal and determine what conditions
23、 must be true to use themnThese conditions become the new goalsnWorking backward through successive subgoals until(we hope again!)it work back toRule-Based Expert SystemnRule based expert system represent problem-solving knowledge as ifthennIt is one of the oldest techniques for representing domain
24、knowledge in an expert systemnIt is also one of the most natural and widely used in practical and experimental expert systemRule-Based Expert SystemnIn a goal-driven expert system,the goal expression is initially placed in working memory nThe system matches rule conclusions with the goal,selecting o
25、ne rule and placing its premises in the working memorynThis corresponds to a decomposition of the problems goal into simpler subgoalsnThe process continues in the next iteration of the production system,with these premises becoming the new goals to matchA unreal Expert System Example Rule 1:if the e
26、ngine is getting gas,andthe engine will turn over,thenthe problem is spark plugs.Rule 2:ifthe engine does not turn over,andthe lights do not come onthenthe problem is battery or cables.Rule 3:ifthe engine does not turn over,andthe lights do come onthen the problem is the starter motor.Rule 4:ifthere
27、 is gas in the fuel tank,andthere is gas in the carburetorthenthe engine is getting gas.The production system at the start of a consultation in the car diagnostic example.The production system at the start of a consultation in the car diagnostic example.nThree rules match with this expression in wor
28、king memory:rule 1,2,and 3nIf we resolve conflicts in favor of the lowest-numbered rule,then rule 1 will firenThis cause X to be bound to the value spark plugs and the premises of rule 1 to be placed in the working memoryThe production system after Rule 1 has fired.The production system after Rule 1
29、 has fired.nNote that there are two premises to rule 1,both of which must be satisfied to prove the conclusion truenSo now we need to find out whethernThe engine is getting gas,and nThe engine will turn overnWe may then fire rule 4 for whether“The engine is getting gas”The system after Rule 4 has fi
30、red.Note the stack-based approach to goal reduction.The and/or graph searched in the car diagnosis example,with the conclusion of Rule 4 matching the first premise of Rule 1.Explanation and Transparency in Goal-Driven ReasoningnThe following dialogue begins with the computer asking the user about th
31、e goals present in the working memory:nGas in fuel tank?YESnGas in carburetor?YESnEngine will turn over?WHYExplanation and Transparency in Goal-Driven ReasoningnIn general,the two questions answered by rule-based expert system are WHY?and HOW?nWHY means“why did you ask for that information”nThe answ
32、er is the current rule that the production system is attempting to firenHOW means“How did you get the result”nThe answer is the sequence of rules that were used to conclude a goal Explanation and Transparency in Goal-Driven ReasoningnThe following dialogue begins with the computer asking the user ab
33、out the goals present in the working memory:nGas in fuel tank?YESnGas in carburetor?YESnEngine will turn over?WHYIt has been established that:1.The engine is getting gas,2.The engine will turn over,(we need to know)So that we can make the conclusion that“Then the problem is the spark plugs.”Explanat
34、ion and Transparency in Goal-Driven ReasoningGas in fuel tank?YesGas in carburetor?YesEngine will turn over?Why It has been established that:1.The engine is getting gas,2.The engine will turn over,Then the problem is the spark plugs.How the engine is getting gas This follows from rule 4:ifgas in fue
35、l tank,andgas in carburetorthenengine is getting gas.gas in fuel tank was given by the usergas in carburetor was given by the userOutline nExpert System introductionnRule-Based Expert SystemnGoal Driven ApproachnData Driven ApproachnModel-Based Expert SystemData-Driven ReasoningnThe previous example
36、 exhibits goal-driven search.The search was also depth-first searchnBreadth-first search is more common in Data Driven reasoningnThe algorithm for this category is simple:compare the contents of working memory with the conditions of each rule in the rule base according to the order of the rules Data
37、-Driven ReasoningnIf a piece of information that makes up the premise of a rule is not the conclusion of some other rule,nthen that fact will be deemed“askable”nFor example:the engine is getting gas is not askable in the premise of rule 1A unreal Expert System Example Rule 1:if(not askable)the engin
38、e is getting gas,andthe engine will turn over,thenthe problem is spark plugs.Rule 2:ifthe engine does not turn over,andthe lights do not come onthenthe problem is battery or cables.Rule 3:ifthe engine does not turn over,andthe lights do come onthen the problem is the starter motor.Rule 4:ifthere is
39、gas in the fuel tank,andthere is gas in the carburetorthenthe engine is getting gas.Data-Driven ReasoningData-Driven ReasoningnThe premise,the engine is getting gas is NOT askable,so rule 1 fails and continue to rule 2nThe engine does not turn over is askablenSuppose the answer to this query is fals
40、e,so“the engine will turn over”is placed in working memoryThe production system after evaluating the first premise of Rule 2,which then fails.The production system after evaluating the first premise of Rule 2,which then fails.nRule 2 fails,since the first of two AND premises is false,we move to rule
41、 3nWhere rule 3 also fails nSo finally,we move to rule 4The data-driven production system after considering Rule 4,beginning its second pass through the rules.The data-driven production system after considering Rule 4,beginning its second pass through the rules.nAt this point,all the rules have been
42、 considered nWith the new contents of working memory,we consider the rules in order for the second roundOutline nExpert System introductionnRule-Based Expert SystemnGoal Driven ApproachnData Driven ApproachnModel-Based Expert SystemModel-Based Expert SystemnHuman expertise is an extremely complex co
43、mbination of:nTheoretical knowledgenExperienced based problem solving heuristicsnExample of past problems and their solutions nInterpretive skillsnThrough years of experience,human expert develop very powerful rules for dealing with commonly encountered situationsnThese rules are often highly“compli
44、ed”Model-Based Expert SystemnIn a rule-based expert system example for semiconductor failure analysis,a descriptive approach might base on:nDiscoloration of components(burned-out)nHistory of faults in similar devicesnObservation of component by electron microscopenHowever,approaches that use rules t
45、o link observations and diagnosis do not offer the benefits of a deeper analysis of devices structure and functionModel-Based Expert SystemnA more robust,deeply explanatory approach would begin with a detailed model of the physical structure of the circuit and equations describing the expected behav
46、ior of each component and their interactions.nA knowledge based reasoner whose analysis is founded directly on the specification and functionality of a physical system is called a MODEL-BASED SystemModel-Based Expert SystemnThe model based system tells its user what to expect,and when observations d
47、iffer from these expectations,it will lead to identification of faultsnQualitative model-based reasoning includes:nA description of each component in the device nA description of the devices internal structure nObservation of the devices actual performanceModel-Based Expert System ExamplenThe expect
48、ed output value are given in()and the actual outputs in Model-Based Expert System ExamplenAt F,we have a conflictnWe check the dependencies at this point and determined ADD1,MULT1 and MULT2 are involvednOne of these three devices must have a fault,so we have three hypotheses to consider:nEither the
49、adder behavior is bad or none of its two inputs was incorrect Model-Based Expert System ExamplenAssuming ADD1 and one of its input X is correct(6)nAnother input Y must be(4)nContinue this reasoning,Y can not be MULT2 since G is correctnWe are left with the hypotheses that the fault lies in either MULT1 or ADD1Model-Based Expert System ExamplenFinally,we should note that in the example,there was assumed to be a single faulty device.nThe world is not always this perfectnMany other possible problems may occur:nWire is brokennFaulty connection to the multiplier