1 Chapter 9 Rules and Expert Systems. 2 Chapter 9 Contents (1) l Rules for Knowledge Representation l Rule Based Production Systems l Forward Chaining.
Published byModified over 6 years ago
Presentation on theme: "1 Chapter 9 Rules and Expert Systems. 2 Chapter 9 Contents (1) l Rules for Knowledge Representation l Rule Based Production Systems l Forward Chaining."— Presentation transcript:
2 Chapter 9 Contents (1) l Rules for Knowledge Representation l Rule Based Production Systems l Forward Chaining l Conflict Resolution l Meta Rules l Backward Chaining l The Architecture of Expert Systems l Expert System Shells
3 Chapter 9 Contents (2) l The Rete Algorithm l Knowledge Engineering l CLIPS l Backward Chaining in Expert Systems l CYC
4 Rules for Knowledge Representation l IF… THEN Rules can be used to represent knowledge: nIF it rains, then you will get wet l Rules can also be recommendations: nIF it rains, then you should wear a coat
5 Rule Based Production Systems l A production system is a system that uses knowledge in the form of rules to provide diagnoses or advice on the basis of input data. l The system consists of a database of rules (knowledge base), a database of facts, and an inference engine which reasons about the facts using the rules.
6 Forward Chaining l Forward chaining is a reasoning model that works from a set of facts and rules towards a set of conclusions, diagnoses or recommendations. l When a fact matches the antecedent of a rule, the rule fires, and the conclusion of the rule is added to the database of facts.
7 Conflict Resolution l Sometimes more than one rule will fire at once, and a conflict resolution strategy must be used to decide which conclusions to use. l One strategy is to give rules priorities and to use the conclusion that has the highest priority. l Other strategies include applying the rule with the longest antecedent, or applying the rule that was most recently added to the database.
8 Meta Rules l The rules that determine the conflict resolution strategy are called meta rules. l Meta rules define knowledge about how the system will work. l For example, meta rules might define that knowledge from Expert A is to be trusted more than knowledge from Expert B. l Meta rules are treated by the system like normal rules, but are given higher priority.
9 Backward Chaining l In cases where a particular conclusion is to be proved, backward chaining can be more appropriate. l Works back from a conclusion towards the original facts. l When a conclusion matches the conclusion of a rule in the database, the antecedents of the rule are compared with facts in the database.
10 The Architecture of Expert Systems (1) l An expert system uses expert knowledge derived from human experts to diagnose illnesses, provide recommendations and solve other problems.
11 The Architecture of Expert Systems (2) l Knowledge base: database of rules (domain knowledge). l Explanation system: explains the decisions the system makes. l User Interface: the means by which the user interacts with the expert system. l Knowledge base editor: allows the user to edit the information in the knowledge base.
12 Expert System Shells l The part of an expert system that does not contain any domain specific or case specific knowledge is the expert system shell. l A single expert system shell can be used to build a number of different expert systems. l An example of an expert system shell is CLIPS.
13 The Rete Algorithm l A rete is a directed, acyclic, rooted graph (a tree). l A path from the root node to a leaf represents the left hand side of a rule. l Each node stores details of which facts have been matched so far. l As facts are changed, the changes are propagated through the tree. l This makes an efficient way for expert systems to deal with environments which change often.
14 Knowledge Engineering l A knowledge engineer takes knowledge from experts and inputs it into the expert system. l A knowledge engineer will usually choose which expert system shell to use. l The knowledge engineer is also responsible for entering meta-rules.
15 CLIPS l CLIPS is C Language Integrated Production System – an expert system shell. l CLIPS uses a LISP- like notation to enter rules.
16 Backward Chaining in Expert Systems l Backward chaining is often used in expert systems that are designed for medical diagnosis: l For each hypothesis, H: If H is in the facts database, it is proved. Otherwise, if H can be determined by asking a question, then enter the user’s answer in the facts database. Hence, it can be determined whether H is true or false, according to the user’s answer. Otherwise, find a rule whose conclusion is H. Now apply this algorithm to try to prove this rule’s antecedents. If none of the above applies, we have failed to prove H. l Usually backward chaining is used in conjunction with forward chaining.
17 CYC l A frame based production system. l Uses a database of over 1,000,000 facts and rules, encompassing all fields of human knowledge. l CYC can answer questions about all kinds of knowledge in its database, and can even understand analogies, and other complex relations.