Page 92 - DCAP305_PRINCIPLES_OF_SOFTWARE_ENGINEERING
P. 92

Principles of Software Engineering



                   Notes           This example illustrates two points. First, in a sophisticated rule-based system the elements
                                   of the simple rule-based system are elaborated in response to execution characteristics of
                                   the particular class of languages being interpreted. If the design is presented in this way,
                                   the original concept is retained to guide understanding and later maintenance. Second, as
                                   the design is elaborated, different components of the simple model can be elaborated with
                                   different idioms.


                                                 Figure 3: Simplified Sophisticated Rule-based System
                                                                                        Knowledge
                                                         Working                        Base
                                                         Memory
                                                                                   Rule Memory  Fact Memory
                                                                    Triggering
                                                         Multi-     data              Inactive  Inactive
                                                         dimensional         Activation/
                                        Inputs                              deactivation  rules  facts
                                                         working
                                                         memory                       Active    Active
                                                                                      rules     facts
                                    Outputs
                                                                                         Active rules
                                                                                          and facts
                                                        Data    Update
                                                                                                Rule and
                                                                                                fact
                                                                                                compiler

                                                                                                Rule
                                                                                           antecedent
                                                                                        subexpressions

                                                 Unfinished                                   Data-flow
                                                 actions                                      network
                                     Execution            Interpreter                         by partially
                                     stack      Next action                                   evaluated
                                                                                 Delete       rule activations
                                                                                 completed
                                                                                 activations
                                                              Selected                       Matching
                                                    Incomplete  action                     <rule, data>
                                                    procedures                                  pairs
                                                                   Prioritized
                                                                   activations         Candidate
                                     Control                                          <rule, data>  Rule and
                                     procedures           Scheduler           Agenda  activations  fact
                                                                                                compiler
                                                                                          Preferences
                                              Rule Interpreter                                  and
                                                                                            priorities
                                                                         Rule and data
                                                                         element                Metarules
                                                                         selection


                                   Note that the rule-based model is itself a design structure: it calls for a set of rules whose
                                   control relations are determined during execution by the state of the computation. A rule-
                                   based system provides a virtual machine a rule executor to support this model.
                                   Questions
                                   1. What is sophisticated rule-based system?

                                   2. Explain the simplified sophisticated rule-based system.



        86                                LOVELY PROFESSIONAL UNIVERSITY
   87   88   89   90   91   92   93   94   95   96   97