
- •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
HISTORICAL PERSPECTIVE AND RELATED WORK |
37 |
2.3 HISTORICAL PERSPECTIVE AND RELATED WORK
For three centuries, mathematicians and philosophers have attempted to develop a general decision procedure for verifying the validity or inconsistency of a logic formula. Leibniz (1646–1716) [Davis, 1983], the co-inventor of Calculus, first tried to develop such a procedure. Then in the 1900s Peano [Peano, 1889] and in the 1920s Hilbert’s group [Hilbert, 1927] again studied the problem and tried unsuccessfully to find a decision procedure. Finally, in 1936 Church [Church, 1936] and Turing [Turing, 1936] independently proved that the problem of determining the validity of first-order logic formulas is undecidable; that is, no general decision procedure for this problem exists.
Turing invented the Turing machine [Turing, 1936] in 1936 to formalize the notion of an algorithm to investigate whether the above satisfiability problem in first-order logic is solvable or not. Turing’s machine has one two-way infinite tape and one head. In the same year, Post independently conceived a similar model [Post, 1936]. Mealy in 1955 [Mealy, 1955] and Moore in 1956 [Moore, 1956] were among the first to develop finite automata, also called Mealy and Moore machines, as simplifications of the Turing machine. Also in 1956, Kleene [Kleene, 1956] demonstrated that finite automata accept regular languages. Oettinger [Oettinger, 1961] introduced the pushdown automaton as another simplification of the Turing machine.
In 1930, Herbrand [Herbrand, 1930] proposed an algorithm to find an interpretation that can make a specific first-order logic formula false. A valid formula is by definition true under all interpretations. If the formula to be checked is valid, then Herbrand’s algorithm will not find a falsifying interpretation and terminate in a finite number of steps. His algorithm was the first step toward automatic proof procedures or mechanical theorem proving.
In 1960, Gilmore [Gilmore, 1960] implemented Herbrand’s algorithm on a computer to determine whether the negation of a formula is unsatisfiable or inconsistent. This was proof by contradiction since a formula is valid iff its negation is inconsistent. His program turned out to be quite inefficient for proving most formulas. Davis and Putnam [Davis and Putnam, 1960] improved Gilmore’s computer implementation but their method still was not practical for many formulas. Robinson [Robinson, 1965] made it possible to efficiently perform mechanical theorem proving by introducing the resolution principle.
Several refinements of resolution were introduced in the following years. Slagle [Slagle, 1967] proposed semantic resolution, which unifies hyper-resolution, renamable resolution, and the set-of-support strategy. Boyer [Boyer, 1971] introduced a very efficient lock resolution. Loveland [Loveland, 1970] and Luckham [Luckham, 1970] independently developed linear resolution. Chang [Chang, 1970] showed that a special case of linear resolution called input resolution is equivalent to unit resolution.
Chang and Lee’s textbook [Chang and Lee, 1973] is an excellent introduction to symbolic logic (propositional and predicate) and mechanical theorem proving. Hopcroft and Ullman’s textbook [Hopcroft and Ullman, 1979] is a classic text introducing automata, languages, and the theory of computation. A simpler introduction
38 ANALYSIS AND VERIFICATION OF NON-REAL-TIME SYSTEMS
to automata, languages, and computation is the text by Lewis and Papadimitriou [Lewis and Papadimitriou, 1981]. Their second edition [Lewis and Papadimitriou, 1998] gives a clearer introduction but omits presentations on symbolic logic.
2.4 SUMMARY
This chapter explores the basic foundations of symbolic logic, automata, formal languages, and state transition systems. These concepts can be used to reason, analyze, and verify the correctness of non-real-time systems. Many analysis and verification techniques for real-time systems are based on these untimed approaches.
Symbolic logic is a collection of languages that use symbols to represent facts, events, and actions, and provide rules to symbolize reasoning. Given the specification of a system and a collection of desirable properties, both written in logic formulas, we can attempt to prove that these desirable properties are logical consequences of the specification. Two popular logics are the propositional logic (also called propositional calculus or zero-order logic, the most simple symbolic logic) and the predicate logic (also called predicate calculus or first-order logic).
Using propositional logic, we can write declarative sentences called propositions that can be either true (denoted by T) or false (denoted by F) but not both. We use an uppercase letter or a string of uppercase letters to denote a proposition. The basic proof procedure is based on the following principle.
Resolution Principle: For any two clauses C1 and C2, if a literal L1 in C1 and a literal L2 in C2 such that L1 L2 is false, then the resolvent of C1 and C2 is the clause consisting of the disjunction of the remaining clauses in C1 and C2 after removing L1 and L2 from C1 and C2, respectively.
Propositional logic can express simple ideas with no quantitative notions or qualifications and is also good enough for describing digital (Boolean) logic circuits. For more complex ideas, propositional logic is not sufficient, so the predicate logic is needed. Predicate logic allows the use of quantifiers to specify whether a logic formula holds for at least one or for all objects or persons in a universe. The basic proof procedure is also based on the resolution principle.
Resolution Theorem: A clause set S is unsatisfiable iff there is a deduction of the empty clause from S, that is, R (S).
The resolution theorem and the unification algorithm form the basis of most computer implementations for testing the satisfiability of predicate logic formulas. Resolution is complete, so it always generates the empty clause from an unsatisfiable formula (clause set).
An automaton is able to determine whether a sequence of words belongs to a specific language. This language consists of a set of words over some finite alphabet. Depending on the type of automaton used, this sequence of words may be finite or infinite. If these sequences of words correspond to sequences of events and actions, we can construct an automaton that accepts correct sequences of events and actions in a system, and thus solve the verification problem.
EXERCISES 39
With the introduction of more concepts, we can use an automaton to represent a process or system. More precisely, a specification automaton represents the desired specification of a system, and an implementation automaton models an implementation attempting to satisfy the given specification. Our goal is to verify that the implementation satisfies the specification. This problem can now be viewed as the language inclusion problem (also known as the language containment problem), that is, to determine whether the language accepted by the implementation automaton is a subset of the language accepted by the specification automaton.
A DFA belongs to a special class of finite automata in which their operation is completely determined by their input as described below. A DFA can be viewed as a simple language recognition device.
To make finite automata more expressive, we introduce the feature of nondeterminism. A state change in a nondeterministic finite automaton (NFA) may be only partially determined by the current state and input symbol, and there may be more than one next state given a current state. Every nondeterministic finite automaton can be shown to be equivalent to a deterministic finite automaton, but this corresponding DFA usually contains more states and transitions. Hence, nondeterministic finite automata can often simplify the description of language recognizers.
An automaton can specify a physical system or a set of processes, and how to determine whether a sequence of events or actions is allowed in the specified system. The alphabet of a language can consist of names of events or actions in the system to be specified. We call this alphabet the event set of the specified system. Then we can construct an automaton that accepts all allowable sequences (strings) of events in the specified system. This set of allowable sequences of events is the language accepted by this automaton.
EXERCISES
1.Specify the following English statements in prepositional logic formulas:
(a)Traffic light system: If the car traffic light turns red, then the pedestrian traffic sign changes from “don’t walk” to “walk.” If the pedestrian “walk” sign turns on, pedestrians cross the street; otherwise, pedestrians wait at the sidewalk.
(b)Gate controller: The gate to the building remains closed unless the gate controller receives an “open gate” signal from a wireless transmitter or a wired transmitter.
(c)Pipeline valve: Valve labeled “A” is closed if and only if the pressure of the pipeline is between 20 and 50 psi (pound per square inch).
2.Consider the specification in exercise 1(a). Prove the following using equivalent formulas and then using a truth table: If the car traffic light turns red, then pedestrians cross the street.
3.Specify the following English description of an automobile automatic cruise control system in prepositional logic formulas. Automobile automatic cruise sys-
40 ANALYSIS AND VERIFICATION OF NON-REAL-TIME SYSTEMS
tem: If the “auto-cruise on” button is lighted, the automatic cruise system is turned on; otherwise, it is turned off. Pressing the “auto-cruise on” button once turns its light on. Pressing the “auto-cruise off” button once turns the “autocruise on” button’s light off. If the distance between the car and the obstacle in front is less than a safe distance d, the automatic cruise system applies brake slowly to slow the car. If the distance between the car and the obstacle in front is less than a short distance e, the automatic cruise system applies brake quickly to slow the car more quickly and turn on an “unsafe distance” warning light. If the distance between the car and the obstacle in front is d or more, the automatic cruise system does nothing and is in the monitoring mode; otherwise, it is in both monitoring and control modes.
4.Suppose R(x) represents “task x is schedulable by the rate-monotonic scheduler” and E(x) represents “task x is schedulable by the earliest-deadline scheduler.” Specify the following English statements in predicate logic formulas:
(a)Every task schedulable by the rate-monotonic scheduler is schedulable by the earliest-deadline scheduler.
(b)Not every task is schedulable by the earliest-deadline scheduler.
(c)Some tasks not schedulable by the rate-monotonic scheduler are schedulable by the earliest-deadline scheduler.
5.Using the specifications in 4(a), (b), and (c), prove the validity of the following statement: If a task is not schedulable by the earliest-deadline scheduler, then this task is not schedulable by the rate-monotonic scheduler.
6.Prove by resolution whether the following clauses are satisfiable:
A, B, C, D, E, F G, ¬F ¬G, ¬B ¬D ¬F, ¬A ¬C ¬G ¬E.
7.Show the DFA accepting the language represented by the following regular expression: (message ack) .
8.Describe the difference between a deterministic finite automaton and a nondeterministic finite automaton. Are they equivalent in terms of expressive power?
9.Consider the smart traffic light system in Figure 2.14 and the safety property shown in Figure 2.15. Show why this safety property is not satisfied. Describe how the revised Pedestrian automaton in Figure 2.16 corrects the problem.
10.Consider a smart airbag deployment system in an automobile. A sensor that detects the distance between the driver and the steering wheel is attached to the driver’s seat. This distance depends on the shape and size of the driver, and the position of the steering wheel. Based on this distance, the airbag computer determines the force of the airbag inflation to minimize harm to the driver. The airbag will deploy when a collision impact with a speed exceeding 30 mph occurs; otherwise, it will not deploy. If the distance is far (> 1.5 ft), the airbag will be inflated with maximum force. If the distance is average (between 1.0 ft and 1.5 ft), the airbag will be inflated with regular force. If the distance is near (< 1.0 ft), the airbag will be inflated with minimum force. Specify this system as a deterministic finite automaton.

CHAPTER 3
REAL-TIME SCHEDULING AND SCHEDULABILITY ANALYSIS
As in preparing a schedule of to-do tasks in everyday life, scheduling a set of computer tasks (also known as processes) is to determine when to execute which task, thus determining the execution order of these tasks; and in the case of a multiprocessor or distributed system, to also determine an assignment of these tasks to specific processors. This task assignment is analogous to assigning tasks to a specific person in a team of people. Scheduling is a central activity of a computer system, usually performed by the operating system. Scheduling is also necessary in many non-computer systems such as assembly lines.
In non-real-time systems, the typical goal of scheduling is to maximize average throughput (number of tasks completed per unit time) and/or to minimize average waiting time of the tasks. In the case of real-time scheduling, the goal is to meet the deadline of every task by ensuring that each task can complete execution by its specified deadline. This deadline is derived from environmental constraints imposed by the application.
Schedulability analysis is to determine whether a specific set of tasks or a set of tasks satisfying certain constraints can be successfully scheduled (completing execution of every task by its specified deadline) using a specific scheduler.
Schedulability Test: A schedulability test is used to validate that a given application can satisfy its specified deadlines when scheduled according to a specific scheduling algorithm.
This schedulability test is often done at compile time, before the computer system and its tasks start their execution. If the test can be performed efficiently, then it can be done at run-time as an on-line test.
41
42 REAL-TIME SCHEDULING AND SCHEDULABILITY ANALYSIS
Schedulable Utilization: A schedulable utilization is the maximum utilization allowed for a set of tasks that will guarantee a feasible scheduling of this task set.
A hard real-time system requires that every task or task instance completes its execution by its specified deadline; failure to do so even for a single task or task instance may lead to catastrophic consequences. A soft real-time system allows some tasks or task instances to miss their deadlines, but a task or task instance that misses a deadline may be less useful or valuable to the system.
There are basically two types of schedulers: compile-time (static) and run-time (on-line or dynamic).
Optimal Scheduler: An optimal scheduler is one which may fail to meet a deadline of a task only if no other scheduler can.
Note that “optimal” in real-time scheduling does not necessarily mean “fastest average response time” or “shortest average waiting time.” A task Ti is characterized by the following parameters:
S: start, release, ready, or arrival time c: (maximum) computation time
d: relative deadline (deadline relative to the task’s start time) D: absolute deadline (wall clock time deadline).
There are three main types of tasks. A single-instance task executes only once. A periodic task has many instances or iterations, and there is a fixed period between two consecutive releases of the same task. For example, a periodic task may perform signal processing of a radar scan once every 2 seconds, so the period of this task is 2 seconds. A sporadic task has zero or more instances, and there is a minimum separation between two consecutive releases of the same task. For example, a sporadic task may perform emergency maneuvers of an airplane when the emergency button is pressed, but there is a minimum separation of 20 seconds between two emergency requests. An aperiodic task is a sporadic task with either a soft deadline or no deadline. Therefore, if the task has more than one instance (sometimes called a job), we also have the following parameter:
p: period (for periodic tasks); minimum separation (for sporadic tasks).
The following are additional constraints that may complicate scheduling of tasks with deadlines:
1.frequency of tasks requesting service periodically,
2.precedence relations among tasks and subtasks,
3.resources shared by tasks, and
4.whether task preemption is allowed or not.
If tasks are preemptable, we assume that a task can be interrupted only at discrete (integer) time instants unless we indicate otherwise.