Rule based architecture Rule sse Interpreter rule Match antecedents Programs: Knowledge is lost within the control structures Rule-based Architectures: Separate knowledge and control Knowledge: rules assertions Control: rule interpreter Rule based architecture Rule Pick consequent Interpreter rule Match antecedents Programs: Knowledge is lost within the control structures .Rule- based Architectures: Separate knowledge and control Knowledge: rules& assertions Control: rule interpreter
6 Rule Based Architecture Assertions Rules Rule Interpreter Match antecedents Pick rule • Programs: Knowledge is lost within the control structures •Rule-based Architectures: Separate knowledge and control • Knowledge: rules & assertions • Control: rule interpreter Rule Based Architecture Assertions Rules Rule Interpreter Match antecedents Add consequent Pick rule • Programs: Knowledge is lost within the control structures •Rule-based Architectures: Separate knowledge and control • Knowledge: rules & assertions • Control: rule interpreter
Rule based architecture Conflict resolution strategy Assertions consequent Interpreter rule Match antecedents Programs: Knowledge is lost within the control structures Rule-based Architectures: Separate knowledge and control Knowledge: rules assertions Control: rule interpreter conflict resolution strategy Rule Based Systems Big idea: Separation of Knowledge and Control Rules Forward Rule Systems Forward chair Production rules Goal-directed Rule Systems
7 Rule Based Architecture Assertions Rules Rule Interpreter Match antecedents Add consequent Pick rule • Programs: Knowledge is lost within the control structures •Rule-based Architectures: Separate knowledge and control • Knowledge: rules & assertions • Control: rule interpreter & conflict resolution strategy Conflict Resolution Strategy Rule Based Systems • Big idea: Separation of Knowledge and Control • Rules • Forward Rule Systems • Forward chaining • Production rules • Goal-directed Rule Systems
Rule Interpreter(forward chaining) Identify triggered rules, creating rule instances Choose one rule instance(called conflict resolution) Fire the chosen rule instance Terminate when no triggered rules or special stop assertion Rule Interpreter(forward chaining) Identify triggered rules, creating rule instances triggered rule antecedents in assertions database rule instance: rule with variables filled in
8 Rule Interpreter (forward chaining) • Identify triggered rules, creating rule instances • triggered rule: – antecedents in assertions database – can change the database (e.g. add new assertion) • rule instance: rule with variables filled in • Choose one rule instance (called conflict resolution) • Conflict resolution strategies, e.g. first instance, random instance, most specific instance, etc. • Fire the chosen rule instance • Firing a rule instance means performing the actions indicated by the rule (e.g. adding a new assertion) • Terminate when no triggered rules or special stop assertion Rule Interpreter (forward chaining) • Identify triggered rules, creating rule instances • triggered rule: – antecedents in assertions database – can change the database (e.g. add new assertion) • rule instance: rule with variables filled in • Choose one rule instance (called conflict resolution) • Conflict resolution strategies, e.g. first instance, random instance, most specific instance, etc. • Fire the chosen rule instance • Firing a rule instance means performing the actions indicated by the rule (e.g. adding a new assertion) • Terminate when no triggered rules or special stop assertion
Rule Interpreter(forward chaining Identify triggered rules, creating rule instances antecedents in assertions database rule instance: rule with variables filled in Choose one rule instance(called conflict resolution) Conflict resolution strategies e.g. first instance, random instance, etc Rule Interpreter(forward chaining) Identify triggered rules, creating rule instances triggered rule antecedents in assertions database rule instance: rule with variables filled in Choose one rule instance(called conflict resolution) Conflict resolution strategies e.g. first instance, random instance, etc Fire the chosen rule instance Firing a rule instance means performing the actions ndicated by the rule (e.g. adding a new assertion)
9 Rule Interpreter (forward chaining) • Identify triggered rules, creating rule instances • triggered rule: – antecedents in assertions database – can change the database (e.g. add new assertion) • rule instance: rule with variables filled in • Choose one rule instance (called conflict resolution) • Conflict resolution strategies e.g. first instance, random instance, etc. • Fire the chosen rule instance • Firing a rule instance means performing the actions indicated by the rule (e.g. adding a new assertion) • Terminate when no triggered rules or special stop assertion Rule Interpreter (forward chaining) • Identify triggered rules, creating rule instances • triggered rule: – antecedents in assertions database – can change the database (e.g. add new assertion) • rule instance: rule with variables filled in • Choose one rule instance (called conflict resolution) • Conflict resolution strategies e.g. first instance, random instance, etc. • Fire the chosen rule instance • Firing a rule instance means performing the actions indicated by the rule – (e.g. adding a new assertion) • Terminate when no triggered rules or special stop assertion
Rule Interpreter(forward chaining Identify triggered rules, creating rule instances triggered rule antecedents in assertions database can change the database(e.g. add new assertion) rule instance: rule with variables filled in Choose one rule instance(called conflict resolution) Conflict resolution strategies e.g. first instance, random instance Fire the chosen rule instance Firing a rule instance means performing the actions ndicated by the rule (e.g. adding a new assertion) Terminate when no triggered rules or special stop assertion Forward chaining-strep throat (using rule order for conflict resolution) 1:主f hroat infec)) ococcus) then (sages tthat at infec) R4: if R2: if stain gram-pos) red throat then (signs (throat infec)) morph chain Asserti。ns: (sore throat (。 rg stain gram-pos) org morph coccus)
10 Rule Interpreter (forward chaining) • Identify triggered rules, creating rule instances • triggered rule: – antecedents in assertions database – can change the database (e.g. add new assertion) • rule instance: rule with variables filled in • Choose one rule instance (called conflict resolution) • Conflict resolution strategies e.g. first instance, random instance, etc. • Fire the chosen rule instance • Firing a rule instance means performing the actions indicated by the rule – (e.g. adding a new assertion) • Terminate when no triggered rules or special stop assertion Forward chaining - strep throat (using rule order for conflict resolution) R1: if (signs (throat infec)) (org streptococcus) then (strep throat) R2: if (red throat) then (signs (throat infec)) R3: if (sore throat) then (signs (throat infec)) R4: if (org stain gram-pos) (org morph coccus) (org growth chains) then (org streptococcus) Assertions: (sore throat) (org stain gram-pos) (org morph coccus) (org growth chains)