
- •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
CHECKING FOR UNSATISFIABILITY |
155 |
Rewriting the formula in clausal form yields the following three clauses:
f (T ) + 45 ≤ h(U )
h(U ) − 59 ≤ f (T ) (which is equivalent to h(U ) < f (T ) + 60)
h(U ) + 1 ≤ g2(T ) g2(T ) + 46 ≤ h(U )
Next we construct the constraint graph corresponding to the formulas in clausal form.
6.4.1 Graph Construction
For each literal v1 ± I ≤ v2, we construct a node labeled v1, a node labeled v2, and an edge v1, v2 with weight ± I from node v1 to node v2. The outline of the algorithm [Jahanian and Mok, 1987] to construct the constraint graph is as follows.
Algorithm Build Graph: Initially, the graph G is empty.
For each clause Ci , for each literal in Ci : v1 ± I ≤ v2:
1.Find the cluster with the function symbol of term v1. If not found, create a new cluster.
2.Search the cluster found or created in step 1 for a node labeled vi . If not found, add the node labeled v1 to the cluster. (Note that if the cluster has just been created in step 1, the search is not necessary as the cluster is empty.)
3.Repeat steps 1 and 2 for the term v2.
4.Create a directed edge v1, v2 with weight ± I from node v1 to node v2.
Figure 6.1 shows the construction of the constraint graph corresponding to the above example specification and negation of the safety assertion.
6.5 CHECKING FOR UNSATISFIABILITY
We can use the constructed constraint graph G representing F to determine whether F is unsatisfiable by identifying cycles with positive weights in G. To do so, we first define unification and then redefine the concepts of a path and a cycle for this type of graph.
Unification: We say there is a unification of vi and v i if a substitution S (which replaces a term by another term) exists such that vi S = v i S where vi S and v i S denote the terms after applying S to vi and v i , respectively.
Chapter 2 contains a discussion of unification as well as related concepts, and provides examples.

156 REAL-TIME LOGIC, GRAPH-THEORETIC ANALYSIS, AND MODECHART
0
a. f(x) g1(x)
30
0
b. f(x) g1(x) g2(x)
30
c. |
f(x) |
0 |
g1(x) |
15 |
g2(x) |
|
|
||||
|
|
|
30 |
|
|
d. |
f(x) |
0 |
g1(x) |
15 |
g2(x) |
|
|
||||
|
f(T) |
|
|
|
|
45
h(U)
30
e. |
f(x) |
0 |
g1(x) |
15 |
g2(x) |
|
|
||||
|
f(T) |
|
-59 |
|
|
45
h(U)
30
f. |
f(x) |
0 |
g1(x) |
15 |
g2(x) |
|
|
||||
|
f(T) |
|
-59 |
46 |
g2(T) |
|
|
45 |
|
|
1 |
|
|
|
h(U) |
|
|
Figure 6.1 Constructing the constraint graph corresponding to example.
EFFICIENT UNSATISFIABILITY CHECK |
157 |
Path: We say there is a path from node v0 to node vn in a graph G if there is a sequence of edges v0, v1 , v 1, v2 , v 2, v3 , . . . , v n−2, vn−1 , v n−1, vn and a substitution S such that there is pairwise unification of vi and v i for all 1 ≤ i < n. Note that each pair of vi and v i , 1 ≤ i < n − 1, must be either the same or in the same cluster.
Cycle: A cycle exists in a graph G if there is a sequence of edges v0, v1 , v 1, v2 ,v 2, v3 , . . . , v n−2, vn−1 , v n−1, vn and a substitution S such that there is a path from v0 to vn , and v0 and vn can be unified with the substitution S. Again, note that v0 and vn must be either the same or in the same cluster. The weight of a path or cycle is defined as the sum of the weights of the edges in the path or cycle.
Now we are ready to show that if there is a cycle with positive weight in the graph G corresponding to formula F , then the formula consisting of the conjunction of literals (inequalities) corresponding to the edges in the cycle is unsatisfiable. We apply the substitution S to each inequality Li in the cycle.
v0S + I0 ≤ v1S
v 1S + I1 ≤ v2S
v 2S + I2 ≤ v3S
.
.
.
v n−1S + In−1 ≤ vn S
Then we add these inequalities, yielding
I0 + I1 + · · · + In−1 ≤ 0,
which is clearly unsatisfiable, meaning that the original RTL inequalities corresponding to these edges are unsatisfiable.
6.6 EFFICIENT UNSATISFIABILITY CHECK
We have shown that if every edge in a positive cycle corresponds to a literal that belongs to a unit clause, then the formula F must be unsatisfiable, and hence the safety assertion SA is derivable from the specification SP. However, if an edge in the cycle corresponds to a literal that belongs to a non-unit clause, then we have to show that each of the remaining literals in this clause corresponds to an edge in a different positive cycle. The intuitive reason behind this is that the clause is disjunctive. Therefore, to show that the entire clause is unsatisfiable (false), each of its disjuncts must be shown to be unsatisfiable (false). In our example, the negation
158 REAL-TIME LOGIC, GRAPH-THEORETIC ANALYSIS, AND MODECHART
of the safety assertion contains the clause
h(U ) + 1 ≤ g2(T ) g2(T ) + 46 ≤ h(U ).
If an edge in a positive cycle that corresponds to h(U ) + 1 ≤ g2(T ) is identified, then we also have to show that another positive cycle exists with an edge corresponding to the second literal g2(T ) + 46 ≤ h(U ).
Obviously, as the number of edges in positive cycles that correspond to literals belonging to non-unit clauses increases, the number of different positive cycles that must be identified increases combinatorially. In fact, the problem of determining the unsatisfiability of F is NP-complete. Considering the difficulty of the problem, a more efficient, but still exponential-run-time, algorithm is developed in [Jahanian and Mok, 1987] to check for unsatisfiability.
The algorithm makes use of the following observations. Recall that the formula F is a conjunction of n clauses
C1 C2 · · · Cn , where each Ck is a disjunctive clause
Lk,1 Lk,2 · · · Lk,mk .
Note that the literals in different clauses need not be distinct. We use the following notations to denote the inequalities corresponding to the edges in the ith positive cycle found:
Xi,1, Xi,2, . . . , Xi,ni ,
where Xi, j is the literal corresponding to the jth edge in the ith positive cycle found, and each Xi, j is in at least one of the Ck s. Suppose
Pi = Xi,1 Xi,2 · · · Xi,ni .
We know from the above discussion that Pi is unsatisfiable. Therefore, F is satisfiable iff F ¬Pi is satisfiable. As a result, the existence of the positive cycle is equivalent to adding the clause
¬Pi = ¬Xi,1 ¬Xi,2 · · · ¬Xi,ni
to F , making it possible to use ¬Pi to show that F is unsatisfiable.
Example. We use capital letters to denote the literals in the set S1 of clauses of F :
A= f (x) ≤ g1(x)
B= g2(x) − 30 ≤ f (x)
C = g1(y) + 15 ≤ g2(y)

EFFICIENT UNSATISFIABILITY CHECK |
159 |
D= f (T ) + 45 ≤ h(U )
E= h(U ) − 59 ≤ f (T )
F G = h(U ) + 1 ≤ g2(T ) g2(T ) + 46 ≤ h(U ).
Each clause in the following set S2 of clauses corresponds to a positive cycle found:
¬F ¬G
¬B ¬D ¬F
¬A ¬C ¬G ¬E.
The unsatisfiability check algorithm builds a search tree using the clauses in set S2, and while doing so, determines the unsatisfiability of the clauses in sets S1 and S2. Each new level in the tree is the result of examining a new clause in S2 corresponding to a new positive cycle found. Each node in the tree is either one literal in a clause of S2 or the conjunction of literals in different clauses of S2. In our example, the nodes in the first level correspond to literals in the first clause of S2, that
F
B
F
F
D
F
G
B
G
G
D
G
F
F
B
A
F
B
C
F
B
G
F
B
E
F
D
A
F
D
C
F
D
G
F
D
E
F
A
F
C
F
G
F
E
G
B
A
G
B
C
G
B
G
G
B
E
G
D
A
G
D
C
G
D
G
G
D
E
G
F
A
G
F
C
G
F
G
F
E
Figure 6.2 Worst-case search tree for example.