170 likes | 272 Vues
This lecture covers the use of rules for knowledge representation, discussing forward chaining, backward chaining, and conflict resolution in rule inference models. We delve into different rule types like relations, recommendations, directives, strategies, and heuristics, with examples such as traffic light rules and car maintenance rules. The lecture also explains the architecture of rule-based inference, highlighting the components like rule base, fact base, inference engine, and user interface. Additionally, it explores the match-fire cycle, conflict resolution strategies, and the characteristics of rule representation in guiding reasoning processes. The practical applications of forward chaining for data-driven reasoning and backward chaining for goal-driven reasoning are also examined.
E N D
Lecture 04 Rule Representation • Topics • Rules as a Knowledge Representation Technique • Rule Inference Model • Characteristics of Rule Representation • Forward Chaining • Backward Chaining • Discussion
Rules as a representation technique • Experts are capable of expressing their knowledge in the form of rules for problem solving • IF the ‘traffic light’ is green THEN the action is go • IF the ‘traffic light’ is red THEN the action is stop • Any rule consists of two parts: the IF part, called the antecedent (premise or condition) and the THEN part called the consequent (conclusion or action)
Rules as a representation technique • A rule can have multiple antecedents joined by the keywords AND (conjunction), OR (disjunction) or a combination of both • IF antecedent 1 IF antecedent 1 AND antecedent 2 OR antecedent 2 : : AND antecedent n OR antecedent n THEN consequent THENconsequent
Rules as a representation technique • Rules can represent relations, recommendations, directives, strategies and heuristics • Relation IF the ‘fuel tank’ is empty THEN the car is dead • Recommendation IF the season is autumn AND the sky is cloudy AND the forecast is drizzle HEN the advice is ‘take an umbrella’ • Directive IF the car is dead AND the ‘fuel tank’ is empty THEN the action is ‘refuel the car’
Rules as a representation technique • Strategy IF the car is dead THEN the action is ‘check the fuel tank’; step1 is complete IF step1 is complete AND the ‘fuel tank’ is full THEN the action is ‘check the battery’; step2 is complete • Heuristic IF the spill is liquid AND the ‘spill pH’ < 6 AND the ‘spill smell’ is vinegar THEN the ‘spill material’ is ‘acetic acid’
Rule inference model • Rule-based inference architecture External Database External Programs Rule Base Fact base Inference Engine User Interface User
Rule inference model • Rule base contains rules about task knowledge • Fact base contains facts about the current situation; Facts are used to match against the IF (condition) parts of rules • External programs and database • Inference engine carries out the reasoning by linking the rules with the facts. When the condition part of a rule is satisfied, the rule is said enabled and the action part is executed (fired) • User interface solicits problem specification and displays the inference results
Rule inference model • Match-fire cycle • Recognize enabled rules by match • Resolve conflicting rules • Fire rules and add new facts back to fact base
Conflict resolution • Suppose we have two rules with the same IF part. Both of them can be enabled when the condition part is satisfied. They represent a conflict set. • The inference engine must determine which rule to fire from such a set. • A method for choosing a rule to fire when more than one rule can be fired in a given cycle is called conflict resolution.
Conflict resolution • Resolution strategies • Priority • Specificity • Recency • Meta-knowledge • Meta-rule 1: Rules supplied by experts have higher priorities than rules supplied by novices • Metarule 2:Rules governing the rescue of human lives have higher priorities than rules concerned with clearing overloads on power system equipment.
Characteristics of rule representation • Represent knowledge to guide the reasoning and thus reduce the search space for a solution • Rules are separated from its processing; knowledge base and the inference engine are split up • Inexact reasoning is possible with confidence degree associated (to be discussed in next lecture) • Rule base maintenance is, in general, easier owing to local modification by adding single rules
Forward chaining • Data-driven reasoning
Forward chaining • Forward chaining is a technique for gathering information and then inferring from it whatever can be inferred • Many rules may be executed that have nothing to do with the established goal • If our goal is to infer only one particular fact, the forward chaining inference technique would not be efficient
Backward chaining • Goal-driven reasoning
Backward chaining • If one begins with a hypothetical solution and then attempts to find facts to prove it, choose the backward chaining inference engine
Discussion • Rules vs. First-order definite clause • In rule: IF the season is autumn AND the sky is cloudy AND the forecast is drizzle THEN the advice is ‘take an umbrella’ • In First-order definite clause Autumn(Season) Cloudy(Sky) Drizzle(Forecast) Umbrella(Advice) • In First-order logic Autumn(Season) Cloudy(Sky) Drizzle(Forecast) →Umbrella(Advice)
Discussion • Rule inference • Modus ponens ├mp • {c1c2…cn→a, c1’c2’…cn’} ├mps(, a) • = Unify(c1c2…cn, c1’c2’…cn’) • ├mp is sound and complete on First-order definite clause (also Horn clause)