\begin{slide*} \heading{Chapter Overview} \centerline{Rule-Based Reasoning with {\CLIPS}} \begin{description} \item[Introduction] \ \\ Review Lessons "Rule-Based Reasoning", "{\CLIPS}" \item[Forward Reasoning] \ \\ Example: Flood Warning Example: Boxer \item[Rete Algorithm] \ \\ Example: Cats and Dogs \item[Backward Reasoning] \ \\ Example: Dinner Choices Example: Baseball \item[Chapter Review] \ \\ \end{description} \closing{} \end{slide*} %% insert review slides "Rule-Based Reasoning", "{\CLIPS}" %% \begin{slide*} \heading{Forward Reasoning} from data towards conclusions \begin{description} \item[matching] known facts are compared with the premises of rules \\ if all premises of a rule are true, it is satisfied \item[conflict resolution] if multiple rules are satisfied, one must be selected \item[execution] the selected rule is applied \\ new facts or rules can be generated \item[usage] need for quick response, few facts, few rules many acceptable conclusions \item[domains] monitoring and real-time process control, synthesis; design, configuration, planning, scheduling \end{description} \closing{} \end{slide*} Example: Flood Evacuation {\GD} p. 113-119 \begin{slide*} \heading{Flood Evacuation} example forward reasoning \begin{description} \item[problem] \ \\ flood warning and evacuation system for a flood-prone region \item[problem analysis] \ \\[-3ex] \begin{itemize} \item relatively small number of parameters and rules \item relations known prior to execution \item data acquisition automatically from sensors \item continuous monitoring required \end{itemize} \item[design decisions] \ \\[-3ex] \begin{itemize} \item forward reasoning \item confidence factors \item inference network \end{itemize} \item[internal representation] \ \\[-3ex] \begin{itemize} \item {\em rules:} rule number, parameters in the premises (upstream elements), parameters in the conclusions (downstream elements), premises, conclusions \item {\em parameters:} name, rules that modify the parameter, rules using the parameter, values and confidence factor (if known) \item {\em input data:} list of parameters used as inputs \item {\em conclusions:} output parameters \end{itemize} \end{description} \closing{} \end{slide*} \slideGD{ Figures 5.1, Flood Warning Knowledge Base 5.2, Flood Warning Inference Network, 5.3, Forward-Reasoning Inference Network} \begin{slide*} \heading{{\sc Boxer}} example forward reasoning \begin{description} \item[problem] \ \\ system for arranging things to be packed into boxes \item[problem analysis] \ \\[-3ex] \begin{itemize} \item relatively small number of parameters and rules \item not all relations known prior to execution \item synthesis problem: many possible solutions \item no optimal solution required \item pattern matching required for properties of objects \end{itemize} \item[design decisions] \ \\[-3ex] \begin{itemize} \item forward reasoning \item pattern matching system \item conflict resolution \\ 1) larger number of instantiated premises first \\ 2) ordering of input data \item grouping of rules, reflects overall packing strategy \item some simplifying assumptions \end{itemize} \end{description} \closing{} \end{slide*} \slideGD{ Figures 5.4, Boxer packing list, rule base 5.5, items to be packed 5.3 - 5.11, database in several stages} \begin{slide*} \heading{Pattern Matching} efficiency considerations \begin{description} \item[problem] \ \\ pattern matching can be extremely inefficient: all rules are compared with all the facts in every cycle \\ rules * facts$^{premises}$ \item[observation] \ \\ most of these comparisons are not necessary in each step, only for changes in the fact base \item[solution] \ \\ keep a list of satisfied rules \\ modify it only when changes occur due to addition or deletion of facts \end{description} \closing{} \end{slide*} \begin{slide*} \heading{Rete Algorithm} efficient pattern matching \begin{description} \item[basic idea] \ \\ keep track of satisfied rules \\ updates according to changes in the fact base \item[pattern network] \ \\ set of trees from all premises of all rules \item[join network] \ \\ connects leaf nodes of the trees that share variables \\ checks consistency of variable bindings \item[changed facts] \ \\ modify the corresponding entries in the pattern and join network \end{description} \closing{} \end{slide*} see also {\GR} pp. 513 - 522 \begin{slide*} \heading{Conflict Resolution} selecting the next rule \begin{description} \item[number of rules] to be executed in one cycle\ \\ usually one, but several is possible (parallel execution) \item[order of rules] \ \\ lowest number, \\ lowest number after current rule, \\ lowest numbered rule deriving a new fact, \ldots \item[rule complexity] e.g.~number of premises\ \\ most complex (specific) rule first, or most generic (simplest) rule first \item[order of facts] \ \\ lowest / highest number, \\ oldest / newest, \ldots \end{description} \closing{in practice combinations of the above criteria are used} \end{slide*} \begin{slide*} \heading{Backward Reasoning} \begin{description} \item[goal selection] \ \\ take one goal and determine all rules capable of satisfying that goal \\ consequents of the rules must match the goal \item[matching] \ \\ check applicable rules; if all premises are satisfied, a rule can be executed, and the goal is solved; \\ otherwise, new subgoals are created, or the user may provide inputs \item[usage] \ \\ unknown response time, possibly many facts, many rules few acceptable conclusions \item[domains] \ \\ classification, diagnosis; \\ inference networks for static knowledge, otherwise pattern matching \end{description} \closing{} \end{slide*} \begin{slide*} \heading{Example: Dinner Choices} example backward reasoning \begin{description} \item[problem] \ \\ select beverage and main course for a meal \item[problem analysis] \ \\[-3ex] \begin{itemize} \item small number of parameters and rules \item relations known prior to execution \item inputs provided by the user upon request \item planning problem, few possible solutions \item no pattern matching necessary \end{itemize} \item[design decisions] \ \\[-3ex] \begin{itemize} \item backward reasoning \item inference network \end{itemize} \end{description} \closing{If all inputs are provided in advance, forward reasoning can be applied} \end{slide*} Evaluation example {\GD} p. 138-142 \begin{verbatim} Goal Stack rule candidates selected premises known facts drink 3, 4, 5, 12 3 wine-type dinner \end{verbatim} \begin{slide*} \heading{Chapter Review} \centerline{Rule-Based Reasoning with {\CLIPS}} \begin{description} \item[Introduction] \ \\ Review Lessons "Rule-Based Reasoning", "{\CLIPS}" \item[Forward Reasoning] \ \\ Example: Flood Warning Example: Boxer \item[Rete Algorithm] \ \\ Example: Cats and Dogs \item[Backward Reasoning] \ \\ Example: Dinner Choices Example: Baseball \end{description} \closing{} \end{slide*}