Chaining & uncertainty

  • View

  • Download

Embed Size (px)

Text of Chaining & uncertainty

  1. 1. A quick lookA quick look Inference ChainingInference Chaining Forward ChainingForward Chaining Backward ChainingBackward Chaining Conflict and its resolutionConflict and its resolution Meta knowledgeMeta knowledge Uncertainty in Rule-Based Expert SystemUncertainty in Rule-Based Expert System
  2. 2. Inference ChainingInference Chaining
  3. 3. Inference Chaining In rule-based expert system, the domain knowledge is represented by a set of IF-THEN production rules and data is represented by a set of facts about the current situation. The inference engine compares each rule stored in the knowledge base with facts contained in the database.
  4. 4. Inference Chaining Fact: A is X Fact: B is y Rule: IF A is x THEN B is y Knowledge base Database Match Fire Figure : The inference engine cycles via a match-fire procedure
  5. 5. Inference Chaining The matching of the IF parts to the facts produces inference chains. The inference engine must decide when the rules have to be fired. There are two principal ways in which rules are executed Forward Chaining Backward Chaining
  6. 6. Forward ChainingForward Chaining
  7. 7. Inference Chaining Forward chaining Its the data-driven reasoning. The reasoning starts from the known data and proceeds forward with that data. Each time only the topmost rule is executed. When fired, the rule adds a new fact in the database. Any rule can be executed only once. The match-fire cycle stops when no further rules can be fired.
  8. 8. Lets see an exampleLets see an example
  9. 9. Knowledge-Base Database Rule-based Knowledge representation Y & D Z X & B & E Y A X C L L & M N Match Fire A B C D E X Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N Match Fire A B C D E LX Cycle #1 Forward chaining
  10. 10. Rule-based Knowledge representation Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N Match Fire A B C D E YL Cycle #2 Forward chaining X Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N Match Fire A B C D E ZYLX Cycle #3
  11. 11. Backward ChainingBackward Chaining
  12. 12. Rule-based Knowledge representation Backward chaining Its the goal-driven reasoning. Here an expert system has the goal and the inference engine attempts to find the evidence to prove it. First the knowledge base is searched to find rules that might have the desired solution. Such rules must have the goal in their THEN parts. If such rule is found and its IF part matches data in the database, then the rule is fired and the goal is proved.
  13. 13. Rule-based Knowledge representation Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N A B C D E Pass 1: Goal: Z Backward chaining Pass 2: Sub-goal: y Z Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N A B C D E Y ?
  14. 14. Rule-based Knowledge representation Pass 3: Sub goal:X Backward chaining Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N A B C D E X ? Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N A B C D E Pass 4: Sub goal:X Match Fire X
  15. 15. Rule-based Knowledge representation Pass 5: Sub-goal: Y Backward chaining Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N A B C D E Pass 6:Goal: Z Match Fire YX Knowledge-Base Database Y & D Z X & B & E Y A X C L L & M N A B C D E Match Fire ZYX
  16. 16. Forward VS Backward ChainingForward VS Backward Chaining
  17. 17. Forward vs. Backward ChainingForward vs. Backward Chaining consequents (RHS) control evaluation antecedents (LHS) control evaluation similar to depth-first search similar to breadth-first search find facts that support a given hypothesis find possible conclusions supported by given facts top-down reasoningbottom-up reasoning goal-driven (hypothesis)data-driven diagnosisplanning, control Backward ChainingForward Chaining
  18. 18. How do we choose between forwardHow do we choose between forward and backward chaining?and backward chaining?
  19. 19. Can we combine forward andCan we combine forward and backward chaining?backward chaining?
  20. 20. ConflictConflict
  21. 21. ConflictConflict Lets see an example.Lets see an example.
  22. 22. ConflictConflict Rule 1 Rule 2 IF IF THEN THEN The Agent has two legs AND The Agent has two hands AND The Agent can sleep The Agent has two legs AND The Agent has two hands AND The Agent can sleep The Agent is a Man The Agent is not a Man
  23. 23. So Conflict means So Conflict means A situationA situation WhenWhen Two or more actions are foundTwo or more actions are found For only one conditionFor only one condition
  25. 25. They have givenThey have given 33 methods tomethods to resolve conflictresolve conflict
  26. 26. Method 1Method 1 Fire the rule with theFire the rule with the Highest priorityHighest priority
  27. 27. Method 2Method 2 Fire the rule with theFire the rule with the LONGEST MATCHLONGEST MATCH
  28. 28. Method 3Method 3 Fire the rule with theFire the rule with the Data most recently enteredData most recently entered
  29. 29. So keep it in mindSo keep it in mind Highest priorityHighest priority Longest matchLongest match Recent timestampRecent timestamp
  31. 31. METADATA = Data about data.METADATA = Data about data. METAKNOWLEDGE = knowledge aboutMETAKNOWLEDGE = knowledge about knowledge.knowledge. Knowledge about theKnowledge about the propertiesproperties andand usesuses of knowledge.of knowledge.
  32. 32. METAKNOWLEDGEMETAKNOWLEDGE Metaknowledge is knowledge aboutMetaknowledge is knowledge about thethe useuse andand controlcontrol of domainof domain knowledge in an expert system.knowledge in an expert system. -----------Waterman,-----------Waterman, 19861986
  33. 33. Why Metaknowledge?Why Metaknowledge? To improve theTo improve the performanceperformance of anof an expert system, we should supply theexpert system, we should supply the system with some knowledge aboutsystem with some knowledge about the knowledge it possesses.the knowledge it possesses.
  34. 34. RepresentationRepresentation In rule-based expert systems,In rule-based expert systems, metaknowledge is represented bymetaknowledge is represented by metarules.metarules.
  35. 35. What is metarule?What is metarule?
  36. 36. MetaruleMetarule Rule about ruleRule about rule A metarule determines a strategy forA metarule determines a strategy for use of task-specific rules in expertuse of task-specific rules in expert system.system.
  37. 37. Example of MetaruleExample of Metarule Metarule 1:Metarule 1: Rules supplied by experts haveRules supplied by experts have higher priorities than rules suppliedhigher priorities than rules supplied by novices.
  38. 38. Example of MetaruleExample of Metarule Metarule 2:Metarule 2: Rules governing the rescue ofRules governing the rescue of human lives have higher prioritieshuman lives have higher priorities than rules concerned with clearingthan rules concerned with clearing overloads on power systemoverloads on power system
  39. 39. What is the origin ofWhat is the origin of Metaknowledge?Metaknowledge? The knowledge engineer transfersThe knowledge engineer transfers the knowledge domain expert to thethe knowledge domain expert to the expert system, learns how problem-expert system, learns how problem- specific rules are used, and graduallyspecific rules are used, and gradually creates in his or her own mind a newcreates in his or her own mind a new body of knowledge, knowledge aboutbody of knowledge, knowledge about overall behaviour of the expertoverall behaviour of the expert system.system.
  41. 41. Most expert systems cannot distinguishMost expert systems cannot distinguish between rules and metarules.between rules and metarules. Some expert systems provide a separateSome expert systems provide a separate inference engine for metarules.inference engine for metarules. Metarules should be given highest priorityMetarules should be given highest priority in the existing knowledge the existing knowledge base.
  42. 42. When fired, a metaruleWhen fired, a metarule injectsinjects somesome important information into theimportant information into the database than can change thedatabase than can change the priorities of some other rules.priorities of some other rules.
  43. 43. U N C E R T A I N T YU N C E R T A I N T Y Common characteristics ofCommon characteristics of InformationInformation I M P E R F E C T I O NI M P E R F E C T I O N
  44. 44. UNCERTAINTYUNCERTAINTY in expert systemin expert system Lack of the exact knowledge thatLack of the exact knowledge that would enable us to reach awould enable us to reach a perfectly reliable conclusion.perfectly reliable conclusion.
  45. 45. Uncertain knowledge in expertUncertain knowledge in expert systemsystem Four main sources:Four main sources: Weak implicationsWeak implications Imprecise languageImprecise language Unknown dataUnknown data Combining the views of differentCombining the views of different experts.experts.
  46. 46. Dealing UncertaintyDealing Uncertainty in rule-based expert systemin rule-based expert system Numeric methodsNumeric methods Non-numeric methodsNon-numeric methods We will focus onWe will focus on Bayesian reasoningBayesian reasoning Certainty factorCertainty f