Rule-Based Expert Rule-Based Expert SystemsSystems
Expert SystemsExpert Systems
Acknowledge that computers do not Acknowledge that computers do not posses general knowledge (common posses general knowledge (common sense)sense)
Attempt to train computer in a “limited Attempt to train computer in a “limited domain”domain”
Experts have deep, often complex Experts have deep, often complex knowledge, but generally for a limited knowledge, but generally for a limited domaindomain
Can A Computer Do What an Can A Computer Do What an Expert Does?Expert Does?
Limited domainLimited domain The system has a finite, and relatively small number The system has a finite, and relatively small number
of things it needs to “know” about.of things it needs to “know” about. The processing might be complex, but computers are The processing might be complex, but computers are
good at that.good at that.
Can the expert knowledge be extracted?Can the expert knowledge be extracted? Knowledge Engineers do the extractingKnowledge Engineers do the extracting Experts provide their knowledgeExperts provide their knowledge Programmers encoded the knowledge into an “expert Programmers encoded the knowledge into an “expert
system.”system.”
Some HistorySome History
In the early to mid 1980’s the desire to In the early to mid 1980’s the desire to build “expert systems” was very high in the build “expert systems” was very high in the US and elsewhere.US and elsewhere. Japanese 5Japanese 5thth generation computing project generation computing project AI researchers aggressively recruited by AI researchers aggressively recruited by
industryindustry Expert systems were considered by many to Expert systems were considered by many to
be “the next big thing.”be “the next big thing.”
Overstatement of CapabilitiesOverstatement of Capabilities
The results of several expert systems The results of several expert systems were oversold.were oversold. Prospector didn’t really discover millions of Prospector didn’t really discover millions of
dollars worth of Molybdenum.dollars worth of Molybdenum. The originators of the system never made this The originators of the system never made this
claim, but despite their efforts to stop it, the story is claim, but despite their efforts to stop it, the story is repeated to this day.repeated to this day.
Frequently Cited Examples of Frequently Cited Examples of Expert SystemsExpert Systems
MYCINMYCIN Infectious blood disease diagnosisInfectious blood disease diagnosis
DendralDendral Analyzed mass-spectra (chemistry) Analyzed mass-spectra (chemistry)
PROSPECTORPROSPECTOR Geological analysisGeological analysis
R1R1 Configure a VAX computerConfigure a VAX computer
Expert knowledge can be difficult to Expert knowledge can be difficult to extractextract
Experts often do not really know how they do Experts often do not really know how they do things themselves. Although the expert can things themselves. Although the expert can perform the tasks, he/she does not necessarily perform the tasks, he/she does not necessarily have access to the mechanism used.have access to the mechanism used.
Experts have reasons to be uncooperative in the Experts have reasons to be uncooperative in the process of disseminating their expertise.process of disseminating their expertise.
Experts often disagree on both processes and Experts often disagree on both processes and conclusions.conclusions.
The process might require judgment that is not The process might require judgment that is not easily codified.easily codified.
Rule-based Expert SystemsRule-based Expert Systems
Sets of IF-THEN rules are established to Sets of IF-THEN rules are established to codify expert knowledge.codify expert knowledge. If <antecedent> then <consequent>If <antecedent> then <consequent>
Antecedents can be combined using logical Antecedents can be combined using logical operatorsoperators
If <a> and <b> or <c> then <consequent>If <a> and <b> or <c> then <consequent>
IF “3 enemy stones in a row” ANDIF “3 enemy stones in a row” AND NOT “3 friendly stones in a row”NOT “3 friendly stones in a row”
Then “place a stone in the row with 3 enemy Then “place a stone in the row with 3 enemy stones.”stones.”
Knowledge EngineersKnowledge Engineers
Tasked with working with the expert to Tasked with working with the expert to extract expertise and codify in a set of extract expertise and codify in a set of rules.rules.
Has training in the development of expert Has training in the development of expert systems, but not necessarily in the systems, but not necessarily in the application domain.application domain.
Know the capabilities of the technology Know the capabilities of the technology and knows how to apply it.and knows how to apply it.
Expert System ShellsExpert System Shells
Separate the mechanisms for making Separate the mechanisms for making inference from the rule baseinference from the rule base
Facilitate the entry of rules by non-Facilitate the entry of rules by non-programmersprogrammers
Provide reuse for what would otherwise be Provide reuse for what would otherwise be redundant code across expert systemsredundant code across expert systems
Expert System ComponentsExpert System Components
Inference EngineInference Engine Forward or Backward-chainingForward or Backward-chaining Conflict resolution algorithmsConflict resolution algorithms
Rule-baseRule-base IF-THEN rulesIF-THEN rules
DatabaseDatabase Current state on which IF-THEN rules are applied.Current state on which IF-THEN rules are applied.
Explanation FacilitiesExplanation Facilities An important advantage rule-based expert systems An important advantage rule-based expert systems
hold over other types of AIhold over other types of AI
Inference EnginesInference Engines
Forward-chainingForward-chaining Submit current data to all rulesSubmit current data to all rules Rules make conclusions, which in turn, Rules make conclusions, which in turn,
generate new datagenerate new data ““Inference Chains” result from initial data and Inference Chains” result from initial data and
the data generated in conclusions.the data generated in conclusions.
Backward-chainingBackward-chaining Try to prove a conclusion by working Try to prove a conclusion by working
backwards from ways to prove it.backwards from ways to prove it.
Forward-chaining Example (A,B,E, Forward-chaining Example (A,B,E, and D are given)and D are given)
If Y and D then ZIf Y and D then Z If X and B and E then YIf X and B and E then Y If A then XIf A then X If C then LIf C then L If L and M then NIf L and M then N
A
D
B
X
E
YZ
Example from Negnevitsky
CL
Backward ChainingBackward Chaining
Prolog uses backward chainingProlog uses backward chaining Work backward from the goal.Work backward from the goal. Check rules that can provided the desired Check rules that can provided the desired
goal.goal.
Backward Chaining ExampleBackward Chaining Example
If Y and D then ZIf Y and D then Z If X and B and E then YIf X and B and E then Y If A then XIf A then X If C then LIf C then L If L and M then NIf L and M then N
A
D
B
E
C
ZY
D
X
B
E
Forward or Backward Chaining?Forward or Backward Chaining?
What do experts use?What do experts use? Are we trying to prove a particular Are we trying to prove a particular
hypothesis?hypothesis? Backward chainingBackward chaining
Are we trying to find all possible Are we trying to find all possible conclusions?conclusions? Forward chainingForward chaining
What does the rule set look like?What does the rule set look like? Could be either one or a combination of both.Could be either one or a combination of both.
Conflict ResolutionConflict Resolution
What happens when two rules provide What happens when two rules provide conflicting conclusions?conflicting conclusions? If it has feathers then it is a birdIf it has feathers then it is a bird If it can’t fly then it is not a birdIf it can’t fly then it is not a bird What if has feathers, but can’t fly?What if has feathers, but can’t fly?
Conflict Resolution MethodsConflict Resolution Methods
Use rule-order as an implied priorityUse rule-order as an implied priority The first rule to provide an answer is used.The first rule to provide an answer is used.
Assign a priority to each rule, the rule with the Assign a priority to each rule, the rule with the higher priority is sustained.higher priority is sustained.
Longest Matching Strategy uses the rule with the Longest Matching Strategy uses the rule with the most specific information.most specific information. If it cannot fly and has feathers then it is a bird.If it cannot fly and has feathers then it is a bird.
Certainty-based conflict resolutionCertainty-based conflict resolution Measures of certainty are provided for data and rules. Measures of certainty are provided for data and rules.
Most certain rule is sustained. Most certain rule is sustained.
Frame-based Expert SystemsFrame-based Expert Systems
FrameFrame Marvin Minsky (1975)Marvin Minsky (1975)
Frame-based Expert Systems utilize Frame-based Expert Systems utilize frames to encapsulate data and methods frames to encapsulate data and methods about an entity.about an entity.
Frames are similar to objects, but the data Frames are similar to objects, but the data types and processing methods are quite types and processing methods are quite different.different.
FramesFrames
A frame is a data structure with typical A frame is a data structure with typical knowledge about a particular object or concept knowledge about a particular object or concept [Negnevitsky].[Negnevitsky]. Frame is a collection of attributes called “slots”Frame is a collection of attributes called “slots”
Example slots for a truckExample slots for a truck Engine sizeEngine size Number of wheelsNumber of wheels
Slots consists of attribute/value pairs called facetsSlots consists of attribute/value pairs called facets Value/18Value/18 Default Value/4Default Value/4 Range/[3-18]Range/[3-18] User Query/”Enter the number of wheels:”User Query/”Enter the number of wheels:”
DemonsDemons
Slots or facets can contain procedures that are Slots or facets can contain procedures that are executed with the data is accessed or changedexecuted with the data is accessed or changed When_Changed demon is executed when new When_Changed demon is executed when new
information is placed in a slot.information is placed in a slot. Might include forward chaining or backward chaining rulesMight include forward chaining or backward chaining rules
When_Needed demon is executed when information When_Needed demon is executed when information is read from a slotis read from a slot Might include code to read sensors or try to prove a goalMight include code to read sensors or try to prove a goal
InheritanceInheritance
Frames can inherit from other frames.Frames can inherit from other frames. Frame implicitly contains all the slots Frame implicitly contains all the slots
contained in the inherited frame unless the contained in the inherited frame unless the frame overrides the slot with its own definition.frame overrides the slot with its own definition.
Inheritance is established with the “IS-A” Inheritance is established with the “IS-A” relationshiprelationship
In frames, inheritance is principally used to In frames, inheritance is principally used to provide default values, rather than structure provide default values, rather than structure and methods.and methods.
Other Frame RelationshipsOther Frame Relationships
Aggregation (a-part-of)Aggregation (a-part-of) An engine is a-part-of a carAn engine is a-part-of a car A spark plug is a-part-of an engineA spark plug is a-part-of an engine
Association (Other semantic relationships)Association (Other semantic relationships) ExamplesExamples
Ownership (computer has-owner Joe)Ownership (computer has-owner Joe) Uses (dentist uses drill)Uses (dentist uses drill) Location (Joe is-near theDesk)Location (Joe is-near theDesk)
No Limits on RelationshipsNo Limits on Relationships
Frame can employ multiple inheritanceFrame can employ multiple inheritance Frame can have any number of Frame can have any number of
relationshipsrelationships Relationships can be of any type that is Relationships can be of any type that is
useful.useful.
Interactions of Frames and RulesInteractions of Frames and Rules
Different frame-based systems use Different frame-based systems use different mechanisms.different mechanisms.
Rules are often invoked by demons. Rules are often invoked by demons. Some systems allow different rule sets to Some systems allow different rule sets to be applied to different framesbe applied to different frames
Why Use Frames?Why Use Frames?
In large systems, frames can provide the In large systems, frames can provide the system the capability to find relevant system the capability to find relevant information quickly.information quickly.
Making inferences from the most relevant Making inferences from the most relevant information can provide greater efficiency information can provide greater efficiency and allow searches to be constrained.and allow searches to be constrained.
Relationships between frames can be Relationships between frames can be provided at a relatively low cost.provided at a relatively low cost.
Advantages of Expert SystemsAdvantages of Expert Systems
Provide an explanation capabilityProvide an explanation capability What rules fired to provide the conclusion?What rules fired to provide the conclusion? Why other conclusions were not made.Why other conclusions were not made.
For simple domains, the rule-base might For simple domains, the rule-base might be simple and easy to verify and validate.be simple and easy to verify and validate.
The system might use a method similar to The system might use a method similar to what the expert uses.what the expert uses.
Expert system shells provide a means to Expert system shells provide a means to build simple systems without programmingbuild simple systems without programming
Disadvantages of Expert SystemsDisadvantages of Expert Systems
When the number of rules is large, the effect of When the number of rules is large, the effect of adding new rules can be difficult to assess.adding new rules can be difficult to assess.
Expert knowledge is not usually easily codified Expert knowledge is not usually easily codified into rules.into rules.
Expert often lack access to their own analysis Expert often lack access to their own analysis mechanisms.mechanisms.
Validation/Verification of large systems is very Validation/Verification of large systems is very difficult.difficult.
Track record does not seem to contain many Track record does not seem to contain many successes. Relatively high-risk to implement.successes. Relatively high-risk to implement.