Page 1
Lecture 2Lecture 2 Rule-based expert systemsRule-based expert systems Introduction, or what is knowledge?Introduction, or what is knowledge? Rules as a knowledge representation techniqueRules as a knowledge representation technique The main players in the development teamThe main players in the development team Structure of a rule-based expert systemStructure of a rule-based expert system Characteristics of an expert systemCharacteristics of an expert system Forward chaining and backward chainingForward chaining and backward chaining Conflict resolutionConflict resolution SummarySummary Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 1
Page 2
Introduction, or what is knowledge?Introduction, or what is knowledge? KnowledgeKnowledge is a theoretical or practicalis a theoretical or practical understanding of a subject or a domain.understanding of a subject or a domain. Knowledge is also the sum of what is currentlyKnowledge is also the sum of what is currently known, and apparently knowledge is power. Thoseknown, and apparently knowledge is power. Those who possess knowledge are called experts.who possess knowledge are called experts. Anyone can be considered aAnyone can be considered a domain expertdomain expert if he orif he or she has deep knowledge (of both facts and rules)she has deep knowledge (of both facts and rules) and strong practical experience in a particularand strong practical experience in a particular domain. The area of the domain may be limited. Indomain. The area of the domain may be limited. In general, an expert is a skilful person who can dogeneral, an expert is a skilful person who can do things other people cannot.things other people cannot. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 2
Page 3
The human mental process is internal, and it is tooThe human mental process is internal, and it is too complex to be represented as an algorithm.complex to be represented as an algorithm. However, most experts are capable of expressingHowever, most experts are capable of expressing their knowledge in the form oftheir knowledge in the form of rulesrules for problemfor problem solving.solving. IFIF the ‘traffic light’ is greenthe ‘traffic light’ is green THENTHEN the action is gothe action is go IFIF the ‘traffic light’ is redthe ‘traffic light’ is red THENTHEN the action is stopthe action is stop Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 3
Page 4
Rules as a knowledge representation techniqueRules as a knowledge representation technique The termThe term rulerule in AI, which is the most commonlyin AI, which is the most commonly used type of knowledge representation, can beused type of knowledge representation, can be defined as an IF-THEN structure that relates givendefined as an IF-THEN structure that relates given information or facts in the IF part to some action ininformation or facts in the IF part to some action in the THEN part. A rule provides some descriptionthe THEN part. A rule provides some description of how to solve a problem. Rules are relativelyof how to solve a problem. Rules are relatively easy to create and understand.easy to create and understand. Any rule consists of two parts: the IF part, calledAny rule consists of two parts: the IF part, called thethe antecedentantecedent ((premisepremise oror conditioncondition) and the) and the THEN part called theTHEN part called the consequentconsequent ((conclusionconclusion oror actionaction).). Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 4
Page 5
IFIF <<antecedentantecedent>> THENTHEN <<consequentconsequent>> A rule can have multiple antecedents joined by theA rule can have multiple antecedents joined by the keywordskeywords ANDAND ((conjunctionconjunction),), OROR ((disjunctiondisjunction) or) or a combination of both.a combination of both. IFIF <<antecedent 1antecedent 1>> IFIF <<antecedent 1antecedent 1>> ANDAND <<antecedent 2antecedent 2.. >> OROR <<antecedent 2antecedent 2.. >> .... .... ANDAND <<antecedentantecedent nn>> OROR <<antecedentantecedent nn>> THENTHEN <<consequentconsequent>> THENTHEN <<consequentconsequent>> Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 5
Page 6
The antecedent of a rule incorporates two parts: anThe antecedent of a rule incorporates two parts: an objectobject ((linguistic objectlinguistic object) and its) and its valuevalue. The object and. The object and its value are linked by anits value are linked by an operatoroperator.. The operator identifies the object and assigns theThe operator identifies the object and assigns the value. Operators such asvalue. Operators such as isis,, areare,, is notis not,, are notare not areare used to assign aused to assign a symbolic valuesymbolic value to a linguistic object.to a linguistic object. Expert systems can also use mathematical operatorsExpert systems can also use mathematical operators to define an object as numerical and assign it to theto define an object as numerical and assign it to the numerical valuenumerical value.. IFIF ‘age of the customer’ < 18‘age of the customer’ < 18 ANDAND ‘cash withdrawal’ > 1000‘cash withdrawal’ > 1000 THENTHEN ‘signature of the parent’ is required‘signature of the parent’ is required Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 6
Page 7
Rules can represent relations, recommendations,Rules can represent relations, recommendations, directives, strategies and heuristics:directives, strategies and heuristics: RelationRelation IFIF the ‘fuel tank’ is emptythe ‘fuel tank’ is empty THENTHEN the car is deadthe car is dead RecommendationRecommendation IFIF the season is autumnthe season is autumn ANDAND the sky is cloudythe sky is cloudy ANDAND the forecast is drizzlethe forecast is drizzle THENTHEN the advice is ‘take an umbrella’the advice is ‘take an umbrella’ DirectiveDirective IFIF the car is deadthe car is dead ANDAND the ‘fuel tank’ is emptythe ‘fuel tank’ is empty THENTHEN the action is ‘refuel the car’the action is ‘refuel the car’ Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 7
Page 8
StrategyStrategy IFIF the car is deadthe car is dead THENTHEN the action is ‘check the fuel tank’;the action is ‘check the fuel tank’; step1 is completestep1 is complete IFIF step1 is completestep1 is complete ANDAND the ‘fuel tank’ is fullthe ‘fuel tank’ is full THENTHEN the action is ‘check the battery’;the action is ‘check the battery’; step2 is completestep2 is complete HeuristicHeuristic IFIF the spill is liquidthe spill is liquid ANDAND the ‘spill pH’ < 6the ‘spill pH’ < 6 ANDAND the ‘spill smell’ is vinegarthe ‘spill smell’ is vinegar THENTHEN the ‘spill material’ is ‘acetic acid’the ‘spill material’ is ‘acetic acid’ Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 8
Page 9
The main players in the development teamThe main players in the development team There are five members of the expert systemThere are five members of the expert system development team: thedevelopment team: the domain expertdomain expert, the, the knowledge engineerknowledge engineer, the, the programmerprogrammer, the, the project managerproject manager and theand the end-userend-user.. The success of their expert system entirely dependsThe success of their expert system entirely depends on how well the members work together.on how well the members work together. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 9
Page 10
The main players in the development teamThe main players in the development team Expert System Development Team Project Manager Domain Expert Knowledge Engineer Programmer Expert System End-user Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 10
Page 11
TheThe domain expertdomain expert is a knowledgeable and skilledis a knowledgeable and skilled person capable of solving problems in a specificperson capable of solving problems in a specific area orarea or domaindomain. This person has the greatest. This person has the greatest expertise in a given domain. This expertise is to beexpertise in a given domain. This expertise is to be captured in the expert system. Therefore, thecaptured in the expert system. Therefore, the expert must be able to communicate his or herexpert must be able to communicate his or her knowledge, be willing to participate in the expertknowledge, be willing to participate in the expert system development and commit a substantialsystem development and commit a substantial amount of time to the project. The domain expertamount of time to the project. The domain expert is the most important player in the expert systemis the most important player in the expert system development team.development team. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 11
Page 12
TheThe knowledge engineerknowledge engineer is someone who is capableis someone who is capable of designing, building and testing an expert system.of designing, building and testing an expert system. He or she interviews the domain expert to find outHe or she interviews the domain expert to find out how a particular problem is solved. The knowledgehow a particular problem is solved. The knowledge engineer establishes what reasoning methods theengineer establishes what reasoning methods the expert uses to handle facts and rules and decidesexpert uses to handle facts and rules and decides how to represent them in the expert system. Thehow to represent them in the expert system. The knowledge engineer then chooses someknowledge engineer then chooses some development software or an expert system shell, ordevelopment software or an expert system shell, or looks at programming languages for encoding thelooks at programming languages for encoding the knowledge. And finally, the knowledge engineer isknowledge. And finally, the knowledge engineer is responsible for testing, revising and integrating theresponsible for testing, revising and integrating the expert system into the workplace.expert system into the workplace. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 12
Page 13
TheThe programmerprogrammer is the person responsible for theis the person responsible for the actual programming, describing the domainactual programming, describing the domain knowledge in terms that a computer canknowledge in terms that a computer can understand. The programmer needs to have skillsunderstand. The programmer needs to have skills in symbolic programming in such AI languages asin symbolic programming in such AI languages as LISP, Prolog and OPS5 and also some experienceLISP, Prolog and OPS5 and also some experience in the application of different types of expertin the application of different types of expert system shells. In addition, the programmer shouldsystem shells. In addition, the programmer should know conventional programming languages like C,know conventional programming languages like C, Pascal, FORTRAN and Basic.Pascal, FORTRAN and Basic. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 13
Page 14
TheThe project managerproject manager is the leader of the expertis the leader of the expert system development team, responsible for keepingsystem development team, responsible for keeping the project on track. He or she makes sure that allthe project on track. He or she makes sure that all deliverables and milestones are met, interacts withdeliverables and milestones are met, interacts with the expert, knowledge engineer, programmer andthe expert, knowledge engineer, programmer and end-user.end-user. TheThe end-userend-user, often called just the, often called just the useruser, is a person, is a person who uses the expert system when it is developed.who uses the expert system when it is developed. The user must not only be confident in the expertThe user must not only be confident in the expert system performance but also feel comfortable usingsystem performance but also feel comfortable using it. Therefore, the design of the user interface of theit. Therefore, the design of the user interface of the expert system is also vital for the project’s success;expert system is also vital for the project’s success; the end-user’s contribution here can be crucial.the end-user’s contribution here can be crucial. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 14
Page 15
Structure of a rule-based expert systemStructure of a rule-based expert system In the early seventies, Newell and Simon fromIn the early seventies, Newell and Simon from Carnegie-Mellon University proposed a productionCarnegie-Mellon University proposed a production system model, the foundation of the modern rule-system model, the foundation of the modern rule- based expert systems.based expert systems. The production model is based on the idea thatThe production model is based on the idea that humans solve problems by applying their knowledgehumans solve problems by applying their knowledge (expressed as production rules) to a given problem(expressed as production rules) to a given problem represented by problem-specific information.represented by problem-specific information. The production rules are stored in the long-termThe production rules are stored in the long-term memory and the problem-specific information ormemory and the problem-specific information or facts in the short-term memory.facts in the short-term memory. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 15
Page 16
Production system modelProduction system model Long-term Memory Short-term Memory Production Rule Fact REASONING Conclusion Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 16
Page 17
Basic structure of a rule-based expert systemBasic structure of a rule-based expert system Knowledge Base Database Rule: IF-THEN Fact Inference Engine Explanation Facilities User Interface User Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 17
Page 18
TheThe knowledge baseknowledge base contains the domaincontains the domain knowledge useful for problem solving. In a rule-knowledge useful for problem solving. In a rule- based expert system, the knowledge is representedbased expert system, the knowledge is represented as a set of rules. Each rule specifies a relation,as a set of rules. Each rule specifies a relation, recommendation, directive, strategy or heuristicrecommendation, directive, strategy or heuristic and has the IF (condition) THEN (action) structure.and has the IF (condition) THEN (action) structure. When the condition part of a rule is satisfied, theWhen the condition part of a rule is satisfied, the rule is said torule is said to firefire and the action part is executed.and the action part is executed. TheThe databasedatabase includes a set of facts used to matchincludes a set of facts used to match against the IF (condition) parts of rules stored in theagainst the IF (condition) parts of rules stored in the knowledge base.knowledge base. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 18
Page 19
TheThe inference engineinference engine carries out the reasoningcarries out the reasoning whereby the expert system reaches a solution. Itwhereby the expert system reaches a solution. It links the rules given in the knowledge base with thelinks the rules given in the knowledge base with the facts provided in the database.facts provided in the database. The explanation facilities enable the user to ask the expert system how a particular conclusion is reached and why a specific fact is needed. An expert system must be able to explain its reasoning and justify its advice, analysis or conclusion. The user interface is the means of communication between a user seeking a solution to the problem and an expert system. Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 19
Page 20
Complete structure of a rule-based expert systemComplete structure of a rule-based expert system External Database External Program Expert System Knowledge Base Database Rule: IF-THEN Fact Inference Engine Explanation Facilities User Interface Developer Interface User Knowledge Engineer Expert Negnevitsky, Pearson Education, 2002Negnevitsky, Pearson Education, 2002 20
Affichage des 20 premières pages. Téléchargez le document pour le voir en entier.
Commentaires (0)
Aucun commentaire pour le moment. Soyez le premier !