
- •CONTENTS
- •PREFACE
- •LIST OF FIGURES
- •INTRODUCTION
- •1.1 WHAT IS TIME?
- •1.2 SIMULATION
- •1.3 TESTING
- •1.4 VERIFICATION
- •1.6 USEFUL RESOURCES
- •2.1 SYMBOLIC LOGIC
- •2.1.1 Propositional Logic
- •2.1.2 Predicate Logic
- •2.2 AUTOMATA AND LANGUAGES
- •2.2.1 Languages and Their Representations
- •2.2.2 Finite Automata
- •2.3 HISTORICAL PERSPECTIVE AND RELATED WORK
- •2.4 SUMMARY
- •EXERCISES
- •3.1 DETERMINING COMPUTATION TIME
- •3.2 UNIPROCESSOR SCHEDULING
- •3.2.1 Scheduling Preemptable and Independent Tasks
- •3.2.2 Scheduling Nonpreemptable Tasks
- •3.2.3 Nonpreemptable Tasks with Precedence Constraints
- •3.2.5 Periodic Tasks with Critical Sections: Kernelized Monitor Model
- •3.3 MULTIPROCESSOR SCHEDULING
- •3.3.1 Schedule Representations
- •3.3.3 Scheduling Periodic Tasks
- •3.4 AVAILABLE SCHEDULING TOOLS
- •3.4.2 PerfoRMAx
- •3.4.3 TimeWiz
- •3.6 HISTORICAL PERSPECTIVE AND RELATED WORK
- •3.7 SUMMARY
- •EXERCISES
- •4.1 SYSTEM SPECIFICATION
- •4.2.1 Analysis Complexity
- •4.3 EXTENSIONS TO CTL
- •4.4 APPLICATIONS
- •4.4.1 Analysis Example
- •4.5 COMPLETE CTL MODEL CHECKER IN C
- •4.6 SYMBOLIC MODEL CHECKING
- •4.6.1 Binary Decision Diagrams
- •4.6.2 Symbolic Model Checker
- •4.7.1 Minimum and Maximum Delays
- •4.7.2 Minimum and Maximum Number of Condition Occurrences
- •4.8 AVAILABLE TOOLS
- •4.9 HISTORICAL PERSPECTIVE AND RELATED WORK
- •4.10 SUMMARY
- •EXERCISES
- •VISUAL FORMALISM, STATECHARTS, AND STATEMATE
- •5.1 STATECHARTS
- •5.1.1 Basic Statecharts Features
- •5.1.2 Semantics
- •5.4 STATEMATE
- •5.4.1 Forms Language
- •5.4.2 Information Retrieval and Documentation
- •5.4.3 Code Executions and Analysis
- •5.5 AVAILABLE TOOLS
- •5.6 HISTORICAL PERSPECTIVE AND RELATED WORK
- •5.7 SUMMARY
- •EXERCISES
- •6.1 SPECIFICATION AND SAFETY ASSERTIONS
- •6.4 RESTRICTED RTL FORMULAS
- •6.4.1 Graph Construction
- •6.5 CHECKING FOR UNSATISFIABILITY
- •6.6 EFFICIENT UNSATISFIABILITY CHECK
- •6.6.1 Analysis Complexity and Optimization
- •6.7.2 Timing Properties
- •6.7.3 Timing and Safety Analysis Using RTL
- •6.7.5 RTL Representation Converted to Presburger Arithmetic
- •6.7.6 Constraint Graph Analysis
- •6.8 MODECHART SPECIFICATION LANGUAGE
- •6.8.1 Modes
- •6.8.2 Transitions
- •6.9.1 System Computations
- •6.9.2 Computation Graph
- •6.9.3 Timing Properties
- •6.9.4 Minimum and Maximum Distance Between Endpoints
- •6.9.5 Exclusion and Inclusion of Endpoint and Interval
- •6.10 AVAILABLE TOOLS
- •6.11 HISTORICAL PERSPECTIVE AND RELATED WORK
- •6.12 SUMMARY
- •EXERCISES
- •7.1.1 Timed Executions
- •7.1.2 Timed Traces
- •7.1.3 Composition of Timed Automata
- •7.1.4 MMT Automata
- •7.1.6 Proving Time Bounds with Simulations
- •7.2.1 Untimed Traces
- •7.2.2 Timed Traces
- •7.3.1 Clock Regions
- •7.3.2 Region Automaton
- •7.4 AVAILABLE TOOLS
- •7.5 HISTORICAL PERSPECTIVE AND RELATED WORK
- •7.6 SUMMARY
- •EXERCISES
- •TIMED PETRI NETS
- •8.1 UNTIMED PETRI NETS
- •8.2 PETRI NETS WITH TIME EXTENSIONS
- •8.2.1 Timed Petri Nets
- •8.2.2 Time Petri Nets
- •8.3 TIME ER NETS
- •8.3.1 Strong and Weak Time Models
- •8.5.1 Determining Fireability of Transitions from Classes
- •8.5.2 Deriving Reachable Classes
- •8.6 MILANO GROUP’S APPROACH TO HLTPN ANALYSIS
- •8.6.1 Facilitating Analysis with TRIO
- •8.7 PRACTICALITY: AVAILABLE TOOLS
- •8.8 HISTORICAL PERSPECTIVE AND RELATED WORK
- •8.9 SUMMARY
- •EXERCISES
- •PROCESS ALGEBRA
- •9.1 UNTIMED PROCESS ALGEBRAS
- •9.2 MILNER’S CALCULUS OF COMMUNICATING SYSTEMS
- •9.2.1 Direct Equivalence of Behavior Programs
- •9.2.2 Congruence of Behavior Programs
- •9.2.3 Equivalence Relations: Bisimulation
- •9.3 TIMED PROCESS ALGEBRAS
- •9.4 ALGEBRA OF COMMUNICATING SHARED RESOURCES
- •9.4.1 Syntax of ACSR
- •9.4.2 Semantics of ACSR: Operational Rules
- •9.4.3 Example Airport Radar System
- •9.5 ANALYSIS AND VERIFICATION
- •9.5.1 Analysis Example
- •9.5.2 Using VERSA
- •9.5.3 Practicality
- •9.6 RELATIONSHIPS TO OTHER APPROACHES
- •9.7 AVAILABLE TOOLS
- •9.8 HISTORICAL PERSPECTIVE AND RELATED WORK
- •9.9 SUMMARY
- •EXERCISES
- •10.3.1 The Declaration Section
- •10.3.2 The CONST Declaration
- •10.3.3 The VAR Declaration
- •10.3.4 The INPUTVAR Declaration
- •10.3.5 The Initialization Section INIT and INPUT
- •10.3.6 The RULES Section
- •10.3.7 The Output Section
- •10.5.1 Analysis Example
- •10.6 THE ANALYSIS PROBLEM
- •10.6.1 Finite Domains
- •10.6.2 Special Form: Compatible Assignment to Constants,
- •10.6.3 The General Analysis Strategy
- •10.8 THE SYNTHESIS PROBLEM
- •10.8.1 Time Complexity of Scheduling Equational
- •10.8.2 The Method of Lagrange Multipliers for Solving the
- •10.9 SPECIFYING TERMINATION CONDITIONS IN ESTELLA
- •10.9.1 Overview of the Analysis Methodology
- •10.9.2 Facility for Specifying Behavioral Constraint Assertions
- •10.10 TWO INDUSTRIAL EXAMPLES
- •10.10.2 Specifying Assertions for Analyzing the FCE Expert System
- •Meta Rules of the Fuel Cell Expert System
- •10.11.1 General Analysis Algorithm
- •10.11.2 Selecting Independent Rule Sets
- •10.11.3 Checking Compatibility Conditions
- •10.12 QUANTITATIVE TIMING ANALYSIS ALGORITHMS
- •10.12.1 Overview
- •10.12.2 The Equational Logic Language
- •10.12.3 Mutual Exclusiveness and Compatibility
- •10.12.5 Program Execution and Response Time
- •10.12.8 Special Form A and Algorithm A
- •10.12.9 Special Form A
- •10.12.10 Special Form D and Algorithm D
- •10.12.11 The General Analysis Algorithm
- •10.12.12 Proofs
- •10.13 HISTORICAL PERSPECTIVE AND RELATED WORK
- •10.14 SUMMARY
- •EXERCISES
- •11.1 THE OPS5 LANGUAGE
- •11.1.1 Overview
- •11.1.2 The Rete Network
- •11.2.1 Static Analysis of Control Paths in OPS5
- •11.2.2 Termination Analysis
- •11.2.3 Timing Analysis
- •11.2.4 Static Analysis
- •11.2.5 WM Generation
- •11.2.6 Implementation and Experiment
- •11.3.1 Introduction
- •11.3.3 Response Time of OPS5 Systems
- •11.3.4 List of Symbols
- •11.3.5 Experimental Results
- •11.3.6 Removing Cycles with the Help of the Programmer
- •11.4 HISTORICAL PERSPECTIVE AND RELATED WORK
- •11.5 SUMMARY
- •EXERCISES
- •12.1 INTRODUCTION
- •12.2 BACKGROUND
- •12.3 BASIC DEFINITIONS
- •12.3.1 EQL Program
- •12.3.4 Derivation of Fixed Points
- •12.4 OPTIMIZATION ALGORITHM
- •12.5 EXPERIMENTAL EVALUATION
- •12.6 COMMENTS ON OPTIMIZATION METHODS
- •12.6.1 Qualitative Comparison of Optimization Methods
- •12.7 HISTORICAL PERSPECTIVE AND RELATED WORK
- •12.8 SUMMARY
- •EXERCISES
- •BIBLIOGRAPHY
- •INDEX

460 OPTIMIZATION OF RULE-BASED SYSTEMS
enabling condition of a rule increased from 15.6 to 58.8. Algorithms ES and ESM derived the graph with five vertices.
•For ISA4, the unoptimized rule-set is cycle-free and requires a maximum of five rules to be fired to reach a fixed point. A corresponding optimized set required a maximum of four rules to be fired. The average number of operations to evaluate an enabling condition increased from four to 24. While algorithm ESM derived a state space consisting of nine vertices, the one derived by ES used 14 vertices.
•In the case of ISA2 and ISA3, an optimal rule-set would still need a maximum of two rule firings to reach a fixed state, so no optimization of the original ruleset is required.
12.6 COMMENTS ON OPTIMIZATION METHODS
This section provides a qualitative comparison of the optimization methods, comments on the constraints over EQL language required by optimization algorithms, and considers the optimization of other real-time rule-based systems.
12.6.1 Qualitative Comparison of Optimization Methods
In the previous section we presented several techniques for the optimization of rulebased systems. They were all based on a bottom-up approach for derivation of an optimized state-space graph. All remove the unstable states and generate a state graph with only stable states. Potentially unstable states of the unoptimized program are transformed into stable states in the optimized system by removing the transitions that were responsible for cycles. Optimization alters the enabling condition part of rules, leaving the action part unchanged. Although these methods exhibit many similarities, they vary in complexity (execution time and required memory space) and in the optimization results they achieve.
Table 12.4 qualitatively compares the optimization methods. It shows the tradeoff between minimizing the number of rules to fire and minimizing the size of the state-space graphs. While BU and ES can guarantee minimization of rule firings, the number of vertices in the state-space graph generated by ESM is expected to be
TABLE 12.4 Optimization algorithms and their features
|
|
Optimization algorithm |
|
|
|
|
|
|
|
Features |
BU |
ES |
ESM |
ESMD |
|
|
|
|
|
Exploits equivalence of states |
no |
yes |
yes |
yes |
Exploits rule-firing concurrency |
no |
no |
yes |
yes |
Removes cycles and unstable states |
yes |
yes |
yes |
yes |
Stabilizes potentially unstable states |
yes |
yes |
yes |
yes |
Minimizes number of rules to fire |
yes |
yes |
no |
yes |
Generates deterministic transition system |
yes |
yes |
no |
yes |
|
|
|
|
|

COMMENTS ON OPTIMIZATION METHODS |
461 |
lower. ESMD minimizes the number of the rule firings, but as shown in the following discussion, does not perform well with respect to the state-space graph complexity minimization.
12.6.2On Constraints over EQL Language Required by Optimization Algorithms
To enable the use of the proposed optimization techniques, several constraints were imposed on EQL rule-based programs. First, a two-valued (Boolean) EQL(B) variant of the EQL language is used. In section 12.3.1 we showed that the conversion from multi-valued EQL program to corresponding two-valued EQL(B) is straightforward. EQL(B) rules are further constrained to use only constant assignments in the subactions (section 12.3.1). This simplifies the derivation of fixed points and is then implicitly used also in the conditions for rule-based decomposition (D1a), (D1b), and (D2), section 12.4.1) and for parallel rule firing (M1) and (M2), section 12.4.2). To use the proposed optimization technique also for EQL(B) programs with nonconstant assignments, a possible solution is to convert them to corresponding programs with constant assignments. Such a conversion is straightforward and we illustrate it through an example. Consider the following rule:
v1 := Exp1 ! v2 := Exp2 IF EC
where Exp1 and Exp2 are nonconstant expressions and EC is the enabling condition. This rule can be converted to its constant-assignment equivalent:
v1 |
:= |
TRUE |
! v2 |
:= TRUE |
|
|
IF |
Exp1 AND Exp2 AND EC |
|
[] v1 |
:= |
TRUE |
! v2 |
:= FALSE |
|
|
IF |
Exp1 AND (NOT Exp2) AND EC |
|
[] v1 |
:= |
FALSE ! v2 |
:= TRUE |
|
|
|
IF |
(NOT Exp1) AND Exp2 AND EC |
|
[] v1 |
:= |
FALSE ! v2 |
:= FALSE |
|
|
|
IF |
(NOT Exp1) AND (NOT Exp2) AND EC |
In general, for a rule with k nonconstant assignments, such a conversion would replace this rule with 2k new rules with constant assignments.
A different approach would be to allow EQL(B) programs to have nonconstant assignments, but to change the optimization algorithm to handle such cases as well. This would require a more sophisticated fixed point derivation algorithm, Derive FP2 (section 12.3.4). New constraints that would handle rules with nonconstant assignments for decomposition and parallel rule firing could then be adapted from existing ones used for analysis and parallelization of such rule-bases as described in [Cheng et al., 1993] and [Cheng, 1993b].
Several restrictions were imposed that influenced the generation of state-space graphs and defined which state may be merged in a single vertex and thus reduce the number of vertices in state-space graphs. Through experimental evaluation (section 12.5), we have shown that this restriction may still allow the construction of a reduced state-space graph of relatively low complexity.
462 OPTIMIZATION OF RULE-BASED SYSTEMS
12.6.3 Optimization of Other Real-Time Rule-Based Systems
The equational rule-based EQL language was initially developed to study the rulebased systems in a real-time environment. EQL’s simplicity is due to its use of zero-order logic. To increase the expressive power of such production language, a similar fixed-point interpretable Macro Rule–based language (MRL) that uses firstorder logic was derived from EQL [Wang, Mok, and Cheng, 1990]. Consequently, many algorithms for decomposition, response-time analysis, and parallelization of EQL (see [Cheng et al., 1993; Chen and Cheng, 1995b; Cheng, 1993b]) were then reimplemented for MRL [Wang and Mok, 1993]. It was shown that the expressive power of MRL and a popular production language, OPS5, is the same, and to enable the use of response-time analysis tools for OPS5, translation methods from OPS5 to MRL and vice versa were proposed [Wang, 1990c]. Furthermore, the analysis tools that originated from those of EQL and consequently from those of MRL were recently developed for OPS5 as well (see chapter 11).
The importance of the above-mentioned work for the generality of the methods proposed here is that the concepts used for decomposition, response-time analysis, and parallelization of EQL, most of which were adopted and used here, were then defined and used for MRL and OPS5 production systems. For example, the optimization of MRL might as well use state-space graphs that would be derived starting from the fixed points and would gradually be expanded to exclude the cycles. Again, a breadth-first search would optimize the response time of MRL assessed through the number of rules to fire to reach a fixed point. The main difficulty in implementing such optimization is due to different logics used in EQL and MRL: while EQL is zero-order-logic-based, MRL uses first-order logic. In other words, the major task of adapting the optimization methods used for EQL to those for MRL would be the reimplementation of symbolic manipulation routines that handle expressions (logical operators, minimization). This may be a difficult task, but once accomplished it would enable the development of proposed optimization methodology for MRL and for similar first-order-logic-based production languages.
12.7 HISTORICAL PERSPECTIVE AND RELATED WORK
The timing analysis problem is similar to that of protocol reachability analysis. Reachability analysis tries to generate and inspect all the states of a system that are reachable from a given set of initial states [Holzmann, 1991]. This top-down approach requires that either a set of initial states is given, or, as advocated by [Valmari and Jokela, 1989], the model of the environment is known from which the initial states are derived. Reachability analysis tools use algorithms such as hashing without collision, state-space hashing, and similar techniques to reduce the number of the states stored in the working memory. These methods are used only for analysis and limit their usability in synthesis and optimization because they generate only a part of the state-space graph. [Bouajjani, Fernandez, and Halbwachs, 1991; Bouajjani et al., 1992] presented a useful method to reduce the complexity of state-space graphs that is based on the identification of equivalent states. [Godefroid, Holzmann,
HISTORICAL PERSPECTIVE AND RELATED WORK |
463 |
and Pirottin, 1992] showed that most of the state explosion due to the modeling of concurrency can be avoided. They annotated the vertices of a state-space graph with sleep sets. If the rule that is enabled in a certain state is also in the sleep set of the same state, its firing would result in a state that was already checked in the earlier stage of the reachability analysis.
To overcome the prohibitive complexity of state-space graphs in the analysis problem, [Cheng et al., 1993] presented the static analysis method which determines if a program has a finite response time. They have identified several special forms of rules: if all rules belong to one of such forms, the program’s response time is finite. Recent work of [Chen and Cheng, 1995b] focused on the methods that extend this approach by further estimating the program’s response time in terms of the number of rules to fire to reach a fixed point.
[Cheng, 1993b] proposed an approach to decompose the rule-based system into independent rule-sets. This allows for independent analysis of each such rule-set. The overall response time is then derived from the response times of the independent rule-sets. A similar modular approach in the analysis and synthesis of rule-based systems is also advocated in [Browne et al., 1994].
A different approach to response-time optimization is to speed up the rule-based system by a parallel-rule execution. For example, [Kuo and Moldovan, 1991] proposed a parallel OPS5 rule firing model. They used a notion of context, which groups the rules that interfere with each other. Several contexts can be executed in parallel if they are mutually independent. [Cheng, 1993b] proposed a similar rule-firing model for EQL programs and further investigated the possibility of parallel firing of the rules that belong to the same context. In terms of the synthesis problem, a rule-base can be rewritten to increase the parallelism. [Pasik, 1992] introduced the constraint copies of so-called culprit rules, thus balancing the work performed in parallel and reducing the amount of work done sequentially. Culprit rules are rules that require substantially more computation time, which is due to their condition elements that require comparisons to many more working elements than other rules. While the culprit rules have a modified condition part, their action part is the same as that of the rules they are derived from. Another example of speeding up the execution of the production system is Ishida’s algorithm [Ishida, 1994], which enumerates possible joint structures for OPS-like systems and selects the best one.
Although Pasik and Ishida both addressed the execution time, their methods do not explicitly addressed problem of fulfillment of the timing constraints and do not estimate the upper bound of execution time. Increased parallelization and execution speedup as proposed above can thus be used to reduce the execution time, but does not give an adequate solution to synthesis and optimization problems for real-time systems as stated in [Browne, Cheng, and Mok, 1988]. [Zupan and Cheng, 1994a; Zupan and Cheng, 1994b] first propose the optimization techniques described here, which are refined and extended in [Zupan and Cheng, 1998].