
- •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
294 DESIGN AND ANALYSIS OF PROPOSITIONAL-LOGIC RULE-BASED SYSTEMS
[]v63a28 := true IF ((v63a22 = false) AND
(v63a12 = true) OR ((v63a12 = false) AND (v63a13 = true)) AND (v63a12 = true) AND (v63a11 = false) AND (v63a8 = false) AND (v63a5 = false) AND (v63a3 = false) AND (v63a1c = true)) OR ((v63a26 = true) AND (((v63a23 = true) AND (v63a1b = true)) OR (v63b7 = true)))
[]v63a30 := true IF (((v63a1b = true) AND (v63a23 = true)) OR (v63b7 = true)) AND (v63a26 = false) AND (v63a29 = true)
[]v63a33 := true IF (v63a32 = false) AND (v63a31 = true) AND (v63a29 = false) AND (v63a26 = false) AND (v63a23 = true) AND (v63a1b = true)
[]v63a35 := true IF (v63a32 = true) AND (v63a31 = true) AND (v63a29 = true) AND (v63a26 = false) AND (v63a23 = true) AND (v63a1b = true)
[]v63a36 := true IF (v63a34b = true) AND (v63a31 = false) AND
(v63a29 = false) AND (v63a26 = false) AND (v63a23 = true) AND (v63a1b = true)
[]v63a37 := true IF ((((v63a1b = true) AND (v63a23 = true)) OR (v63b7 = true)) AND (v63a26 = false) AND (v63a29 = true)) AND
((v63a32 = false) AND (v63a31 = true) AND (v63a29 = false) AND (v63a26 = false) AND (v63a23 = true) AND (v63a1b = true)) AND ((v63a32 = true) AND (v63a31 = true) AND (v63a29 = true) AND (v63a26 = false) AND (v63a23 = true) AND (v63a1b = true)) AND ((v63a34a = true) AND (v63a31 = false) AND (v63a29 = false) AND (v63a26 = false) AND (v63a23 = true) AND (v63a1b = true))
[]v63a38 := true IF ((v63a34a = true) AND (v63a31 = false) AND
(v63a29 = false) AND (v63a26 = false) AND (v63a23 = true) AND (v63a1b = true))
[]v63a39 := true IF (v63a34b = true) AND (v63a31 = false) AND
(v63a29 = false) AND (v63a26 = false) AND (v63a23 = true) AND (v63a1b = true)
TRACE
v63a2, v63a4, v63a6, v63a7, v63a9, v63a10, v63a14, v63a15, v63a18, v63a19, v63a20, v63a21, v63a24, v63a25, v63a27, v63a28, v63a30, v63a33, v63a35, v63a36, v63a37, v63a38, v63a39
v63a2, v63a4, v63a6, v63a7, v63a9, v63a10, v63a14, v63a15, v63a18, v63a19, v63a20, v63a21, v63a24, v63a25, v63a27, v63a28, v63a30, v63a33, v63a35, v63a36, v63a37, v63a38, v63a39
END.
10.8 THE SYNTHESIS PROBLEM
The following definition is needed to formalize the synthesis problem. We say that an equational rule-based program P2 is an extension of a program P1 iff the following conditions hold: (1) The variables of P1 are a subset of those of P2; (2) P1 has the same launch states as the projection of the state space of P2 onto that of P1; that is, if P2 has more variables than P1, we consider only those variables in P2 that are

THE SYNTHESIS PROBLEM |
295 |
also in P1; (3) The launch states of P1 and the corresponding ones in P2 have the same end points. Notice that we do not require the state-space graph of P1 to be the same as the corresponding graph of P2; for example, the paths from launch states to their end points may be shorter in P2. The synthesis problem is: Given an equational rule-based program P that always reaches a safe fixed point in finite time but is not fast enough to meet the timing constraints under a fair scheduler, determine whether an extension of P exists that meets both the timing and integrity constraints under some scheduler.
For programs in which all variables have finite domains, we can in principle compute all the end points for each launch state since the state-space graph is finite. We can create a new program from the given program as follows. The new program has the same variables as the given program. Suppose s is a launch state and s is an end point of s. We create a rule r that is enabled iff the program is in s and firing r will result in the program being in s ; i.e., the enabling condition of r is to match the values of the variables in s, and the multiple assignment statement of r assigns to the variables the corresponding values of those in s . By this construction, the new program will always reach a fixed point in one iteration. Thus in theory, a solution always exists for the synthesis problem in the case of finite variables. This solution is very expensive in terms of memory since there are at least as many rules as there are launch states, even though some optimization can be performed to minimize the number of rules by exploiting techniques similar to those used in programmable logic array optimization. However, we still have to compute the end points for each launch state, and this can be computationally expensive.
We would like to find solutions to the synthesis problem without having to check the entire state space of a program. Two general approaches have been identified:
1.transforming the given equational rule-based program by adding, deleting, and/or modifying rules, and
2.optimizing the scheduler to select the rules to fire such that a fixed point is always reached within the response-time constraint. This assumes that at least one sufficiently short path exists from a launch state to every one of its end points.
We shall illustrate both approaches with the program in example 1, which is reproduced below.
Example 7
initially: object detected = false, sensor a status, sensor b status = good input: read(sensor a, sensor b, sensor c)
1.object detected := true IF sensor a = 1 AND sensor a status = good
2.[] object detected := true IF sensor b = 1 AND sensor b status = good
3.[] object detected := false IF sensor a = 0 AND sensor a status = good
4.[] object detected := false IF sensor b = 0 AND sensor b status = good

296 DESIGN AND ANALYSIS OF PROPOSITIONAL-LOGIC RULE-BASED SYSTEMS
5.[] sensor a status := bad IF sensor a = sensor c AND sensor b status = good
6.[] sensor b status := bad IF sensor b = sensor c AND sensor a status = good
In this program, the variables sensor a status and sensor b status are initially set to good, and the variable object detected is initially set to false. At the beginning of each invocation, the sensor values are read into the variables sensor a, sensor b, sensor c. Note that if sensor a and sensor b read in values 1 and 0, respectively, rule 1 and rule 4 may fire alternatively for an unbounded number of times before either rule 5 or rule 6 is fired. Similarly, if sensor a and sensor b read in values 0 and 1, respectively, rule 2 and rule 3 may fire alternatively for an unbounded number of times before either rule 5 or rule 6 is fired. In this case, sensor c can be used to arbitrate between rules 1 and 4, or rules 2 and 3 by firing rule 5 or 6. (However, notice that only one of rules 5 and 6 may fire in each invocation; we do not want sensor c to override both sensor a and sensor b.) This program will reach a fixed point in finite time since fairness guarantees that rule 5 or rule 6 will eventually be fired.
In approach (1), we ensure that this program will reach a fixed point in a bounded number of iterations starting from any launch state by performing the appropriate program transformation. First, we detect those rules that may constitute a cyclic firing sequence. In this program, the alternate firings of rule 1 and rule 4, or rule 2 and rule 3, may constitute a cyclic firing sequence. Noting that the firing of either rule 5 or rule 6 may disable two of rules 1–4, we add a rule (rule 7) and some additional conditions to enforce the firing of either rule 5 or rule 6 first if a conflict exists between the values read into sensor a and sensor b, thus breaking the cycle. The transformed program, which is always guaranteed to reach a fixed point in a bounded number of iterations, is shown below.
initially: object detected = false, sensor a status, sensor b status = good invoke: conflict := true
input: read(sensor a, sensor b, sensor c)
1.object detected := true IF sensor a = 1 AND sensor a status = good AND
conflict = false
2. [] object detected := true IF sensor b = 1 AND sensor b status = good AND conflict = false
3. [] object detected := false IF sensor a = 0 AND sensor a status = good AND conflict = false
4. [] object detected := false IF sensor b = 0 AND sensor b status = good AND conflict = false
5.[] sensor a status := bad IF sensor a = sensor c AND sensor b status = good
6.[] sensor b status := bad IF sensor b = sensor c AND sensor a status = good
7.[] conflict := false IF sensor a = sensor b OR sensor a status = bad OR
sensor b status = bad
In this program, the variable conflict is always set to true by the invoke command of EQL, which is executed at the beginning of each invocation.
THE SYNTHESIS PROBLEM |
297 |
In approach (2), we customize an optimal scheduler that always selects the shortest path to any end point from a launch state. For the program in the example, this can be achieved by a fixed-priority scheduler which assigns a higher priority to rules 5 and 6; that is, if rule 5 or rule 6 is enabled, it is always fired before rules 1–4.
It should be emphasized that the two approaches for solving the synthesis problem are not in general polynomial time. Determining whether a scheduler exists that meets a response-time constraint is NP-hard, as we shall show in the next section.
10.8.1Time Complexity of Scheduling Equational Rule-Based Programs
Consider the following equational rule-based program:
initially: R = 0, t1 = t2 = · · · = tn = 0
input: read (C)
1.R := R + q1(t¯)!t1 := t1 + 1 IF R < C
2.[] R := R + q2(t¯)!t2 := t2 + 1 IF R < C
.
.
.
n. [] R := R + qn (t¯)!tn := tn + 1 IF R < C
In the above program, t¯ is the vector t1, t2, . . . , tn . We can think of the variable R, which is initially 0, as the accumulated reward for firing the rules, and ti as the number of times rule i has been fired, which is initially 0 for all n rules. The function qi (t¯) gives the additional reward that can be obtained by firing rule i one more time. All the qi (t¯)s are monotonically nondecreasing functions of t¯, so the program may reach a fixed point in finite time, assuming that some qi s return positive values.
The time-budgeting problem is to decide whether the above program can increase R from 0 to ≥ C in T iterations, for some given T . The time-budgeting problem arises when an output must be computed within a response-time constraint of T by a real-time decision system that is composed of n subsystems. To compute the output, the decision system must invoke a number of subsystems Si , i = 1, . . . , n, each of which computes a partial output. The quality qi of each partial output is dependent on the time ti allocated to the subsystem Si , and the overall quality of the output depends on some function of the quality of the partial outputs. Given a fixed time period T , the objective of the time-budgeting problem is to maximize the overall quality R = q1 + · · · + qn by determining an optimal partition of T into n time slices, where each time slice ti , i = 1, . . . , n corresponds to the time allocated to subsystem Si .
Referring to the EQL program above, it is obvious that the time-budgeting problem is in NP since a nondeterministic algorithm can guess the number of times each