• 沒有找到結果。

2 A Model for Hybrid Systems

N/A
N/A
Protected

Academic year: 2022

Share "2 A Model for Hybrid Systems"

Copied!
31
0
0

加載中.... (立即查看全文)

全文

(1)

The Algorithmic Analysis of Hybrid Systems



R.Alur y

C.Courcoub etis z

N. Halbwachs x

T.A.Henzinger {

P.-H.Ho x

X. Nicollin z

A. Olivero z

J. Sifakis z

S.Yovine z

Abstract

We present a general framework for the formal speci cation and algorithmic analysis of hybrid systems. A hybrid system consists of a discrete program with an analog environment. We model hybrid systems as nite automata equipped with variables that evolve continuously with time according to dynamical laws. For veri cation purposes, we restrict ourselves to linear hybrid systems, where all variables follow piecewise-linear trajectories. We provide decidability and undecidability results for classes of linear hybrid systems, and we show that standard program- analysis techniques can be adapted to linear hybrid systems. In particular, we consider symbolic model-checking and minimization procedures that are based on the reachability analysis of an in nite state space. The procedures iteratively compute state sets that are de nable as unions of convex polyhedra in multidimensional real space. We also present approximation techniques for dealing with systems for which the iterative procedures do not converge.

A preliminary version of this paper appeared in theProceedings of the 11th International Conference on Analysis and Optimization of Discrete Event Systems, Lecture Notes in Control and Information Sciences 199, Springer-Verlag, 1994, pp. 331{351, and an extended version appeared in Theoretical Computer Science 138, 1995, pp. 3{34.

yAT&T Bell Laboratories, Murray Hill, NJ, U.S.A.

zUniversity of Crete and ICS, FORTH, Heraklion, Greece. Partially supported by Esprit-BRA 6021 REACT-P.

xVERIMAG-SPECTRE, Grenoble, France. VERIMAG is a joint laboratory of CNRS, INPG, UJF, and VERILOG S.A., associated with the institute IMAG. SPECTRE is an INRIA project. Partially supported by Esprit-BRA 6021 REACT-P.

{Computer Science Department, Cornell University, Ithaca, NY, U.S.A. Supported in part by the National Science

(2)

1 Introduction

A hybrid system consists of a discrete program with an analog environment. We assume that a run of a hybrid system is a sequence of steps. Within each step the system state evolves continuously according to a dynamical law until a transition occurs. Transitions are instantaneous state changes that separate continuous state evolutions.

We model a hybrid system as a nite automaton that is equipped with a set of variables. The control locations of the automaton are labeled with evolution laws. At a location the values of the variables change continuously with time according to the associated law. The transitions of the automaton are labeled with guarded sets of assignments. A transition is enabled when the associated guard is true, and its execution modi es the values of the variables according to the assignments. Each location is also labeled with an invariant condition that must hold when the control resides at the location. This model for hybrid systems is inspired by the phase transition systems of [MMP92, NSY93], and can be viewed as a generalization of timed safety automata[AD94, HNSY94].

The purpose of this paper is to demonstrate that standard program-analysis techniques can be adapted to hybrid systems. For veri cation purposes we restrict ourselves to linear hybrid systems. In a linear hybrid system, for each variable the rate of change is constant|though this constant may vary from location to location|and the terms involved in the invariants, guards, and assignments are required to be linear. An interesting special case of a linear hybrid system is a timed automaton [AD94]. In a timed automaton each continuously changing variable is an accurate clock whose rate of change with time is always 1. Furthermore, in a timed automaton all terms involved in assignments are constants, and all invariants and guards only involve comparisons of clock values with constants. Even though the reachability problem for linear hybrid systems is undecidable, it can be solved for timed automata. In this paper, we provide new decidability and undecidability results for classes of linear hybrid systems, and we show that some algorithms for the analysis of timed automata can be extended to linear hybrid systems to obtain semidecision procedures for various veri cation problems.

In particular, we consider the symbolic model-checking method for timed automata presented in [HNSY94], and the minimization procedure for timed automata presented in [ACD+92]. Both methods perform a reachability analysis over an in nite state space. The procedures compute state sets by iterative approximation such that each intermediate result is de nable by a linear formula;

that is, each computed state set is a nite union of convex polyhedra in multidimensional real space. The termination of the procedures, however, is not guaranteed for linear hybrid systems.

To cope with this problem, approximate analysis techniques are used to enforce the convergence of iterations by computing upper approximations of state sets. Approximate techniques yield either necessary or sucient veri cation conditions.

The paper is essentially a synthesis of the results presented in [ACHH93, NOSY93, HPR94].

Section 2 presents a general model for hybrid systems. Section 3 de nes linear hybrid systems, and presents decidability and undecidability results for the reachability problem of subclasses of linear hybrid systems. The veri cation methods are presented in Section 4. Some paradigmatic examples are speci ed and veri ed to illustrate the application of our results. These examples are analyzed using the Kronos tool [NSY92, NOSY93] (available from Grenoble) and the HyTech tool [AHH93, HH94] (available from Cornell), two symbolic model checkers for timed and hybrid systems.

(3)

2 A Model for Hybrid Systems

We specify hybrid systems by graphs whose edges represent discrete transitions and whose vertices represent continuous activities.

A hybrid system

H

= (Loc

;

Var

;

Lab

;

Edg

;Act;

Inv) consists of six components:

 A nite set Loc of vertices called locations.

 A nite set Var of real-valued variables. A valuation



for the variables is a function that assigns a real-value



(

x

)2R to each variable

x

2Var. We write

V

for the set of valuations.

A state is a pair (

`;

) consisting of a location

`

2Loc and a valuation



2

V

. We write  for the set of states.

 A nite set Lab of synchronization labels that contains the stutter label



2Lab.

 A nite set Edg of edges called transitions. Each transition

e

= (

`;a;;`

0) consists of a source location

`

2Loc, a target location

`

02Loc, a synchronization label

a

2Lab, and a transition relation





V

2. We require that for each location

`

2 Loc, there is a set Con  Var of controlled variables and a stutter transition of the form (

`;;

IdCon

;`

), where (

;

0)2IdCon i for all variables

x

2Var, either

x

62Con or



(

x

) =



0(

x

).

The transition

e

is enabled in a state (

`;

) if for some valuation



0 2

V

, (

;

0) 2



. The state (

`

0

;

0), then, is a transition successor of the state (

`;

).

 A labeling function

Act

that assigns to each location

`

2Loca set of activities. Each activity is a function from the nonnegative reals R0 to

V

. We require that the activities of each location are time-invariant: for all locations

`

2Loc, activities

f

2

Act

(

`

), and nonnegative reals

t

2R0, also (

f

+

t

) 2

Act

(

`

), where (

f

+

t

)(

t

0) =

f

(

t

+

t

0) for all

t

02R0.

For all locations

`

2 Loc, activities

f

2

Act

(

`

), and variables

x

2 Var, we write

f

x the function from R0 to R such that

f

x(

t

) =

f

(

t

)(

x

).

 A labeling function Inv that assigns to each location

`

2Loc an invariant Inv(

`

)

V

. The hybrid system

H

is time-deterministic if for every location

`

2 Loc and every valuation



2

V

, there is at most one activity

f

2

Act

(

`

) with

f

(0) =



. The activity

f

, then, is denoted by

'

`[



].

The runs of a hybrid system

At any time instant, the state of a hybrid system is given by a control location and values for all variables. The state can change in two ways:

 By a discrete and instantaneous transition that changes both the control location and the values of the variables according to the transition relation;

 By a time delay that changes only the values of the variables according to the activities of the current location.

The system may stay at a location only if the location invariant is true; that is, some discrete transition must be taken before the invariant becomes false.

(4)

A run of the hybrid system

H

, then, is a nite or in nite sequence



:



0 7!tf00



1 7!tf11



2 7!tf22



of states



i = (

`

i

;

i) 2, nonnegative reals

t

i 2R0, and activities

f

i 2

Act

(

`

i), such that for all

i

0,

1.

f

i(0) =



i,

2. for all 0

t



t

i,

f

i(

t

)2Inv(

`

i),

3. the state



i+1 is a transition successor of the state



0i= (

`

i

;f

i(

t

i)).

The state



0i is called a time successor of the state



i; the state



i+1, a successor of



i. We write [

H

] for the set of runs of the hybrid system

H

.

Notice that if we require all activities to be smooth functions, then the run



can be described by a piecewise smooth function whose values at the points of higher-order discontinuity are sequences of discrete state changes. Also notice that for time-deterministic systems, we can omit the subscripts

f

i from the next relation 7!.

The run



diverges if



is in nite and the in nite sumPi0

t

i diverges. The hybrid system

H

is nonzeno if every nite run of

H

is a pre x of some divergent run of

H

. Nonzeno systems can be executed [AH94].

Hybrid systems as transition systems

With the hybrid system

H

, we associate the labeled transition system TH = (

;

Lab[R0

;

!), where the step relation ! is the union of the transition-step relations !a, for

a

2Lab,

(

`;a;;`

0)2Edg (

;

0)2

 ;

02Inv(

`

) (

`;

)!a(

`

0

;

0)

and the time-step relations !t, for

t

2R0,

f

2

Act

(

`

)

f

(0) =



80

t

0

t: f

(

t

0)2Inv(

`

) (

`;

)!t(

`;f

(

t

))

Notice that the stutter transitions ensure that the transition system TH is re exive.

There is a natural correspondence between the runs of the hybrid system

H

and the paths through the transition systemTH: for all states

;

02, where



= (

`;

), and for all

t

2R0,

9

f

2

Act

(

`

)

;

7!tf



0 i 9



00 2

;a

2Lab

: 

!t



00!a



0

:

It follows that for every hybrid system, the set of runs is closed under pre xes, suxes, stuttering, and fusion [HNSY94].

For time-deterministic hybrid systems, the rule for the time-step relation can be simpli ed.

Time can progress by the amount

t

2R0 from the state (

`;

) if this is permitted by the invariant of location

`

; that is,

tcp`[



](

t

) i 80

t

0

t: '

`[



](

t

0)2Inv(

`

)

:

Now we can rewrite the time-step rule for time-deterministic systems as

tcp`[



](

t

) (

`;

)!t(

`;'

`[



](

t

))

(5)

Example: thermostat

The temperature of a room is controlled through a thermostat, which continuously senses the temperature and turns a heater on and o . The temperature is governed by di erential equations.

When the heater is o , the temperature, denoted by the variable

x

, decreases according to the exponential function

x

(

t

) =

e

;Kt, where

t

is the time,



is the initial temperature, and

K

is a constant determined by the room; when the heater is on, the temperature follows the function

x

(

t

) =

e

;Kt+

h

(1;

e

;Kt), where

h

is a constant that depends on the power of the heater. We wish to keep the temperature between

m

and

M

degrees and turn the heater on and o accordingly.

The resulting time-deterministic hybrid system is shown in Figure 1. The system has two locations: in location

`

0, the heater is turned o ; in location

`

1, the heater is on. The transition relations are speci ed by guarded commands; the activities, by di erential equations; and the location invariants, by logical formulas.

x

_ =;

Kx

x

=

m

x

=

M x

=

M

`

1

`

0

x

_ =

K

(

h

;

x

)

x



M x



m

Figure 1: Thermostat

The parallel composition of hybrid systems

Let

H

1 = (Loc1

;

Var

;

Lab1

;

Edg1

;Act

1

;

Inv1) and

H

2 = (Loc2

;

Var

;

Lab2

;

Edg2

;Act

2

;

Inv2) be two hybrid systems over a common set Var of variables. The two hybrid systems synchronize on the common set Lab1 \Lab2 of synchronization labels; that is, whenever

H

1 performs a discrete transition with the synchronization label

a

2Lab1\Lab2, then so does

H

2.

The product

H

1

H

2 is the hybrid system (Loc1Loc2

;

Var

;

Lab1[Lab2

;

Edg

;Act;

Inv) such that

 ((

`

1

;`

2)

;a;;

(

`

01

;`

02))2Edg i

(1) (

`

1

;a

1

;

1

;`

01)2Edg1 and (

`

2

;a

2

;

2

;`

02)2Edg2,

(2) either

a

1 =

a

2 =

a

, or

a

1 62Lab2 and

a

2=



, or

a

1 =



and

a

2 62Lab1, (3)



=



1\



2;



Act

(

`

1

;`

2) =

Act

1(

`

1)\

Act

2(

`

2);

 Inv(

`

1

;`

2) = Inv1(

`

1)\Inv2(

`

2).

It follows that all runs of the product system are runs of both component systems:

[

H

1

H

2]Loc1  [

H

1] and [

H

1

H

2]Loc2  [

H

2] where [

H H

] is the projection of [

H H

] on Loci.

(6)

3 Linear Hybrid Systems

A linear term over the set Var of variables is a linear combination of the variables in Var with integer coecients. A linear formula over Var is a boolean combination of inequalities between linear terms over Var.

The time-deterministic hybrid system

H

= (Loc

;

Var

;

Lab

;

Edg

;Act;

Inv) is linear if its activ- ities, invariants, and transition relations can be de ned by linear expressions over the set Var of variables:

1. For all locations

`

2Loc, the activities

Act

(

`

) are de ned by a set of di erential equations of the form _

x

=

k

x, one for each variable

x

2Var, where

k

x 2Z is an integer constant: for all valuations



2

V

, variables

x

2Var, and nonnegative reals

t

2R0,

'

x`[



](

t

) =



(

x

) +

k

x

t:

We write

Act

(

`;x

) =

k

x to refer to the rate of the variable

x

at location

`

.

2. For all locations

`

2Loc, the invariant Inv(

`

) is de ned by a linear formula over Var:



2Inv(

`

) i



( )

:

3. For all transitions

e

2Edg, the transition relation



is de ned by a guarded set of nondeter- ministic assignments

) f

x

:= [

x

;

x]j

x

2Varg

;

where the guard is a linear formula and for each variable

x

2Var, both interval boundaries

x and

x are linear terms:

(

;

0)2



i



( ) ^ 8

x

2Var

: 

(

x)



0(

x

)



(

x)

:

If

x =

x, we write



(

e;x

) =

x to refer to the updated value of the variable

x

after the transition

e

.

Notice that every run of a linear hybrid system can be described by a piecewise linear function whose values at the points of rst-order discontinuity are nite sequences of discrete state changes.

Special cases of linear hybrid systems

Various special cases of linear hybrid systems are of particular interest:

 If

Act

(

`;x

) = 0 for each location

`

2 Loc, then

x

is a discrete variable. Thus, a discrete variable changes only when the control location changes. A discrete system is a linear hybrid system all of whose variables are discrete.

 A discrete variable

x

is a proposition if



(

e;x

) 2 f0

;

1g for each transition

e

2 Edg. A nite-state system is a linear hybrid system all of whose variables are propositions.

 If

Act

(

`;x

) = 1 for each location

`

and



(

e;x

)2f0

;x

gfor each transition

e

, then

x

is a clock.

Thus, (1) the value of a clock increases uniformly with time, and (2) a discrete transition either resets a clock to 0, or leaves it unchanged. A timed automaton [AD94] is a linear hybrid system all of whose variables are propositions or clocks, and the linear expressions are boolean combinations of inequalities of the form

x

#

c

or

x

;

y

#

c

where

c

is a nonnegative integer and #2f

<;



;

=

;>;

g.

(7)

 If there is a nonzero integer constant

k

2Z such that

Act

(

`;x

) =

k

for each location

`

and



(

e;x

)2f0

;x

gfor each transition

e

, then

x

is a skewed clock. Thus, a skewed clock is similar to a clock except that it changes with time at some xed rate di erent from 1. A multirate timed system is a linear hybrid system all of whose variables are propositions and skewed clocks. An n-rate timed system is a multirate timed system whose skewed clocks proceed at

n

di erent rates.

 If

Act

(

`;x

)2f0

;

1gfor each location

`

and



(

e;x

)2f0

;x

gfor each transition

e

, then

x

is an integrator. Thus, an integrator is a clock that can be stopped and restarted; it is typically used to measure accumulated durations. An integrator system is a linear hybrid system all of whose variables are propositions and integrators.

 A discrete variable

x

is a parameter if



(

e;x

) =

x

for each transition

e

2 Edg. Thus, a parameter is a symbolic constant. For each of the subclasses of linear hybrid systems listed above, we obtain parameterized versions by admitting parameters.

Notice that linear hybrid systems, and all of the subclasses of linear hybrid systems listed above, are closed under parallel composition.

3.1 Examples of Linear Hybrid Systems A water-level monitor

The water level in a tank is controlled through a monitor, which continuously senses the water level and turns a pump on and o . The water level changes as a piecewise-linear function over time.

When the pump is o , the water level, denoted by the variable

y

, falls by 2 inches per second; when the pump is on, the water level rises by 1 inch per second. Suppose that initially the water level is 1 inch and the pump is turned on. We wish to keep the water level between 1 and 12 inches.

But from the time that the monitor signals to change the status of the pump to the time that the change becomes e ective, there is a delay of 2 seconds. Thus the monitor must signal to turn the pump on before the water level falls to 1 inch, and it must signal to turn the pump o before the water level reaches 12 inches.

The linear hybrid system of Figure 2 describes a water-level monitor that signals whenever the water level passes 5 and 10 inches, respectively. The system has four locations: in locations 0 and 1, the pump is turned on; in locations 2 and 3, the pump is o . The clock

x

is used to specify the delays: whenever the control is in location 1 or 3, the signal to switch the pump o or on, respectively, was sent

x

seconds ago. In the next section, we will prove that the monitor indeed keeps the water level between 1 and 12 inches.

A mutual-exclusion protocol

This example describes a parameterized multirate timed system. We present a timing-based algo- rithm that implements mutual exclusion for a distributed system with skewed clocks. Consider an asynchronous shared-memory system that consists of two processes

P

1 and

P

2 with atomic read and write operations. Each process has a critical section and at each time instant, at most one of the two processes is allowed to be in its critical section. Mutual exclusion is ensured by a version of Fischer's protocol [Lam87], which we describe rst in pseudocode. For each process

P

i, where

i

= 1

;

2:

(8)

y

= 10

x

:= 0

y

= 1

x

= 2

x

= 2

y

= 5

x

:= 0

x

_= 1

0

3

2

x

_ = 1

x

_ = 1

y

_= 1

y

_= 1

y

10

x

2

x

_ = 1

y

_=;2

x

2

y

_=;2

y

5 Figure 2: Water-level monitor

repeat repeat

await k

= 0

k

:=

i delay b until k

=

i

Critical section

k

:= 0

forever

The two processes

P

1 and

P

2 share a variable

k

and process

P

i is allowed to be in its critical section i

k

=

i

. Each process has a private clock. The instruction

delay b

delays a process for at least

b

time units as measured by the process's local clock. Furthermore, each process takes at most

a

time units, as measured by the process's clock, for a single write access to the shared memory (i.e., for the assignment

k

:=

i

). The values of

a

and

b

are the only information we have about the timing behavior of instructions. Clearly, the protocol ensures mutual exclusion only for certain values of

a

and

b

. If both private processor clocks proceed at precisely the same rate, then mutual exclusion is guaranteed i

a < b

.

To make the example more interesting, we assume that the two private clocks of the processes

P

1 and

P

2 proceed at di erent rates, namely, the local clock of

P

2 is 1

:

1 times faster than the clock of

P

1. The resulting system can be modeled by the product of the two hybrid systems presented in Figure 3.

Each of the two graphs models one process, with the two critical sections being represented by the locations 4 and

D

. The private clocks of the processes

P

1 and

P

2 determine the rate of change of the two skewed-clock variables

x

and

y

, respectively.

A leaking gas burner

Now we consider an integrator system. In [CHR91], the duration calculus is used to prove that a gas burner does not leak excessively. It is assumed that (1) any leakage can be detected and

(9)

1

2

3

4

x

_ = 1

x

_ = 1

x

_= 1

k

= 0

x

:= 0

x < a x k

:= 1:= 0

x > b

^

k

6= 1

k

= 0

A

B

C

D

y

:= 0

y > b

^

k

6= 2

k

:= 2

y < a

k

:= 0

k

:= 0

k

= 1

k

= 2^

x > b

^

y

_= 1

:

1

y

_= 1

:

1

x

_ = 1

y

_ = 1

:

1

y

_ = 1

:

1

y > b

y

:= 0

Figure 3: Mutual-exclusion protocol

stopped within 1 second and (2) the gas burner will not leak for 30 seconds after a leakage has been stopped. We wish to prove that the accumulated time of leakage is at most one twentieth of the time in any interval of at least 60 seconds. The system is modeled by the hybrid system of Figure 4. The system has two locations: in location 1, the gas burner leaks; location 2 is the nonleaking location. The integrator

z

records the cumulative leakage time; that is, the accumulated amount of time that the system has spent in location 1. The clock

x

records the time the system has spent in the current location; it is used to specify the properties (1) and (2). The clock

y

records the total elapsed time. In the next section, we will prove that

y

 60 ) 20

z



y

is an invariant of the system.

1

x

:= 0 2

x

30

x

:= 0

x

= 0

z

= 0

y

= 0

x

_ = 1

y

_= 1

z

_= 1

x

1

x

_ = 1

y

_= 1

z

_= 0 Figure 4: Leaking gas burner

(10)

A temperature control system

This example appears in [JLHM91]. The system controls the coolant temperature in a reactor tank by moving two independent control rods. The goal is to maintain the coolant between the temperatures



m and



M. When the temperature reaches its maximum value



M, the tank must be refrigerated with one of the rods. The temperature rises at a rate

v

r and decreases at rates

v

1 and

v

2 depending on which rod is being used. A rod can be moved again only if

T

time units have elapsed since the end of its previous movement. If the temperature of the coolant cannot decrease because there is no available rod, a complete shutdown is required. Figure 5 shows the hybrid system of this example: variable



measures the temperature, and the values of clocks

x

1 and

x

2 represent the times elapsed since the last use of rod 1 and rod 2, respectively.



=



M ^

x

1 

T

x 

1=:= 0



m

shutdown x

2 

T

x

2:= 0



=



m



=



M^



=



M ^

x

1

< T

^

x

2

< T x

1=

T

x

2=

T

1

x

_2 = 1







m

0

2 3



_=;

v

2

x

_1= 1

x

_2 = 1







m



_=

v

r

x

_1 = 1

x

_2 = 1







M



_=;

v

1

x

_1 = 1

Figure 5: Temperature control system

A game of billiards

Consider a billiard table of dimensions

l

and

h

, with a grey ball and a white ball (Figure 6).

Initially, the balls are placed at positions

b

g = (

x

g

;y

g) and

b

w = (

x

w

;y

w). The grey ball is knocked and starts moving with constant velocity

v

. If the ball reaches a vertical side then it rebounds, i.e., the sign of the horizontal velocity component

v

x changes. The same occurs with the vertical velocity component

v

y when the ball reaches a horizontal side. The combination of signs of velocity components gives four di erent directions of movement.

The hybrid system shown in Figure 7 describes the movement of the grey ball for the bil- liards game. Each possible combination of directions is represented by a location. The rebounds correspond to the execution of transitions between locations.

(11)

v

y

v

v

x

x

g

x

w

l x

h y

w

y

g

y

Figure 6: Billiards game

x

=

l

_ 1

x

=

v

x

x



l

^

y



h

_ 2

x

=;

v

x

y

_=

v

y

x

0 ^

y



h y

_=

v

y

y

= 0

y

=

h y

=

h y

= 0

3

y

_

x

_==;

v

x

v

y

4

x

_=;

v

x

x

= 0

x



l

^

y

0

x



y

_0=^;

y v

y0

x

=

x

g

y

=

y

g

x

=

l x

= 0

Figure 7: Movement of the grey ball

(12)

3.2 The Reachability Problem for Linear Hybrid Systems

Let



and



0be two states of a hybrid system

H

. The state



0is reachable from the state



, written



7!



0, if there is a run of

H

that starts in



and ends in



0. The reachability question asks, then, if



7!



0for two given states



and



0of a hybrid system

H

.

The reachability problem is central to the veri cation of hybrid systems. In particular, the veri cation of invariance properties is equivalent to the reachability question: a set

R

 of states is an invariant of the hybrid system

H

i no state in ;

R

is reachable from an initial state of

H

.

A decidability result

A linear hybrid system is simple if all linear atoms in location invariants and transition guards are of the form

x



k

or

k



x

, for a variable

x

2Var and an integer constant

k

2Z. In particular, for multirate timed systems the simplicity condition prohibits the comparison of skewed clocks with di erent rates.

Theorem 3.1

The reachability problem is decidable for simple multirate timed systems.

Proof.

Let

H

be a simple multirate timed system. We translate

H

into a timed automa- ton sc(

H

): (1) adjust the rates of all skewed clocks to 1, and (2) replace all occurrences of each skewed clock

x

in location invariants and transition guards with

k

x

x

. Given a valuation



of

H

, let the valuation sc(



) be such that sc(



)(

x

) =

k

x



(

x

) for all skewed clocks

x

and sc(



)(

p

) =



(

p

) for all propositions

p

; moreover, sc(

`;

) = (

`;

sc(



)). It is not dicult to check that there is a run of

H

from



to



0 i there is a run of sc(

H

) from sc(



) to sc(



0). The reachability problem for timed automata is solved in [ACD93].

Two undecidability results

Theorem 3.2

The reachability problem is undecidable for 2-rate timed systems.

Proof.

The theorem follows from the undecidability of the halting problem for nondeterministic 2-counter machines. Given any two distinct clock rates, a 2-rate timed system can encode the computations of the given 2-counter machine

M

. For the 2-rate timed system

H

, we use \accurate"

clocks of rate 1 and skewed clocks of rate 2. We use an accurate clock

y

to mark intervals of length 1: the clock

y

is zero initially, and is reset whenever it reaches 1. The

i

-th con guration of the machine

M

is encoded by the state of

H

at time

i

. The location of

H

encodes the program counter of

M

, and the values of two accurate clocks

x

1 and

x

2 encode the counter values: the counter value

n

is encoded by the clock value 1

=

2n.

Encoding the program counter, setting up the initial con guration, and testing a counter for being 0, is straightforward. Hence it remains to be shown how to update the counter values.

Suppose at time

i

the value of an accurate clock

x

is 1

=

2n, that is, suppose that the clock

x

is reset to 0 at time

i

;1

=

2n. Suppose the value of the counter encoded by

x

stays unchanged. Then simply reset

x

to 0 when its value reaches 1 (that is, at time (

i

+ 1;1

=

2n)); the value of

x

at time

i

+ 1 will then be 1

=

2n. To increment the counter represented by

x

, reset an accurate clock

z

when the value of

x

reaches 1, then nondeterministically reset both

x

and a skewed clock

z

0in the interval (

i

+ 1;1

=

2n

;i

+ 1) and test

z

=

z

0 at time

i

+ 1. The equality test ensures that the value of the skewed clock

z

0 is 1

=

2n at time

i

+ 1, and hence, the value of

x

is 1

=

2n+1 at time

i

+ 1.

To decrement the counter represented by

x

, nondeterministically reset an accurate clock

z

in the interval (

i

;1

;i

;1

=

2n), reset a skewed clock

z

0 simultaneously with

x

at time

i

;1

=

2n, and test

(13)

the condition

z

=

z

0at time

i

. This ensures that the value of

z

at time

i

is 1

=

2n;1. Then resetting the clock

x

when the value of

z

reaches 1 ensures that the value of

x

is 1

=

2n;1 at time

i

+ 1.

Thus, the runs of

H

encode the runs of

M

, and the halting problem for

M

is reduced to a reachability problem for

H

.

Theorem 3.3

The reachability problem is undecidable for simple integrator systems.

Proof.

This is proved in [Cer92].

4 The Veri cation of Linear Hybrid Systems

We present a methodology for analyzing linear hybrid systems that is based on predicate transform- ers for computing the step predecessors and the step successors of a given set of states. Throughout this section, let

H

= (Loc

;

Var

;

Lab

;

Edg

;Act;

Inv) be a linear hybrid system.

4.1 Forward Analysis

Given a location

`

2Loc and a set of valuations

P



V

, the forward time closure h

P

i%` of

P

at

`

is the set of valuations that are reachable from some valuation



2

P

by letting time progress:



02h

P

i%` i 9



2

V;t

2R0

: 

2

P

^ tcp`[



](

t

) ^



0=

'

`[



](

t

)

:

Thus, for all valuations



0 2h

P

i%` , there exist a valuation



2

P

and a nonnegative real

t

2R0 such that (

`;

)!t(

`;

0).

Given a transition

e

= (

`;a;;`

0) and a set of valuations

P



V

, the postcondition poste[

P

] of

P

with respect to

e

is the set of valuations that are reachable from some valuation



2

P

by executing the transition

e

:



02poste[

P

] i 9



2

V: 

2

P

^ (

;

0)2

:

Thus, for all valuations



02poste[

P

], there exists a valuation



2

P

such that (

`;

)!a(

`

0

;

0).

A set of states is called a region. Given a set

P



V

of valuations, by (

`;P

) we denote the region

f(

`;

)j



2

P

g; we write (

`;

)2(

`;P

) i



2

P

. The forward time closure and the postcondition can be naturally extended to regions: for

R

=S`2Loc(

`;R

`),

h

R

i% = [

`2Loc(

`;

h

R

`i%` ) post[

R

] = [

e=(`;`0)2Edg(

`

0

;

poste[

R

`])

A symbolic run of the linear hybrid system

H

is a nite or in nite sequence

%

: (

`

0

;P

0)(

`

1

;P

1)

:::

(

`

i

;P

i)

:::

of regions such that for all

i

0, there exists a transition

e

i from

`

i to

`

i+1 and

P

i+1 = postei[h

P

ii%`i];

that is, the region (

` ;P

) is the set of states that are reachable from a state (

` ;

) (

` ;P

)

(14)

the runs and the symbolic runs of the linear hybrid system

H

. The symbolic run

%

represents the set of all runs of the form

(

`

0

;

0)7!t0 (

`

1

;

1)7!t1 

such that (

`

i

;

i) 2(

`

i

;P

i) for all

i

0. Besides, every run of

H

is represented by some symbolic run of

H

.

Given a region

I

 , the reachable region (

I

7!)   of

I

is the set of all states that are reachable from states in

I

:



2(

I

7!) i 9



02

I: 

07!

:

Notice that

I

(

I

7!).

The following proposition suggests a method for computing the reachable region (

I

7!) of

I

.

Proposition 4.1

Let

I

= S`2Loc(

`;I

`) be a region of the linear hybrid system

H

. The reachable region (

I

7!) =S`2Loc(

`;R

`) is the least xpoint of the equation

X

= h

I

[post[

X

]i%

or, equivalently, for all locations

`

2Loc, the set

R

` of valuations is the least xpoint of the set of equations

X

` = h

I

`[ [

e=(`0;`)2Edgposte[

X

`0]i%`

:

Let be a linear formula over Var. By [[ ]] we denote the set of valuations that satisfy . A set

P



V

of valuations is linear if

P

is de nable by a linear formula; that is,

P

= [[ ]] for some linear formula . If Var contains

n

variables, then a linear set of valuations can be thought of as a union of polyhedra in

n

-dimensional space.

Lemma 4.1

For all linear hybrid systems

H

, if

P



V

is a linear set of valuations, then for all locations

`

2Loc and transitions

e

2Edg, both h

P

i%` and poste[

P

] are linear sets of valuations.

Given a linear formula , we write h i%` and poste[ ] for the linear formulas that de ne the sets of valuations h[[ ]]i%` and poste[[[ ]]], respectively.

Let pc 62 Var be a control variable that ranges over the set Loc of locations and let

R

=

S`2Loc(

`;R

`) be a region. The region

R

is linear if for every location

`

2 Loc, the set

R

` of valuations is linear. If the sets

R

` are de ned by the linear formulas `, then the region

R

is de ned by the linear formula

= _

`2Loc(pc =

`

^ `);

that is, [[ ]] =

R

. Hence, by Lemma 4.1, for all linear hybrid systems, if

R

is a linear region, then so are bothh

R

i% and post[

R

].

Using Proposition 4.1, we compute the reachable region (

I

7!) of a region

I

by successive approximation. Lemma 4.1 ensures that all regions computed in the process are linear. Since the reachability problem for linear hybrid systems is undecidable, the successive-approximation procedure does not terminate in general. The procedure does terminate for simple multirate timed systems (Theorem 3.1) and for the following example.

(15)

Example: the leaking gas burner

Let

I

be the set of initial states de ned by the linear formula

I = (pc = 1 ^

x

=

y

=

z

= 0)

:

The set (

I

7!) of reachable states is characterized by the least xpoint of the two equations

1 = h

x

=

y

=

z

= 0_ post(2;1)[ 2]i%1

2 = hfalse_ post(1;2)[ 1]i%2 which can be iteratively computed as

1;i = 1;i;1_ hpost(2;1)[ 2;i;1]i%1

2;i = 2;i;1_ hpost(1;2)[ 1;i;1]i%2

where 1;0 =h

x

=

y

=

z

= 0i%1 = (

x

1 ^

y

=

x

=

z

) and 2;0 = false. For

i

= 1, we have

1;1 = 1;0_ hpost(2;1)[ 2;0]i%1

= 1;0

2;1 = 2;0_ hpost(1;2)[ 1;1]i%2

= hpost(1;2)[

x

1 ^

y

=

x

=

z

= 0]i%2

= h(

x

= 0 ^

y

1 ^

z

=

y

)i%2

= (

z

1 ^

y

=

z

+

x

) Now, it is easy to show by induction that for all

i

2,

1;i= 1;i;1_

x

1 ^ 0

z

;

x



i

^ 30

i

+

z



y

and

2;i= 2;i;1_

y



i

+ 1 ^ 30

i

+

x

+

z



y

Hence, the least solution of the equations above is the linear formula

R = (pc = 1 ^ 1)_ (pc = 2 ^ 2) where

1 =

x

1 ^

x

=

y

=

z

_ 9

i

1

:

(

x

1 ^ 0

z

;

x



i

^ 30

i

+

z



y

)

= (

x

1 ^

x

=

y

=

z

)_ (

x

1 ^

x



z

^

y

+ 30

x

31

z

)

2 =

z

1 ^

y

=

x

+

z

^

x

0_ 9

i

1

:

(

z



i

+ 1 ^ 30

i

+

x

+

z



y

)

= (

z

1 ^

y

=

x

+

z

^

x

0)_

y



x

+ 31

z

;30

This characterization of the reachable states can be used to verify invariance properties of the gas burner system ( Ris the strongest invariant of the system). For instance, the formula R implies the design requirement

y

60 ) 20

z



y

.

(16)

4.2 Backward Analysis

The forward time closure and the postcondition de ne the successor of a region

R

. Dually, we can compute the predecessor of

R

.

Given a location

`

2 Loc and a set of valuations

P



V

, the backward time closure of

P

at

`

is the set of valuations from which it is possible to reach some valuation



2

P

by letting time progress:



02h

P

i.` i 9



2

V;t

2R0

: 

=

'

`[



0](

t

) ^



2

P

^ tcp`[



0](

t

)

:

Thus, for all valuations



0 2h

P

i.` , there exist a valuation



2

P

and a nonnegative real

t

2R0 such that (

`;

0)!t(

`;

).

Given a transition

e

= (

`;a;;`

0) and a set of valuations

P



V

, the precondition pree[

P

] of

P

with respect to

e

is the set of valuations from which it is possible to reach a valuation



2

P

by executing the transition

e

:



02pree[

P

] i 9



2

V: 

2

P

^ (



0

;

)2

:

Thus, for all valuations



02pree[

P

], there exists a valuation



2

P

such that (

`;

0)!a(

`

0

;

).

The backward time closure and the precondition can be naturally extended to regions: for

R

=

S`2Loc(

`;R

`),

h

R

i. = [

`2Loc(

`;

h

R

`i.` ) pre[

R

] = [

e=(`0;`)2Edg(

`

0

;

pree[

R

`])

Given a region

R

, the initial region (7!

R

) of

R

is the set of all states from which a state in

R

is reachable:



2(7!

R

) i 9



02

R: 

7!



0

:

Notice that

R

(7!

R

).

The following proposition suggests a method for computing the initial region (7!

R

) of

R

.

Proposition 4.2

Let

R

= S`2Loc(

`;R

`) be a region of the linear hybrid system

H

. The initial region

I

=S`2Loc(

`;I

`) is the least xpoint of the equation

X

= h

R

[pre[

X

]i.

or, equivalently, for all locations

`

2Loc, the set

I

` of valuations is the least xpoint of the set

X

` = h

R

`[ [

e=(`;`0)2Edgpree[

X

`0]i.` of equations.

Lemma 4.2

For all linear hybrid systems

H

, if

P



V

is a linear set of valuations, then for all locations

`

2Loc and transitions

e

2Edg, both h

P

i.` and pree[

P

] are linear sets of valuations.

It follows that for all linear hybrid systems, if

R

is a linear region, then so are both h

R

i. and pre[

R

]. Given a linear formula , we write h i.` and pree[ ] for the linear formulas that de ne the sets of valuations h[[ ]]i.` and pree[[[ ]]], respectively.

參考文獻

相關文件

The purpose of this talk is to analyze new hybrid proximal point algorithms and solve the constrained minimization problem involving a convex functional in a uni- formly convex

In Paper I, we presented a comprehensive analysis that took into account the extended source surface brightness distribution, interacting galaxy lenses, and the presence of dust

At least one can show that such operators  has real eigenvalues for W 0 .   Æ OK. we  did it... For the Virasoro

If the best number of degrees of freedom for pure error can be specified, we might use some standard optimality criterion to obtain an optimal design for the given model, and

In this paper we establish, by using the obtained second-order calculations and the recent results of [23], complete characterizations of full and tilt stability for locally

In this paper we establish, by using the obtained second-order calculations and the recent results of [25], complete characterizations of full and tilt stability for locally

In this paper, motivated by Chares’s thesis (Cones and interior-point algorithms for structured convex optimization involving powers and exponentials, 2009), we consider

Towards a model apprenticeship framework: A comparative analysis of national apprenticeship systems. Globalization and new industrial organization: Implication for