Zhou Chaochen Michael R. Hansen
Duration Calculus A Formal Approach to Real-Time Systems
With zo Figures
Springer Berlin Heidelberg New York Hong Kong
London
Milan Paris
Authors
Series Editors
Prof. Zhou Chaochen
Prof. Dr. Wilfried Brauer Institut fiir Informatik der TUM Boltzmannstr. 3, 85748 Garching, Germany
[email protected]
Chinese Academy of Sciences
Institute of Software South Fourth Street 4 Zhong Guan Cun
Prof. Dr. Grzegorz Rozenberg Leiden Institute ofAdvanced Computer Science University of Leiden Niels Bohrweg 1,2333 CA Leiden, The Netherlands
[email protected]
100080 Beijing
China
[email protected] Assoc. Prof. Dr. Michael R. Hansen
Informatics and Mathematical Modelling Technical University Denmark Building 321
Prof. Dr. Arto Salomaa Turku Centre for Compuler Science Lemminkdisenkatu 14A, 20520 Turku, Finland
[email protected]
2800 Lyngby
Denmark
[email protected]
Library of Congress Cataloging-in-Publication Data Zhou Chaochen, 1937a formal approach to real-time systems / Zhou Chaochen, M. R. Hansen. (EATCS monographs on theoretical computer science)
Duration calculus: p. cm.
-
Preface
Includes bibliographical references and index. ISBN 3-540-40823-l (acid-free paper) 1. Real-time data processing. 2. Formal methods (Computer science) 3. Mathematics-Data processing.
I.Hansen,Michael R., 1956- II.Title. III.Series. QA76.54.H37 2004 005.2'73-dc22 2003066406
I)rrration calcuius (abbreviated to DC) rcpresents a logical ilpproach to the lirlrnal design of real-time systems. In DC, real numbers are used to model l'i,rrr,t'., antd Boolean-valued (i.e. {0, 1}-valued) functions over time are used to rro(lcl states of real-time systerns. The clurnti,on of a state in a time interval is 1hr: accumulated presence time rif the state in the interval. DC extends l.tt,l,r:ratal loqic to a calculus that carr be used to specify and reascin about I)r'ol)erties of state durations. R.r:search on DC began during the ProCoS project (trSPRIT BRA 3104), ri'lrcn the project was investigating formal techniques for clesigning safetyr.lil,ir:al real-time systems. In a project case study of a gas burner system) il wrrs realized that state duration was useful for spccifyirrg the real-time lrt'lrin,iol of cornputing systenrs. A research program on state duration was llrclcftrre initiated by the project in 1990. The first paper on DC was publislrcrl in 1991. Since then, research on DC has covered the developrnent of l,111ica,l (:irlculi, their applications and mechanical support tools. The success , rl l )(l has aiso stirmrlatecl sirnilar rcsearch on other fonnal approaches. 'l'lrc airn of this book is to present DC in a systematic and coherent way.
l.
'l'h
lf
ils [irrrnaliztr,tion in DC. The model comprises Boolean states, state transiliorrs ancl events, and superdense transitions. The formalization is carried oul, irr DC with botli corltracting and expanding interval modalities, so Ilr;rl rrol, orrly safcty l)ropcrtics but also liveriess and fairness properties of lc;rl lirrrc sysl;clrs r:an llc hanrllcrl. Irr clrder to analyze the dependability ol rr';rl-lirrrc s.ysl,
ACM Computing Classification (1998): D.2.1,D.2.4, D.3.1, F.3.1, F.4.3 ISBN 3-540- 40823-l Springer-Verlag Berlin Heidelberg New York This work is subject to copyright. Al1 rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on micrbfitm or in any other way, and storage in data banks. Duplication of this publicition or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, i965, in its current version, and permission for use must always be obtained from Spiinger-Verlag.Violations are liable for prosecution under the German Copyright Law. Springer-Verlag is a part of Springer Science+Business Media springeronline.com
ii.
Springer-Verlag Berlin Heideiberg 2004 Printed in Germany @
The use of general descriptive nanrcs, traticrrrarhs, ctc. in this prrblitllion tlot's ttrt( itttply, t'vt'rt irt lltc absence ol a specific slNlctncnl, (hrt sttch niuncs ilrc t'xt'nrIl lrrrtt lltt ttltviutl lrrol('(liv( lrtws itttrl thcrclirrc l-rt'c lirr gcrrt'ritl rrsc. (
)rytr
I
)rsi t t t: I( iirrkt'll,olrkrr, I Ieitlcllrer
1i
'I'tfr5tltiu!:: ( lrrulrtrlct lo lilrtr lry ,tttlltot s rl.tl't
l'tirtlr'rlott.r,rrl It,r'lJ.r|r'r'l',/Il'1.'/(;l r''l \.'
I
{)
:;,'lt'r':; ;ttl ttol ll;tlrot;tllr
l,rtt itt lltl lrooli.
VI
Preface
Contents
Acknowledgments The authors express their sincere thanks to C.A.R. Hoare and A.P. Ravn, the coauthors of the first publication on DC, to the other site leaders of the ProCoS project, i.e. D. Bjorner, H. Langmark and E'-R. Olderog, and to other colleagues who have contributed to the study of DC. We hope that all of their names and publications have been included in the references. otherwise, we apologize for any mistake that we may have made. The authors thank the following institutions and projects which have supported the authors in the preparation of this book: the Computer Science Laboratory, Institute of Software, Chinese Academy of Science; Informatics and Mathematical Modelling, Technical University of Denmark; the International Institute for software Technology, United Nations university; and the Chinese Natural Science Foundation project 60273022. October 2003,
Beijing
Zhou Chaochen
Lyngby
Michael R. Hansen
1. Introduction. .. 1.1 Real-TimeSystems 1.1.1 TwoExamples... 1.1.2 Real Time 1.1.3 StateModels.... I.7.4 State Durations . . 7.2 Interval Logic . I.2.1 Interval Variables I.2.2 IntervalModalities 1.3 Duration Calculus 1.3.1 Models 7.3.2 Applications 1.3.3 Tools . 7.4 BookStructure... 2.
Interval
... .. .. .......
1
4
....... .......
2l
Logic
23
23 24 27
Deduction
Duratiori
31
34
Calculus
3.1 Syntax 3.2 Semantics 3.3 ProofSystcn).....
Soundness Deductiurr :1.4 Tluxrrcrrrg 3.5 Exurrrlllc: Gu,s Brrrrurr' 3,5.1 InfrrrtrtnlArgtuturttl; 3,6.2 Proof ,
6 9 9 10 14 74 18
20
2.4 Theorems 3.
1
3
2.L Syntax 2.2 Semantics 2.3 Proof System 2.3.7
1
4I 47 41
.......45
3.3.1 3.3.2
46 48 51
.......
60 60 62
VTTT
4.
Contents IX
Contents
Deadline-Driven Scheduler
4.7
4.1.1 Shared Processor 4.1.2 Periodic Requests 4.7.3 R,equirement 4.L.4 Scheduler.
4.2
ancl Dtrirtllitr('s
lt
'
'
'{) 7',) 7,1
9.4
76 8{)
.'
89 90
.
6.1 Discrete-Time Duration Calculus 6.1.1 Discrete Time Versus Continuous Tirrrtr ' 6.I.2 Expressiveness of Discrete-Time RDC 6.2 Decidability for Discrete Tirne . 6.3 Decidability for Continuous Time 6.4 Cornpiexitv, Tools and Other Decidable Subcltrssos '
10. Superdense
r00 I01
t02
'
'
106 109 111
.
Extensions of RDC 7 .t.1. RDC y(r)
111 111
7.L.2 R.DC2 7.1.3 nDc 3 7.1.4 Two-Counter Machines
712
7.2 Undecidability of RDCI (") 7.3 Undecidabilit'y of RDC2 7.4 Undecidability of RDCs
113
tt4 118 12',)
8. Model Checking: Linear Duration Invariants 8.1 Example . 8.2 Real-Time Automata 8.3 Linear Duration Invariants 8.4 Reduction
125
t26
.
131 133 135 136
8.4.1 Congrtrent Equivalence 8.4.2 Closure Properties of Normal Forms 8.4.3 An Algorithm Deriving Normal Forms 8.4.4 Infinite Term .
r4l 742 143 143
8.5 Generalization...
I
1.
Neightrorhoodlogic ll.llntrodrrction. 11.2 Syntax and Semantics.... 11.3 Adequacy of Neighborhood Modalitics 11.4 ProofSystem 11.4.1 Axioms and Rules 11.4.2 Ttreorems . I l.J-r Corrrplctcness for arr Abstract Domain ll.6 N[-Bzrs
12. l' ro|r:rlril isl;i<: IJrrr':rtiorr Calculus I2. I lrrltorlttr'1,iott I
2.2 I'r'olr;rlrilisl,ic I2.2.
9. State Tbansitions and Events 9.1 Iritrrl<1tr<:tior| ... -. 9.2 'l\'irrtsiliott I'irt tttttlit,s . . . {).2.1 l'i,t ttttll;ts \ S, ,r',S', ' .
,{
;tttrl 1,S
'
'
I
4Ir
I
'l
l-r
ll8 lls
.
10.3.3PrograrnSemantics.... 10.3.4 ProgramSpecification...
tl2
.
State TYansitions .. ..
10.1 Introduction . 10.1.1 Superdense Computation 10.1.2 SuperdenseChop 10.2 Calculus for Superdcnse State Transitions 10.2.1 Syntax..... 10.2.2 Semantics. 10.2.3 Proof System 10.2.4 Theorems . 10.3 Real-Time Sernantics . . . 10.3.1 Prograrn Notation 10.3.2 Program States
99 99
.
7.I
9.3
(
Decidability . ...
Undecidability.
I
(i,! '
Liu and Layland's Theorem
5. Relative Completeness... 5.1 Ideas Behind the Proof 5.2 Proof of Relative Completeness. 6.
Sclrlrlrtl''t
....... 150 ..... L52 ....153 CalcuhrsforStateTransitions ....... 154 9.3.1 Proof System: Part I..... .......157 9.3.2 ProofSystern: PartII .... 9.3.3 Soundness and Relative Completeness.... ..... 159 .....160 Example:Autclmaton .......161 9.4.1 Specification .. 762 9.4.2 Verification 9.2.2 FormulasJ,S,tS, -I5andTS... 9.2.3 Exarnple: NOR Circuit. . . ..
(t7
.
Formalization of the Deadlirxl_l)r'ivt'tr
I
. .
..... .....
165 165 166
.. ...169 . . . . . 170
.......170
..170
......171 .. 173 .. 775 . ..
.
..
175 176
...180 ..185 ..189
......189 ....... 191 .
.
193
......194 .
195
..
I97
.
201
. .
.....204 .......204 ..... 206 209 209
Arrl,orrt;tl,;t,
Sl;rIc Sltltnttct'
12..1.2 S;rl,i:.1;rcli,rtt
.
l'r'olr;rlrilily
lll.il l'r'r,l,lrlrilirrlir' l)ttt;rliott ( 1;rlr'ttltt:;: Axiottts :rtr,l llrtlcs ll) il I Sr rrl;rr l:l:l:f l't,r,rl lir:,i,'ttt: l';rtl I
...'213 . . . 2lIr 'i li 2l(i
Contents
12.3.3 Proof System: Part
II
12.4 trxample: Gas Burner 12.4.1 Calculation of p(-Dest) 72.4.2 Calculation of P'(-Desz)
218
1. Introduction
2t9 220 223
References
227
Abbreviations
239
Syrnbol Index....
24r
Index
243
1.1 Real-Time Systems A real-time system is a computing system with real-time requirements. Let us consider the following two examples of real-time systems.
1.1.1 Two Exarnples Deadline-Driven Scheduler Consider a finite number of processes, saY Pt,Pz, . . . ,Pm, which share a single processor. Each process p; has a periodic behavior. In a period of length fr, process pd requests a constant amount of processor time Ci, whete Ci 1Ti. We assume that the request periods for process p, start at times k' Q,
fork:0,1,2,3,....
The purpose of the scheduler is to grant processor time to the processes, i.e. to schedule the processes, so that process pr runs on the processor for C; time units in every period, for i' :0,1, . . . ,m. Figure 1.1 shows a schedule for first two periods of process p1. In the first period, from time 0 to time fl, three pieces of processor time, with durations Ch,Ch and Ci, are scheduled for pi. The requirement of p2 is fulfilled in the
first period, since C6 - Ch I Ci, I Cir. In the second period, from time fl t,o time 2 .Ta, lwo pieces of processor time are scheduled for p6. However, the rcquirement of pi is not satisfied in the second period, as C, > C|r+C'or.
I
tt:
C:,
Qh
Q;z
Cl"
1,,,,'l,,tl T;,
C,i,=Ct,,
lCt,r*Ct"
Ct>Cl,*Ol, Ftg. 1.1. tit:lurrlulur firr
p1
itt
t,lrr:
I'lrnl two ptrrioth
2.7;
1.1 Real-Time Systems
1. Introduction
llrllill ;rll tt'r1trt'r;lri ril lltr'llrr)(('si'r('s. T|is is a real-tirne requirernent, as any rt:<1tt<'sl, ol ;t ;,t,x t':;:r rtttl;il lrc lrrllill<'tl before its expiration. The deadline-driven scheduling algorit,hrrr \v;rs l)r'()l)(xicrl irr lfil,l. ll s:rlis fies this requirenrent, under the assumptiotrs Llr;r.l llrt' sclrlrlttl,'t ovlt ltr';trl is Therequirementforthescheduleris
1,o
negligible and
provecl befcrrc implcmentation proceeds. After iustification of the clesign decisions, a computer program can be designcd accordingly, and hosted in the gas burner. This program interacts with a flame sensor to detect flame failures, and controls the opening and closing of the gas valve, so that the dcsign decisions, and hcnce the requirement, can
bc
lrt
\- Lt . /-.t.:-'
these two decisions implies the original requirement, a fact which must be
r
i:l
In this algorithm, the expiration time of tr rt:<1tt
Gas Burner This exarnple was first irrvestigated in [145]. A gas burncr is
val at least one rrlinntc long otherrvise the requirement rvouid be violatccl irnmediately on the start of a leak. This is also a real-tirnc re<prircrttt:rlt. Tlrning next to the task of dersign, certairr decisitxrs rlrust, l)(r t'aktrtr alrottt, hciw t|c real-tinre re<prir:ernerrt is to b
()n('s('( ottrl; ;trtrl lo lrtlvlttl 1rq'iorl sltoulrl lrc rlcl,r'r'(;tlrlr, ;rrrrl slolrlr;rlrlr"nvillrirt llr;rl ;tlllt ;ltt\ lr';rli irr llri:;1,''tiorl, llrl J',;rrl lrcrqrrcrrl lr';rlis, il il;tctlPl;rlrll l,rr11rlr rr,ilcl:r llrr,r;u'ilr'lrirrl,, lrr ll 1',;u; liir llrirl\ :tllotr,lrt l'lr,'(rrltltttt( lirltt {rl
satisfied.
tr
Both the deadline-driven scheduler and the gas burncr a,re real-time sysLcms, altliough the first one is a software system, iind the second is a softwarerrrrrbedded system, also called a hybrid system. Duration calculus (abbreviated to DC) is a logical approach to designing lcal-tirne systems. Real numbers are used to nrodel time, and functions frorn lirne to Boolean valucs are used to model the behavior of real-time systems. Orr the basis of interval logic, DC provides a formal notation to specify propt'rl,ies of real-time systems and a calcuhrs to formally prove those properties, srr<:h as
the satisfaction of the requirernerrts for the deadline-driven scheduling
irlgorithrn and for the design decisions of the gas burner. 1.1.2 Real Tirrre r\t, l,lur lervcll of requirements, rcal time is ciften understood popularly as conlirrrrorrs tirre. However, at the level of implementation, a piece rif software is irnl>l
lior cxample, the gas burnet, a software-embedded system, is used in rrrr cnvirr)nment where tiurc progresses continuously. However, the errrbedded rr,['l wrrrc of the gas burncr rnay rurl in a computer with a certain machine
r'lc, irrrrl interzlcts with other physical comporrcnts via sertsors and ar:tu,ators Iriclr operrate discretely. Alt,luxrgh the dearlline*driven sr:heduler, a software system, is hosted in a lorrrpul,cr wlu:r'e time progrcsses discretely, thc correctness of the deadlinerlrivcn sr:lrcrlrrlirrg illgorithrrr is expected to be indcpendent of the specific host r rirrrpul,cr', i.c. l,ir<: algolithrn can bc bcttcr understcicld in terms of continuous
r'1 rr
litrrr,.
'l'lrclr'lirrc. l,lrtr irrl,rrr'[a,
1.1 Real-Time Systems
1. Introduction
is irlcrrlilit', l, Ilottt u'lticlt rli''t rt'lt irrr<:it,tt lrt' svtrl lrt':riztrl. llcli'rcrrccs lll), controllers digital pl"-"niaiions callecl sl;r,l,cs lo ;rl)l)r{)\irr;rlt' t ottlirtttotts discrot(: irrtroduce 156] 20, 25, 137, 138, sptrt ilit;t(,iott:r ('xl)l('rj:i('(l ;rs l)(l continrulrs refine pr.ovide to rules states, and implementations. formulas into discrete
In
[32], a subset of DC forrriula,s
1.1.3 State Models In DC, states ancl euerfts ale used to model thc lrclr;rvior o{'r'r';rl lirrrc sysl'trttts. ( However, the book concentrates on state rnotltls rrrrlil llrrrlr. 1), rvlrt'rrr sl,atcr sltt'l.t: rrtrxl,tl' of lltxt!,r'rtrt A of ev
P, : llime -+
'{0, 1}
,
where 'lfime is the set of the real numbers. Each Boolean-valued function, also called a" Bool,ut,rr, sl,u,l,r: (
Deadline-Driven Scheduler In orcler to prove the correctness of the deadline-drivcn s<;lttlcltrl<1 , wtr irttroduce the foilowing states to model the behavior of thc sc:lrctlttk)l:
+ {0, 1} Stdi :lfimc + {0,1} Urgo, : 'lfime -+ {0,1},
R.trn; : llime
fori,
j:1,2,...,'rfl.
: !,2,. . .,m) are used to characterize the tr)ro(:essor : l means thaL pi is running in the processcir at tirnc l,
The states Runl (ri occupation. Runi(t)
while Runi(f) :0 rtrezt"ns that p; is not running at f' Thc states stcl, (t :1,2,...,m,) characterize the standing of thc requcst. Stdr(t) : 1 means that at tinre I the current request of pi is still stzr"ndirig. Narnely, the current request of p; is yet to be fulfilled at tirne t. Stdr(t) - 0 mearls that at I the current request of pi is not standing anyrr ore' Lt otlicl' worcls, the current requr:st of pi has been fulfilied bv time l' For a llair of processes fii and pi ( I j), thc stzll,c LIrg,.,
of the progcsses is morrr rrrg
It
is obvious that any set of the above functions which characterizes a
possible behavior of the deadline-clriven scheduler must satisfy ccrtain prop-
crties. For example, at any time f, if Runi(t)
:
1, then
Runi(f) :0fctr
jI
i,,
as the processes share a s'ingle processor. The properties which capture the scheduling algorithm are utore complicated. DC provides a formal notation to speci{y the real-time properties of the
scheduling algorithrn in terms of states Run,;, Stdi and Urgor. Furthermore, hhe real-tirrre requirement of the scheduler can also be expressed in DC through these states, and the correctness of the scheduling algorithm can n t,hen be verified using DC.
A Boolean state model of a system represents an abstraction of the behavior of the system, and may be refined to more primitive states during the rlesign and the implementation of the system. In particular, fcir designing a software-embedded system, a Boolean-valued state may be finally refined to nral-valued functions which model the behavior of physical compcinents of l,lrc system, as in control theory. We call thc real-valued functions a'real state rn,odel of the system. Consider the exarnple of the gas burner. Cias
Burner
verify the design decisions ;rg:rinst the requirement, one may start with a single Boolean state to model Llrc critical aspect of the system
'l'her gas burner is a software-crnbedded system. To
: lfime -+ {0, 1} u,lr
,
0 means
llrirt gas is not leaking at f IJowever, at a later stage of the design one may have to sper:ify the phases ol llrrning and idling of the gas burner, and introduce more primitive Boolean sl,ir,l,cs of the system such as Gas and Flame to characterize the flowing and lrrrlrring of gtrs, Then Leak can be pointwise defined as a Boolean expression .
corrl,:rirriug Gns a,nd Fiarne:
Lurk(/) : Gas(l) n -Flame(t), lirl irrry /
Ct'll'irrrr'.
lirolrr;rrr olrcr';rl,ors (c.g. ,;r,rrrl A) lor sfia,ttrs arc tliereftire inchrded in DC, :;o llr;rl ;r. r'onr;rosilr' sl,;rl,t' o[ ;t t'c;tl litttc sJ'st,trttt <:an ltc rcfirtecl to primitive rl;rl,r,:; of llrc s),slcrrt.
llou'r'r,r'r', llrc ll'rt,ol 1i;ll; irr;rclu;rll\';r tr';rl v;tlttt'tl flrrrr'liotr o['l,ittttr, it,tttl r';ur lrr,rlr,lcnrrirrr.rl lrI llrr,,1,'1,.1,',' 'l,r1r.ttitt1,, ol';t 1,,;t:r r':tlt'r'.'lir rlt'sctilrc Llt
\:rlr',,
'll'ttrr,
lrt, ( ,l
t.1 Real-Time
1. Introduction is introducecl, where Valve(f)
:
d meilrts l'lr;rl' I'lr<'v;rlvc is opcttlrl
{o;t
tltrgttrrr
d(0<0<@)attinlet.
The Boolean state Gas can be regmr.l
-
I t. if Valvel t\ 2 0o lo.o'herwise lilrr<:1,iotr ol'
;t
pt opct l,V
tlf the
real-valued function Valve. Furthermore, the opening and the closing of 1,ltc virlvc rtttr t:ottl'tttlltlrl by a piece of software embedcled in the gas burner, whit:lt govt't rrs I'lrc irPlrli<:a1,ion of a force to open or close the valve. This applied fixt:t't:;ttt lrtr trxPt-<:sse<1 as another real-valued function:
Force:lfime +[-Q,O), stan{s for the greatest strength of the applictl lil't:tr. 'l'lttr rtlal-r'alued functions Force and Valve are called real states of thc ga,s ltttttttrt, :nrcl join with other functions to form a real state model of thc systtrrrr. Tlitl relation between Force and Valve may be defined by a differential trrlrrtr,t,i
from
f/
fl
mechanics.
As a design calculus for software-embedded systelns) rcs
1.1.4 State Durations Ttre notion of state d,'urat'ion is lsed to specify the behavior of real-time systems. The duration of a Boolean state over a time interval is the accumulated presence time of the state in the interval. Let P be a Boolean state (i.e. P:'llirne -+ {0, 1}), and [b,e] an interval (i.e. b,e € llime anrl e ) b). The duration of state P over [b,e] equals the
integral
f;r67 at. Let us use the two examples described above to illustrate the importance of state durations in specifying real-time behavior.
is lo llrllill rrll lllt'ptot'r'ss tt' (11('sls lrt'lirrt' Llrcil t,xlrit;rl,iorr. 'l'lril tcrlttitt'tttlttl t;ttt lrt'r'xpt,'l'lrit'tl itt l.r't ttts ol rlrrr';rliorri,rl {ltl rll;rllr; llrttr,, l,,t t l.:1.. ',r,. r'
ol'llrc
f("
I)Ti,nT1) is equal to i(t) dt
:
C1:
ci
'
l{ence, the r.equirernent is satisfied by t}re scheduler iff the duration of R.uni over the interval l(n - l)T6,nTif is equal to C6, for alI i -- 1,2,. . . ,rn and
n
rt,:7r2r....
Gas Burner 'llhe real-time requirement of the gas burner is that the proportion of leak Lirne in an interval is not more than rtne-twentieth of the interval, if the irrterval is at lcast one minute long. This requirernent can be expressed in l,
) 60s + 2Of;Leak(f lirl arry interval [b, e]. (. -
b)
I
dt < (e - b) ,
n
A mathematical formulation of these two requirements can hardly leave state clurations. Since the processor may be preernpted dynamico,Ily, the rlrrr:ation of R,uni extracts the accumulated nrrning time of p; from tlie dyrr;r,nric occupaticin of the processor. Also, since gas leaks occur owing to rant/lnr, flante failures, the duration of Leak extracts the accumulated leak time ol gas from the randorn flame faillres. Therefore, state durations are adopted irr l)C to splecify the behavior of real-time systems. 'llte dista'nce between states (or events) is another important measuferrrcnt, of rcal-time systems. This was studied extensivcly before the developrrrr.rrl,
rrrrt,
l','
t'(t)
tt,t.
-' (tl . r') > t),
il',,1'r'tl9 rr9l, t'ir.lc itlrottl, itts{,;rltlrtttt'otlS:tlrSrlltr'
<11
/'. ThiS t:xllreSSiOn iS read
rrr tr';r.l ;ttt;rlysis ;rs
Deadline-Driven Scheduler 'l'lrrr
Let us assurre that all the processes raise their first request at time 0. .Ihus, every rith rcquest of pi is raised at time (ri I)Tu and expires a,t time n4, where n - 7,2,. . . . Therefore, the schcduler fulfills the nth request of p; iff the accumulated run time of pi in the interval l(n - l)Ti,nT;] equals the requested time c1. Namely, the duration of state Runl over the interval
{1,,"o""
In other words, Gas becomes the characteristir:
Systems
st'lr<'rlrrlt't
"/' :tp1tr';ttrt ;tlttto:il t't,t'tl tt'lt,'1,' irr 1,,rll" l'ltrtrl. t,';rl litttl r'1tt:lll;tiltlii r)ll lllt'l;rrll.ilrl',1rlti'rrl:; ol r;l;rl'':; t;tlt ltt't'x;ttl'ri:;t'tl ilt lltttt ,,,1 ',l,rl, ,lttl;rlt,ttt,. .
1.2 Interval Logic
1. Introduction Then,
Gas Burner <:trsrr of'llrt'11irs lrttttrt't. l,t't, fb,r'l lrrr guarantee tlt
c
Consicler the first design decision in the
Yc,d:h
I
c
I d(
e.(Leak[c,
d] + (d-
r:)
<
I s).
Real-time constraints on distances betwecrt stitl,t's c;ut lrc trxpr
thirty
seconds long:
Yc,d,r,.s : b ( c < (Leak[c,
r]
r <sI
d
I
d]) + (.s r) 2
:]tts
where Nonleak is a state defined from Leak using thc rttlgal,irlrr
Nonl,eak(f)
(-):
so, by the coltraposition law of propositional logic, we complete the proof of l,he equivalence of the two forrnulatiorrs of the second design decision. n However, the equivalence of these two formulas holds only for continuous l,irne. In the rest of this book, whcn we are concerned with a contitruous time rlgrnain, we shall adopt the second formulation, since it correspclnds to a slrnpler formalization of the second design decision for the gas burner in DC.
By axiomatizing integrals of Booiean-valued functions, DC provides a lrossible way to introcluce notions of real analysis into formal techniques for tlcsigning software-embedded real-tirle sYstems. Notions of integral and/or automata [4, 99], statecharts sequential procommunicatirrg and 176] [t)2], systems. software-embedded considering crrssc's (CSP) [55], rvhen Stlte dlrations, as integrals of Boolean-valuecl functions, are functions temporal logic of actions (TLA)
The above formulation of the second design decision for thc gas burner can be changed to a syntactically weaker but semantically equivillent gne:
+
(d
- ") > 30 s
<'r < s < d' in lb,e)
time intervals to real numbers. The state durations of DC have been ;rxiornatized on the basis of thc interval logics proposed in 11, 27, 43], which t ;rrr lle regarded as logics for functions of timc intervals. ll orn
.
The equivalence of these two formulas can be proved as follows. It is obvious that the first formula implies the second one. In order tci prove the other implication, we assume that there are
1.2 Interval Logic lly irrtnrval logic we rnean logics in the sense of 11,27,43], for example. We Vicw l,hcse lcigics as logics for time intervals. Let ]Intv be the set of time irrlcrvirls, i"e.
such that Leak[c',
llnt,r'
r], Nonleakfr, s], Leakfs, d'] and (s - r) <
Under this assumption, we let
?:(30-(s-r))>0 c : max{c', (r (q/l))} d,: min{d', (.s + (r1/3))}.
30.
d,,i.lferen,tiat have also been adopted irr studies of
foranyt€lfime.
c'
r], Nonleakfr, s], Leakfs, d] and (d - c) <
Leakfc,
l,he seconcl design decision differently. ,
I -Leak(t),
Yc,d,rrs : b I c: I r I s I d I e. (Leakfc, r] A Nonleak[r, s] n Leak[s, d])
rind
Iu chap. 12 we shall deal with a discrete time domain and shall formalize
e.
A Nonl,eakfr, s] A Leak[s,
it is easy to prove that
I
{ [b,r:] | b,c €
lfimeAb < e].
30. I
.2.
I
I
nt,orv*rl Vrriatrles
Irr llrcsc logir:s, wc ('il.n oxllt'()si-j lrrollt:t1,ics o{ [iurtrti
t r t tt t,l, ut t,t"ir
1,,,1 1r,
t,lt Lc
t,, : llrrlv n l11r,,
s.
(lirl i
l,2,it, l) lrt'itrlt'lvitl r';ttiitlrlcs, i.t'. i
lll ,l,,rr,,lr,:,
ll'i:,
1
l1r' r;r,l ,,1
t,,;rl rrilrrrl,,'t:,
10
1.2 Interval
1. Introduction
A formula such as u1 I (u2 I rts'tta) is interprete
q'u4) :
nrrlv
-+ {It.ff}.
An interval [b,e] satisfies the formula iff the value of u1 of'l/r,r'l is lt'ss l,ha,n or equal to ttre sum of the value u2 of lb,el and the pro
I : llntv -+
lR.
For an arbitrarily given interval [1,,c], I delivers tlie va,lrr
In the literature of
/P
The sutrinterval modalitv O (Fig. 1.2) is a unary modality. For any formula ,h, Orb is a new formula which holds for an interval iff / holds for some su,binterual.
Matheniatically, an arbitrary interval [b, e] satisfies O/ iff there exist that b { r: I d ( e and the interval fc, d] satisfies @. Thus, frorn intcrval [b, e] one can reach its subintervals with O/.
srrr:lr
is
c,
d
the:
\+ ,b
fir1t1at.
lrig. 1.2. The modality
Gas Burner The requirement of the gas burner can be expressed in terrtrs of the state duration Jleak as
': t > 60 =+ 2OPeak 1(-, burner.)
O
'lhc dual of O is n, which is definecl as
Zr[ = -O-d. ll.r, r:] satisfies n/ iff any subinterval of [b, e] satisfies /. Witli n, onc cal] forrmlate the first design decision for the gas blrrner, llr;rl irrry k:ak in tlie guarantee period of the gas burner must be stoppable
llt'rrr:c,
where 60 stands for 60 seconds. (Henceforth we choose tlte: second as the tirne
n
1.2.2 lnterval Modalities The set of interr,'als llntv is the semantic domtrin of interval logic. Li irrt
O
o6
an arbitrarily given interval [b, e], the value of the intcrva,l variable [b, e], i.e. the value
urrit in the example of the gas
mathematical logic, logics of modalities are called
The Subinterval Modality
the duration of P in
GbReq
11
rnodallogics 115, 66]. The semantics domain of a rnodal logic is usually called a frarrte and it consists of a set of worlds and a reachabili'ty relation of the worlds. Thus, an interval logic is a modal logic wtrich takes intervals as worlds. In [1,43, 147], tu'elve unary modalities and three binary moda,lities are suggcsted for defining various interval reachabilities. We list here four of the rnodalities, which are used later in this chapter.
/P : Ilntv -+ IR. lbr
Logic
u'il lrirr orrc s
l,'ilsl,, thc rnatlxrrnatit;a,l chfirrition of Plc,d] (i.e. P takes the valuc 1 almost ,'r,r'r'ywlrrrrc itr a uortlltiittl, itrtclrval ft:, d]) can be expressed as a formula withciut rrrt,rrl,iorrirrg l,ltt: irtl,clv:t,l
ll/'ll //'(^(>0. l'lrt'rr.
llrl
l)r',,it
lirllolvirrlr; lirnrrrrl;r
11(ll,r,;rli,ll :./'
is;r lirlrrr:rliz;tliott o[ ],]r
rlttsigrr tltrt:isiort:
l). l
12
1.2 Interval
1. Introduction
The Chop Modality ^ The chop modality ^ (FiS. 1.3) is a binary rrrorlir,lil,y ittl,ttttlttt:rrrl irtlo irrl,trtvill Iogic by [43]. For formulas Q and,r!, the ncw [irlrrrrrl;r tft tf, iv, s;rl,islictl lrv tur interval iff the ilterval can be chopped irtto Lwo ;t,tl.iitt:t:rrl srrlrirrlr:tv;tls str
Inotherwords,theinterval[b,e] satisfiersl,lt
1,lr.t'rr
cxists
Logic
13
However, contracting modalities cannot express un,bounded liuertess and fa'irness properties of computing systems, sincc these properties are about lrroperties outsi,de any given time interval. Modalities which provide access to the region outside a given interval are called erpandi'ng modalities. In the following we givc two exarnpies of expanding modalities.
The Right Neighborhood Modality O' 'l'ire modality O" (Fig. 1.4) is a unary modality. An interval satisfies O,Oltr a r"ight neigh,borhood of t'he endin,g point of the interval satisfies /. Nfathematically, fb, e] satisfies O,d ltr there exists d ) e such that interval
d-t,
[r,,
m,
d] satisfies
/.
,b
orrb
Fig. 1.3. The modalitv 'b
Thc reachabiiity relaticln defined by ^ is a ternary one. It provitles access to adjacent slbintervals of an interval, and hence clefine:s a' tclllporal ord,er
Fig. 1.4. The modality O'
alnong subintervals of an interval. with ^ anri n, one can fcrrnralize the second formulation of the second clesigrr decision for the gas burner giverr in Sect. 1.1.4:
'I'}lrs, O, provides
Des2
2 n((flLcakl ^[-Leakl -fleakl)
=+
access to right neighborhoods of e from [b,e]. Since ricighborhoods of e are outside lb,el, O, is an expanding modality. 'l'hc modality D,is the dual of O' and is defined as
ri1,,lrt,
I > 30).
zr$ 2 -Qr-[. To pr6vc the correctness of the two design decisions is therefori: to prove the validity of the formula (Des1 A Des2)
=+
GbRetl
Wit,lr O", one can specify properties related to future time, such as liveness ;rrrrl lirirrress properties of cornputing systems. Corrsider the example of the
.
In fa,ct, the subinterval modality
'l'lrirt is, an intcrval satisfies arf itr any right neighborhood of the endirrg ;roirrl, of thc interval satisfies /.
o
can be derived frorn the chop rnodalitv,
sinr:e
lrurrrcr. Let HeatRcq Lre a state to characterize a request for heat from llrr, grr,s llrrrrrcr', The forrnula
1,,;rs
O,l <+ (true^(/^truc)),
llllcal,ll.
wherc "true" stancls for a formula which is satisfied by any interval. Therefore, the seconci dcsign decision (as u'ell as the first one) for the gas burner t:ari be expressed in an interval lcigic of state durations with ^ as thc orrlv rntlda,litr-.
n
if l,lro trtotl;r.li1,y prot'itltrs ;tr:trrrss ottly ltr pitt.ls oI ir givt'tr irrl,r'r'v:tl. i.r'" srtlrittl,t'r'r,ltls,,l'l,lrt' irrlt'tr,:tl. O ;trttl ;t1t. l,w6 lxrrrlplr,s ol conl.r';rclitr1,; rrrorl;rlilics. \Villt llto cottlt;rr"litr1', trrorl;rlilt' , u't, lr;rt,r,r'x;rtr':r:rprl llt1 lt19 rllrlil',tt (l('{ iiliollri Ior llrl'1',;t:; l,ttttt,'t rllrilll r';ttt A
rrrrrrli,Llity is ca,lktrl utrr,!:nr,t:t,i,n,t1
-+
q.(.fFlarrrc
)
0)
if ortir riliscs a hent request, then tliere will exist ;r l)r'('ri(,r(('o['l,'lrr.rrrc irr Llrc [irl,rrrc. This fiirnlrla call represent an additional rr,rlrrin'rncrrl [irr Llrc p,;ts lrttt'tttrt, l,o ttrjtrt:1, a sa,[
(,xl)r'('sr'jcr-i l,lrc r:orrtlil,iorr 1,ha1,
'l'lrc
l,r'11,
Nciglrlrollroorl Morlrrlil,.y Q
,i,rt,s,i,tl,c
1,,tt;rt:rtrl|r'llrr' .';rr/i /17 r'ttltr':rl t|rlttitItttItll
{rl lllI l'.ili' I'tlttt''l
l'lrl rrrrrrl;rlrl\" t (l"it', Llr) ir;;r tttt;tttr tttorl;rlil1', ,\rr irrlt'tr';rl s;rlislics Q1,f,ill ll tti t,lltl',ttlt,,,trl.,,l llv l)(tlttttttttrl;roittl ol llll irrlltt;tl r;;tlirllilrl '/'
L
it
1.3 Duration
1. Introduction
Fig. 1.5. The modality Q
[c, b] satisfies
'
r:'i
b sttr:h 1,hll, irrl,
-O1-Q. n
this book, it is proved that all twelve unary rnotlalities and three binary modalities of interval logic can be derived fi'orrr o' and Q in a ^ first-order l,ogic with interval length l. Howevcr, this book will use as the fairncss and livcness llroperties only moclality, except in Chap. 11, whcre tlte of computing systems are discussed.
In Chap.
rvith the Boolean state
moderl.
/.
Thus, the modality Q provicles access to the past tilrttl
aft 4
15
models, real-valued functioris are called real states of systerns, and characteristic furictions of properties of undcrlying real statcs are c,alled Boolean states. Boolean states are assurned stable, i.e. any presence (or absence) of a Booiean state must last for some period, and are represented by Boolean-valued slep frrnctions. Euen,ts are taken to be transitions of Boolean states. First, a basic calculus the calculus for durations cif Boolean states was developcd, and then other rnodeis were introduced by adding to the basic r:alculus extra axioms, which formalize the models and also their interrelations
d
Mathenatically, [b,e] satisfies qd itr t]rere exists
Calculus
11 of
Boolean State Model
'flic basic calculus of DC
[168] axiornatizes state clurations for the Boolean
stzrte model, i.e. irrtegrals of Boolean-rralued functions, under an assumption
ol t'ini,te uario,b'ility (aiso called the non-Zeno phenornenon) of states. The irssumption of finite variability stipulates that any state carr orrlv change its l)rosence and absence finitely rnany times in any bounded tirne period. That is, only finitely many state transitions can take place in any bounded timc pr:riod. The interval rnodality used in the basic calculus is the chop rnodality . This calculus can be used to spccify and verify state-based safetv proprrr'1i
lloolean State and Event Model
1.3 Duration Calculus Research on DC was initiated by the case study [145] in connection with the proCoS project (trSPRIT BRA 3104 and 7071). Several real-time fcrrmalisrns were invlstigated in circler to specify requirements and design decisions for a gas burner system; but they ali faiied in this case study. Two rnain observations of this case studv were that the ncition of a time interval was useful and that the notion of a state duratiort was convenient. This led to the first publication on DC [168] in 1991. Since then, research orr DC has considered ,liffe.ent models of- real-time systems) applications of DC and mechanical
sllpport tools for DC. in [161], there is a brief overview of early research on DC, and in there is a detailed account of the logical foundations of DC'
'l'lrrr l]oolean state and event model was stuclied nr [164, 169]. ln 1169], an event is a Boolean-valued d-function, i.e. a Boolean-valued llrrrctirrrr witli a value of I al discrete points. This rneans that an event is ;rrr irrst,ant action, and an event takes place at a given time point iff tlie lirolciur-vtrlued d-function of the event takes the value 1 at that poirrt. By lirrliirrg
;1
rr,r'i
lir:at,iorrs
if
prograrns.
llowcvcr', wit,h integrais of functiorls, one cannot capture the value of a lrrrrcl iorr 1r,1, ir qroirrt,, sirrr:c thc intcgral of a function at a point is airn''ays equal L zr,r'o, no rrr;r,1 tcr wlrirl, t,h
151],
1.3.1 Models l)il[i'r.rrrrl, rrrsrl<'ls;r1r'rrslrl lry rlt'si11rrr,r's ol'tr';rl l,irrrt'sYslt'ttts;tl rlil[i'r't'rrl rlcsil',lr ovcI sl;r.1,;r,s. lrr 1r'rlr,t lo;rcconrrrrorl;rlt, lrll ttcccr*i;ttl ttt,t,llls, slls ol'lllttr'liott:l lltr':rl;rlr' ltt irr l)(' rl1':llr'lttrl lirrrr'. r';rlllrl :;lul.r':i.;tt,'ttr;,',1 l,r tlt,,rlll tr';rl littt''
o['lr I]oolcirrr-vir,lrrrrrl irrlllr';rls lo f(), I l, i.r,. rrr,';rn \,;rluc
/':
ll
rrl
\ )
l0,
ll,
ftrrrc{,i
P, rlcsiglittcd P, is a function frorn
16
1.3 Duration
1. Introduction
Finite-Divergence Model
and is defined in real analysis as follows: P(rb,
el)
:
for any interval
dtt@
{#(;u
-
u)
:l;':1,
Calculus l7
,
[b, e].
Therefore, one can clescribe point properties of Boolcarr-va,hr
Ip = P.t. Additional axiorns ancl rules for reasoning about d-func1,i<xts att
Real State Model A real state model consists of a set of real-valued functions which describe the behavior of physical components of a software-embedded system. By using a
real state model, we introcluce stmctures into Boolean states, and a, Boolean state becomes a characteristic function of a property of reai states of the model. Therefore, specifications and reasoning at the level of the state may have to employ real analYsis. In 1170], it was investigatedhow Dc can be combined with real analysis, so that feal state models can be specified within the framework of Dc. In by the formalization of some parts [165], this research was further developed rnodalities. neighborhood right left and of real analysis using the
Dependability The dependability of an implernentation with regard to a given requirenient can be quantitatively measured by a satisfaction probability 61 the requirement for this imPlementation. In the context of the Boolean state model and a discrete time dornairt, the work presented in [86, 87, 89, 90] provicles clesigners with a set of nrlcs l,o reason abolt a1{ calculate t}ie sa,tisfactiorr lrrollability ttf zr givtrll rtr
The assunrption of finite variability of states and events stipulates that within a finite time period, state transitions and events can happen only finitely many times. The finite-variability assumption is always adopted in the case of software systems where Lirne progresses discretely. The notion opposite to finite variability is called finite diuergence (also r:alled the Zeno ythenomenon). Continuous mathematics does not reject finite rlivergence, and intrciduces the notion of a limit in order tci study finite clivcrgence. In [4S], the finite-divergence model was folmalized by introducing irito DC some rulcs to calculatc a state duration in a finitc-divergence modcl irs a limit of its apprciximations in a finite-variability model.
Srrperdense Computation comqtutation is a sequence of operatiorrs which is assurrred to be lirneless. This is an abstraction of a real*time computation within a context rvil;lr a grand time granularity. This assumptiorr is known as the sgnchrony lrypothesis and has been adopted in the case of digital control systems, whcre Llrrr cycle time of an embedded computer may be nanoseconds, while the s;r,rripling period of a controller ilIay be seconds. Therefore, the computation lirrr<: of the ernbedded sclftware of the digital control system is negligiblc, and rorrrl>utational operations can be abstracted as timeless actions. 'l'o accommodate timeless operations, [164] adapts the c]rop rnodality and r'(,n;rrrres it Lhe su,perdense chop. This can chop a time point in a grand time spirrt into multiple points in a finer space, and hence the superdense chop irrllorluces structure into a time point. lJy generalizing the projection operator [97] of interval temporal krgic, l2l introduced into DC the uisi,ble and i,n,uis'ible states, and computed nonI rrrllligible time through projection ontci the visible state. 'l'lrrrs, bhe properties of superdense computation can also be specified and vt.r'ilicrl irr DC. In 1107, 114], other approaches are considered for treating the rryrrclrr'<xry hypothesis within the fiamework of DC. A. superdense
l') x 1 xr
n
as ^ arr
\\'illr
crrrrl,r'rrr:1,irrg rrrorla,lil;ics str<:h
rrrorl;rlil,irl.r,.i7;rtrrl,l.'r iur';rrlcrltt;tlt', itr l,lrc st'ttst'llr;rl llrc ol,ltt't r:ottl'r;tt:1,ittg ;rrr,l,'rlr;rrr,lirrl,, trrr,l;rlil.ilrl;tt1',1,,r'rll,',1 irr Il, l;t, I l7l t;rlr lrt rlltivt'rl llotrr Ilrt'trr
rrr ;r litr;l ,rrrllr l,r1',il rr.'illr lrrr rrrlr,rr';rl lltr,,,llr /'.'l'lrr,r'uttt;rlr'lt'ttt':lt rtl llrl lit:tl, rrrrlr,r r';rllrrlrrr l'or 7;rrll i l,,t\'r'rr rrr lltilrl \\';l; lrrr,\'('(l itt l1)1, trrrrl, irr lsl. tlrt'
18
1.3 Duration
1. Introduction
completeness was proved for a combination of a first-order ternporal krgitl aricl
an interval logic with neighborhood modalities' In 131], an interval logic where intervals have a direction wirs srtggtlsterl. This logic is based on the chop modality, but the "chop poirrt" is a.llorvtlrl to be outside. the interval un
in [120,
123].
Calculus
19
level monitor [30,64], a gas burner lL27), a steam boiler [31,83, 135], an air traffic controller [68], a production cell [113], a motor-load control system 1157], an inverted pendulum [151], a chemical concentration control system 1153], a heating control system 1155], a redundant control system [36] and a hyrlraulic actuator system [125]. A case study for formalizing and synthesizing iln optimal design of a double-tank controi system was conducted in [62]. On the basis of these case studies, a methodology and notation for designing software-embedded systems were studied and developed in [16, 21, 149,1711.
Infinite Intervals The behavior of a real-tirne system, such as the dcacllirrc-drivcn scheduler or the gas burner considered here, is often assumed to be in,fin'ite. However, DC is a logic of finite intervals. An infinite behavior is tircroftlrc specified in DC as the set of all finite prefixes of the behavior. To sptlcifv liveness and fairness properties of the behavior of a system in terrns of its finitc prefixes, expanding modalities have been introduced.
An alternative to expan
can straightforrvardly express and reason about both ter"min'ati,ng and inf'nite behaviors of real-time sYstems. References 1117, 118, 1191 also compare the
expressive power of these extensions with the expressive power of monadic logic of order.
Real-Time Sernantics, Specification and Verification Irr order to apply DC to the specification and verification of real-time systems, l,cr:hniques for integrating DC with other formalisms such as CSP, phase {r'iirrsition systems, Verilog and RAIStr have been developcd in f37, ls7,5g,
1,78, 152], where DC has been used to define the underlying semarrtics. lrr [88], a uniforrn framework for DC and timed linear ternporal logic was
ti
plt:sentetl.
In [63], CSP, Object-Z and DC were combined into a uniform framework lirl thc specification of processes, data nnd time, based on a smooth integraliorr of the underlying semantic models.
hr [58, 133, 134, 164, 166], DC was used to define the real-time semantics lirr OCCAM-like languages. In [164], it was assurned, in the semantics of an
l(lAM-like language, that assignments and message passings take no time, In [171], a semantics was given to a (lSI' language with continuous variables which was proposed in 155] and can lrc rrs(xi to describe software-embedded systerns. lrr [98], DC was used to deline a real-time semantics for SDL, while [95] ,'rrrlrr,
Higher-Order and Iteration Operators when DC is applied to real-timc programming, it bccomes inevitable that onel introduces advanced operators into DC corresponding to the programming notions of local variables and channels, and of the lciop' In [39,41,6t], 108, 110, 163], the sernantics and proof rules of the (trigherorcler) quantifiers over states and thc p operator $rere investigated' It is interesting to cliscover that, because of the finite variability of states, the quantifiers over states can be reciuced to first-ordel quantificrs over global variables, and also that the superdense chop can be derivecl from the higherorder quantifiers.
I
1.3.2 Applications The applir:ations of DC focrrs on tlrc forrrral rlesigrr of rtlal-tirrx: sYstcttts.
Casc Stu
r
I
tr<
I
S.y
)(
;rrrrl r:;ur form a superdense computation.
sl'c
rr
rs
l)(l lr;rs lrcltt ;rJrlrlicrl l,t t;trl':llrtrliul rtl ttt;ttt\' :lollw;ttr'''tttlr''rltl'''l :11'rllr'lltrl r;1r.lr;;r ;rrr;rrrlolril,,l ll:l{il.lrr;rilrr';r\'11orrr;itt1', lllll;rlrrltttlt't l"rl'll:ti-1,;t tvltllt
)( I spccilir:tr,l,iorrs.
lrr 1521, l)(l wir,s rrscrl 1,o slrct:ily:urrl rca,son zrbciut real-tirne properties lilcrril,s. llr,lirlcncrr ll2,til ;rpplit,rl l)(l Lo lnovr: l;hc r:orrcctrrcss of Fischer's ',1 rrrrrlrr;rl lxclttsiotr lrlolotol. llr'{i'r'r'rrct's [17,20,25] sylc
20
1.4 Book
1. Introduction
properties of real-time database systems, and, in [49], DC was trse
Refinement of DC SPecifications In [g4], there was a first attempt to clefine refinement laws for a rcstrir:ted set whit:h dcscribe of ftrmulas of DC toward forrnulas r:alled DC im?tlementttbk:.s, properties such as tirnecl progress ancl stability. A full t:xptisition of these ia"u, i, given in the rnonograph l12al' In this rnonograph, tltcre is also a i.c. that it is strrdy of how to ensure that a set of implementables ts ft.o,sibl,e, set of Dc consistent ancl extendable in time. Techniques to refinc a f'ciisiblc
into an implementables via a mixed specification and prograt]lrlling language executable program were developed in [100, 133, 134]' into References ;2,t,7+,75,1'32l represent work on rcfining DC lbrrmrlas speciautomata. References [153, 154]proposed approaches to refining DC the and logic Hoarer fications into programs follo*itrg the paradigms of the
assumpticin-commitment logic.
1.3.3 Tools Interesting results about the completeness of the calculi for inten'al modalities and state durations ancl abotl deci'sion procedures and m'odel-checld'ng algorithms for DC subsets have been published' In [27], the completeness of the interval logic rlescribed in Chap. 2 was proved r- un abstract domain. A similar result was proved in 19] for the described ireighborhood logic describecl in Chap. 11. The duration calculus also be It can complete rekrtiuely be to in bnap. 3 has Leen provecl JSO_1.
co*pl"ie for arr abstract domain if we use o''-rules as in [38]' were Deciclable subsets of Dc and the complexity of decision algorithms 167]' 131' 116' I02,115, 47, 79, 35, 32, 18, in discovered ancl analyzecl [2, timed of a subset of sequences transition rn,hether siate In order tci check (even hybricl) automata satisfy a linear inequality of the state durations, which emplov itz, zo,' 80, 81, 82,84,158, 159, 172] developed algorithms iechniques from linear and integer programming'
Onlne basis of the abo'e res'lts, a proof assista't for DC was developed in [93, L40,744] as an extension of PVS [101], and a decision procedure [167] sourtclness for DC was incorporated into this procif assistant. For example, the proof assista'nl'' this by checkecl was Dc for rules induction proof in [50] of the 'Furtherrnore, 40] rrsirrg iil c:hrl<:kcrd w
I
t
(';l:l( )t ti I tl',
I
lcl
t
lt ir
1t
tr':1.
In
Structure
21
to check the validity of a subclass of DC was presented. 1105] developed a tool (DCVALID) to check the validity of a subclass of discrete-time higher-order DC. In [150], DCVALID was used to verify the correctness of a multimedia communication protocoi. In [34], a bounded model construction for discrete-time DC was presented, which was shown to be NP-complete. [142], a tool
Furthermore,
The proof theory for signed interval logic was developed and investigated 723), and SIL is encoded in the generic theorern prover Isabelle
iri [121, 722, [111].
1.4 Book Structure Chapter 2 (Interval Logic) develops the syntax, semantics, axioms and rules of ii first-order interval logic. It is the logical foundation of the axiomatizatlons
rllivcrr scheduling algorithm in DC. This demonstrates ari application of DC lo il rather complicated software system. Chapter 5 (Relative Completeness) proves the relat'iue completeness of l)(l with respect to a continuous time dornain represented by the set of real rrrrrrrbcrs. By relative completeness) we mean that, in the context of this conl,irurous time domain, any valid formula of DC is provable in DC, provided ;rrry valid formula of interval logic can be taken as a theorem of DC. (lli:r,pter'6 and 7 (Decidability and Undecidability) describe decidable and rrrrrk:cirlable subsets of DC formulas in discrete and continuous time domains.
'l'lrc rl
rrrlrsr,l.
llr;rplcr li (Morlcl (llrct'liirrg: Lirrcitr Dtrriitiori Inva,riarrts) presents an all,,olil,lrrrr 1,o rlccirlc wlrcl,lro ir,u irrrplcrrrcrrl,rrl,iorr of il rcal-tirn
Ittr,';rt
I
rt,'y,,t ;rtrr trritr1,. 1,t,,1,1,'trr,
_T]II-T!T 22
.:::;]@":.._
1. Introduction
formrlchapter 9 (state Transitions arrd Events) introduces extra atornic ervents' anrl transitions state about reason to ias zrnd axioms to express and with this extension, one carr refine state-basecl requirernents into stattl and an irrtplemcnevent rlixcd (or evcnt-basecl) implementations. Iri this chapter',
2. Interval Logic
against
tation as a real-time autornaton is verified for the gas burner example the two design decisions. hvpotheChapter iO (Sr,perdense State Transitions) treats the synchrotrv chop, supcrdcnse the With modality. chop superclense sis, and introduceslhe language' In this chaptcr presents a real-time semantics for an OCCAM-like passings take no the sernantics, it is assumed that assignments and message time.
neighborchapter 11 (Neighborhoocl Logicr) introcluces the left and right arld applies hoocl nrocialities. lt proves the a{eqlacv of t}rese two rnodalities, them to specify unbounded liveness and fairness' implemenchapter 12 (Probabilistic Duration calculus) assumes that an having tation of a real-tirne system is represente dby a probabi,listi'c automaton and Axioms a probability clistribution over tlisr;rete time fol each transition' probability ,rri", ur" clevelopecl to calculate and reason about the satisfactiorl over a of a requirernent, fclrmalized using DC, for a probabilistic automa'ton the to explain specifiei tirne interval. The gas llurner is uscd as an exar'ple notions and techniques involved'
Irr this chapter rve give the syntax, semantics and proof systenr for interval (IL). This part is based rriainly ot 127,28]. Furthermorc, we develop 1h
Iogic
2.1 Syntax 'l'lrc forrnulas of IL are constructed from the follorn'ing sets of svlnbols:
(iVt,r: Aninfinitc setof qlot)aluari'ablesr,A,z,'... Thesevariablcsarecalled
,,global,, since their meaning is independent of time and time intervals. 'l'Vril': An infinite set of te'mytoral uari'ables u,u',... . The rneaning clf a tcmlloral variable is a real-valued intcrval function. We assume the existence
0f a special ternporal variable I
e
TVar. Thc symbol I stands for the
irrl,crval function rn'hich gives the length of the interval as its value. !i,\'rtrrt,lt'. An infinite set of globo,l functi'orr' symbols fn,g*,... equipped with rrrities n,n'L )> O.If f " has arity ri : 0 then / is called a consto'rft. The rrr
lcirl mrrtrbers, wlfch ls be independent of time ancl tinle intervals. An infinite set of global relut'ion, symbols Gn,H- cquipped with aril,ics rr,,rrr, ) 0. The meaning of a glollal relation svmbol G'", fl ) 0, is an rr,.tr,r'1, l,nrth-r,zrluerl ({tt,tri) function on real numbers, witich is irrdepenrlcrrl, o[ l.irrrc and tinte intervals. Ttre trttth cclnstants true and false are llrt' orrly Lwo gkrllill relation symbols with arity 0. I ' Lr t I t'r". A rr irr lirritg sr)t, ctf tr:'nr,'porc'l' pr oposit'ional lette'rs X ,\', . . . . Tlic Ineanirr1,, ol r':rclr l,crrrlrolai propositional lettcr is a truth-valued intcrval funcli,\'t1rrt,lt'.
liott.
'l'lrl (l
scl,
rl'
lt'rttr,s
0.0; e 'l't"r'rn is tlr:Fititl
, ll I./"(0t. .
,0,,)
l lr,' r;r'l rtl .lttrttt.tt.ltr:; ,ft. rl' r l"rtt'ttrrrltt i:; rlclirrcrl
lrt I Irt' litllorvirrll itltsl t;tr:1
t trl;tr:
\ |('"'l/rr
r,',
| { lr ),i,
2.2
2. Interval Logic
^
is a binary modality for "choppirlg" an interval into two consccutive srrbintervals. We also use tp' Si,tfti and rp1 to denote formulas' false, and We shall use standard notation for constants, e.g. 0, 1, true and
where
for function and relation symbols of real arithmetic, e'g'
*
and
)'
reads: "for some subinterval: 95" reads: "for all subintervals: @" '
Thestandardabbreviationsfrompredicatelogicwillbeused,e'g.
- -((-d) v (-d)) ^4' ,b =+ 4, = ((-d) V,i)
+ 4, = @.+ ,b) n(:rl' + (V")Q ' -((lr)-/).
(rd)
+ (((v')(-{))^e)
+
e Gtrlor -+ IR.
Vol p'recedence
can be written as
r@
and a total function
l,<:t Val stan
6)
Wherr -, (lr), (Vr), tr and O occur in forniulas they have higher than the binary connectives and the modality ^, €'8'
fn,
is associated with each n-ary relation syrnbol G"'. Function symbols, e.g. + and -, and relation symbols, e.g. > and :, are assumed to have their standard meanings. In particular, tt and ff are associated with "true" and "false", respectively, i.e. true : tt and false : ff. The meanings of global variables are given by a ualue assignm,ent V, which is a function assclciating a real number with each global variable: J/
d
6
lRl -+ R
/'e
G' € IR' -+ {tt,ff}
The following abbreviations will be used:
true^(/^true) ; -O(-d) ab =
25
We a,ssrrme that a total function
is associated rnith each n-ary function symbol
Abbreviations and Conventions
OO
Semantics
((Vr)-',lt- e).
The following conventions for quantifiers will be used:
: (lr)(r > 0 A $) and similarly for )' (' " ' (Vz)(r > e + il and sirnilarly for )'('"' Y11,lr2,...,rn.Q' (Vr1)(Vrr) "' (Y"-)4t 1r1,12....,rn.d' (1r1)(3rr) "' (1".)d'
3r > 0.(t Yr > 0.$'
?
GVo,r -+ R.
Two value assignments Y,V' € Val are called r-equ'iualent if V(y) : V'(y) lirl cvery global variable y which is different from r. R,emember that llntv stands for the set of all bounded and closed intervals ,rl rral rrumbers: Ilrrtv
] t[b,.]
A b < e].
'fhe rneanings of ternporal variables and propositional letters, i.e. the "irrl,crval-dependent symbols", are given by an interpretation:
/ Tvo.r \
/
[ntv -+
R \
Lj l, u l,l' ;/cl ' - rtlrr,,,) \ \0n,"-+-1tt.n1/ (
wlr,'r','
2.2 Semantics r1o stl The meanings of terms ancl formulas are explained in this section' T
I b,e € R.
t1u717t,e]) e lR, for all u
€ TVar,
\ .r!\l0.ell p-b. and l. .rtr )([b, e]) € {tt,ff}, for all X € PLetter'
'l lrrrs, ;rn irrl,cr'pr
./
with each with each teniporal
associates a rcal*valued interval function
l,,rnPor';rl vir,r'i;r,lrlrr rrrrrl a {,t'ttl;}t-va,lttcrl interval furtction
1rr,;rosil,ion;rl lcl,lt'r'. ltr pit,r'1,it:rtlirt, I'lt
t'.t
,'/(r') ;rrr,l \'.r
./( \
)
/
denotes
26
2.3 Proof
2. Interval Logic The semartti,cs of a term 0 in an interpretation
J[0] e (VaI x Ilntv)
J
is a function
: l(r) :'ui(lb,el) (V,lb,e]) : fn(cr, "',cn) ' where ci : J[?r.\ (7, [b, e]), for I f i 1n" The semanti'cs of o' formula { in an interpretation J e]) J[u\(l,lb,e]) J[,f'(0r,. ..,0;n [b,
is a function
following defined inductively on the structure of formulas below, wherc the abbreviations will be used:
J ,V ,lb, ? O = J[f'l (V, [b, e]) : tt "l g' O = J[On Q),lb,e]) : J,V,lb,el\
J,Y,
[b,
e]
\,b^1n
LL "'
: tt
2. J,l,[b, e] l= G"(0t, ' ' ' ,0n) ItrQ!'@1,...,",): tt, where ci: ![?i](V, 3. J,Y,lb,ell -tP
[b,e]) for 7
4. J,V,lb,e)l $v r! \fr J ,v,[b, F d or J ,V,lb,e) l: t! "] 5. J,V,lb,"lF Q^'l' tfr J,V,li,^)tr r! a,,r
r
=+
?n
e [b'e]
(H,n:;iil,ili:ilTlj '')
d] + -((t - r) -o). ^ - i): r)) + -(-@ (( = "r)) \0 l( ((t
.
((l:r+e)
L2 (r >0Ay>0)=+
(;
il'rl thcn (.V")Q
l\
il
y'r
4,,
ill.,/,v,f/r,rll ry'firlt'vovirrl,t'r'lrlll,rrliotr .'/,v;r,lrtcirssil"rrrttctr{ }'";rrtrl ittlt't r';tl t/' lirt riottt. l/r,rl. I'rrr.tlrr,,:,,,,,,.,,, ;r lirr.rrrrrl;r rf,itt ,trr,lr.s.li.tr,hl,t'tll'.'7,1:,l/,,,| | i',t.,'it,rt'l;tli.tt .'/, r';tlttr';t:ir;il',ltttt.ttl )';rttrl itllr't'lrl l/r''
llrcrr
i['4, tlrt'rr
M t,!,'i
1.
is not free in iy'' is not free in /.
<+
(((':r)^([:a))).
.
'l'hc inference rules of IL are: MP if rf and $ + 'rl then t/.
A formula S is uali'd, written ts
o if@is a rigidformula. \) it rp is a rigid formula.
(q-((:0))' ,., uu Q) ,,=, l(( :0)' 6)
lff J,V,lb,")ft 6
6. J,Y,lb,ell (=r)$ iff v, tb ett:6
a) + D rL @^ '> (E '
D (1.'d ^ tlt) =+ =n'(Q- {) 1f r L 1r.($^r/t) if r tb)
PX
Xr{b,el)
t/l n -(d^d) =+ @^(4' n -P))' N \0 _ ^' ((d ^ $) + ((d n -p)^/). ^-lp^r/,)) A2 ((,b-,b)^d e (O^(,b ^,P)). A)
The definition of "7[@] is Itr
2.3 Proof System
A0 l>0.
J[6\ e (Vat x [ntv) -+ {tt,ff},
I.
27
The proof system of IL that we adopt here is called ,S' in [28]. To formulate the axioms and inference rules, we need the standard notions of free (global) variables. A term or formula is called fl,erible if a temporal variable including the symbol I or a propositional letter occuls in the term or formula. A term or formula which is not flexible is called rigi'd" Note that a rigid formula may include the chop modality. For example, the formula ((" > A) ^true) is rigid. The axioms of IL are:
-+ R,
defined inductively on the structure of terms by
J[rl(V,
System
) i
-(--rh tl') -1r,' ,q))
r/, llrrrtr (,1,-
r/' l,lrcrr (V,
. .
q) .+ U,-p) ,1,) > (P - /')
l'lrr,irrli'r'r,rr1r'r'rrlr,N4l'is r';rllr,rl "trrlrltts p61t'lri-i".'l'lrs irrli'r'r'rttt't'ttlrr (i is l lrtl tttL'l'r'ortr lit:il, oltlt't lo11ir', rrrrrl (i is r';rlllrl 1';r'lrrrt;tl 'l'lrc i:i llrll,',1 llr tttll ol ttllrl.liil),,;ttttl llrc itrli'tt'rtlr' irrli,r'r,rrcr,rrrl,,N ru;rli,rr
:,1;rrrrl;r1rl l,,r,t1,t;tliz;tliott
rrrll l\l
iri
lltl utott'l nttilill ttll,'r; lirt
r'lrop,
2.3 Proof System
2. Interval Logic of the sequence. We write
Predicate Logic The proof system also contains axioms of first-order predicate logic with equality. Any axiomatic basis can be chosen. Special cale must, howevcr, be taken when universally quantified formulas are instantiated anrl when an existential quantifier is introduced. A term d is called free for r in. $ If r does not occur freely in @ within the scope of 19 orYy, where E is any variable occurring in d' Furthermore, a formula is called t:hop free if ^ does not occur forrnula. We first illustrate bv simple exaniples why side-conclitions a'r'e nceded in the axiom schemas fclr the quarrtifiels. For example, the term y is free for r in (12)(z ) r), whcreas E is not free for r it (1y)(y ) r). These two forrnulas are both valid. Instarrtiat,ion of r with u in the first formula yielcls (12)(z ) g), which is a va,lid forrnula. However, instantiation of r with g in the second formula yields (ly)(y > y) , which is not valid. Flrther.more, consicler the following universally quantified and va,lid Ibrrnula:
(Vr)(((l : r) -'({ : r)) .+ (! :2r))
((L
:
() ^ ((
: l)) .+ (1. :
2t!)
to denote tlrat there exists a proof of $ in IL, and we call $ a th,eorem of IL in this case. A. detluct'iort, of Q i,'n IL from a set of form,'ula.s I is a sequence of formulas (hr . . -6,,, where /r is @, and each y',; is either a member of f , an insta,nce
one of the above axiom schemas or obtained by applying one of the above inference rules to previous members of the sequence. We write
ftd l,e clenote
it with
the tcrm
l,
fi,r
(f
Q2 4'@) +
O(e)
=n.$(r)
U
|dj) -
f
irr
IL,
and we write
,l'
I
( it e is free for' .r' in g5(r). antl leiihcr I is ligid or /(.r) is chop free-
I
cf impli,es
Q.
l,rrxt.f.It, in not difficult to show that each axiom is a valid formula, and that validity irr the sense that it gives a valid formula when
r';rr.lr nrle prcserves
,
\ /
'I1e ploof system has to contain axiorns of a first-order logic for tlie v:rlue and tirne clomain of IL, narnely a first-order logic of real arithmetic' In this book, we shall avoid the issue of forrnalization of real arithrnetic, but applv informal understanding of it in proofs.
Proof and Deduction oI lirtrrrrrllls tftl' 'rft,,, wlrctc ry',, is Ttrrtrt.[ 9t'ry' is lr Iirlil,rr s(r(lrl('ll(:(r rf, :t.'tl 1ir.r.lr ry'; is cillrr,r' trrt irrsl ;trrt'r' ol'ottt' ol'lltt' ;t.lrovt' ltxirtltt r-it ltlttl;ls rtt' .lrl,;rilr.rl lry;rpplyirr1,, ()1(,()l llrt,;rlrovr,itrli'tlttll tttlr':; lo;rtlli,rllri Ill('ltll)t'l:l
Rrrrrrir,lly, it
from
The fcillowing theorem about the soundness clf the IL proof systcm is an ,,xlrrrrple of a metatheorem which expresses a property of IL.
which is
which is not valid. Therefore, side-conditions occur in the follciwing two axiorn schemas:
Yr.$(r) =+
/
f,cfl t!
;rlrplirrrl
Ql
that there exists a deductiorr of
'l'lrcorem 2.1 (Soundness)
.
This forrnula is rrot chop free and instantiating flexible, yields the formula
l(b
1,o
valid
formulas.
i]
IL will be denoted IL7,IL2,..., to distin1,,rrislr l,lutrn from the metatheorems. Henceforth, in proofs of IL theorems and rrrclirl,lrtxrrcrns, we sliall use "PL" when we refer tO prediCate-logiC theorems 'l'lr
)r r'(';rl ;rlil,lrrrrctir: theorems. 'l'lrc krgic IL is arr externsion of the modal logic 54 (e.g. [66]) since the rllowirrg li llrr
(
tlr;rt lJry' is ;rrr irlrlrlcvil,tion of -O-rb and that Odr is an abbreviation of (Itttr' (r/, I'rrrt,)):
ll,l
tt@
il,2
I ltft i-
I
l,:t
lt,l
I l,/r
>,1,) > rft
.
.l; l ll
,l,l I l,/,.
ly'r
(t-lrl+n/;).
2.3 Proof System
2. Interval Logic The following is a proof of IL6:
We give proofs of IL1 and IL4 onlY.
Proof.
7. Z$ + tlt 2..(ud + {)
L proof of IL1:
1. (-(true^(-@^true)) n (true^(-rl ^true))) + (true^((-t/^true) n -(-d^true))) A1 2. ((-rh ^true) n -(-d^true)) A1 + ((-t/ n --d)^true) ^true))) ^ ^ (-rl ^true)) (true n (-/ (-(true 3. 1.,2., M, PL + (true ^((d n -'l) ^true)) Def(n) 3., 4.(tlfn-nl) s -a($+t!) 4.,PL. (DO n(d + {) + 5. =+.rh)
3.
assumption
(-@
n in the la,ter u be used will The following theorems and derived rule about proof of the deduction theorem:
TL5
Jrn+ -(-A)^": r(t/ L-]@ *
IL6
ttd + qt I.Q + 1$.
f.dl
rlt\.
2. (-4^',1,)
+
(-@^true)
PL
4.
7. (,t[' rlt) > (( 0 ( ,rft /')) l{. ( ',/ tl,) ) (l lrrt' ( uft t,t ttt') )
I l.$.+
4,.
I'roof. The proof is by induction on the length n of the deduction
n: l.
lu,sc uhere
f
Then {r must be either
/,
a member of
f
l,Ol {.
or an axiom.
{ i,s $: This case is simple, since F a(h =+ rf by IL2 and thus, a Z(b =+ th. i:,s
an ari,om or a mem,ber of
l: In this case the following
l.tlt '2. rf;
)
(J,h
3.3r[ ]
I'l ll,lt
tlt
+
rl.') PL 1.,2., MP
> 9).
'l'lrr, r'rr,sl wlrlltr r/, is cil,lrcr ry', ;r, rncrrrlrrrl ol' /' or' ;rrr ir,xiorrr is irs itllovc. ()llrnwist,,;r,rr irrlt'r'r'rrlt'r'rrlt'is rrpyrlicrl irr llrc l;rsl, slt'p irr llrl tlr,rlrrt:l,iorr:
l,:] 7., (i., | 'l
cl,eduction
Itul,rr,r'l,i,rtr: s/,c1n: Srrpllosc n ) 0. Tlrc irrduction hypothesis is: If I, Ql g,by a rlr,rlrrcl,iorr o['lrrrrgl,lr slrorl,cr l,hiur z whir:h rlocs not contain an application of llrr'1';r'rrcr';rliz;r,l,iorr rrrl
M PL 1.,
1:0?true ((.:0^(-d^t/l)) + (true^(-/^4r;1 3.,M 5. (true ''(-4t-',ll) + (tnr
3.
here.
no appli,cati,on of the qenerali,zation rule G in which the quantified
(lrne uh,ere rft
IL5 are similar, so we ctinsider only the first. we i.e. (-4^rb) + (true^(-/^true)), to prove IL5:
IL
uuriable is free in S, then
lliviirlly,
t .p) + ((o u) + (p -,r)) rL7 :10 n(@+A+l(a^Q)+(,tr-p)) - rl, + -tr/, 1. ty' + true
i,n,uolues
(
-Q).
prove (-@
5.,4., PL.
tb
llu,sr'. stey.
Proof . The two parts of
2.,3., MP
IL3
Theorem 2.2 (Deduction) If a
3.,6., MP.
^true))
r.,rL| ILr
lrr order to simplifv proofs, we establish a deduction theorem for
1., N
2., N -(true ^-(-(-/ ^true))) PL 4.(-d^true) + -(-(-@^true)) 5. (true ^ (-/ ^true)) =+ (true ^-(-(-d ^true))) 4', M 6. -(true ^-(-(-d ^true))) .+ -(true ^ (-/ ^true)) 5.' PL
-(true ^
.4i
2.3.1 Deduction
3.
f.
+
Tlre proof of ILT is left for the reader.
Proof. A. proof of IL4: 2. -(-@ ^true)
/)
=+
=) (nnd
* 84, 5. nd + nrd 6. nd + n{
4. aDd
!
r.o
n(nd
assumption
,.
32
2.3 Proof
2. Interval Logic
Case MP; The deduction from
f 0 {'b}
System
33
Case N: We give only a proof of the first rule of N. The second rule can be proved sinilarly. Let / have the form -(-{y^g), and the deduction from l- U {d} have the form
has the forrn
:
tht :
4,t
:
th =+ 4t
:
-F'Qt^q).
:
,l)
and aO '+ (Ih + T/) from f , by the inductionhypothesis.Adeductionofl@+/fromfcanbegivena,sfollows: There are decluctions of
.) : ! k.uO+4)r)
n6
=+
Ty'1
cleduction of u$
:
\
+
tl4 ftom
deduction of n@ + (r1,,
+/)
from ]-
+ ((!d + dr) =+ (nd + i/)) l (ild + 1r) il,') + + t + z. ia6 tO
=>
.') : i deduction of n/ + k..6 - 1Lt ) k.,rL6 k+Lad=+altt k + 2. ntl4 + -(-/r ^rp) IL5
f
l. JQ =+ \tbt => a) ) rpll I + r. 1r4' + (b' I + 3.
By the induction hypothesis, there is a deduction of n@ + ry'1 frorn z$ + -(-tf4 ^cp) from l- can be given as follows:
$
k
PL l',1 + 1', MP
f.
A
deduction of
+3. tO
+ -6th^v)
k + 1., k
ty'1
frorn
f
+2.,PL.
M: We give only a proof of the first rule of M. The second rule can be lrrrived similarly. Let / irave the form (rltt^p) + (b, ^rp), and the deduction llrim l- U {/} have the form Co,se
k',1 + 2', MP'
has the form Case G:q/., has the form (Vr)T/1, and the deduction from ]. u{@} :
rh.+ {z :
,bt
:
U't^q)
'(Y*)r/,t
r
does not occur freely
l,[rc induction hypothesis, there is a deduction of n@ + 0h + tbz) from f . A rlcrltt<:tion of DS-+ ((r/'t^g) + (rlt, ^9)) from f can be given as follows:
in
4i and hence
n@. Thus, we have, from
in
PL, F (Vz)(r@
+,!) +
: (zO =+ (Yr)$1)
: k.
Ac[ =+
\ '1,'1
deduction of n@
*
I il.tkh
> (Vrr:)y'"
(Vrr:)r/r1)
lrl, A;
f'
l
A
I
a"arr.tion of
4,2)
n{ +
(rl,t
+
rlz) from
l.,A:
l2.,Ml'
f
k.,IL6
t 'z.a(1,'.+ tl4) + ((,/lr ^e) + ((t2-e)) IL7 k + I.,k + 2.,PL. A: I il. rtlt + ((r/1 - p) =+ (,1,"^p)) A',
l,lrrr lrlool'o1'l,lrc
n
l,lr<xrr
l'r'ool,s r';ur i.iorrrr'l irrrcs lrc olrl,;rirrcrl rnorc cirsily lr.y rrsirrg Ilrlon'trr. Wc t';rtr, [irt cx;unplt', pt'ovr'
G
A;.,
4,t)
from
'l'lris r,rrrls
f
)
(Vt)(il(.,+
ft:* 2. (V:r)(n tf * tftl) + (n/ =] h:
dr from
Ty'1
]
l,'. ny'r + (t'1 + tl2\ ) ZQL1 -+ A: I l. Ztb
'
By the induction hypothesis, there is a deduction of n@ + deduction of !d + (Yr)rbt from f can be given as follows:
ft;+ 1.
A[z^p).
lly
-
Note that
=+
ll,8
t
t(l' ) /')
lr,|nr ;r rlr,rlrrr'liorr nl
)' I l(l 1,lr
1,hc dcdttction
i I l/,)
ll(ll,/, :'Il/') lrorrr 11y', :.y'')|
rr:;rrr1,,'l'ltcotlttt
.1.f,:
2.4
34
2. Interval Logic
r.6 +
is a "pure" theorem of predicate logic. This formula is chop free and the term / is free for z in 1y.(n : y). Henr:e, by Ql, the following formula is a theorenl
4,
1.,IL4 {) 2.,ILl, MP 3. to + Dlh 4..(.$ =+.1/)) 3.,IL4.
Z.
n(d
Theorems 35
=+
of IL:
1y.((.:
it is Remark. Although we shall avoid the issue of formalizing real afithmetic,
still interesting to mention a result in [28], where it is proved that, given any first,order logic for the value and time domain of IL which includes at least proof system is axioms for defining totally ordered commutative groups, the tr logic' given cornplete with respect to abstract domains of the
Y)
.
Many other theorems can be proved in a similar way'
e.g.
Q2y))12)0.(!.:y1-z). In the following, we shall simply refer to PL when we introduce theorems such as the two above.
Rigid Forrnulas Using the axiom schema R, one can derive many useful theorems for rigid formulas. For example
2.4 Theorems In this section, we shall present a collection of theorems and derived rules of IL which can help one to understand the logic and to conduct proofs. some of the theorems are proved. Others are left as exercises' proof: sometimes we shall use the following convention for presenting a dt
+ dz +62
0
IL10
(h n d") =+ 6z 3.h =+ rbs
2.
C'b, eQz
is an abbreviation
for
This generalizes to longer chains:
il +
'''
+
-
,lt))
Yr.(S =+ @^,1'))
1. (1.: r) + O 2.Vr.((1.: r) =+ d)
c
O. and /1 H ' ' '
\,e
I
@ lVr'(Q =+ d) Yr.(Q =+
if rp is a rigid formula. if dr is a rigid formula'
if r is not free in @.
l'roof.
++ Qz 2. Qz dz <+ 4s.
3.h
*
(l: r) + Ol 6
ILll
1.h
*.(,A Y
if / is a rigid formula.
Existence of Length
and
dt
e.O
The prools are left as exercises.
r-h + 6z is an abbreviation for
ILg
3.Yr.((1.:r)
o O''
=+
4.1r.(L:r)+d 5.1t .(!. : n) 6. O
Quantifications
fi+
assumption 1., G
(=r.(!.:r)=+ d) PL(rnotfreein/) 2.,3.,MP PL
4.,5., MP.
n
used later Some of the theorems and rules about quantification which will be are
Quantification and Chop 1r.(r[ - tl,) -+ (1t .$^1r.t!)
l,lxisl;r-.rrtial
+ b) =+ (it.A + ii )l V".(',1t + 6) + Qlt+Yr.Q) |
Yr.(rb @
=, u).7r.6
| t!
ll,l2
f r does not occur free inTy''
I 'tt x t.l'.
)
r)
PI, I )r tft I'1, tl, ', lr.'rf' 1.,2., M (lt tl,) ) ( lt .,1, i.rlt) Lr:./')) :1.,(l l. V.r'.((/, tl') ',. ( lr! l. Lr',(,/, l'\ i ( l.r'.1, 1.,'.y'') 1., I'1,.
L rlt
2. 3.
Predicate Logic and Ternporal Variatrles ,llr..trglr.rrl, l,lts lrg11l< wc slr;rll irr(,rotlttct'ltrrrgl,lr,;ttttlol,lttrt l'tttttDot;tl i11,1 "prl1c" l,ltt'ot trttts ol' plt'rlilltlt' lo11ir" l'irt cx;rttrlllt'
.
vit't
i;rlrlt's,
36
2.4
2. Interval Logic
Chop and Conjunction
Chop and False
-false) false' rL13 (false ):. {) <+ <+ false.
( (q, A l = .r\ r/', )\ ((pr AdzA(:r) (./r ^t/'z))' \ntto, ^(:"r; ;:;)c> ( tOt-(rrLnl:r))\ ^,)-((dr ^ nl:r))' \n (d, - t',tr'no:"r;;)<+ ^02)'\Qt ^rttz
(u
1r,77
proof . The direction J follows from R, since false is a rigid formula. The n other direction follows from PL.
Chop and Disjunction ((Ov
ILI4
0^e) e
((6-
dv
@^@ v,p)) <+ (@^,h)v
(,1'-
Proof . The proof of IL17 is quite tedious. We sketch here a proof of the + part of the first theorem, and leave the rest for readers. This proof involves two lemmas. The first lemma is
((({.: r)^rht) n((1.: r)^tbz)) + (((.: r)^(rbt nrhr)).
e))'
(d^d).
By L1, L2 and IL14, we can derive
follow straightforwardly from M. We prove the other direction of the first theorern by the method of reductio ad absurdum: Proof . The directions
((((
+
IL13.
(@'^Q
il^rl|) + -((l : r n -d)-'q)' @^Q : r Ar!)) + -(9 ^Q :, n-rh)).
IL16
:
r
A
: (!' : *- il' "^-d)) +> ((>rn -(-d^!':r)) c (Q^!':r)'
(.Zd n -((l:r)^-d)
+
^
-((t = n) ^ -($t n /r)))
.
- y - r)) n (62- (t - a - r))) +
((d' n dz)^
((.
: s - r))
(h
: r))^@tt
nrhr)) A1
M
Ll. n
()hop and Point
of the first theorem of IL16.
+ (1y > 0.(1.: r + A)) A -((l : r)- -6) + ((L : r) ^1y > 0.(!.: e)) A -(((' : r) ^ -d) + (((.: r)^true) n -((l : r)^-d) =+ (!. : r) ^ (true n --d) =+ (l : r)^$
r) ^4'z)) =+ ((l > r)
n dz n (1,: r)) ^true) n -((dr A dz A (l (dr n dz n (l : r)) ^-(tbt A {z) =+ (!. : r) ^ -(r!y n d2) + -((( : r) ^ (th t 4,z))
+
({> * A-(l
proof. we prove only the direction
:
ilrrd hence the lemma. On the basis of the above lemmas, we can conclude l,lre theorem through
Chop and Negation ((1.
((.
The proof is similar to that of the first lemma but through ILl1. By assuming r7 to be the length of the interval concerned, from L2 we can conclude that the length of the second subinterval is (g - r). Therefore, we can follow the proof of the first lemma to prove
A1
PL,M
* false^rp + false
^
((((l : r) A Or) ^true) A (((l : r) A d2) ^true)) =+ (((!: r) n dt A dz) ^true) .
d ^ -(kb^ dv (d^e)) PL n -(d^,P) -(tlt^e) ((dvrl')^d + + ((dvd)^ -$A-{)^e ^
: r)^4d
Hence, from IL16, we can obtain the first lemma. The second lemma is
(kbv,/,)-
IL15
Theorems 37
(o- (: u) <+ d. ((=o-'4i<+cb.
Il,t8 PL
l'rtxt.[.'l'|rc rlirct:l,iorr
L2,rLr2,M, PL PL,M
li
A1 PT,, M.
e
folkrws from L3. The other direction is proved as
rllows:
lf t-0)A
'
ll
i l'irlsc I i I'irlsc
0
M
ll,lrt.
38
2.4
2. Interval Logic
Box and Conjunction
Chop and Box
Fd n (,h ^p)) (nd Qh ^p))
IL19
^
+ (@ n,b)^d + ('l'^ @ ,P))
Proof. The following is a proof of
^
(l/
IL22
.
.
n (rL,^d)
+
IL23
<+
(Ld
^D$).
(.$v.11) + 3(dv $).
is often convenient to specifv properties of prefir interuals, i.e. intervals starting a given interval. For example, in chap. 4, to formulate the deadlinedriven scheduler, we specify the behavior of the processes on intervals starting at time 0. Below we give some definitions and theorems for the properties of prefix
It
Chop and Length
intervals:
((l > 0) ^((. > 0)) <+ (l > 0) ILzo ((l > 0) ^(t. > 0)) <+ (t > 0) . ((l > 0) ^(!.>0)) e (l> 0). Proof.We first give aproof of ((L> 0)^(l > 0)) + I >
Qrd =
.
1. (t>o)^(l>o) + 1r > 0.(1.: r)^1Y > 0-(L: + 2n > O.lE > 0'((l : r) ^ (l : Y)) 2.(r > 0As > 0^ ((l : r)^(t: v))) + 3.((!>0)^(t>0)) + Q>0) (l > 0)
=+
aorlt 0:
PL,M
Y7
E
(l > o) PL,L2 r.,2.,PL.
((t> o)^(t > o)):
0
+ 1r > 0.((': r) + lr > 0.((: r12+ r12) + 1r > 0.((!.: r12)^(L:
PL PL nl2))
PL,L2
(1r > 0.(!.: nl2))^(1r > 0.(!': rl2)) ILI2
+ + ((,> 0) ^(l > 0)
PL,M.
The other proofs are similar.
Box and Length The following theorem illustrates that the I modality can be expresse
rr6r rtrtt
^rh)
Prefix Intervals
!
The other proof is similar.
The following is a proof of
D(o
Box and Disjunction ((d n lrlt)^p)t
IL5,PL 1.(nd n(rh^d) + (-(-4-,p) T/) ^e) 41 ^(rb^e)) ^ ((--4 n (rh + 2. (-FO- 'p) n d) L',2',PL 3.(ild n(rh^d) + ((--4 nrh)^e) M (O nrlt)^P) + 4. ((--O rtr/)^d 3',4',PL 5.(Dd n(,b^d) + ((d n,h)^e)
!.>
Theorems 39
a$ a Vr,u20.(r* A Sl) + ((l = r) ''4'*( =U)) provirlrrtl rry tltt tlrtl, tttrtlllr frcc itr y'r,
IL24
rL2E
@^true
= -Or-tft J$ * ArS.
reads: "for some prefix interval:
reads: "for all prefix intervals: ry'".
e uo =o
/".
<+ Llup@.
=e-'6
Many properties of tro resembles properties of n, e.g'
tL26 .o(Q + rh) + Fod +.p{). IL27 .o4 + d. IL28 Aed e toJo6. IL29 d t aod. IL30 (trod) <+ Vr > 0.((z < l) + (O^V': "))). IL3L .o,b + -Fd^{). lL32 Dod + rlt | -rd -+ Dplb. IL33 .o(6+ d + ((O-0 + @- AD. lL34 d + apf if / is a rigid formula. IL36 (nrd (L^d) + ((d nrb)^d. ^ IL36 trr(d n rlt) + (nrS A arrf) ILSZ (nrd v tr,,,/,) + at,@v 4,) .
.
'l'lur proofn urtr ltrfl, tttt ttxtrrttixtttl.
3. Duration Calculus
In this chapter we present the syntax, semantics and proofsystem ofduration calculus. In addition, we present some theorems and rules of DC which are useful when conducting proofs.
3.1 Syntax We establish DC as an extension of IL in the sense that temporal variables u € TVar other than lhave a structure
Js, where /,S is called a state durat'ion and S is called a state enytressi,on. The set of state expressions is generated from a sel SVar of state uariables P,Q,R,... , according to the following abstract syntax:
S
:::
0 I 1 | P I -Sr I 51 V,92.
We shall use the same abbreviations for propositional connectives in state expressions as those used
in Chap. 2 in IL formulas.
Remark. The propositional connectives - and V occur both in state expressions and in formulas but, as we shall see below, with different semantics. This does not cause problems, as state expressions always occur in the context of /.
n
3.2 Semantics When we generate temporal variables from state variables, the semantics of the temporal variables must be derived from the semantics of the state variables. The semantics of a state variable is a function from time to Boolean values {0,1}, where the function is irrtegrable in every time interval.
3.2 Semantics
3. Duration Calcrrlus Remember that we use real numbers to model time:
I
llime
IR.
An interqtretati,on for state variables, the symbol
I
and propositional letters
is a function
Jx6) :T(X) ' Jz(lS) : I[lSl, Jr(t) : I(t)
/r"ime )lo.r)\
r:l ,3' l.l
r,,.,uu*m I
\er,rt,rrr/ \ fntv + ft.fi f
where
. T(P) :
llime -+ {0,1}, for every state variable P; furthermore, Z(P) has at most a finite number of discontinuity points in every intervall T(l) : Ilntv -+ IR and T(l)lb,el: e * b; and T.(X) : ilntv -+ {tt,ff}, for every propositional letter X.
Thus, each function Z(P) has the property of finite uariabili:ty, and, hence, I(P) is integrable in every interval. The semantics of a state erpress'ion S, given an interpretation Z, is a
for temporal
for every propositional letter X, for every state expression S,
The semo,nt'ics of a duration calculus forrnula 7 to state variables, is a function
ItQl t
'llime -+ {0,1}
1
I
We shall use the abbreviation St = TISI. We see from this semantics that each function 57 has at most a finite number of discontimrity points in any interval and is thus integrable in every interval. The semant'ics of temporal uariables, which now have the forilr /s and are called state durations, is given bv a function IR.,
tlcfin
/ lJ /;slll/),'
Lf,i,
:;, (r),tt
{tt,ff},
O ': Itb\ V,lb,el) ::ff. I,V,lb,"lVO ' T[d]V,[b,e])
I,V,lb,el F
11
We can define the semantics of DC formulas in terms of the semantics of
IL formrrlas, using the interpretation Jr indtced from
an
interpretalionL
The semantics of a DC formula /, for an arbitrary interpretation Z, value assignment V and interval [b,e], is defined by
I,V,lb,e]? 0Ifr Jt,V,[b,e]l Q in IL. variable
7[o](r) - o ztln(r) r[Pn(t) : r(P)(t) 7[(-S)](r) :1-7[S](r) : 0 and z[^ez](t) : o 7[(,s1 v sz)n(,) : { ? :t_fl::]i:, t otnerwrse
nntv -+
interpretation
Remark. For two given interpretations T and 7/ whose values for any state P disagree in at most a finite number of points in any interval we
,
defined inductively on the structure of state expressions by
L[[S\ :
(Val x Ilntv) -+
@' given an
for which we use the abbreviations
function
7[S] :
Jt
.
( trri, \
. .
This function can be used to induce an interpretation variables and propositional letters from 7:
have
rtfPn lb,el
: I'[[Pl lb,e],
for any [b, e]. No DC formula can distinguish between T and I' , since state expressions occur only within the context of /. We can therefore define T and It to be equivalent, and build equivalence classes of interpretations if necessary. n The notions of satisfiability and uali,di,ty of DC formulas are defined as for
IL formulas. In fact, the definitions of satisfiabilitv and validity for DC formulas can be simplificrl as shown in Ttreorem 3.1 below, which gives an alternative r:lrirracterizittion of validity and satisfiability using only prefin intervals, which iirc iril,crv;lls tf thc fbrrn [0, e], for nonnegative real nuntbers e.
Tlr
l'r,,(l) l'1(t I l) .
.
44
3.3 Proof
3. Duration Calculus
45
3.3 Proof System
We have the following lemma.
Lemma 3.1
IL, we adopt all axioms and inference rules of IL given in the previous chapter as axioms and inference rules for DC. We add axioms reflecting the structure which DC adds to temporal variables: Since DC is an extension of
T,V,lb,el
=
0 iff Tt,,V,l},e - b) t
O.
Proof. A. proof can be given by showing
T[lPn 1",4 for any 1",4 C
h(t + b) : for any
System
:
[b,
To[lPl
lc
-
b,d
-
DCA1 /O: O. DCA2 fi: l.. DCAS /S > o. DCA4 [5, + !Sr: .(St v,S2) + lS1 A Sr). : ([S : n + y) DCAs (US : ")^(JS a)) =+
b],
e]. This follows since
Pru(t)
,
t €lc-b,d-b].
tr
DCA6 [St: ISr, provided ,Sr e
We can then easily prove the fcrllowing theorem.
^92
.
holds in propositional logic.
In order to formalize the finite variability of state expressions, we add two
Theorern 3.1 1. A formula d of DC is uali,d iffI,V,[0,"] F
i:nduction rules.
S
for
eaery i,'nterpretati,onl,
ualue ass'ignmentY and nonrtrcgati,ue real number e. 2. A formula $ of DC is satisfi,able iffT,V, [0, .] F S for some interpretati'on T, ualue assignmentV a'nd nonnegati,ue real number e.
Let H(X) be a formula containing the propositional letter X and let Sr, Sz, . . . , Sn be any finite collection of state expressions which is complete in the sense that n
(V so) <+ t.
The following abbreviations will be used frequently:
i,:L
il 2 l:o llsl " IS:1. A l>0.
For a complete collection of state expressions St, Sz,. inducLion rules:
The formula [Sl holds in an interval [b, e] iff b < e and S is 1 (almost) everywhere in fb,e]. In fact, because of the finite variability of ,5,,5 can be 0 at at most a finite number of time points in fb, e].
IRl If
H(tr1) and fl(x)
=+
..
, Sn, there are two
H(x v Vl'1x^lfs;]1))
then 11(true) and
IR2
Gas Burner
If I1(lll) and I1(x) =+ H(x vVlr([s,l^x)) then 11(true)
.
The requirement of the gas burner can be formalized in DC by GbReq
In these rules 11(/)
(.> 60 + 2}!Leak 11, =
every occurrence of
/1(li"ll) is called lhe
and the two design decisions can be formalized in DC by
Desl ?
and
n(lfleakl =+ l. < l)
X
base case,
H(X) is called the i'nduct'ion hypothes'is
is cailed the inducti:,on letter.
R,ertr,u,r'k.
l.
ancl
l)r:s,;:, ll((lll,r'll
denotes the formula obtained from 11(X) by replacing
X in H with /.
,l,r'llill lll,r';rkll) )' /' 'll{)), |l
'l'Jrc $orrrr
46
3.3 Proof
3. Duration Calculus
2. Although we have presented the inductiorr rules above in their most
gen-
eral form, we shall often use them by choosing a state expression S and its negation -S as the complete state set, and choosing n(X + @) as H(X), where X does not occur in /. 3. In the following proofs of the soundness theorem and deduction theorems, we shall deal only with the induction rules where a state expression and its negation -^9 are taken as the complete set of states. For the general n case, the proofs can be derived similarly. of formulas dr'"Sn,where rfnis instance of one of the above axiom schemas or an is either an and each $i @, axiom schema of DC, or obtained by applying one of the induction rules or the inference rules of DC to previous members of the sequence. We write F @ to denote that there exists a proof of @ in DC, and we call @ a theorem of DC. A deduct'ion in DC is defined similarly to a deduction in IL, and we write f I $ to denote that there exists a deduction of c! in DC from l- , where / is a DC formula and f is a set of DC formulas.
L
proof of
/ in DC is a finite sequence
3.3.1 Soundness
tuo formulas Sy
T,V ,1c,4
for
l:
Q
iff T,V,l",
a'nE uo,lue o,ssigrtment
rI1
l:
',lt
and r[2 are equ'iualent in[b,e] of T. then 9($1) and p(52) a're equiaalent in lb,el of T.
Proof. By structural irrduction on
FAi-t 151
' '
H
FAi (St
)) and any 'interual
v ([Sl
n
9(X).
Lernrna 3.4
d6) 'implies d\!), = y.trouided r! is free for X in $(X), i.e. X does not occur in $(X) within a scope of 1r orYr, where r is a free uari,able of r!. =
Proof . We can apply induction on the structure of T,
/(X) to prove that
given
I,V,lc,rlll: O(b) iff T',V,1r,4 F d(X), T.'
(X)lc, dl
:
rbbnu ,lr,
dl)
7'is
defined so that
,
for any lc,rl C lb,el. The details of the proof will not be presented.
n
Theorem 3.2 (Soundn,ess) The proof system of DC is sound,'i.e.
,
lc,
d] where
lc, d)
C
Definition (Finite alternation) G'iuen a state erpression S, FA'(S), for i ) 0, describes fewer than, i, alterno,t'ions of S:
zuo(s)
and, 52,
If fu
We want to establish the soundness of the proof system. The following definitions and lemmas are convenient for this purpose. (Equiualence) Giuen a'n interual lb,e] and an i'nterpretation T, we call two formulas $ and 'gl equivalent in fb,e] of T. i'f
47
Lemrna 3.3 Let 9(X) be a formula i,n'uhi:ch the propositi,onal letter X may occur, let fb,el be an i'nterual and letT be an i,nterpretation. Then for any
for any V and lc,dlC [b,e], where
Definition
System
FAi
(S\) v
(il-S-ll f,4'(S))
lQi,mpli,es
lb, e).
the formula
.
l$.
Proof. The proof of soundness is by induction on the structure of proofs, i.e. the soundness of each axiorn and inference rule of DC must be proved. The axioms and inference rules of IL are treated in [28]. The axioms of DC are simple and left for the reader. We prove here the soundness of IR2, where S and -S are used as the complete set of states. The soundness of IR1 carr be proved similarly.
By the induction hypothesis of the soundness proof, we have
Lernrna 3.2 For o, g'i'uen state erpress'ion S, 'irtterual lb,e] and in,terpretatio'n T, th,ere 'is a natural nurnber k such tho,t
true and
FAk
6)
are equ'iuale'nt in lb,e,] of T. sirrcrr ,51 lr;rs l,l rnosi ;r litril,r' rrtnrrlu'l ol it,ll,trnr;r.l iotts itr t';t,tt lrt'1,;rltt'tt rri A:, wlrirlr ir;rtt tt;rlrlt lrottttrl ott lltr' ir.rrrl Llris trrtttrlrcl fb,r'1, II ;rllllrrir.l ion rrrttrrlrr,n; o1 ,51 itt iutl'rrrtltittir't t'itl nl l/r.r'l
Pnnf. Tltts filllows
F 11(m), i.c. F
11(F,40(s)),
(3.1)
Ir,ttt I
|
//(
\)
> tt(.\' v (11,5il
.r)v (li,,sll
Wl tnttsl lsl;rlrlislr I //(lrrrr').
Y))
(3.2)
3.3 Proof
3. Duration Calculus
has the form
I H(FA"(S)), for any natural number n, by induction
:
11([ I
Ind,uct'iue slep: From Lemma 3.4 and (3.2), we obtain
combining this with the induction hypothesis
F 1{(F/"+1(fl)
:
H(x v (x^llsll) v (x^ll-sl))
11(true).
=
To show f /I(true), we must showthat I,V,lb,e] I f/(true) for any interpretation 7, value assignment V and interval [b, e]' But, by Lemma 3'2' there is a natural number k such that true and fAfr(S) are equivalent in [b,e] of T, ancl,by Lemma 3.3, we have the result that A(true) and 11('F'4k('S)) are also.
By the induction hypothesis there are deductions from l- of n/ =+ fI(ffi) and n/ + (11(x) + H(x v (x^[s-ll)v (x^lf-sl))).r" rhe following, we abbreviate ,Y v (X^[Sl) v (lf^[-Sl) to nert(X,S):
.\ : k. zO
I,V,lb,ell H@AkGD, we have
!
=>
:
H(FA"(S)) we obtain
.
ofI
)
H(x)
I H(FA"(S)) + H(FA"*'(S)).
T,V,lb,e]
49
Co,se IR1: We consider only the simple case where S and -S constitute the complete state set, iy' has the form /I(true), and the deduction from f U {/}
We first prove
equivalent in [b,e] Thus, from
System
fI(true). !
+
!
deduction fiom /-
11( ll ll) J
: I deduction fiom f 1.26 + (H(X) + H(neil(x. S))) J t + t. zo + (H(x) + H (nent(x, s))) =+ ((trd + 11(X)) .+ FO =+ H(nert(X, S)))) pL t + 2. (nO.+ f1(x)) + (nO + H (nert(X, S))) t., / + 1., Mp I + S. t4; + I/(true) k.,l + 2.,IRL Note that we have taken into account the fact that the induction letter X in / in the application of IRl with n/ + H(X) as the induc-
does not occur
3.3.2 Deduction
tion hypothesis.
to simplify proofs in DC, we establish the following deduction theo-
l:.J:U* Z$
to
IRl.
!
The deduction theorem can often be used to simplify a proof. In connection with the application of the induction rules, the following theorem is
Theorern 3.3 (Deductio'n)
f ,4t l ,b imPlies f I
Case IR2 is similar
+
t!
convenient. ,
prouid,erl a d,ed,uct,ion f,O I r! in,uolues n,o applicati,ort of the ge'n,eralization lrule G for whi,ch the quan,ti,fi,ed, uariable. is free i,n, $ and euery appl,i,t:ati'ort of the ind,uction ru,les i,n, th,is d,al,u,r:t,i,ort, su,ti,s.ft,es tlt,e unt,dliti,otr, tlr,a't i'ts 'in,d,rr,r:ti,ott, l,etter does tr,ttt ou:ur irr, r[.
Theorem 3.4
f t H([l) and r, H(x) ts H(x v Vi_, (x^ fiszl)) i,rn,7il,i,r:s
I' I It (tuarn)
,
ult,ur: \,9r, ^S:,...,S,,\
Pnxf. W<' rnrrsl, irrlrl l,o l,lrc lrloo{'ol l,lrt' tlt'rlttr:l,iotr l,ltt'otlttt [irl ll, l,lrt'r'ltst's wlrlr.r'llrl irrrlrrr.lion lrtlcs;rtr,;rpplilrl ;rs lltl l;rsl, sl,t'p ttf l,ltl rlotltlt'liolr. All
Tntnri,tlrtl,
ol,lrct' t';tst's tcttt;titt Iltc ti;lttlt'.
t trrul,'i,l.i.rut Llttr,l, i,l.s i.tt,tl,rr,t'l.t.ttrt,
rr, rhtl,rt,t:t.i,tnr,
i,s rttrrt,,pl,cte,
/://(.\') I //(.\' V Vl' ,(,{ - [,q,1)) lt,u,s t.lt,c proTx:r-t'y h'll.r'r' rhx'x tntl tx'r"rt,t'rrr,
//(.\').
3.4
3. Duration Calculus Proof.We consider only the case where {'9,-S} is used as the complete set' Let y1,A2t. . .ty' be all the variabies occurring free in 11(X) and let H"(X) denote tlre formula (Vyt)(Vyt)''' (Vy")H (X). Since l- F 11([-ll) and f,H(x) F H(Xv (x^[sl)v(X^[-S]l)), we also have
r F H.(lll) and r,H"(x) t H,(X v (x^[Sl)v (x^ll-Sl))
and Ql).
In the following cleduction, we abbreviation nert(X, S):
(using G
Theorems
51
Bv PL, we have 11([ I
)
We now establish
(x + DC1) F (x v (x^[s]]) v (x^[-s-fl))
use the deduction theorem and also the
=+
DCl
by establishing the three deductions
(x+DC1) F X+DC1 (b) (x + DCl) F (x^fsl) + DC1 (.) (x + DCl) F (x ^ [-sl ) + DC1 (u)
k. JH"(x)
r
=>
H"(nett (x'
fl ) J
deducrions tiom
:
11"(m) ) l + 1. l/1c(lll) I + 2. JH,(X) + zH,(nert(X, S)) I + 3. nf1"(true) I + 4. DH"(t,rue) + f/"(true) I + 5. -H"(true) / + 6. /{(true) where
/'
The first case, i.e. (a), is trivial. The cases (b) and (c) are similar, so we shall establish only one of them. The following constitutes a deduction for case
l.,rL4 k.,rL6 l + 7.,1+ 2.,IR1 IL2 I + 3.,t + 4., MP I + 5., PL,
(b)'
l.X+true 2.(x^ fisl) + (true^lfs]l) 3.
the application of IR1 uses f111"(X) as the induction hypothesis. f]
(x + DCl) F- (x v (x^
Theorern 3.5
f
H(x v VL1(llscl^x))
F 11(lf l) and, r,11(x) impliesflH(true), where {51, Sz,. . . , S.} is comPlete,
prouided,
a d,etluction
Thus, we obtain (true
f,H(X) a H(X v VLr(lfStl^X))
lr(X)
I
DCl is
.Y.+ l)(ll.
+
has the propertv
DC3 DC4
ll-ll
lls-ll)
v (x^ [-sll))
+
DC1
.
PL. tr set of states {Sr, Sr,..., S,},
DC1) using Theorem 3.4, and therr DC1 by
v VL, (true^ lf.e;l
)
ffi v VL,([Sil^true).
3.4 Theorerns In this section
we present theorems and derived proof rules which can help one l,o undcrstand the r:alcuius and to conduct proofs. Some proofs are presented, wlrilr' ,rl lrr,r's ;rrl lr'[l irs t'xclcises.
ffi v (true^[Sl)V (true^[-Sl). [-ll v ([S-ll^true)v (ll-,91^tmer).
Proof . The proof tlf
2.,3.,PL.
Similarly, we can establish that for a complete
that euery applicat'ion of the i,ndu,cti,on rules in this deduct'ion satisfies the conilition that i,ts i,nduction letter does n'ot occur in H(X). The two incluction rules can be used to prove some properties of the finite variability of states. The properties DC1 and DC2 reject infinite oscillation of the state S at a point.
DCl DCz
(true^[Sl)=+ DC1 - lfsl) + DCt
4. (X
PL 1.,M PL
Having established (.), (b) and (c), we have, by PL,
The following theorem is proved in a similar way:
F
.
jl.'1 wil'lr
'l'lt
l)(ll-, f)c0
/,s
r /' ,,s
/;5'. (.
(
.
3.4 Theorems
3. Duration Calculus
A full proof of the theorem also has to deal with the introduction
DC7
.fSt >_ JSr, if sz + sr. Proof . The following is a proof of DC5:
:
| /\Lr1ri.(JSi: ri) A121.(!.: zy) 2. /\Lr1yr(.[S : yt) A122.({.: z2) 3. (D3, [st a 0 ^(I3, [s" s (,) / A|-t1r;.([S;- r,)\ ^ / Af ,1!/i.(.[5,: y;)\ + | nlrl .(( - ,,) I | n122.1(: zr1 |
-S) + fs v -s) DCA4 ^ L,DCAI,DCA2,DCA6,PL' 2.'[S+-FS: I A proof of DC6 can be derived from DC5 by use of (/-S > 0) (DCA3)' In the following proof of DC7, we exploit the fact that Sr c (S, V (-,Sz n Sr))
/s + FS
1.
when
,S2
*
1..[S1
51
:
/(S
:
(fSz +.f(-Sz nSr) ("15, + I-,52 n
: 3.f(-s,As,)>0 4. I& > [52 2."f Sr
- /(S,
Sr))
A (-Sz
nSr)))
DCA6,DCA4
DCAI, DCA6 DCA3 2',3', PL' 1.,
/
first theorem only. The proof of the
=+
) )
Jz1> 0.(JS : r I zt)-122 ) 0.(/S : y + 1zy, z2 > O.((fi - r + zr)^(/S : Y + z2)) )z1,zz > 0.(lS : n I zr + A + 22)
'
second
+ IS>r*y
Dce
5.
DCA5, PL PL.
((tL, Isi 10 ^(I3,
fso 3 (-))
+ (I[,
[&
be used: mmm
(Lr,1 i:t
z1A\'un i-7
1r) ) I("0
-t
at) < zr
t
zz
(3 3)
Having introduced the variables (rt.,Yt,z1,z2) for durations and lengths, we can write the main part of the proof as
/ ALJJs,:',)\ / AT,(/,s; : vi)\ Il;=, '],,, ol (
-,'
zr 'r z':)) / AL,I/S i -( .ri t y;) A ((: y' < ... ) \ n ll:, .., z1 A Il'_, ( l\'i'r(./.s, r, | !ti)A (/ :r I ::r)) ) \nf"',(.r', r t/,) . rr r ',,
I )]j",./'e,' I
^,*:],,',)
Af]_.(/si
rtr^r!1-t... rA-, zl,
proof above
22.
(igiii":)))
t,t,, (:i.;r)
4., PL
t < (.) 3.,5., PL.
The introduction and elirnination of variables, as done in the steps 1., 2., 3. and 5. above, have an archetypical form. Usually, we shall omit these steps in proofs and thereby just focus on the main part. n
<+ !(/S S /) /S
DClo F_<, (+)
or,
.
of the first theorem can be proved by establishing
r) +
.[S
>,
c<1tti vill
(l,r'rrc
l'l'
..
D_4, [s, <
-n(./S < A0, t.2, DCA5, pl.
1',2', M
I
3 !,) .
Proof. In the proof of this theorem, the following fact about arithmetic will
PI,
)
((|ffi:") +
n
PL
: ',11 / A7_,,( fs, : s'" \
: r,11 / A',"=,(.fsi : y,) \ [lg=l '],,,0J I ;!Lr:,i, =,) =+ DL, lsn < t /
1rtr.
PL,M E, PL
22)
Is,'st )
\nf?=,
22.
l-{ii(f'.,, \nf,,ls,stf \nfl1[s;t{)
theorem is similar.
(ls >,) ^Us > y)
A!_,(/si
r!Jm,
l'n'(1'-",,)
tr
Proof . We give a proof of the
\nIL[s, 1t I zr,
1ry,...,frmt!)1-r...
*
((ls> *)^$S >e)) + ([s>r+y). (Us <")^(.Is <s)) + ([s < r +y).
DC8
and
elimination of variables:
(./,9
>
rr:)
-'t,rrr
+
./.9
>
r.
'l'lris firlrrrrrl;r r';rrr lrr' lrr'ovcrl rrsirrl', l,ltrr s;r,rnc
l,
l,ltt' ptcviotts l,lrt'ott'ttt, wltt'tt' wt, itrltorlrrlc v;r.r'i;rlrlr,s l.lrc vlrliorr:i irrlllv;rls. 'l'lrc rrr;r.i rr p;rll, ol llris ploo{'is
lirl
as irr t,lrc pro
l,lrrr
3.4 Theorems
3. Duration Calculus
er
0 Aar> 0Az > 0^ ((/S :a)^(fS: 0 A z > 0 A JS : lJt I Yz * z I
)
) y, > 0 Ay2 )
DC15
z*r)^([S:vr)) r
+ IS>r.
e
((/S
Proof. The direction
+
can easily be proved by use of DCA5.
[,Sl^true). In order to
prove the other direction, we apply Theorem 3.5. Let
The second part of DC10 is proved
n
similarly.
Theorems About [fSl
[0] +
DCll
- 0)
uS > 0)
H(x) -
(x +
The proof of
a(ffi)
((/s > o) + ((/s * is easy, since
We prove
false.
r
Proof.
(([s-ll^x)
lf
l
0)
lfsl^true))).
contradicts (/S > 0).
+ (( - 0) lf,sl^true)
by use of IL18 and M, and then establish [01
+ (/0 : t) A (l > 0) lef([O]) +(0:l)^(l>0) DcAl +
r n([sl^x)
PL.
false
n
ll-Sl + (/s:0).
DCl2
n DCS. DC13 (A"- ll-(^9, (Vrrr Si))l) + (IvL, si) : DT-r [Si) ^ Proof . We present a proof for the case of n : 3. Applying DCA4, we obtain Proof. This can be proved by use of
by PL. Hence, H(X) F 11(lfSl^x). To prove f1(X) a H([-Sl^X), we establish the following deduction from f/(X):
1. x + (-(/s > 0) v ((/s : 0) ^ lfsl^true)) 2. ([-Sl^x) + ((/s:0)^-us > o)) v((/s:0)^(us - 0) [.el^true)) + (/S : 0) v (Us : 0)^lfSl^true)) + (Us > o) + ((/s: o)^lfSl^true))
.
Isr
v^92
v 53)
:
.[St +
/(S, v Sr) - /(Sr
^
(,S2
r)0Ay)0 DC16 +
((t.: n +y)
ltom the antecedent ll-(s2
DC14
[Vf:, s,]l
IS, + [Sz A
s3)l
[sl)
<+ (((t
: r) llsl)^((l: ^
-
.f(5, n,9a).
and DC12, we prove the conchrsion. n
+ (tl:, Is,) Z !.
(((.
: r) (/s : zt))^ ((! : ^
y) A (jS
:
/s,) >
l(!i-l
DC17
s')
lllrrr:c, lr.y ustr o['1,lrc rlclirtil,iort
ol'll
Il
, *,'t'it,tt cottt'lttrlt'l,ltc
z2))
we can apply DCA5 and DC6 to conclude Therefore we complete the proof. As a <xrrollzrrv of DC16, we can establish
kk
y)A [sl)).
the other direction, using L2 we can chop the interval into (/ Assuming arbitqary values for /S over the two subintervals
Proof. From DCA4 and DCA3, we derive
(I
^
Proof . The direction <. can easily be proved by use of DCA5 and L2. To prove
Applying DCA4 again, we obtain .[Sr +
DC12, M
DCA3, DCAs, M, PL DCA3, PL.
!
/(Sr v,5z v Sa) : -[St + /(S, v 53).
:
I.,ILl4,
v S3)).
From the antecedent [f-(S1 A (S, V SB))l and DC12, we can prove
.f(Sr v,92 v 53)
11(x), pL
l,ltt'ot't'trt.
tl
[,s"1] <+
(ll,sl ^llsll)
: r)^(!:
A).
,
that (21 : r) and (zz : y). n
3. Duration Calculus
DC18 [Srl + IfSzl
3.4 Theorerns
if 51 +
n
Proof . This can be derived from DC7.
([srl n [szl) e [f.s1 s2-ll ^ Proof. The + part is a special case of DC18.
Proof . This can be proved by use of DC1 and DC2. For example,
.
The
+
part can be proved
as
follows:
+ +
l&:l.A[s2:(.A(.>o
(. -[st + [s, -Isr v sz) 2 l' A > /(Sr n 52) : Lnl> 0
tr
DCA4,DC6 def. [-1.
) n (true^ [Sr]l)) <+ (true^ 11"91 .9rl ) !!,r':"--IS'n ^ ^true) n (lfS2l ^true)) <* ([Sr n S2l ^true) 11[fSr-ll
lf
(
11(x)
.
By applying Theorem 3.4, we can prove lf
l v (true^[-sl)v [sll v (true^[-sl^[sl).
Furthermore,
(true^fisl) <+ ([sl v (true^ll-,Sl^[sl)). n
proofs.
DC21 uvEL
v,5r'll + ([Srl v
true^ [S1 v
+
(true ^ [,5r]
lfsz-ll)) is not a theorem, the following
6 v Sz-11) <+ ((tlue^ lisr'll) v (true^ lisrl)) . !rr':"^ ([Sr v S2l^true) e (([Srl^true)V ([,5r]^true)).
Proof . We prove the
.
- (x + (lf l v(true^[-sl)v [sl v(true^[-Sl^[s'll))).
Then, by introducing and moving quantification of r by use of G and tr and replacing 1r..( : r by true, we can complete the proof, as we have seen in Although ([Sr is still true.
[-Sl
it can be proved that any two of the above disiuncts are exclusive to each other. Thus, by use of PL and DC22, we can establish
sz ll)
=+ ((t.: r)^ fsr-ll) (!.: r)^ lfsz-11) DC16, M ^ IL77 =+ ((.: r)^(lfsr-|l n lfsz-1l) M, DC19. + (1. : r)^ [Sr n Szl
earlier
[sl
Proof. We prove only the first theorem. Let .
Proof . The € parts can be proved by use of DC18 and M. The + parts can be proved by introducing length values of the prefix and suffix intervals, respectively. For example, assuming r ) y in the following proof, we have
: r)- lfsrl ) n ((l : e)^
llsl) <+ ([sl v (true^ll-,sl^[sl)). DCzs !fl_" ^ ^ ^true)) [.el true) <+ (lls'll v (
n
((t.
t. ffi v (true^ [s-ll) v (true^ [-sl ) DC1 2 (ffi A (true^[,Sl)) + false TL2O, PL 3. ((true^ [Sl ) n (true^ [-Sl )) =+ false DC20, DCl1,IL13 4. -(true^ [Sl ) <+ (ll I v (true^ [-Sl )) I.,2.,3.,PL.
o PL,DC6
+ lfsl A ,5zl
DC20
<+ ([ I v (true^ ll-sl )) DCzz -(9:_" _ llsl ) -([sl ^true) <+ (ll-ll v (ll-Sl^true)).
.
,52.
DCre
57
)
<+
part of the first theorem.
[-s
n -sz
{rru"^ [ -Sr A,Szl-lls'll
/ [S'l v (llSr l]
€ | \
(
flsr
) )
ll-S, n -,Sz ll rrue)
v
ll ll-^9r n .92
Proof . We prove only the first part. By DC23, (true^ ,521
+ fil:r((true^[S,;l)V (true^[-S,l)) (l > 0),DC1 + (true^ [Sr-ll) v (true^ lfS2l ) V((true^ll-St-ll) n (true^ll-Srl)) PL l)C20, DC11,IL13, + (true^ [Sr']l) v (true^ [,S2] )
ll [s l))
I
\
DC24
1[Sr-li true)
1 [Stn V (true -
\ fl true) /
I
lfSll)
is equivalent to
llS'l v (true^ [-S'l ^ lfsr-ll ) F\rrthcrrn
PL'
hzrve
^ P,9r 1l - [f-$, 1A (.92 V
l,rrr
f) (
1,r'rrc
[-',S'
) (l,r'rrc ll
,,5,
-.Sr)l -'[,9r1
n .,9rll ll,s''ll)v (t,r'rrc ll ,S, n,s,ll - ll,srll)
DCA6
t)cr2l, M
3. Duration Calculus
3.4 Theorems
([.9] ^true ^ [-Sl
DC25
=+ (llSl ^
)
[-Sl ^true)
.
f"1,1,"-[-s,
Proof.
^true ^ ll-,5]l + (lls'll v (fisl^[-sl^true))^[-sl + ([s-ll^ ll-sl ) v (llsll^ [-Sl ^t'ue^ ll-sl ) 0)) v (llsl^ [-S-ll^true^ =+ (llsl^ ll-s]^(l lf,Sl
+ llsl^[-,Sl^true
ll-sl)
TLI4 L3, PL M,PL.
\v
DC28
f"
n
t+' ([-su \il " -rrue flsll).
DC26 (^ l[-sL;:T.")) \n(true^llsil) /
\+ DC27
(((nro)
)A
(rrue- ll .S'l - lf sz-ll fisrll) ((npd)- fiszl ))/
)) \
[-S'l
( Utt,af [s'll)
n (true^
^
[-s,l
^
llszl
(((u@i p-s'11- [srl)^((n@)-
\+ /(t[s'l\+
(ne)) n (fisz-lltt fsz-ll - [-,9r l] !d)
")))A
r(
(
&l )
((true^ [Srl ) v (true^
[Sz"l1))
.
true^ lf,S1l =+ (llSr-li V (true^ll-,9r n -,Srll^llsrl) v (true^lf-Sr n Srl^lls,"ll)). The first disjunction follows easily from the above
DC29 Yr,y )
properties.
tr
0.((/S
: r*
U) =+
((/S
: r)^(/S :
s)))
.
Proof. Lel
(x^[sl) +
t (true^ lf-S'll))^ [Szl
Then, by use of IL35 and M, we can complctc i;he proof.
=+
DC2e)
and apply Theorem 3.4. When deriving
.
By IL28, IL35 and DC16, the above formula implies
(nrd
l v (true^l[,51v S2l)v (true^[-(.91 v Sr)l).
H(x)-(x + : r))
I
/
With the induction rules, we can prove the reversal of DCA5.
v)))
3r by DC16 and IL17 the formula implies
((nod) A (true^ lf-s'1^([-ll v ffsrl)))^(llSrl n (('
1[Sz-11
'\
Bv DC24,
[-srl -true))\ ' fsz"ll zilt ) ^
r )
IL13. When
lnlr n-szr -rrue)
(true^ [Sr v
g, the above formula implies (true^false^(! : y)), a,s can be shown by applying ILl7, DC20 and DC1l. This is equivalent to false by
When
/
By DC21, we have
)) \
n(:
I
|
Proof. We prove only the first disjunction. Bv DC1, jf
fisrl))/'
(true^[-sr-ll^([s'n
\
'
Proof. We sketch a proof of the first theorem only. We first introduce interval lengths:
((uod)^([s'-ll n (l:
pszll)
(true
[:il;fir;Tr;' IYtrjh v Lrue)
Proof. The € part can be derived from M, and using DC23 we can easiiy n prove the + part.
/ (((n,Ot ^ lls'l _.
)
I Y H;l^ [-sr n -szr^ - [s,r) I v ltrue ^ [l-,Sr ^ 5rl [Srl)
DC23, M
:
n-szr)
from tr
DC2e
(X + DC29), we can introduce z as the value of /S over the interval x lxrlds, and <:onclude by use of the induction hvpothesis and M that
wh
(x-
li^sl)
+
Jz.(DC2e ^(.1'S
= z))^((fs
:
() n (r > 0)).
60
3.5 trxample: Gas Burner
3. Duration Calculus
(:30
Then, we can prove
(((", > 0Ae1 )
0) A
(/S
:
rL
*yt)) +
(US
:
:
"t)-(F
(x^[-Sl) +
DC2e,
z will be the only possible
with Dc29, we can establish
!
case.
the reversal of DcS and then the general-
ization of DC15.
Dc30 ((">0ns>0)^(/s> r+aD + DC3r
((" 2
0)
^
(/s > r)) <+ ((/s
'
Vr
)
0.ln e N.lE > 0.(g < 30Ar
3.5 Example: Gas Burner
Desl 'n(lfl,eakl + l<1) Desz I n((lfl,eakl ^lf-Leakl ^ifl,eakl) '+ !'> GbRerq:: l> 60 + 20Peak1l,
<
30
:
30 .,n
+ A),
(3.4)
where N is the set of natural numbers {0, 1,2, . . .}. Consider an arbitrary interval of size 30 time units (or less). For this interval, the second design decision Des2 guarantees that there is at most one period where gas is leaking. Furthermore, Desl guarantees that this period is at most 1 time unit iong. Therefore, gas is leaking for at most 1 time unit in any intervai of size 30 or less. This property is expressed as follows: (Des1 A Des2)
+ tr(/ < 30 =+ peak < 1).
n(l < 30 =+ peak < 1) +
In this section, we prove the correctness of the design decisions for the burner. Using the same abbreviations as in Sect. 3'2,
!.
Using this property for all the n intervals of size 30, we obtain the result that gas can be leaking for at most n time units during the first n intervals of size 30. This property is formalized as
((Js>r)^(/s>v))'
: r)^ lls]^true)
!.:3O
This is a consequence of the following fact of arithmetic:
sr)))
by analysis of the cases: ry 1z and 11 ) z. When 11 12, we ca'n find the choppir.g point by using the induction hypothesis within the first srrbinterval where X holds. When rt ) z, the chopping point can be decided using DCt6 in the second subinterval where [Sl holds. Similarly, we can prove
(
.-.-
be
(x^ llsl)
where 11
(:30
61
gas
30)
Vn e
N.n(l :30.n + peak < n).
Furthermore, since the last interval does not exceed 30 time units, the duration of Leak for the full interval is at most n* 1, i.e. we have the situation
peak<1 peak<1
!*"
peak<1 peak<1
peak 1n -t 7
we must give a proof of
(DeslADes2)
+
GbReq.
we first give an informal argument to introduce the main steps of the proof. Thereafter, a detailed proof is given.
3.5.1 Inforrnal Argument The idea behind the proof is the followingConsider a1 alllil,ra,ry intrrrvill ll.r,c] :rrr
For an interval longer than 60 time units we have n
n
)2*20-(n + 1) < 30.n,
)
2, and, since (3.5)
we have the result that 20 times the duration of Leak does not exceed the lcrrgth of the interval. Thus, the requirement holds for intervals satisfying the rlcsign rlc<:isions.
-
62
3.5 Exampie: Gas
3. Duration Calculus
This informal argument will now be proved in duration calculus'
It
A Des2)
+ tr(l < 30 + Peak < 1)
.
suffices to establish the following two deductions:
ffleakfl +t
I tfr-eatol
\
- fLeakl) + ( > 30J l- (peak: 0) + ((' < 30 + Peak <
(3.6)
il-Leakl
Thus, to establish (3.7)
1)
F
(peak > 0)
=+ ((.
\
t >30J
< 30 =+ Peak <
(3.7) 1)
.
This is because, combining the deductions using PL and DcA3, we obtain ) (<1. < l' /flLeakl + -lf-Leakfl - fl-eakl ) + (>30] tt <30 +/Leak I(lll.eat
Then, using IL4, we have
+-(.i.1\tfr-eatl I Leakl-flLeakfl) + 1[1_""t1_
-^]r oto<30+ fLeak< t). (>30J
and, using the deduction theorem (Theorem 3.3) twice together with PL, we obtain a proof of Lemma 3.5:
=+ (
<
t)
\ ln l+n(l<30+.flcak!1). -fleakl) => (rto)/ fl-Leakl \r11lfl-eakl /rllfleakl
The deduction (3.6) is established by the argument
Peak:
0
+peak
PL
+(.<30+.Peak<1PL, without using any asstttttlltiorts.
it
DC15
DC23,M, PL
ILI4 DC23,ILI1, M, PL.
suffices to establish the following three deduc-
tions:
and
f flLeakfl + l< t. -lfleakl) + f tfr"alrl^fl-Leakfl
peak > 0 (peak - 0) fl,eakl^true (peak : 0) ^ (fiLeakl v (lfleakl ^ [f -Leakl ^true)) ((peak - 0) fl,eakl) v((peak - 0) lfl,eakl ^ f-Leakl ^true) <+ ((peak - 0) ffl,eakl) v((peak - 0) lfl,eakl ^ f-Leakl) v((peak - 0) flLeakl ^ f-Leakl ^ fl,eakl ^true) <+ <+ <+
Lemrna 3.5
Proof .
63
The deduction (3.7) can be divided further into subcases according to
3.5.2 Proof
(Des1
Burner
/fleakl + (3oJ r ((peak - 0) fl,eakl) =+ (l < 30 + peak < 1), /llleak'll t- (<1. \ \ (lf l-eakl -Leakl fl-eakl ) + ( > 30 J F ((.peak - 0) fl,eakl^ [-Leakl) + ((.< 30 + peak < 1) | < t. / (lfll Leak11 -> \ -. \ l-eak1 f-Leakl fLeakl ) + | > 30 J p-r,eak-11 ^ fl,eakl ^true) ,_ ((Jleak - 0) [fleakl^ ' )(l<30+peak!1).
(3 8)
(3 e)
[f
,
(3'10)
The deductions of (3.8) and (3.9) are similar to establish, because they consider cases with only one period where gas is leaking. So we consider only (3.e): 1. fl,eakl 2.
+ l. < 7
r(fl,eakl + l. < 7)
IL4 (peak * 0) lfl,eakl ^ f-Leakl * 0) fl,eakl ^(peak : 0) DC12, M =+ (peak + (peak: 0)^(l < 1)^(peak: 0) 2,LL19,PL -+ (peak = 0) ^Uleak ! t)^(f,eak : 0) DC6, M, PL =+ (peak I 0)^(peak ! t)^(peak < 0) M, PL
3.
.+.peak
DC8
4. (./Lcak =+
(( < 30 +./Lcak <
1)
3., PL.
3-5 Example: Gas Burner
3. Duration Calculus
In the last case, i.e. (3.10), we consider intervals with at least two periods where gas is leaking. The assumptions of (3.10) imply that this can happen only for intervals longer than 30 time units, and (' I 30 + peak < 1 obviously holds for such intervals. This is the main idea in the following deduction:
^lf-Leakl ^lfleakl) => ('> 30 1.,rL4 2. n((lfl,eakl ^lf-Leakl ^lfl,eakl) + I > 30) ^true ^ ^(fiLeakl : 3. (/Leak 0) f-Leakl^ fl,eakl) i true ^ lfl,eakl ^ ([Leakl ^ lf-Leakl ^ lfl,eakl ) ^true DC17, M, A2 2.,IL1e,M + ({> 0)^(t > 0)^(l > 30)^(l > 0) 1. (lfl,eakl
A0, PL
+!.>30 : 0) ^ (lll,eakl ^ f-Leakl ^ lfl,eakl ) ^true (!. < 30 + ./Leak < 1) +
DC8
a. (peak
Lernma 3.6
+
Vn €
N.n(l
: 30'n+ peak< n).
Proof . The proof follows when we apply the deduction theorem to the deduc-
tion:
I. (. < 30 + .fleak < 1 2..(L<30 +peak<1) 3. (:0.30 + peak < 0 4. u((.: 0. 30 + peak < 0)
5. l:
r.,rL4 DC6, PL
3.,rL4
(n + 1) .30
Ar((.: n.30 + peak < n)
) !: n'30 * 30 + ((.: n'30) ^(1.:30) + (peak
+ peak 1n -l I 6. n(!.: n .30 + lLeak < n)
+(!.:(n+1)'30 + peak
7.
PL L2, PL IL19, M 2.,IL19, M
IL6
s.,PL
rt((.: n.30 + peak < n)
=+ n((.
8. Vn e
:
(n :_1) . 30
N.n(l
:
+
peak < n + L) 6.,IL6 4.,7.,PL,
n.30 + peak < n,)
where induction on natural numbers is uscd in tht: last
stcp.
(DeslADes2) +GbReq. Proof. The proof is established by applying the deduction theorem to the following deduction: 1. fl,eakl 2. Dest
3. (lfl,eakl 4. Des2
5.l.>
+ (. < | 1,.,rL4
^f-Leakl ^lfl,eakl) .+ (.>
tr
30
2.,rL4
60
)1n € N.ly > 0.(", > 2 Ay <-30 A(:n'30+A) 6. n)2Ag < 30 A(1.:n.30+y) + (!.: n.30)^(l < 30)
L2, PL
.+ (peak < n)^(peak < + peak I n'17 =+ 20' JLeak< (. 7. (.> 60 =+ 20. lLeak < L
LM3.6, PL, M 2.,4.,LM3.5, PL, M DCAs (3.5), PL 5',6', PL'
=+ (.peak < n) ^ (!. < 30)
3., PL.
n
tr(l < 30+ peak < 1)
Theorem 3.6
1)
(3.4), PL
2.,4.,LM}.5,
(In the above deduction, the abbreviation "LM" means "Lemma".)
4. Deadline-Driven Scheduler
The deadline-driven scheduler of Liu and Layland 185] is considered in this chapter. The main idea of the scheduler was given in Chap. 1. The correctness proof for the deadline-driven scheduler will be carried out carefully to illustrate that the proof theory of the previous two chapters can manage a nontrivial proof. The steps of the proof wil not, however, be given in as much detail as in the previous chapters and we shall omit some simple steps and annotations that we have described earlier. The theorem to be formalized in DC arrd proved is:
Theorern 4.1 (Liu and Layland) For a
giuen
deadline-driuen scheduler is feasi,ble i,f and only
(Crll:r) +
(Crlr)
set of m processes, the
if
+ . .. + (C*lT^) < I
(0
where Ci and, T6 are tlr,e run tim,e and request period, respectiuely, of the i,th process, and, T1rT2, . . . ,T^ are 'integers.
In [85], there is an informal description of the algorithm and an informal proof of the theorem. The formal proof presented in this chapter is based on [160].
4.1 Formalization of the Deadline-Driven Scheduler The deadline-driven scheduler is formalized by specifying:
r r r r
several processes running on the same processor, the mnning tirne, periodic requests and deadlines for each process, the rcquirements for each process, and
thc schc
rn proccsses pt,
rv (1,.".,ni,).
...
,pm are given. Let
68
4. Deadline-Driven
4.1 Formalization of the Deadline-Driven
Scheduler
The behavior of the processes and the scheduler are described using three kinds of state variables:
Runl : llime -+ {0, 1} Stdr : lfime -+ {0, i} Urg;i : lfime -+ {0,1}
(ShP
.
4.1.1 Shared Processor A process is only running if it has a standing request to do so:
3
lfRunll =+
fiStar-ll
.
Since all processes use the same processot,
at most one process can run
I
+n
fi-Runil
These properties must hold for every process and every interval:
(,4r 6Ac).
i€d
The formula ShP implies that the sum of the running times for all processes cannot exceed the interval length:
Lemma 4.1 ShP
Each process p, has a periodic request for processor time. The period is Ti ) 0 and the process requires a processor lime Ci ) 0 in each period. We assume that all processes raise their first requests simultaneously, say at time 0. Hence, all arguments are restricted to intervals starting at 0 and their subintervals. By Theorem 3.1, this restriction does not affect the validity of formulas, and it is therefore invisible. Thus, the request periods of p, start at times k.Ti,for k:0,1,2,3,..., and the time point k.Ti (k > 1) is the deadl'ine for process p1's kth request. To capture the deadlines of process p.,, we define a predicate dli,nei which holds for intervals whose end point is a multiple of the period ft of p1. This predicate is defined by
+ (f ftun;; '/J
J
<
which reads: "interval end point is a deadline of pi",
divides A" or "y is a multiple of r", which is true if there is a natural number k such that k .r: y.Thrs, dLi:nei holds for intervals which can be partitioned into a number of intervals each having length 76. For any real number z ) 0, we can find a natural number k ) 0 and a real number r, where 0 ( r ( Ti and z : k. Ti I r. Thus, by the definition of dLinei and L2, we have
.
i+i
shP=trn
+ t lFtur'i : 4. ie1
4.1.2 Periodic Requests and Deadlines
d,L'inei
[fRun;-il
p C a:
R"",1)
^ll!;eB
= Tt I !, where r I gr reads: "r
at any time: ,4s
o,ny
6
lf yti is not running at Stdl(t) : 1 means that the current request of piis still standing at time f, while Stdi(t) :0 -eans that at t the current request of pi is not standing, i.e. it has been fulfilled. Urgrr(t) : 1if pi is more urgent than pi at f, in the sense that the next deadline ofpa is closer than the next deadline ofp7.
,41
to (and does not exceed) the interval length, on an interval throughout
Lernrna 4.2 For
,
o Runi(f) : I If pt is running on the processor at time t, while Runi(t) :
.
Using this lemma and DC14, we can derive the following lemma, which
which they are running.
The intention is that
r
69
expresses the fact that the accumulated running time of a set of processes adds
up
wherei,j€cv.
f
Scheduler
((.: z) # (dLinei^(l
d,Linei^(l1To)
l.
holds on any interval, i.e. any interval can be partitioned into a (possibly
iea Proof . A, proof can be given as follows: ShP
+ (Ire *./h,urr1) = ,/(Vn,,, Il,urrr) l)(ll:| l)(l(i. + (Ir,,,./ll.rnr;) '- /' tl
70
4.1 Formalization of the Deadline-Driven
4. Deadline-Driven Scheduler
In the proof of Liu and Layland's theorem, we must be precise about the deadlines of a process at interval end points. To this end, we use the following conventions:
o Any interval of the form (b,e) : {r e
IR I b
interual.
o Anyintervalof theform (b,e]: {r e
IR
lb<* <e}
i,n,teruo,l.
r r
Any interval of the form [b,e): i,nterual.
Any interval of the form [b, e) : 'interual or just an interval.
{r
< * < e} is called an open
e IR lb
o the formula dLinei^(0 < !, < r) reads "p6 has a deadline in the last open interval of length r", provided that the length of the whole interval is greater than or equal to r, and r the formulz,-(dLi,nei^(1. < z)) reads "pi has no deadline in the last left
r".
The specification of the periodic requests of process p; is partitioned into specifications for the last period and specifications for every period.
ctLinei (^i11i?,[r,o,l -rru"ll)
.
A standing request for processor time may disappear only when the proits task. This is expressed as follows: if Std, changes to 0, then the task for pi must be completed: cess has finished
HoldRequestrl
(I [*
(orun,,- (^if-t,',r))
(,lt,i,r,,,,i (^ f,;.,,11,,,
To formulate upper and lower bounds on the running time of processes, ([-l) and floor (l-.]) functions, where
we use the ceiling
r frl r lrl
is the smallest integer greater than or equal to is the largest integer not exceeding r.
r,
and
Hence,
.
l{.1:fi1 denotes the number of periods started by process p1
in a given
interval,
. ll.lTi) denotes the number of full periods completed by process p,, and . l!./:til.C1 denotes the upper bound on the running ti'me of pi in an interval. The following lemma says that Sli,P and PrR can guarantee that process p; does not get too much processor time granted:
(;i)
+
-fRmu
Proof. A proof of the lemma can have the following steps:
(a) (ShP A PrR) ) (ctli,nei^((t S 7,) n (/Runr l Cr))) (b) (ShP A PrR) a zo(dLin"n^ ((l |:Tt) (.[Rr", S C))). (c) (ShP A PrR) + ./Run1 : l(.lTil.Ci. ^
It
is not difficult to establish step (a). Ftom
dL'inei^(!.<Ti),PL
and IL14,
we have
ShP
a period when the task is contpklt<:
.
(!.
<
?4
3Ct))Y (dLinei^(t- S ?l A /Runi > Ct)).
A,/Run7
Furthermore, we can establish
I
processor time must disappear when the task is completed. This is expressed as follows: it is not the casc that Stdl holcls in
:
A Hold,Requesti A D,isappearRequestu)
i€a
(rllinei-
' .,7, '\\ ) (rr,".,- (nlo.",; :c,)) )
A standing request for
Disttltlxr,rtl,*1'rr,rst,,
? ae Altart&equesti
(ShPAPrR)
The last period must start with a standing request for processor time:
I
PrR
Lernrna 4.3 For any i € ct:
Specifications Concerning the Last Perio d of p;
starlRequesli
The three formulas above must hold for every process and for every prefix interval, i.e. the specification of the periodic requests for the running time for the zn processes is
<, < e} is called a right open
For example,
open interval of length
Specifications Concerning Every Period
is calleda left open
{r € R I b 1 n I e} is called a closed
Scheduler 7l
Slcp (lr) ollsl(1,
il)))
A PrR A (dLinei^
Q.
< ?, A -/Run; > C.))
) dLi,nei^(1. S:fo A (.fi.una - Ct^ fRunil ^true)) * dLin,ei^(1,1T; A (./Runi : Ci ^ollstdil)) + fir,ls
llc rhrrivcrl [iorlr
slr<rp (a,) ll.y us
DC31 ShP DisappearRequest
i.
IL2B, IL36 arr
72
4. Deadline-Driven
4.1 Formalization of the Deadline-Driven
Scheduler
Step (c) can be derived from (b) by establishing (ShP
At: k.:D-(
^PrRA((dLinei
by induction on the natural number
<
k.
",)))
+ /Runi < (k+L)'Ci n
)
Ci, process p, cannot occupy the processor for an entire request period. This property is implied by ShP and PrR.. Since
7,
(ShP APrR) =+ Proof . We prove (ShP /
A PrR) /)
T
1 -(dLinei ^ (lfRunil shP
^
(:Ti
\ \
i _ ci -ofsrd;fl)J
* false
This must hold for every prefix interval and every process:
R"q.i
- apreqi, fori€a,
\ + (,' . ,n -i]r,"), [n )
*
Req, '
Proof. The formula -(dlinei^((. < r)) means that pi has no deadline in the Iast left open interval of length r, so consider the follciwing situation:
(T' > c')'DC3l shP
no deadline of |u_-:t,
Reqt
consequence of this lemma is that a process can have one deadline in a closed interval throughout which it is running, as ShP A PrR A (dLinei ^ (lfRunal A (!. : fi)) ^true)
n at most
,
by the definition of np, would contradict Lemma 4.4. Hence, we have the following lemma. Lernma 4.5 For any'i e a:
\ _ / oS!tA!t+T; Sx \ -"' |/ sh,pApr. ' "r' " \n (true (llRun;ll n{ - r))/ \n 1allr., (( : yD )
Since there is no deadline of pi, i.e. no multiple of 7,, in (*,"f, we have the result (from the definition of the floor operator) that the value of ll.l:fi).Ci does not change in (m,e]. Therefore, Reqi holds on [0,e]. The details of the tr proof will not be presented.
When p1 does not have a standing request, its requirement is fulfilled for the current period (HoldRequesf.;). Moreover, rf p1's requirement is also fulfilled -.- for all the previous periods, then its running time in the entire interval reaches the upper bound:
Lemma 4.7 For any i € a:
nPrR \ ---/ / ./Run, :ltlTil \n 1Roq, - [-Srd;l )/ \ n Rtq, (
ShP
Prool. Notice that
Ci\ )
pt (by
StartRequesf,) cannot have a deadline fi-Stdel holds. That is, we have
in a right
(Rnqo- fi-stclzl) A shP A PrR
The requirement for the deadiine-driven scheduler is that every proccss (:olnpletes its task in every rc(lucst pcri
pcliorl is 7j, ir,rrrl l,lrirt, i1, rrtrtsl, o<:t:ttpy (,ltc proccssor'{irr: C1 l,o <xltrrllltrl,tr il,s l,;rsli itt ;t pctiotl. (,livrrtt l,trttttttil;l.i}, wlrir:lr scl,s a,rr uppf
p1
0me
open interval where
4.1.3 Requirement
l,lrc lowcr lrotttrrl.
An.o R"qn.
( R"q,^((:r)
above.
A simple
tion that thc longttr
{or i € a.
Di:sappearRequesti.
The remaining part is proved as in step (b)
lirl
= JRmo >_ l!.lTi) Ci,
Lernrna 4.6 For any i € o:
(l : Ti))).
PrR
[ni/or. i: ci- [Run;l - rrueyJ
/ + dLine;-- (niJnr"
A
\\
ir*l,;fl) ) ^ lari",,( (^(:Ti
+ clLinel-
reqi
The following lemma asserts that a violation of the requirement formulated above cannot be discovered until a request period is finished.
+ A-@Lin"r^([Runil A((.:Ti))). i€a
/
The lower bound on the running time for process pi oyer an interval is given by the product of the number of full periods (Vlfrl) and the required processor tirne Ca for each period:
Req e
Lernrna 4.4
Scheduler
tlu:
r'
d,[,irrti --( \n./ltrrrr, ) ,( l't'il . ci)\ \ ,' ( tll,'irtt, . (',) (( ' \n ,/ltrrrr, l't',) i ./'llrrrr, l( l'l'il'(!,
\ / (
startRequeslt' lL35 ttttttttlttlrtt"st '
l)(lAl-r, l,M,l.;|.
74
4.1 Formalization of the Deadline-Driven
Scheduler
75
The lemma follows from the fact that p7 has no deadline that di,sti(z) : rn2 - z < distiQ) for all z e (m1,m2).
in (my,m2l
and
4. Deadline-Driven Scheduler
Since
( StartRequesti
\
(^i*n't?fr-tla'l n(=*11)
=> '(dLinei
-(l
the remaining part of the proof follows from Lemma 4.6.
4.1.4 Scheduler The role of the scheduler is to grant processes running time such that each process meets all its deadlines. The nearest deadline of process pi at a given time I is the start of the next period; it can be calculated from
[tlro) + t) .Ti, and the distance to the nearest deadline of p1 is defined by
disti(t)
:
(lt
lTil + I) . Ti -
t
.
A process pr is more urgent than a process pi at' t > 0, if the distance to pi's nearest deadline is smaller than pi's distance to its nearest deadline, i.e. \f dist6ft) < disti(t). Therefore, the state variable Urgo, can be chara,cterized by the formula Urgentit, defined by
((:r)-llU,g,,l ( / V:r. l0
Notice
[Irgentalo A
Urgentur.
This lemma can easily be generalized to a situation where every process
pi,for i, e B,has a deadline in the last left open interval of length g, while no process pi, for 7 € 7, has a deadline in the last closed interval of length y: Lemma 4.9 For anA p,7 C a:
f Urgenl
((
ln/1,uu{rlLinei' - < -(d,Linei (
\nA,u,
\
a)) I r A /\{,ru"ir'aie, 1y))/
The following lemma is a direct consequence of Urgent.
j e a: f llrqent A gt 1 gz \
Schl ?
O
, (,,""^ (^f;g;n r') -tz:y,)) \
W:t,i;;'",\'rb.)[', ,)\n(dLinel ((: llz lTiD/
that a less urgent process cannot be running when a more urgent process has a standing request for processor time. A simple consequence of Schl is that if a process p7 is running throughout a left open interval where it does not have a deadline, then any other process, s&y p,i,, can have at most one deadline in the corresponding closed interval. This is because there would otherwise be an interval where pa was more urgent than pi, and pi was running despite the fact that pi had a standing request: expresses the condition
/
\ngttn",^(:ail/
Proof. The following diagram shows the situation where p1 has two deadlines m1 and m2 in a closed interval throughout which p7 is running.
lfRunrl
pi
dLhtr'1
p; has no dcadline 7.1
)>(:Y,
i:
/ PrRAl[rqentASchl \ / 0(.ur (uz<.u\ : !t))l + -=u,,yr.l A @7tnr, r : irll
I n lrtue-(flRun;l n(
Proof. TIrc following diagram illustrates the antecedent:
d,Li,nei
has no deadline
rn2 l-l
'tfl1
II Irg,,l I
++('
ll
ttt
- il)
Ar,r.o -[UrBr: A Runi A Stdil
\n-(dlzncl-(
Lemma 4.8 For any'i,
ilUrs,;l - (
Note that a process which has no standing request may be more urgent than a process which has a standing request. The scheduler must guarantee that one of the most urgent processes with standing requests will occupy the processor at any time. This is formalized in two steps. The formula
Lemma 4.lO For i, j € a, where ,i f
i,jeo
rl
Strl;
ll
tlrrc
e
76
4. Deadline-Driven Scheduler
4.2 Lfu and Layland's
pi has no deadline in the left open interval where it is running, p; is (by Urgent) more urgent than p7 in the intervallrnl,m2), i.e. lfUrgnrl holds on lm1,rn2]. Furthermore, by PrR, [StdiJl holds on a right neighborhood interval of m1, and we have reached a contradiction with schl on this right n neighborhood of rnr. Since
The formula Schlis, however, true for intervals where no process is running, despite the fact that some processes have standing requests for processor time. The following formula guarantees that some process will be running when there exists a process which has a standing request for processor time:
Sch2;
n
n([Stdcl
That is, we must find a value of
such that the following formula holds:
: r) A ShP A prR A Sch A Req) + (In.. C.l:fi)
( t-Tt.Tz.....T\ \n Sne A PrR n Sch n Req)
+
Note that Sch2 specifies a scheduler with no ouerhead. On an interval where no process is running we have, by Sch2, the result that no process has a standing request. Thus, by Lemma 4-7,we obtain the result that if an interval where /ieq holds is followed by an interval where no process is running, \hen Req holds on the whole interval:
77
(({.
=* A,eo /Run, ? Azeo /Run1
t IV RunTl). j€a
r
Theorem
+
*
>
l(.lfl.q
Req,IL27
) (.lTi.Ci
l(.lTn) :4170
(Ize JRrn,) > (I,n" Ll:li.Ci) " !. > l.(Drc.ctlTt) LM4.1 D,eo CilTi Sf .
Sufficiency
o"o
This part is the difficult part of the proof of Liu and Layland's theorem. Before giving this proof, we establish some further lemmas. The first Iemma expresses the fact that, for a given subset 0 e a, if an interval can be chopped into two parts such that
The formula s Schl and Sch2 together specify that at any time, one of the most urgent processes with a standing request must be running. Therefore, the deadline-driven scheduler can be specified as follows:
1. the run time of any process pl with i, e B reaches l(.1T1].Ct in the first interval, and 2. the accumulated run time of processes in B in the second interval equals the length of the interval,
Lemrna 4.11
Gix:,:frlij
Sch
?
1;l;",
il,),
Urgent A Scht A Schz.
then the sum of the accumulated run time for the processes in B will be no Iess than 16.9lllTr,).Ci, provided (Drep Cilfi tI).
Lemma 4.12 For any B C a:
4.2 Lilu and Layland's Theorem
(t._, c,/7, < t\ \Lt\i-,t-,--'
The theorem of Liu and Layland has two parts. one part is the necessity of the condition (!r.. QlTt, S 1) for the correctness of the scheduler. The other part is the sufficiency of this condition for the correctness. Necessity Consider the formula (Sh,P A PrR, A Srh, A R,u1)
* (I0.,,, Cil'f i) <
I
.
(ff" t(lif't'i < l) is ll('('(ir+{ill'y il'wc t'lrr littrl irlrovc lirlrrrultr, tttttsl, l111l1l orr l,llt,irrl,r't'vrrl. l,lrl l,lrill,
Tlr
n,rr
irrllt'vir,l sttclr
+
ll _!I..a /Run; : i )) \ l,,u,fttun,>L,rpl(lTt).C;
(((A,rB -/Funi =
\+
ltlT)l
)
Proof . We have, from real arithmetic, the fact that
lrly)!lQ-*)la)+l"ly1,
if
z)r)0andE)0.
(4.1)
78
4. Deadline-Driven
4.2 Litt and Layland's Theorem
Scheduler
The lernma is proved as follows:
This fact is used in the following proof:
Di€pCilTi < 1A
\
/(:rA
Spec AA,uB .fRmn
(.i;;/*," : l( lril ,,) - (Iie a JRun; : r; L2, DCAS ) DeeoJRun; : DirBlrl.frl'Cr + Q- - n) / l,ieBlrlT;l'C; \ ) L;epJRrrn; ) ( r 7:""1 i,,o',uc,lT,) Li (. .ct) i\( :;\)iJ t;:; ltt - r)lr;) =+ DrcB/Runl ) Ir.B(lrlTll + l(!. - r)l:ri))'Q PL (4.1). + Drc6 /Runl ) DrcBlllTil'Cr
<
l(.lari) - Ci
n ((AzeB./Run6 : lllrtl .Ct)^llV rcpRunil) + (A,;eB -[Rtt, : ll.l:fi]'C)- (DrcaRun1 : l)
-
=+ DrcB/Run1 ) Lieal( lTi) . Ci + Azep ./Rrr, >- l( lTi) . Ci
t
LM4.2 LM4.72 (4.2).
n The following lemma concerns the situation where the requirement holds
n
for process pi until an interval throughout which a process p7 is running. Furthermore, in this situation we know that pi has no deadline in the last open interval where it is running (i.e. -(dLinej^(0 < I < *)) holds) and that p1's requirement is satisfied on the whole interval, but not necessarily on those prefix intervals ending in the last open interval where p7 is running.
Let
The lemma "fills the gap" by guaranteeing that pi's requirement in fact
Spec
-
(ShP n PrR A Sch
t (',n.,Cilfi) <1)
holds on all prefix intervals, including those ending in the open interval where P7 is running.
In the next lemma we consider an interval and a subset 0 9 a, where every process pi,for z € p, does not exceed its lower bound for processor time (e.g. pi has no processor time in its last, unfinished period in the interval):
A,.B JRr',
s l(.lTi)'ci.
Lemrna 4.14 For all
i,,
e a:
/ Spec \ I n (n"q,- (l : rn [Run;fl)) | * (
\n
If this interval can be partitioned into two parts, where
j
Reqi.
)
Proof. We consider the following situ ation:
1. every process pi,wit'h'i e p,reaches its upper bound for processor time (u.g. pt has processor time in all periods, possibly including a last, unfinished period in this part) in the first part, and 2. throughout the second part, process€s p,, with i € B, are running, then the requirement holds on this interval, for all processes in B.
ta_^ -I
[Run7l
Req,i,
p7 has no deadline
in (a,e)
0o,e
Lemma 4.13 For any B C a: A A,.o ./Rtt' < ll lr,l ' C, \ . ^ ^^^ 'Eqi' : ltlTi]- C,) ^ [V,eB Run;l )) -] t\i€B (tA,.r.[Run, \n Proof. The following fact from real arithmetic will be used in the proof of
f
Spe,"
this this lemma:
(/\7:,@ < ko)^
(IL' u> Di:, kr)) +
/\T:,Q,'> kt).
(4.2)
We split the proof into three cases:
1. p1 lras no deadline in (a, el: -(dLine6^(l < *)). 2. pi has e as its deadline: d,Linei. 3. p; has a dcadline in (o,e): d,L,ine6 ^(0 < l.< r). Case 1: Wlrrn p,. ]ras ncl cleadline irr (n,
t,lrill, /lrrr7, lrolrls
e]
, we have, by Lemma 4.6, the result
4. Deadline-Driven Ca.se 2:
In this
4.2 Lfu and Layland's
Scheduler
p, has e as its deadline. that p, cannot have a further deadline in (o,e),
/ Spec^ \ I n 1nrq, (( : rn fl Run;l)) |
ItdLirr,
I n -t dLinei- (0 < | <.r))
\n..q,
must hold.
|+
-(dLine;
In this case pi has one deadline in (a,e). By the same argument as used in Case 2, we have the result that pi cannot have two deadlines in (o, e), i.e.
i.e.
/ Spec \ : (( .r n n I 6"q,^ lfRun;l).1 | > 0)) I I nldLinel- (:-(0
^(0
I
I
)
If i: j this is obvious. It i I j
pi has a deadline in (o,e),
and
then we have the result that -r€41 holds on [0, e]: Spec
: r A flRunil )) : Tt < r) (,fRun6 3 ll:L' Ct)^(l : Tt AlfRunyl) LM4.3,DC16 (/Runi Sll:L Ct)^Q:T,iA ll-Runrll) ShP (./Run; 1l.lTt-C,)^(l:Tt AJRunn : 0) DC12 JR,un1 'i LfTi'Ci, A (Reqo^ (!,
A
+ + + +
d,Li,nei
^
81
Case 3:
case
We first show
Theorem
)
'(l,Line;
- (( < y)).
I
\ n rr,/,
/
Since p7 is running and has no deadline in (a,e), there is a right neighborhood of rz where p1 is more urgent than pi, p7 is running, and therefore pi has no standing request. Thus, we have by Lemma 4.7 and Lemma 4.6 the result that fdeql holds on l0,e]:
((.
Spec
+ ) ) ) ) )
where the last step follows from DCA5 and the following fact from real arith-
metic:
(ry
it
((. : r A [Run3l )) 1-(dLi;nei^(0< l ,) Reqo^([U.s,il (l - r - a))^(( : ^ ^ (1. : A) Reqt^ llUtgzi A Runil Reqn^ ll-Stdzl ^ (! : y) Reqi^ (l : y)
A (Reqn^
suffices to prove
silygB
-(dL'inei ^(0 <
a) LM4.8
!< "))
DC16, DC19 Scht
Ll.l4.7 LM4.6.
Reqi
n
(^Yit,-"'.;: ,.',,)
)
Yz > 0.((" <
() + (reqo^|.: ,)).
We divide the proof into three cases: z : 0, 0 I z I n and The case z : 0 is trivial: reQi ) Qeqi^Q.: 0)) by L3. The case 0 < z < r follows from
( (Reoi' ( - r- z)) .) - \'[ tf:rr - -/ \n -(d,Linei- ( 1r - z)) ) : * Reqi-'Q. z) ) requ-'(!.: z) The case r { z 1l follows frorn R.r4i- (( : r) -| nt1 , ( * z :r:) (( ;r:) ll,li{) I i. rt't1 , (( ,r ) "2'
rI
z
I
l'.
We shall now prove the main theorem of this chapter, i.e. the sufficiency part of Liu and Layland's theorem. The proof will rely on the lemmas proved in the previous sections. The formal proofs needed to prove the sufficiency part are no more difficult than those we have seen so far. Therefore, the proof of the theorem will be given in a less detailed manner.
Theorern 4.2 (Suffici,ency) Spec
LM4.6 IL27.
+
Req
Proof . The proof is bv i:,'nduct'ion, using
1' An.* -R'ttrii iltltl 2. Il,rrrr.;, I'or j e l, ;r,s
l,lrc corrrplcl,rr scl, o[' sl,irl,cs. Wc slr;rll usr, 'l'lrrrot'r'trr i|.4, wlrcrrr
.\
i. (,5J1'r'
';
llnl)
,
//(.Y)
is
4.2 Lfu and Layland's Theorem
4. Deadline-Driven Scheduler which is the induction hypothesis. The induction hypothesis is equivalent to
(X nSpec) )
Req.
/ Spec
\ = s.; | \n-ldLineio^l1A) /
I
Note that Spec
*
DoSpec
Base case: The requirem enl Req must hold for the point interval I I . This is trivial, as each process obviously has its request fulfilled for that interval. Indu,ctiue step 1: By Theorem 3.4, we must establish
nspec)
)
Req
n1n"q-([Run;,1 A(
=+ R"q,,
Let z be an arbitrary element in a. Either p; has a deadline in the last left open interval of length y ot it has no deadline in this interval. The process pi cannot have two or more deadlines in the closed interval in which p7o is running (see Lemma 4.10). Suppose -(d,Linei^((. < y)), i.e.pi has no deadline in the last left open interval of length g:
0ap
F ((X^llAo..-Run,;l) A Spec) +
Req-
(.:U
Reqt
p; has no deadline in (a, e]
The deduction
(x ^ [A0.. -Rttn,l) A sPec =+ (x A Spec) ^ [l/\16o -Run in ) Req ^ llA,.. -Runr-ll
By Lemma 4.6,
rL25,IL28, IL35 AssumPtion,
that, for this inductive step, it suffices to prove that Req holds for an arbitrary interval of the form Req^ [ Ate, -Runll under the assumption lhat Spec holds for the interval, i.e.
shows
Rertri
holds for the whole interval [0,e], since l(.f Ti) does not
change in the interval (a,e]. Suppose d,L'ine,i^(1. < y),i.e. p1 has one deadline (at time b) in the last left open interval of length .r7:
l:A
Req,i
/Sper\^ (
i;;; ^
- [A,." -R un;l ) /
]
p1o has no deadline
[Urgi,o-11
Induct'iue step 2: We must establish
[l-Std,-ll
(XnSpec))Req r ((X^lfRunTol)nSpec) *
Req,
for every jo e a.
By an argument similar to the one above, it suffices to prove
(Sp"r\^
[^i;;;-fRun,olt)+
in (a,e)
Req '
Hence, the proof of this inductive step follows from Lemma 4.11.
n"n
foralli€a. The proof of this inductivc st
whether ?jn
it
foralleea.
by IL25 and IL28, i.e. when ,9pec holds on an interval, it holds on all prefix intervals as well. We must consider one base case and two inductive steps.
(X
Case 1: Process pjo has no deadline in the last left open interval in which is running, i.e. for this case we must prove
pi has no deadline in
(b, e]
The process pr is more urgent than the process pio in the interval [a,b], because b is a dea,dline for pi and pio has no deadline in (o,e]. Since p7o is running throughout [o,b], po has no request standing in this interval. Thus ,Req6 holds on [0,b] by Lemma 4.7 and, by Lemma 4.6, also on [0,e]. The proof for Case 1 is now completed. Case 2: Process pj. has one deadline in the last left open interval in which is rrrrrrring, i.
/ ,9..tu. I n jt,,, (flltrrrr;,, ll I ^ \ n 1r//,rn r'.,,, (( .' lt)) lirt rll rr rv.
\
til | .+ ttur, I
.
it
84
4. Deadline-Driven
4.2 Lfu and Layland's
Scheduler
Suppose p7o has one deadline (at time b) in the last left open interval of length y, i.e. we have the situation
|: r
Req
P7o has no deadline
in
holds on f0,b] (by Lemma4.3 and since l!.lTiol: llllTi,l when therefore jo € a.. Hence we have the following situation:
0abe
the interval [0,b] (for all r' e a), then we have finished, because the proof of case 1 implies that Req6 (for all z e a) holds on [0, e] also. Thus, to finish the proof we must establish
/ Spec \ I t lArq^(fRunrol n( : t)) I + nrq,, I n d,Line,o \n -(rlLineio (0 < / < r)) / forallz€4. suffices
/ Spec ^(fRunrolnl:r)) \
I n1I""q I n dLineio \n -( dLinclo
(0
I
< I < r)) /
*,.n
I
To prove this for an interval [0,b], we partition the processes into two gro.rp, u..ording to whether they have used the processol in their last unfinished period in [0, b]. To express this precisely, let a< and a;' be two sets such that
:
Q.<
l) a;., (t<
) a> -
(rrue -
0
llV,... Run,l)<+ ("
\v
in
(a, b)
lYrtt'lll,.:L-,,,il [v,,". nun,11) (true- ||V*.o, Runpl
[Vr,".
Run;l)r/
to split the proof into three cases. Case 2a: The interva,l
10,
bl satisfier
[Vi.o. Run7l
.
Since
t.:0 => A /R""i : j€a<
to prove
foralliea.
e.
liRunyol
p7o has no deadline
We use DC24, i.e.
,Req, holds on
it
and
0
lfRuni"l
According to Lemma 4'I4,
Qoll),
85
(b' e]
Req
If we can prove that
Theorem
we can establish
l(.lTjl .c j
Aj.o= req, by Lemma
,
4.13.
Case 2b: The interval satisfies true ^ [f[i.o -Runnl ^ llVr.,. Run7l. In the diagram below, we know that c must be smaller than or equal to o and, furthermore, we have exploited the fact that if the requirement Req holds on an interval ([0,o]), then Req holds on all prefix intervals also (i.e.
for
10,
d] in the diagram).
Req
[f[o.o
llVi.". Runil
-Runil
0d,cb
and, for the interval [0, b], we have the following:
1. For j € a<; JRmi < V.lri) ' Ci. 2. For k e a;.: JRtt* > Ll'11:k) ' Ch. Since
JRrr, >L(.lrn)'Cp
*
reqi,
we onlv ncc<.I t
./ll
rrrr,,,, ll f'l't,,1
'(
1
t,,
On an interval where no process is running, no process can have (by Sch) a rcqrrcst standing, and we can use Lemma 4.7 to show that
[
i(
./1t,,',,
: llltt'i].Oi
rr
lrolrls rrn l0,r'1. Wc
r';r,rr
rrsl,;rlrlisl'
Ai,,,.
rt.q.,
lw l,rrrrrrrrir,4.lii.
4. Deadline-Driven
4.2 Liv and Layland's
Scheduler
Case 2c: The interval satisfies true
^ liVo.o, Runel ^ llViu.. Runil '
In the diagram below, we know that c must be smaller than or equal to a and therefore Req holds on [0,c].
[V*..,
87
c where any pj is more urgent than any px.Tn this neighborhood pi has no request standing, because processes from o;, are running in that neighborhood.
Using Lemma 4.7, we obtain the result that
/\ ,l'R"", : lllTj].Cj
IVi.o. Run;l
Runpl
Theorem
j€t3
holds on [0, c], and, furthermore, by Lemrna 4.13, that req, holdson [0, b] for
alljeB.
Req
A process pr where i ( B has no deadline in (c,b]. Since Reqn holds on c], we have, by Lemma 4.6, the result that Reqo holds on [0, b] also. [0,
We have lhe following:
1. A process prr, k e a;,, has no deadline in [c,b], as ./Runp > l(.lTk) .Ck holds on [0, b] and pp is not running in fc, b]. 2. If a process pi, for j € a<, has no deadline in (c, b], then we have the situation
pi
has no deadline
fRr': > l(.lrj)'C j
in
(c,
b]
[-Runil
.fRmi < V.lrj)'C
j
where we have exploited the fact that /?eq holds on l0,c]. We have that ll-Runil holds on [c,b], becauseif pi were running somewhere in [c,b] then ./Run7 > LllTil' C7 would hold on [0, b], as l!'lT1) does not change
in
(c, bl.
Let B : {i e *t I pi has a deadline in (c, b]}. By 2. above, o.ly pto""sses pj, with j € B, can be running in [c,b], and we have the situation
llVr.o'
Run7,l
IIV:.8 Runil
0dcb A*eo,,ie a (true A769 (t.,te
^ fiUteiol ^ [-Stdjl
) )
ir rlrrnrllirrt'irr (r',[] , wlrik'rro l)r(]('('r{r{ I)At A: ( (t , lrir,s 1. r[,ir,rllirrc irr lr,,/r], llcrrcr', l)y l,('tuurrl ,[], I'lrlrl is rr h'f'|, trliplltlrnrltoorl ol'
Ev
f
//,
1rrrs
The proof is thereby
completed.
n
5. Relative Completeness
In this chapter, we consider the question of whether there is a proof for every valid formula of DC, i.e. whether the proof system of DC is complete. when using DC formulas in specifications, we want /s to be the integral of a Boolean-valued function. Therefore, to show the completeness of DC, it must be shown that the axioms DCA1 DCA6, together with the rules IR1 and IR2 and the axioms and rules of IL, are enough to ensure that temporal variables of the form /,S are definable by integrals. In so doing, functions and constants, e.g. f and 0, must be interpreted as real functions and constants, and the chop modality ^ occurring in the axioms must be interpreted as a modality that chops intervals of real numbers. Since we shall avoid the issue of formalization of real arithmetic in this book, the completeness result for DC presented here is a relatiue-completeness result, where valid IL formulas (with respect to a model based on real numbers) are taken as provable formulas. To formalize this notion, let TL be the set of all valid IL formuras, and we define Tf'a" to be the set of all DC instances of formulas of TL, i.e. a formula gac €TLa. is obtained from a formula ,g e TL as follows: let o1 , ...,r.tnbe the temporal variables occurring in rp; then 94" is obtained by replacing every occurrence of r-'1 with [56, for some state expression Si and for 1 { ,i 4 n. Each formula 96" is a valid DC formula, since ip is a valid IL formula, and we shall take I.La" as the provable formula set of DC provided by IL. The theorem of relative completeness is that
p/implies TLa"lg, for every formula / of DC. we first sketch the main ideas behind the proof of this theorem. The proof then follows.
5.1 Ideas Behind the Proof l'irr rrvcrv va,lirl l)Cj [irrrrnrlir, /, i.c. l- ry', wc rrurst slxrw l,h
rltrrlttr:t,iorr'1.t.,1,. 1
90
5. Relative
5.2 Proof of Relative
ComPleteness
the axioms of DC together with DC1 and DC2, but not the induction rules IR1 and IR2. This deduction of ILa, I S can be considered to be an IL deduction:
ILa", DCRI
rf
,
where DCR denotes the infinite set of all instances of DCA1 DCA6, DC1 and DC2, and temporal variables have the form of durations' However, for the given @, we construct an IL formula, H4,havrn$1')1,u2, ' ' ' as temporal variables, with the property that a deduction
ILa", DCR
I
'11t
= {up1:0} ? 172 {u11: l.}
IL deduction
Oh itr
'11+
IL I nHo +
dn
.
The main part of the proof is to show thai JH6 + $7 is a valid IL formula, i.e. an elernent of IL, if @ is a valid DC formula' Therefore, if ts d, we have the result that (nH4 + dn) €IL, andthat the DC formula JH + /, obtained from tr114 + dn by "properly" replacing temporal variables uz with durations /,54, is a member of ILa"'Thts,
TLa"l sH + 6.
115
=
r
.\.
[irr' ,5
;
{(Yr)(Vs)(((t'gs1
where we define We define
[ups1-11
by
?rl,s1v,s2l
:
*
r) ^(?,tsl
(tr1s1
I [Sr], [Sr] € S=]
o1^s,nszl
:
a)) =+ (rtsl
: r + y)) | l,Sl e S=},
(true^[u1_s1.Tl) | [s] e ([u1-s1-11^true) | [S] e
:
()
A(l>
,
S=], S=],
0).
o H4 to be the conjunction of all the IL formulas in 111 to Hz, and t $1 to be the IL formula obtained from / by replacing each /S by ,u1s1. The definition and lemmas below are convenient for use in the completeness proof.
J,V,lb,e)l =H,
5
as foll
,S ++ ,cit i,rr, ,,t.ntTtrts/,l,itrrt'rt'l
ltxfit' |
if for
,
any subinterval
semantics of IL.
Let an arbitrary duration calculus formula / be given. We now construct the IL formula H p. Let Pt , . . . , P1 be the state va,riables occurring in /, and let 5 be the set ofstate expressions which can be gcncrated from these I state variables.
SI
{uW,) + ?,[s,]
Definition. We cail a triple (J,V,[b,e)) at H-tri,ple tf
5.2 Proof of Relative Completeness
{,S' €
:
?
= {[f l v (true^lfu1s1-11)V ^true)v 11r = {pl v (lfu1s1'11
i.e.
[^9]
,
Ha
The formula 11 is a conjunction of a finite number of instances of DC axioms and Dc1 and Dc2, and a deduction of TLa. I / is then easily achieved.
We consider equivalelrce clilsstrs of
,
'tfi={uysl>0llsl €5=},
where @;, is obtained from @ by "properly" replacing durations /Si with temporal variables o1, and the formula 114 provides a finite encoding in IL of an essential part of DCR. Using the deducticln theorem of IL, we have the result that
H4l
be the set of equivalence classes:
The size k of 5= is the number of Boolean functions in / variables , i.e. k : 22' . We select k temporal variables ,ut,...,u6 and put them in one-to-one correspondence with the equivalence classes. We can therefore index the selected temporal variables with equivalence classes. For the axioms DCA1 * DCA5 and for the two theorems DC1 and DC2. we construct seven finite sets of IL formulas:
TL,H4l $1,
TL,
91
s=={[s] lses].
rb
can be constructed from an
5;
Furthermore, let
Completeness
,
[c,
fl
of [b,e]: J,V,[",d]
IVotation: When an interpretation present context, we write pfor !/(u).
Lemma 5.1
G,iuen an H-tri12l,e
F
[f to temporal variables
(J,V,lb,e]),
then
- r:)* * 121_s1lc,Q, (i,'i) 0 S :p1s1k:,ll { tl, r:, (t)
,u;51[c,
(riil)
r1,s,11r,, r/J
(iu) il
d]
=
(rl
S
t)1,s,v,s,,1[r., 14
'r,1.s1[1,,,,1
fin'tr,rt,11 ,\',,5't ,,5'..,
(,,
lt),
,
t,lt,t:,rt,
114 according
rr1,slfr,rl]
- ll, - r.),
r .\ arrrl rt,rt41 nr,lt'i,rt,l,t,rtuill',tll utlt4rl,
to the
is given in the
5. Relative
5.2 Proof of Relative
ComPleteness
Proof. (i,) and (?i) are trivial, and (zu) can be proved through ?15' We give
t""rT":"t:?'irilfl?
is a tautologv, we have rrom']7zthe result that
ugllc,d) -- ((1- c)
"l: u;-srv(s1vs,)l[c,
d]
.
From 11a, we have
so we have an infinite collection of open intervals covering the crosed and bounded interval [b,e]. Then, by the Heine-Borel theorern, there is a finite sub-collection C : {1t,...,1^} of the open intervals covering [b,e], where any | (1 < i < has the property (5.1), (5.2) or (5.3). ^)out the following steps we now carry in order to find the finite partition.
Step 1: Select the open interval
J ,V,[b,bi]
Using (?) and'112, we obtain
-
c)
?1s,1[c, d]
-
*
u1s,vs,J 1",'lf
:
(d
-
")
*
9l-s' n(s'v s,yl"'
d)
1
'aq,u
s,llc, dl
since t';-srur(srvs:)l [c,,r]
> 0 by
n
?72'
that
4.
f
:b
lfo1s1ll
or J,V,lto-r,ii] [
e, there are (by
b
land)
It.r.[r.t"] !
lful-s1-ll
I
'lla and'Hr) t' pq
s-11
or J-v-U.t"); flul is an open interval (f',f") covering f, [u1s,-ll
lfu1s1-|l
or
s1-11
l
and
f"
such that
{l,V,lb,t")=
lful-q-ll
f
lfogslll
or J,V,lt',el p
rrrv
|,
arrrl
[op-.s1-11
'
(53)
lt > t'.'l'lrrrs, t,ltcttr is ittt optrtt irrl,rrlv;rl (l/, i/') l,lrc clost'tl iill,t'r'v;rl ll"r'l lr;rs llrr';t,lrrtvt'ptttpt'tlv (5.;t)'
We can select an a,rJlitra,ry
?
lfup-s1-11
.
I
lft'1q-ll and ./,V,lm,,bil
I
[u1-s1-11,
,
J,V,lbr.,m]l [ut-"tl and !/,V,lm,bi] p { m z-bi.
[u1s11,
Repeat step 2 until a partition of [b, e] is achieved. This terminates, since there is only a finite number of open intervals in C. n
Lemma 5.3 An H -triple (J,V,[b,e]), where b < e,,induces a DC,interpretat'ion I such that for euery S e S and t e lb,e),
_ ,, ,t t € lti 1,t) *r \" ^q-{/) ' [| 0, ,/ t e lti-1,t1)
J
(5.2 )
'
J,V,[b7,m]
forsomern:bi{mIb11
(5-1)
We can select an arbitrary | < b. Thus, there is an open interval (it,l") covering b. and the closed interval [b.t"] has the above property (j'2)' ( Similarly, for e, there is,by 176, a l' such that b l/ < e and
J,v,lt',el
or .f ,)),lb,bol
,
and the closed interval Thus, there above ProPertY (5.1). [l', ' t"] has the Fo, the left end point b, there is,by 117, a f/r such that b
J,v,lb,t"l $
lfo1s1-ll
for some ,m : bi
for i, = I,. . .,tu. Proof. For any
f
J,V,[bn,bi]F firtql , 2. J,v,lbo,bil I lfup_s1-ll , 3.
J,V,lti-t,ti] [
b. Then the
7.
,
Lemrna 5.2 Gi,uen an arbi'trary H -tri'ple (J ,V ,lb, e)) , where b < e, then f or : any S e S, there i's a fi'ni,te partition b : to I h I "' I tn e of lb'el such' e'ither
Ii - (ot,b) from C covering
Step 2: Stop if bt : Otherwise, b6 I e. Select an open interval Ii : Qti,bi) ". from C covering ba. Since bi { e, the closed interval lb.;,bi] will (by (5.1) and (iu) of Lemma 5.1) satisfy one of
'
which gives u;s,1[c, d]
93
closed interval [b,b,] satisfies (5.2):
q-s,1[c,d] *tr;s,vsz1 1",4:?l-s,v(,s,vs,;1 [c,d1 +91-s,,r1.s1vs2;1 [c'dJ '
(.d,
Completeness
b:
( tr (
and, and,
J,V,fti_t,r6] ! J,V,lt,i,_r,t;] I
lftrlsl-ll
[ol_s1]l,
t, - e i,s a part'ition of lb,e] sati,sfyi,ng J,V,[t;t,ti] ! lftrpsll or J,V,ltr-r,fn] F firt-ql
where
fo
.. . 4
,
fori,:7,...,1t. Proof. Define an interpretation 7 as follows. For any state variable e / S t € Time, let Qt(t) :0. Furthermore, for any state variable P € ,5, let b : to 1 tt .--'.. I t,,, :e bc a partition of [b,e] for P given by Lemma 5.2. and
5. Relative
5.2 Proof of Relative Completeness
ComPleteness
Using the definition of lfups,vs,,11, we have the result that
We define
( t, tf tn-,'. 1t :-tiand !/,l,lttt,ti] P.(t\=1^'U, .' otnerwlse.
I
lfu;r1'll for
\1i1n'
J,Y,lk-t, ti] f
I
For case (zi), we must prove that J,V,[to_r,ti]
Each such function has only a finite number of discontinuity points in any interval, so 7 is indeed an interpretation in DC. we prove the remaining parts of the lemma by structural induction on ,5. Assume S e 5. The cases where ,9 is 0, 1 or P are trivial, so consider the
following
cases:
Case: S has the
It
follows fromHq that u;s,vsr,, 0i-1s,vs,,;1
Si(t)' Consider an arbitrary t (b
If J,V,ltrr,ti) F llrt-",t], then si(l) But then (-S')z(t) : 1 as required.
0 by the induction hypothesis.
S'V,5". We combine the two partitions of fb,e], for S'and 'S", given by the induction hypothesis to obtain a finite partition b : to ( Ji ( "' I tn : s, one of the four formulas [r.'1s,1-11 n [u;s,,1-ll. [fu1-s'1-ll n lf'u1-s''1-11, *h"re ""a.1ly or [u1-s,1ll n lf'u1s,,1-ll will hold in each section lk-t,tt]' [tr1s,1-11 n lfup-s,,1'll, 'Therefore, using the"induction'hypotheses for ,5' and S", each section lk-t,til of the partition will fulfill one of the following cases:
J,V,lti-r, tll I
- t;t
and
Si(l) : Si(t):
1,
i'e' ('5'v S")7(t) :
1'
forfz-r 1t1tt. (:ii) ?[-s,] = ?;-s,,1 : tt-k-r and Si(t) : Si(t):0, i.e' (S'vS")7(t) :0, for/i-1 (f (t1. g, 1'"' liii) u15,1 - ti - t;t, !!l-s,,1 - tt. - ti r, SL(t) : 1 and Sf(f) : (S' VS";7(f) = l. for l; t I t I I i' (iu) ut-s,t - ti - ti-1, uysrrl - tt - ti 1, SL(t) : 0 and Sl(t) : l' i'e' (S'VS")z(/): l. for /i-r ( I 1ti. For case (z), we must prove that
J,V,lti-r)tif F
[fu1s'vs"1-Tl
'
u1s,1ltr t,tr.7
Therefore, by Lemma 5.1,
0(?[s,vs,,] lti-r,tl 1t,i-t,i,-t
J,V,lt,-t,fl] I
so it f
0(rr1,s,ns,,1[f,-r,tt.)1t'i,-ti,'t,
J,V,ltr_r,t;] |
[f,u1s,vs,,1-ll
t6
-
[fo1s,vs,,1l. Since, by
,
ti_1, i.e.
.
For case (ztr), the proof is similar to that for the case (zzz).
fl
Lemma 5.4 For a giuen H-tri,ple (J,V,[b,e]), let T. be an interpretation giuerr, by Lemma 5.3. Then for euery S eS and'interuallc,QClb,e], T[[S\[c, d] : 721s11c, dl . Proof. Suppose c: d. Then Tffjsllc,d] :0, and oJql",4:0, since we have from Lemma 5.1 the result that 0 ( qlfl[", 4 < d * ,. Now suppose that c < d. Since (J ,V,lb, e]) is an /J-triple, so is (/, V ,lr, rI). Let c: t0 I t1 pretation T given by Lemma 5.3 satisfies the condition that for t €fc,d), ,s_r r\t ut\L
:- ! 1, tt t e [ti_1, ti) and J ,V,lt;t,ti] ! \ o, if t e lti_1, l1) and J,V,ltu_r,r1] I
[t
1s1-ll
[t'i_s1"11.
Thus,
f,' ,sr\) clt : u61[ttt,td, fot
arr
.
4 u1s,v5,,1[k-t,tr) { ti - ti*1
it follows that u1s,vs,, 1lk-r,tt) -
From
Lemma 5.1,
[o1-1s,rrs,';1-ll
For case (iii),we must prove that Lemma 5.1, we have
Case: S has the form
t2ls,l:9-1s,,1: tt
lt*t,ttl:
1[k_t,tt):0. t'i - tt-t
and, hence,
--,5r 9,S/.
(i)
lfol_1s,vs,,)l-ll. From
ups,vs,'1[fr-r,to] ) 0 and o;s,ns,,1[h-t,ti)> 0 uys1lh-r,1,;] : 0 and o1s,,1lt,;-1,t1] : Q.
form -S'.
Letb:to,-1,l
I
Lemma 5.1,
the induction hypothesis. This can also be regarded as a partition for -,5', as
.
[tr1s,vs,,1-ll
i, '/
:
7,.
[,/,5'l|
..
,n,, arrd by 715,
lr,,,t1
--
.l,t,S
r
(t),tt = itrls1 [rr- r, r,:] :,ir1s1 [r:, r4 . it
t'l
96
5.2 Proof of Relative
5. Relative Completeness Let dn be the IL formula obtained from
of /,S in t' with
/
by replacing every occurrence
Lemrna 5.5
means the validity of (nHa) + dn in IL. We first prove that I { implies F (nIlo)
* (aHi )
+
(|Hil + =
dh
dr,. Suppose that
Qn,
f
d]
:
Since "7,V,lb,el
*6-
u6{c,4-
V
Qn, we have the result
To prove the other direction, i.e. that
I
tha| r,V,lb,e]
(n11p)
+
@7,
f
implies
@,
and hence
I
@, suppose
trd, Dc interpretation z, value assignment v and interval such that L,V,lb,")V O. Let us construct an IL interpretation "7:
i.e. there are a u;s1lc, d1
:
[b, e]
TWSlLc. d)
:.[:sr$)dt
.
for all ,S e 5 and any interval [c, d]. By construction, we have from T,V,lb,"]F
J,v.lb.,ll*
4t
the result that
on
and, from Theorem 3.2 (soundness),
J,V,lb,ellrHo.
So
P (nHa)
+
4n'
n
The relative-completeness theorem can now be proved.
Theorem 5.1 (Relati'ue completeness) For euery formula $ of DC,
TLd"lO.
l$
impli,es
TLa"
I ttH =+ O
Prool. Suppose ! 4. By Lemma 5.5, we obtain ? (aHil + dn'Let fI be obtained from H6 by replacing each u1s1 by /S. Then (n11 '+ il e TLa" and .
We have the result lhat
H is a conjunction of a finite mrmber of insta,rtccs of
DC axioms and DC1 and DC2, and, bv PL and IL4,
w
F NH.
A rlrrrlrtr:l,iorr
ril"1 f.,t,.
I
ry'
[irlktws lrv
rr,1rplyitt1"';
Ml',
Remark.
conducting proofs.
dn. By Lemma 5.4, i.e. there is an //-tripl e (J,V, [b, e] ) such that !1, V, lb, el S and for any S e 7 such that interpretation there is a DC [c,d)C[b,e),
I[[Sllc,
97
1. Note that the relative-completeness result was achieved using the theorems DC1 and DC2 instead of the two induction rules IRl and IR2. It is, however, convenient to have the two induction rules available when
ugs1.
itr F(nno) +dn. =d Proqf. Note that $ / means the validity of $ in DC, and
Completeness
ll
2. Reference [38] presents another completeness result of DC. It replaces IR1 and IR2 by an c,.'-rule to axiomatize the finite variability of states, and proves the completeness of the revised DC for an abstract domai,n. See Sect. 11.5 for more explanation of this completeness. tr
6. Decidability
In this chapter we consider a subset of formulas of DC for which the satisfiability of a formula is decidable. Since a formula / is valid iff the formula -d is not satisfiable, we can decide whether a formula in the subset is valid as well. The decidability results presented here are based on [167]. We investigate now the set RDC (resfticted duration calculus) of formulas generated by f . if ^9 is a state expression, then [Sl e RDC, and 2. lf 4,(t e RDC, then -d, OV $,4^$ e RDC. We first present a discrete-tizne interpretation of RDC together with decidability results for the satisfiability of formulas for discrete time. It is also shown that RDC is expressive enough to formalize an interesting case study
under the discrete-time interpretation. We then present a decidability result for RDC with regard to contimrous time, which involves more complication.
6.1 Discrete-Time Duration Calculus What shall we consider to be a discrete-time duration calculus? Even when the set of natural numbers N : {0, 1,2,. . .} is chosen as the discrete structure of the time, questions remain concerning restrictions on interpretations, intervals, and the truth of formulas. First of all,.we require, for every interpretation
T:
SVar -+ (llime -+ {0,1})
,
that the set of discontinuity points of each Pt (P € SVar) must be a subset of N. An irrterpretation satisfying this property is called a discrete interpretati,on. [,ik
only discrete i,nteruals
lb.r'l c llrrl,v.
wlrclr'/r,r'(
N.
l,'irr;rllv, lirl ir llivur /i/)(.'lirlrrrrrlir ,y', wc corrsirlt'r'i1,s Irul,lr vir,lrrc liu itrl.r,t v;rls lrtrrI tlislt'r'1,r, itrlr,t 1rtll;rl,iotrs otrly.
100
As a consequence of this, the definition of chop (d^rh) is different from that given in chap. 2 for continuous time. Assuming thal T is a discrete interpretation and [b, e] is a discrete interval, we define ( T.lb. mlL- 4, and T.frt.el I tr. \ L.lb.ell a- 'b itr m *h"r" m e NJ ro-" elb."] lfor Here we leave out value assignments (v) from the definition, since we have no global variables in formulas of RDC. The other semantic clauses are not given, as they remain as they were in Chap. 3. However, from the semantics, we can derive T.,lb,e)
F [Sl
itr (e - b) > 0 and for any t, b I t I e arLd t /N: /[.9](t) : f. Ln RDC formula Q is uali'd for d'iscrete time Itr I,lb,el I @ for every
discrete interpretationT and every discrete interval lb,e], and $is satisfi,able for d,'iscrete time rfi T,lb,e) I @ for some discrete interpretation 7 and some discrete interval fb, e].
6.1.1 Discrete Tirne Versus Continuous Time One can ask the question of what difference it makes to consider a discretetime domain instead of a continuous-time dornain. For discrete time, we can define l: I in RDC as follows:
|
6.1 Discrete-Time Duration
6. Decidability
: t ? lf1-Jl -([1] ^[1]). ^
We can do this since I : 1 is the unit of time in the discrete-time domain; it is not a time point, and cannclt be divided further into smaller time periods either. However, I : 1 cannot be defined in continuous-time RDC where I is syntactically excluded, as we shall prove in Sect. 6.2 that continuous-time RDC is decidable, whereas continuous-time RDC extended with I : 1 is undecidable, as we shall see in Sect. 7.2. There are also formulas of RDC which are valid for continuous tirne, but no{ valid for discrete 1ime. e.g.
llsl + (llsl ^[sl). This formula is not true for a rliscrete interpretation ovel a rrnit interval, where S has value 1 throughout the interval. In the following sections we shall present algorithms to identify tlte forrnulas of R.DC which are valid for discrete time and ihc, R,Dc forrnula,s whir:h are valid for continuous tirrc, sinr:c the vzrlidil,ics of fottnttlas ttt .R,DC a.r<'. decidable for both rlisr:r'
Calculus
101
6.1.2 Expressiveness of Discrete-Tirne RDC From the proof of the decidability result for discrete-time RDC given in Sect. 6.2, it is not difficult to conclude that discrete-time RDC has the same expressiveness as a formulation in terms of simple timed automata, where each transition takes place at a discrete time point and consumes one time unit. This generalizes to the case where the time consumed by a transition is within specified upper and lower bounds, including infinity and zero. This generalization follows from the following equivalences, which imply that 0 < fP n.fp
[:0
<+
fe:o
<+
-lill
[-Pl Y l!:0 (+ llll -([1] ^ llll ) ^
(,:l
:t e (lp:o)^([l)l t:\^(lp :o) ^ ,fP : tt+1 <+ Up : k)- (lp :r) <+ UP: k)^true IP > k lP>k +, UP >k)^-(lP:k) a+ -(.fP > k) fP S t' ,l'P
where k € N and true can be defined, say, as
lllll
V
-
[1-|.
Remark. Of the above definitions, only the first two are correct for continuoustime R.DC, but the rest of them are not. The expressiveness of continuoustime RDC is, unfortunately, equivalent to that of untimed automata. See the proof in Sect. 6.3 for details. Regarding the gas burner example, it is obvious that the two design decisions (Des1 and Des2) can be expressed in discrete-time RDC. However, the requirement GbReq involves inequalitv between state durations, 20 fLeak
<
!.
.
In the next chapter, it is proved that after [St : /S2 is added to RDC the satisfizr,hility problcm of this extended subset becornes undecidable for both
6.2 Decidability for Discrete
L02 6. Decidability Fortunately, in Sect. 3.5, be refined into
z(1.<30
+
it
was shown
that the requirement GbReq can
where concatenation is defined by:
L1L2
+ D(l < 30 + peak < 1),
for discrete time (see Lemma 3.5), following the decision algorithm developed in the next section.
? {uulu €-L1 and u e L2}.
Since (DNF(S))+ is a regular language, and the family of regular languages is closed under union, complement and concatenation [65], every formula can be denoted by a regular language. More precisely,
r,([sl) : 6.2 Decidability for Discrete Time
L\(il
is nonempty.
Let 5 be the (finite) set of all state variables occurring in alphabet X of the language fi($) is the set
/.
Then the
,b)
Lt(P^rl') :
h(rl'). We define the string 'u : a!...arr € I* to correspond to a discrete interpretationL of Qtf T[a1\(t): l for t € (i-l,i),i € {1,...,,^\r}. (If N : 0, Lr(P)
then o is the empty string which corresponds to any discrete interpretation on the point interval [0,0].)
Lemma 6.1 Let a formula $ e RDC, a di:screte i:nterpreto,ti,onT of $, its correspo'ndi,ng string n : et. . .ay be giuen. Then
t:P(S) of subsets of 5. A letter a € X can denote the state expression (called the basic conjuncf) of S
Arn A
Pea
(rllr(.s))+
: L'(P) o hQh) h(-v) : z.\h(p) h(vv
We show that the satisfiability of a formula O e RDC for discrete time is decidable by defining a regular language 11(/) such that is satisfiable for discrete time Ifr
l1(/) is quite straightforward. Let every letter of I
remains for an arbitrary positive number of time units. Disjunction V is denoted by union, negation - by complement, and chop ^ by concatenat'ion,
which can be expressed in discrete-time RDC. Thus, we can mechanically check the validity of
@
103
correspond to a unit interval. Therefore, the formula [Sl is associated with the positive closure (rl'/F(S))+, which means that the presence of state S
peak<1),
(Des1A Des2)
The definition of
Time
-e,
Q€(S\a)
Z, [0,N]
?
d fo, d'iscrete
time itr u belongs
to Lt(d).
Proof. By induction on the structure of /. The "if" and "only must be proved jointly because of the complement (-) case. Base case:
and,
if"
directions
/ is lfSl.
which asserts that all state variables in a have value one, while those of s not in a have value zero. Flom now on, we shall use a to stand for both a letter of f and the basic conjunct of 5 denoted by that letter. A state expression s of / can be transformed into a disjunctive normal form of state variables of S. Suppose S <+ VLr oi, where n > 0 (when S is 0, n :0). Then ,S can be denoted by a subset of letters of E, {a1,-..,en},
1. "Only if": Suppose [,5] holds on [0,N] for Z. We have ly' ) 0, and for every z € {1,...,N}, Z[Sn(t) : l for t € (i- 1,2). Since u: ar"'aN corresponds toT,for every z € {1,...,,4'/} and I e (i,-l,z), we have the result that T[a1!(t) : t. So rzi e DNf (S) by S <+ Voe ar,,r1s;o. Tlrerefore u e DNF(S)+. That is, o € Ar([Sl).
abbreviated to
2. "If:
Dlff
(.9).
With each formula { we associate a regular language Lt(il e X*, such that 6 holds on a discrete interval lb,el fot a discrete interpretation I itr there is a string u € Lt(/) which corresponds to the interpretatir>t T on for discretc timc iff thc langua,lic fb, e]. Thus, the formula / is satisfiilblc
Q($)
is rtoncrrtptY. Sirr<:
Suppose u € L1(llSl).Then u e ,I'ry(.g)+, and hence l'/ > 0. Sirrcc u corresponds to I, we have T[a,1](t) : 1 for i, e {1,. . . ,l[] and
t e (,i, -1,2). So 7[S](r) : 1 for t € (i -1,2) and i € {7,...,N}, because u,; € DIVF(S) frx r, e {1,...,ly'}. T}rus, we can concludeT,[0,,^/] F [Sl [i:orr
r lro 1,
s
r:
irrit,ion.
104 6. Decidabilitv Indu,ctiue case:
(b
6.2 Decidability for Discrete
is -tb.
1. "Only if":
Suppose -{ holds on [0,]/] forZ. We have the result that'ry' does not hold on [0,]/] for T.By the induction hypothesis, u / h(4'). Therefore u € (t* \ lr(,ry')). Hence u € Lr(-Ib), because we have that
:
([Pl ^[rl)+
Inductiue case: S is rb^p.
1. "Only if": Suppose r/.' ^g holds on [0, ,A/] for Z. We have M € {0, . . . , I'r} such that ql holds on [0,M] for T, and rp holds onlM,l/] for Z. Since u corresponds to I on [0, l/], u7 : at ' ' ' &M corresponds to T on 10, M] and u2 : aM+r '' 'o,1,r corr€sponds to Ixa on [0, N - M], where the definition of Ty1 refers to Lemma 3.1, i.e.
: r[Pl(t+M),
Lt(r/t^g).There must be o1 :
\ t{P}, I i > 1}) : t}. The last equality holds. Therefore, the formula ([P-ll^[pl) + [Pl is valid n for discrete time. Question 2: Is the formula llPl + (liPl ^ [fPl ) valid for discrete time? Again, the alphabet is I : {{P}, {}}. We have itr ttPJ,
(/
&t
vrp). This case is left for those readers who are inter-
ested in the details of the proof.
is obvious that for every string o of length ly' in I* there is an interpretation T of $ such that u corresponds to T and, conversely, for every interpretationl of @ and interval 10, l/] there is a string u of length l[ in f* which corresponds to Z. By Theorem 3.1 and Lemma 6.1, we have:
It
Lemrna 6.2 A formula d e RDC is ular language h(d) is nonempty.
sati:sfi,able
for discrete ti,nr,e i,ff the reg-
Theorern 6.1 The sati,sfi,ability of RDC formulas for discrete t'ime is
dec'id-
able.
We now show how to lurcha,nir:a,ll.y rlr
of
l?,DC [irrrrnrlin
li>2jn(r-
[Pl + (llPl ^lfPl) is valid iff [Pl n -([Pl ^ llPl) is not satisfiable Ifr Lr|lpl)nf,(-ffiPl ^[Pl)) : {} Lr([Pl) n (t. \ 41(llPl ^[Pl])) ffi 11([P-ll) e ar ([Pl ^ llP]l) itr {{P}' l, > 1} q {{P}' I i,>2}. Ifr
"'
aM e 41(r/) and 'uz : aM+t '' 'a.nr € 41 (cp) such that r., : 'u{uz.Then u1 corresponds to Z on [0,M] and o2 tolxa on [0,,V - M]. By the induction hypothesis, f holds on [0,M] for T and tp holds on [0,-Atr - MlforInr.By Lernma 3.1, rp also holds on lM, Nl for Z. Therefore we can conclude fhat $ holds on [0,,n/] for 7.
Inductiue case: $ is
is valid
-((llPl ^ llPll) + [Pl) is not satisfiable iff (llP]l ^ [Pl) n -llPl is not satisfiable iff c1$pl ^ [pl ) n t1(- lf.P-ll) : {}
for any P e SVar. By Lemma 3.1, rp holds on [0, ,A[ - M) for T.p1 . Thercfore, by the induction hypothesis, u1 € h(th) and u2 € L1(9). Thus, u :'uru2 e hQ!)Lz(v) : Lt({t^q). Suppose u €
lfPl
itr
u / Lr(rh). By the induction hypothesis, ry' does not hold on [0,,A/] for Z. Thus -Ty' holds on [0, ]/] for 7.
2. "If:
105
Quest'ion 7: Is the formula (llP-ll^llpl)=+ lfPl valid for discrete time? Since P is the only state variable occurring in the formula, the alpha,bet E {{P}, {i}. We have
Lr(-t): (r* \ t1(?/)). 2. "If : Suppose u € Lr(-1r),i.e.
rM[P\(t)
Time
:
{}
The last inclusion is false, as the letter {P} belongs to {{P}i I , > 1}, but not {{P}t I i, >_ 2} Namely, for a discrete interpretation and a unit interval over which P has value 1 under the interpretation, the truth value of the formula [Pll =+ (llPl ^lfPl) is false. Thus, the formula [Pl + ([Pl ^lfPl) is not valid for discrete time.
to
Using this technique, we can decide that the formula (Des1 A Des2) =+
n(l < 30 + peak < 1)
is valid.
It is, however, more interesting that the phase automatonof a more "realistic" gas burner specification considered in 1127] can be expressed in discreteLi:nr', R.DC a,s wcll. This phase automaton represents an implementation of a sct of rrrryuir
106 6. Decidability
6.3 Decidability for Continuous
4r([Sl) : ('lrF(S))+ Lz(P v ,lt) : Lr(P) tt Lz({) Lz(-p) :8.\Lz(p) Lt(p-'rb) : 1(Lz(w) L"(rl'))
6.3 Decidability for Continuous Time Consider the formula [Pl + (llPl ^[fPl), which is valid for continuous time, but not for discrete time. Recalling the answer to the question of its validity for discrete time given
in Sect. 6.2, we have
[P] + ([Pl ^[Pl) i'valid iff ar([pl) c 41(llPl ^llPl) Because {P} € lt(llP-ll) and {P} / L1(trPl^[Pl), the inclusion property
is not satisfied. In the discrete-time domain, the intuitive interpretation of {P} is that state P lasts for one time unit. However, a letter, say {P}, cannot be interpreted as lasting one time unit in a continuous-time domain. But with a closure property, it is possible to reuse ideas from the discrete-time construction to achieve a decidability result for continuous time. A language ,L over the alphabet X is called contract'ion closed 1f ur,tcnt
€ tr irrrplies
uanu
€
for any u,w € E* and a € f. The language A1([Pl ^ IIPII) - {{P}tli > 2} is not contraction ciosed, since {P}{P} belongs to the language and {P} does not belong to the language.
denote the contraction closure of L, i.e. the smallest contractionclosed set containing I. By a simple construction on finite automata, we can establish the following lemma.
Let
tL
Lernrna 6.3 If
L 'is regular, then so is tL.
A. The transition relation of and any letter n,
A'
rs defined as follows. For any states q and q'
there is a transition from q to q/ on
o"
q1
11
:
Qrt
Qn:
to q,+r on n, in A, for 1 f i
I
q/ and
n,.
Orr l,lrc llasis of Irolnrnil (i.l], wc (fir]l now corrsl,t'ucl ir tr'llttlirt
t lil)(l in;r
lirtrp;ttit,grr
w;rv sitrril;tt
Q
€ RDC, L2(0) is contract'ion
closed.
Proof. We prove the lemma by induction on the structure of /. However, set subtraction does not preserve the contraction closure property. For example, t. \ {o} is not contraction closed for any a of E. We therefore introduce the auxiliary notions of erpans'ion closed and fully closed. A language Z is expansion closed if
uaw € tr implies uaaw €
J*
and a
L,
€ E. tr is fully
closed
if tr is both contraction
and
expansion closed.
It
can easily be proved that (D,nff'(S))+ is fully closed, and the operators { preserve the full-closure property. Thus, Lz(6) is fully closed for
\ any$eRDC. U,
and
tr
L1 and L2 be contraction-closed languages over
Let,
f
and o €
IQrLr).
The following lemma is easily established.
Lemrna 6.5 Ei,ther there are ut € Lr and u2 € L2 such that u :1)1'D2, or there are u1 € L1, uz € Lz and cr, € E su,ch that u : u'rau'2, where u1 : u\o'
-
aut.
/
€ RDC is satisfiable for continuous time Itr Lr(O)
between an interpretation
T and a string u. Since a letter of o no longer
In order to prove that
is not empty, in the continuous-time domain, we introduce the correspondence
represents a unit of time, the correspondence depends on a partition of the interval considered, which is derived from the finite variability of Z. Given a fcirmula Q, a partition of an interpretation T. over an interval [0, e]
b, e N.)
! [.,2Qlt) l\n'rttt iltlrilt;rrily 1,;ivcrr lirlrtrrtl;r ry' 1rlot r,rltrtr, trit',I lirt rlisltr'lc I itttr':
.
is a collection of reals 0 : bo ( br ( "' ( b.nr : e such that Z[P](l) is constant on (b; 1 ,b1) for every state variable P of $. From the assurnption of tlre finitc va,rizr,bility of states, it is obvious that for any d,7 and [0,e] there cxists a, partition. (Notc that in the special case of discrete time we have
in A' ,
if and only if there exist states Q\,...,q, such tlnt there is a transition from
Lemma 6.4 For anE
anrl u2
Proof. Let "4 be a finite autornaton accepting tr. We give here the main ideas behind a construction of an automaton ,4' accepting +L. A' has the same states (including the same initial and final states) and the same alphabet as
L07
We prove in the following lemma that the above regular languages are contra,ction closed.
for any 1))u €
L,
Time
lo lltt'
'l'lrcsl lirrgrr- u,t-.-u,N € J*rrxrcsllortrlstothcrintcrpretalionl on[0,e] wil,lr 1rir,r'l,it,iotr 0 L1y <.b1 <. "'( b1y:r,if 7[rll](f) -1forf € (bi 1,bi) ;rrrrl rl r { 1,. ..,,ry }. ll ,ry 0, llrcrr rr is I'lrc trtttpl'.y sl,r'ittg iuttl r' : ()lly ;rn irrrlrrcl iorr pt ool'orr Llrl sl lrrcltttc ol',y', wc t';tn t'sl ;rlrlislr Ilrtr firllowirrg It,r trtr
lr,
108 6. Decidability
6.4 Complexity, Tools and Other Decidable Subclasses
Lernma 6.6 Let a formula $ e RDC , an interual l},e], an i'nterpretati'on T of $ with partition 0 : bo t h <. "' ( b.rr : e, o'nd cr' corresponding string r) : ar- . . aN be gi,uen. Then T,10, e] O itr u belongs to Lz(d).
=
Proof. We can present a proof similar to that of Lemma 6.1 by induction on the structure of /. The important changes are in the inductive case: @ is ,b -'p.We now present the details of the proof for this case. There must be an m € [0,e] r/ holds on 10, m] for 7 and rp holds on lm,e] fctr T. First, the cases m : 0 and rn: e are straightforward: they can be dealt with by using the induction hypothesis for rp and 'ry', respectively. The case where 0 < 'm < e is divided into two subcases: such that
Subcase: there is an Ai[
€ {1,
such that rn : bru. to that used in Lemma 6.1, we obtain the corresponds t'o T on the interval l0,rn] with
...,
l/}
By applying similar reasoning
ar"'aM partition 0: bo th 1"'.--bnr:mtthe string a1a41 "'o'tr corresponds to I^ onthe interval l},e-m] with partition 0 ( brrz -m 1"'( b,nr -m, and then u e Lz(rl,)Lz(p). Since Lz(rb)Lr(p) e l@z(tb)Lr(p)) by the definition of .f, we have the result that u €IG2(rh)Lr(p)): Lz(rh ^p), and thus the result that the string
proof for this subcase is completed.
M € {1,...,1[] such thatbm_t 1m1b1ya. Then, by the induction hypothesis t Dr : ar'''aM-raM e L2Qlt), because
Subcase: there is an
?,1correSpondstoIon|0,m]withpartition0:bo1bt<...< and u2 : aMaM+r "'a.nr € Lr(p), because u2 corr€sponds to T- on interval [0, e - m) with partition 0 < bnr - m have u1tr2 - a1 "aM-raMar/raM+r"'orr € Lt(rl')Lr(p), and therefore 1) : ar "'aM-raM&M+r " 'o.nr € J @z(t)Lz@)) : Lz({t^p)"If": Suppose u e Lz1b^p) : t@z(t)Lr(p)). By Lemmas 6.4 and 6.5, there are two subcases. First, consider the subcase
't)t:c4'''aM Then,
if
e Lz(b)
we choose 7n
0(br 0 l bxaa1 -
1 "' (
:
?,r
:
1r112)
where
andu2:aM+r '''arr € Lr(p).
bM, u1 corr€sponds to
*
:
Z on [0,m] with partition
- rn. By the induction hypothesis and Lemma 3.1, ql holds on [O,rn] for T, and p holds on [m, e) for I, so {^p holds ori 10, el for L. Second, consider the subcase p : 71tr71,7r4p!r, wltara 'tt1
;t,ttrl tr2
m,
b,nr
trL
e
- 'tt\(t'1,1 = 11', "'tt X1 (:, ["2(tft) : (t Ittllt (t t(t,It I t " ' rr,,ry [ (i'' (rt') 1
we now choose m: (btr-r +bM)12, u1 corresponds to Z on [0,rn] with partition 0 < br with partition 0 < bur -m, hypothesis and Lemma 3.1, ry' holds on [0,m] forZ and cp holds on lTn,e] for n I, so tfi ^rp holds on 10, e] for Z.
If
It is trivial to show that for any string u of length ly', given an interval partition of [0, e] with l/ sections, there is an interpretation Z such that u corresponds to I on [0, e] with the given partition. Conversely, for any 10,
Lei6berb^p: "Only if": Suppose r!^gholds on [0,e] forZ.
.
109
e] and a
interpretation 7, given an interval [0,e] and a partition of [0,e], there is a unique corresponding string u € t* . Hence, by Lemma 6.6 and Theorem 3.1, we can prove:
Lernrna 6.7 A formula 6 e RDC language L2(Q) is not emptE. Since
42(/) is a regular
i,s sati,sfiable
for
con,tinuous ttme i,ff the
language, we have:
Theorem 6.2 The sati,sfi,abili,ty of RDC
form,u,lo,s
for
conti,nuou,s t'im,e 'is
decidable.
6.4 Complexity, Tools and Other Decidable Subclasses The efficiency of the above decision procedure depends not only on the decision algorithm for the emptiness problem of a regular language, but also on the constructions of the regular language. trach negation occurring in the formula may cause an exponent expansion of the construction. The authors ofl7a2l have proved that the complexity ofthis decision procedure is nonelementary. So the worst case is very poclr indeed.
In [142], the decision procedure was implemented and used to prove the correctness of Fischer's mutual exclusion protocol. The results were not too bad. It took, for example, approximately 12 minutes to verify a formula consisting of 3775 characters on a DECStation 5000-240 with 128 MB of memory. The proof assistant tool for DC described in [1a3] also supports the use of this decision procedure. In the literature, the decidability issue of DC has been investigated further. In [105], after quantifications over states are introduced into.RDC (the result is called qualified discrete-time duration calculus, QDDC, in [103]), the satisfiability of formulas is still decidable. This decision algorithm was implcrnontc
110 6. Decidabilitv that the number of discontinuous points of any state in any unit interval has
7. Undecidability
a fixed upper bound.
In [41], a decidability result was presented for a variant of DC where negation is removed from RDC but an iteration operator is introduced together with the inequalities !. ) k and l. 4 k, whete k e N. In [104], CTL. ([29]) was extended with QDDC, and it was shown how the extension could be reduced to CTL*. On the basis of this reduction, another model-checking tool, CTLDC, was implemented. In 113, 106], the digitization of the validity problem of DC formulas and its reduction to QDDC were investigated, and results were obtained concerning how to check the validity of DC formulas (for continuous time) by using DCVALID.
All the disappointing news
comes in this chapter: even for a very restricted subset of DC formulas, it is undecidable whether a formula in the subset is satisfiable. The general technique used to show these results is to reduce the halting problem of a two-counter rnachine to the satisfiability of formulas belonging to the subset under consideration. The main results are taken frqm [167].
7.1 Extensions of RDC Below we define three different extensions of RDC, cal\ed RDCr(r), RDCz and RDC3. The extensions seem small, but in later sections we shall establish undecidability results (of satisfiability and validity problems) for each of the corresponding subsets. Hence, each of these extensions marks a border between decidability and undecidability.
7.1.1 RDCl(r) In this extension, we add to RDC the atomic formula
!.:r, r is a real number. Hence, the set of formulas RDC1 (r), where the subset of DC generated as follows: where
r € IR is a fixed constant,
is
1. the formula l: r belongs to RDCl(r), 2. if S is a state expression, then lfSl belongs to RDCl(r), and 3. if (b irrrd'/ bclong,to R,DC1(r), then so do -d, Ov 1b, and $-t1,.
r
na,trrr:ill urrrnll<:r, we have previously seen from Sects. 6.1.2 lilr
is
a,
irrr
7I2
7.1 Extensions of
7. Undecidabilitv
RDC1(O) is decidable for continuous time. If r ( 0 \hen (.: r is false, which is expressible in RDC as well. Therefore, the continuous-time domain and r ) 0 are assumed in the undecidability proof for RDCl(r) given in Sect 7.2. This undecidability result illustrates the strength of imposing the precision | : r on the length of an interval for continuous time.
7.1.2 RDC2 In this extension, we allow atomic formulas of the form
T&:
TS2
only, where Sr and ,52 are state expressions. In the case we can still express the formulas of RDC as
fisl <+ (/s : I) ^ -(F : "[o). Hence, the set of formulas RDC 2 is the subset of DC generated as follows: f
. if 51 and Sz are state expressions, then /S1 :
2. it 6 and
/
belong,to RDC2, then so do
-d,
/,92 belon gsto RDC2, and $v (t and rh^rb.
The undecidability results for this case illustrate the strength ofthe notion of duration for both discrete and continuous time.
7.1.3 RDCs In this extension, we add to RDC atomic formulas of the form
r
7.1.4 Two-Counter Machines The main technique used to obtain these undecidability results is to reduce the undecidable halting problem of a counter machine the to satisfiability of formulas belonging to the subsets. In this section, we give a brief and rather informal introduction to two-counter machines. For a more careful treatment, see [11, 65, 96], for example. A. two-counter m,ach'ine has an i'ni'ti,al label q6, two counters Q and c2 which can hold arbitrary natural numbers from N : {0, 1, 2,- - '}, and a finite set of labeled inslruct'ions mi. The only instructions of two-counter machines are to "increase c1 by one" (cf) and "test c1 and decrease it by one if c1 is not zero" (cf ), and similarly for c2. For example, !
Qiicl')Q.i
Qr: ct ) Qj,q*,
which is also an instruction labeled q6. It tests whether the value of c1 is zero; if so, the machine proceeds to the instruction labeled 47; otherwise, the machine decreases c1 by one and proceeds to the instruction labeled qp. A configuration s of a two-counter machine is a triple t: (q,n1,n2) of the current label q and the values IL1,TL2 e N of the two counters c1 &nd c2. The configuration (q,nr,nz) is fi,nal if there is no instruction labeled q in the computati,on ste'p of a two-counter machine, s ::-> s', transforms a nonfinal configuration s into a configuration s' by means of an instruction of the machine as follows (and similarly for c2):
L
,
is a global variable, and we allow quantification over global variables:
lnstruction
Hence, the set of formulas RDC B is the subset of DC generated as follows: f . if S is a state expression, then lf.9l belongs f,o RDC3, 2. if r is a global variable, then !.: r belongs to RDC3, and 3. It d and t! belong to RDC3, then so do -6, Ov $, Q^{ and (1")6,
where
r
is any global variable.
The undecidability results for this case illustrate tlrc strength of cation in an interval klgi<: f
irrrrl
,
is an instruction labeled qi. It increases c1 by one and proceeds to the instruction labeled q7. Another kind of instruction for cr is
F")d.
-)
113
machine.
l::x where
RDC
f)
<1rran1,ifi-
I,irr illl ol l,lrc l,lrrrrc srrlrscl,s, wt'slrir,ll ttst'sl,it,tttlirr
IIrrrrrl O liorrr ll,.
il
A
qici q:ct
_+
q:c1
)
ej -+ qj,
.^f
5-
qk
Qi,qn
(q,nt,nz) :+ (q,o,nz) (q,rrt +7,n2) -4 ---?
D
(rli,nr + I,n2) (ei,o,nz) (qn,u,nz)
com,putati,on of a two-counter machine is a (finite or
infinite) sequence
of armputal,ions (7
:
so.9 I .s2
..'
I
t:tltttllttt'il,l,itlll, s,, =-:) r-, I I lly llt
wllcl'c, lirr irtry s,, itrrrl s,, I I itt
l,lt
LI4
7.2 Undecidability of
7. Undecidability
We call so
:
(q0,0, 0) the 'init'ial configuration, where q6 is the initial label.
A two-counter rnachine starting with the initial configuration halts if all its computations starting with (96, 0, 0) terminate. We shall make use of the fact that the halting problem for a two-counter machine starting with the initial configuration is undecidable [11, p. 78]. This result also holds if we assume that the two-counter machine is determini;st'ic. That, is, every two instructions of the machine are labeled differently, and hence the computation of the machine starting with the initial configuration is determined. This result still holds even if we assume further that the two-counter machine cclntains precisely one final label qpr, i.e. q1n is the only label which no instruction has as its label. In the foliowing, we consider an arbitrary deterministic two-counter machine M with the initial configuration (q6,0,0), where 1. qo,. ..,Qfi, are the labels of M, where q6 is the initial label and qp,
is
the only final label, 2. c1 and c2 are the two counters, and 3. rn1,. . . ,'trlt are the instructions of M.
We reduce the haltirrg problem fctr M to the satisfiability of a formula in RDC1 (r) (for r > 0).The encodingof M uses the following state variables:
r
Qi for each label 91, o two state variables Cr and C2 to represent the counter values, and o two auxiliary state variables B and ,L, used as delimiters. one state variable
Let
lBlctlBl. . .lBlc,lBl
in the follou'ing. The mairr idea is that a machine configuration (rl,nt,n2) is encoded on an interval of length 4r as follows:
I'\2O lVul,l\,/L lVal,l \2 '\"j' TrTr
where val; represents the value of counter c7. This is done so that the rr,th configuratkxr of a cornputaticln ocr:trpies t,hc interval l4nr,4(n * 1)r],'n, ) 0.
,
with rzi sections of C, separated by B. Since this interval is required to have a length r, and since there is no bound on the counter value, the time length of each Ci (and B) section must be arbitrary small. The denseness of the time domain makes this representation possible. This representation was inspired by [3]. The reduction must formalize the computation of M as a formula in RDC1 (r). In particular, we must construct a formula representing the initial configuration and a formula expressing how the (n + 1)th configuration relates to the nth configuration in the computation. To do so, the following alrbreviations of formulas in RDCI (r) are useful: [.il
' :
-ll1l
lll v [tl
l.
r')
^true)
- (l!:r)-(1.:r) t ((:2r) -tlue = -((t - 2r) ^ ((.: t (,1:2r)^(l:2r) - ((.:4r)^((.:r)
[,Sl' ':
Q: {Qo,...,Qn"}
115
The representation, Vah and Val2, of the counter values is the following. Let the value of counter c; be ni ) 0. Then the interval describing Vali has the following form:
true
7.2 Undecidability of RDCl(r)
ADCt(r)
lf.9l
^
(l
r) ^true)
: r)
4*4'a -(d^-(mv,i/)). The formula [f Sl' reads ",9 has value one for a duration of r", and the formula d*',! reads "if the interval starts with @, it must end immediately with [l
or with ty'". The initial configuration is (96,0,0), which is represented by the formula
Initl :
[Qul '' ^
Sl,a,t,c varialll
M'ul,t:t:1
:,
[Bl' ^ [ Ll' - [fBl' ^true
rrurst be rmrtually exclusive:
A t-, llti
A
1'z-Tl
,
l't / IIl
rvlrr,r'r' /'1, /1, r'rrrrl',r' ov|r'
!)
IJ
{('t,
('..,. ll,
l,\.
.
7.2 Undecidability of
116 7. Undecidability certain state expressions have a periodic appearance, since configurations are represented on intervals of length 4r. Lei
Per(fi = n((d
^(t:
ar))
+ (([.: ar)^0D
Machine labels, counter values and the separator tr have a periodic appearance. Let
j
Period'ic
Per(\f n
,nfiQll')
A
Per([Q v Bl')
A
Per([r]l')
A Per([C2
v
Bl')
For each instruction m of M we give a formula F(rn'), encoding the computation steps perforrned by rn. Suppose the machine instruction mis qi,cf -+ 4;. The possible computation steps allowed by m are described by a formula
F(^) -
F1
A F2A F3 A Fa A F5 A F6,
where each 4; is defined below. From the determinism of M, qi is the only label of the succeeding configuration that is reached when m is performed. The formula F1 expresses this:
r' = (llQnl'^(t:
ar)) + ((t,:4r) ^llQil')
The formula f-2 copies the Cr sections to the same place in the next configuration. To encode this process, we use formulas of the form $ "> t!. Here 4! characterizes certain configurations whose label is Q.;, and ry' fixes part of the next configuration. The formula is given by - tnre\ \ / [Crl] "'"n' -[Crl Fzz InO,l'^((
/
\
\
l/
*
(ilcrl -true).
We can copy the B sections before a C1 section in Vah to the same place in the next configuration using the same technique:
/ /[Bl [Crl-rrue\\ n Fr+ {[Q,ll''((
\
\
- -^ ((liQil"-ilBil'^(:4r)) \* (true -(((- r)^(lTBil -lTC' Il
ll
The formulas F+ and F5 increase the value of C1 by replacing thc last B section tf Valy with lBlCl lBl in the next configrtratiort.
)
The formula F5 handles the case nL
\
[B])))/
0:
-'*"))) (t
.
lI7
The formula Jr+ handles the case ??r : 0:
'o
.
RDCt(r)
(true (((: r)
^
([Bl llc,l [Bl
/
Note that the beginnings of successive tr sections are exactly 4r apart, and therefore the length of the lfBl ^pcr-li^[Bl section in the consequent in 'F'5 is precisely as long as the last [fBl section in the antecedent. Thus, Fa A -F5 models the condition that the number of C1 sections is increased by one, as desired. The formula f'6 copies the value of c2 to the next configuration using the same technique as used above:
/
{[q,l''((
\ Fo=n /
-[cz]l
/ [C"l - true\ \
-{
\
n
(:4r
ll-(llGii
Lruc)
//
/ [Bl -rrrre\\ ^(2r<( <Jr)- [Bl { n I I { no,-1' \ \ (:4r //
({lal -rrue).
-
The formula Peri'odic takes care of copying the Z section to the next configuration.
Every instruction rn6 can be encoded as formulas F(^r) by techniques similar to those used above. If this is done" the entire machine is encoded as follows: Machi'ne1
? Muteu A In'it1 A
Pe,iod,ic
n f1 of i-7
1-o;
.
By the construction of the formula Machinel, we know that the computation of M terminates (i.e. the computation is a finite sequence of configurations ending up with a final one) if and only if (Machinel n O[Qn"l) is satisfiable.
Theorerrr 7.1 Tlt,r: sotisfiubi,l,it'y problem of formulas i,n RDCl(r) (r > 0) u,rr,du:i,d,tr,b Lc .fu' utn,ti,rt,rt,otls ti,rn,e.
zs
lltrrt,tu'k:. 'l'lris lcsrrll, rl<'pcrrrls on l,irc a,lrilit,y 1,o
irrl,<,r'v;rls ;rs
lollowr:
7.3 Undecidability of
118 7. Undecidability
l:
r 1 -((1.< r) v (lf1l ^-(l < r)))
expressions:
We reduce the halting problem for M to the satisfiability of a formula in RDC2. We give a reduction which works for both the discrete- and the continuous-time domain. The following state variables are used in this reduction:
1. two state variables Cu+ and C; fot each countet ci,'i : I,2, and 2. state variables Q: {Qo,. . .,Qn,} corresponding to the labels of M. The intension behind using the state variables for counter ci, fori : L,2, is that the value of cl is represented by the value of
Ic; In the reduction, it is only
necessary to
on a suitable interval test whether the value of c; is 0, and this is expressed by the formula
Ic{ : Ico
.
C.f (and C, ), the value of ci can be increased (and Tlre main idea is to encode in RDCz the computation
Hence, using
decreased).
M by a sequence of sections lQEolcolQg rlc'lQE
rlcrl.
of the form
.,
where QEp is a state expression of Q, and C7, is a state expression of
{c{,c{,ct,cz}. If sp :
where Cv describes a possible change of the value of c1 and c2, and C^ actually maintains the value of the counters. Concerning counter values, we introduce the following abbreviations for formrrlas in RDC2:
[s] = (/s:F)^-U0:I)
Incrl Decrl = Incr2 ' Dem2 ? Const ?
(qn,ntr,'np"), then QEu is a state expression representing the label q6, and the values n,k)nk2 of the two counters in the kth configuration are represented by the vaiues of !C{ - [C;, for i : 1,2, ovet the interval covering the sections Co,Ct,Cz,...,Cp. For this idea to work, it mrrst be specifiecl that all sections have the same length and that t,Irc: QE p, art
[C,+ A
-(Ci v C{ v C;)n
llci A-(C1+ v C{ v C;)n [C{ n-(C; v C1+ vCi)l [C; A -(C{ v Cl+ v C1 )l [Cnl
.
The formula 1ncr1 expresses the fact that the value of counter cr is inletting Cr+ be one throughout one section, while the other counter state variables are zero. The formulas Decr1,Incr2, Decr2 have similar explanations. Const is used to keep the counter values constant from one configuration to the next (by increasing [Cd as much as /Cu ). The following abbreviations will also be used for formulas in RDCz: creased by one by
il ' true ' d*,,1' . Js>o
56 51 52 "'
of
cv " cfvcrvC{vC; c^ = cl t c; Aci, AC; Q" = QoV...yQ1n,
7.3 Undecidability of RDCz
(see below).
119
To formalize this idea, we introduce the following abbreviations for state
.
Thus, we cannot achieve a decidable subset by "relaxing the punctuality" ftom l.: r to !. .-r, analogously to the result discussed in [7]. We do not know whether this is possible when I ) r is considered instead of l: r. tr
fcd -
/iDCz
arf zrd Let
.I?
o[sl -[1]l
ffivll1l
-(d^-(lll
reads: "for some prefix interval: reads: "for all prefix intervals:
/"
@"-
ilrrcl S be two exclusive and complete state expressions. Let
l/i l,slnl,sl Irrr ;r
v.t/r))
: @^true ' -(Op(-d)) Rl
(lirril,r'ol irrIirril,rr) so(luon(:c o['ir,lt,
srrr'{,iorrs t'xcr'1r1, k,rr11l,lr.
120 7. Undecidability
7.3 Undecidabilitv of
Below, we construct a formula EqSi'ze(R, S) in RDC 2 which describes the
n
,golcol
'
ffir? <+
-sl v ill)
/
(u)
/(true-([S:.[R>0))\\
+| ((/s
n
ll - J'R > ol ff \ / /(true-t[R-.[S >0))\\ -[s-ll) n + ll -' -il/ | ^trl([sl-il,Bil
^nl([Rl-fisl-llRil) \ \"-'
of the sequence is expanded to
(b)
truel
ilclQ olcf lQ' where only one expansion is possible, owing to the determinism of M. lQ
I
M
.',,) ( l;]t;'' ))l
(c)
G(q1 : cl
-+
qn)
? 'ln',r',rr'
ile"r
are mutually exclusive:
A n-[AA&l Pt#Pz
Muter2?
,
zero. \Me obtain
((*'""t"*;ff,[:"))
sections defined by the formula I
Muterz A EqSize(Qv,
Ct) n Initz A I loG(znr) ,
'
where Init2encodes the initial configuration and ,lf*rlencodes a transition from one configuration to the next caused by the instruction m,;. These formulas are defined below. The initial configuration is (96,0,0):
llQol
-,,r",) i
it'alr.d lor the insl ruction ci -+ qp.qr. of whether the value of counter c1 is
The situation is slight as we must tahe care of
where P1 and P2 range over Q. The computation of M is encoded by a sequence of alternating Q and C
=
Iuil'J.),',,,,'r0", G(q1 : co --r rln,e,)
The formula Init2 tequires that the sequence will start at'Qo, ancl continue with C^. Thts, Init2AEqSize(Qv, Cv) can guarantee that all C sccticins will have the same length, provided C does not appear at the end of tlttl stlqtt
.,,",)
2
^ Const-'true.
The formulas G(rn;) (for ri : 1,...,1), wltit:lt
We
have
\tt1o:-[s>o)^rruel)f
to the labels of
Initz'
qj : c[ --] Q6, w€ must formalize the condition that
"'lQilcl
p,lcol'''
where (a) requires that the state expressions rR and S are complete and mutually exclusive, and (b) and (c) require that the length of each middle section is greater than or equal to the length of its neighboring section. Therefore all the middle sections have the same length. The following property expresses the fact that the states corresponding
Machi'ne2
127
any initial segment
above scquence. EqSize(R, S)
For the instruction
RDCz
11.",,) ( ',111:.:')) (("'""
n: -( /c,F
[C,
,
)
1,hirl, l,lrc rrrtt:otlitrg
(ll:rr
I
)rt'r i)
I
)t'r'r',
ll
(,)u
ll
,
)
122
7.4 Undecidability of .BDC3
7. Undecidability
Tlre first conjunct of G(q1 : cn -+ Qn,Qu) describes the case where the value of counter c.i is zeto) and the second conjunct describes the case of a positive value of counter c;. It can be proved that
if Machine2 n O [Qn"l is satisfiable, then a terof M can be constructed, and vice versa. Thus, the
mirrating computation halting problem for a two-counter machine can be reduced to the satisfiabilitv of formulas in RDCz.
Theorem 7.2 The satisfi,abili,ty problem of formulas for both d'iscrete ti"rne and co'nt'inuous t'im'e.
i,n
RDcz
'is
undecidable
123
where z ranges over real numbers. An instruction ei i .[ + qn transforms configurations as follows:
lQilcl...lc lL'l cl ... lc lL'l n1
-
lQxlclcl.
-.
lc lL'l cl
nr-l-I
. . lc lr,l. n2
Taking into account the determinism of M, we can encode this transformation by means of the formula
H(qi t cf -+
sk)
-
Yn,y, z.
(([QjIl'- llcil, - llz'1" -[cl'- [Lrl'^((:4r t y*z)) \ \+ ttr:3r* a+z) flQi"l"- [Cl'- llc-ll, llZ,li"- [Cl. -[Lrl,))
7.4 Undecidability of RDCB
Vr is the dual of lr and can be expressed in R,DC3, and the for(l :3r i y + z) is an abbreviation of the following formula of RDCy:
where
The halting problem for M can be reduced to the satisfiability of a formula in RDC|. We give a reduction which works for both the discrete- and the
mula
continuous-l ime domain.
ists for
The encodingof hI uses state variables Lt,Lz,C and Qo,...,Q5n,whete tr1 and tr2 delirnit machine configurations, C is used to represent the counter values and the Qs correspond to the labels of the counter machine. All these state variables must be mutually exclusive:
Mu,ters?
A
n-Jf&A&l
Here Q is the label of the configuration of M, n1 is the
r))^([r'l n (!:r))^([rr]l
-\,-
rLI --\-'-
n2
M, these computation
Hkli , ct value of the first
^(t:
z))^true'
ration. We shall 1se th
steps can be encoded
-+ qn,qu) 4
z)) \ [l'1" -[Cl' - ^[Lrl" - -l!:3r*-[Lrn,) -vr'''^ ( (ilQr]':3r I z) fierl, llL,Tl" llCl, \ > ((( ) Yr,y,
z.
( tlQtll" - llcl,
[cl, - [L,l]" {lcl. ILrn, - (:Jr +s + z))\ \+ ttr - 4.r | lt+z)'fl8,[|'- ilCll, llt,l"- [C]l'- lltrll') )
lllrc
^
irrsl,r'rrr:tirin r1i : r:., -+ t11,.,q, calt br: encodcd similarly, and the encod-
irrg of' ,4,/ is givrrrr lry A4tr,t'lt,'irt,t'3 Mul.t,t:11 A lrt,,i,l,,n
/\
it .r'),
n2
as the formula
Each instruc Lion rni of the counter machine is encoded as a formllla H (-,t) R,DCz, which relates a configuration of the machine to the lcxt t:tltlfigtr-
ll,sll)^(/
lQilcl...lc lrrlcl...lc \.-,- lLrl ===a lQ"lcl...lc lLrlcl...lc lLrl. Because of the determinism of
counter c1, &nd nz is the value ofthe second counter cz. The lengtlis ofthe Q, C and I sections must be the same. The initial configuration, (40,0,0), is represented by lQslLllL2l:
(ll ll v
n2
and when the first counter vahre is nonzero,
wlcl. . lc lL'lcl. - - lc lL,l. -,- n2 -- nI
ll,sll'
lQilLrlcl...lc lLrl + lQnlLrlcl...lc lLrl, n2
where Pr and Pz range over {Qo,...,Q5n,C,Ll,L2}. A configuration of the machine is represented by a sequence of sections Q, L and C, ail of the same length:
in
the first counter value is zero,
,
Pt*Pz
Inits-:r.(llQo-ll A((.:
r)^((.: r)''(l: y)^(!,: z). A similar formula of RDCs ex(!: 4r t y -l z). Tlre formula H(qi , -+ qp) can be constructed similarly. An instructiorr qj : ct"[-+ qn, q, transforms configurations as follows. When
(1.: r)-'(l:
I r1t1,,,,1
.
'
124 7. Undecidability The formula M achin4 Ao and hence:
IQ
n"]
is satisfiable if and only if
Theorern 7.3 The satisfi,abi,li,ty problem, of formulas for both d,iscrete time and conti'nuous time'
i,n
M terminates,
8. Model Checking: Linear Duration Invariants
RDcs is undeci'dable
In Chap. 7, it
was proved that the satisfiability (and validity) of simple subclasses of DC formulas is undecidable for both the continuous- and the discrete-time domains. In Chap. 6, decidable subclasses of DC formulas were identified. Some are decidable for both the continuous- and the discrete-time domains, while others are decidable for discrete time only. In the discrete-time domain, interpretations of DC are restricted to those Boolean-valued functions which change their values at integer points only. The research on decidability and undecidability often imposes restriction on syntax and/or on interpretation when exploring this topic. In this chapter, we consider continuous time only, and confine ourselves to interpretations which are generated from a real-ti,me automaton with upperand lower-bound timing constraints on its transitions. F\rrthermore, we syntactically confine ourselves to the subclass of DC formulas which have the
form n
cpin 1l
f",[R<", u'r
)
for 1 1i 1n are real numbers, and fl for 1 ( 'i 1n are state variables. We call a formula of this form a linear durat'i,on inuariant. For example, if we ignore the modality o in GbReq, the simpli,fied requ'irement of the gas burner is a linear duration invariant, since where
c*in, c, and
60<(.
+
ca
2}JLeak<(.
can be reformulated
60
+
as
(20.peak-l)<0
1:
i fNonleak), it can be further reformulated 60
and, by rrsc of
(fi,eak
as
wlrirfi is ir lirurirr rlrrra,l,ion inva,ria,nt with stittc va,r'iablcs Leak and Nonl,eak. (ll,rrtrrrrrrrlrrrr l,lrirl, Norrl,tr;1,11
'l'lrir rk'r'irk'
6
.l,cir,l<.)
clrn,pl,r'r' givcs ;r, posil,ivc ilnsw(rr l,o l,lrc rlrcsl,iorr ol' wlrcl,lr
/]
L26
8.1 Example
B. Model Checking: Linear Duration lnva.riants
127
for 1 ( ,i 1n as its states satisfies a linear duration invariant, and describes how this can be done. An algorithm is pr.esented in this chapter which reduces the problem to a finite number of linear programming problems. Therefore, algorithms for solving linear programming problems can, in combination with this reduction, be used to check the truth of a linear duration invariant with respect to any interpretations generated by a real-time automaton. It is easy to apply this algorithm to check the truth of a conjunction of linear duration invariants and to generalize the algorithm to formulas of the form I
c^in 4 l. 1c-o,
+ t ci' [Si 4 c, i-I
where c-o, is either a real number or oo, and each ,9i is constructed from the states of the real-time automaton using the Boolean connectives. In this chapter, we first use the gas burner example to explain the main ideas of the algorithm and to explain how it can check the correctness of a gas burner design with respect to the requirement, although a formal proof through Dc deduction was given in sect. 3.5. After the example, the reduction is formalized and proved correct. The work presented in this chapter is based on [172].
8.1 Example
Fig. 8.1. Real-time automaton for the
a transition to the Leak state can take place, and it can even stay in the Nonleak slate foreverSuppose for the moment that Nonleak is the i,n'itial state of the automaton. A finite sequence of transitions represents an untimed behavior of the automaton, e.g. an untimed sequence of transitions f
The main ideas and concepts of this chapter will be introduced here using the gas burner example. Consider the formula's
n(fl,eakl
+ !.
r((lf[,eakl ^flNonl,eakl ^lfleakl)
+
I > 30),
which model a design for the gas burner. This design can be represented by the real-time automaton in Fig. 8.1' whiclr has lwo states, Leak and Nonleak. The two edges of the automaton are called transi,tions, and are labeled f (for failure) and r (for recovery). The state Nonleak is called the pre-state of f and Leak is called the Ttost-state of f, and similarly for the transition labeled r. The transitions are also labeled with timi,ng constraints. The timing ctnrstraint on transition r is a boundexl anci closecl int
gas burner
rf
,
which starts with an f (failure) transition since Nonleak is the initial state, and then an r (recovery) transition followed by another failure transition. L timed behavior of the automaton is obtained from an untimed transition sequence by marking each transition with the number of time units the automaton spends in the pre-state of the transition, e.g. (f,31) (r,0.5) (f,50)
is a timed sequence of transitions describing a timed behavior of an automaton which spends 31 tirne units in the Nonleak state before a failure transition to the Leak state occurs. It then stays for 0.5 time units in the Leak statc bcfore a relcovery transition to the Nonleak state occurs. Finally, th
faihrrc
l,r':r,rrsil,iorr 1,o 1,]rc [,cak sl,a,{,
A
(l', / r ) (r', /:t) (l.,
/r)
the tirnirrg constrains
II 728 8. Model Checking:
8.1 Example
Linear Duration Invariants
must satisfy
Constraints:
t1 ) 30, 0 ( lz ( 1 andt3 > 30.
f1
)
30, 0 (
For this timed sequence) the total acr:urnulated time the automaton spcrrds
in the Nonleak state is f r f,lonl,eak
: tr I
t:t
*
l: ( I, Ob.jelt
f.;:
19tz
.
r If the maximal value
Sirnilarly, the (accumulated) time spent in the Leak state is 12 and thc length of tlre total time period covered by this timecl sequence is f1 -ft'z I f3, i.e.
peak:
129
t3>. 30 and
ile
(tr+tz *r.:) > 60.
funcr,ion:
- (tr + tu)
.
of the obiective function is positivc, thcn the linear
rf. e If the maximal r':r,lue of the objectivc {unction is less than or equal to dura.tion invariant is violatcd by f
then f rf sa,tisfies the linea,r drrr:r,tion invariant.
0,
12
Fig. 8.3. Linear programming problem
and
1!: ff eak *./Nonl,eak : tt I
tz
I h.
In thc following, we investigatc how to check the truth of the linear duraticin invariant representing the simplified requirement of the gas burner 60
< {.
+ (19peak fionleak) (
0,
regular language
with respect to all tinied sequences of transitions of the gas burner automaton. First, Iet us fix an untimed transitiorr sequence. Note that infinitely nrany timed sequences may be obtained frorn a given untimed sequence. An untimed scquence of transitions of a real-tirne automaton satisfies a lincar duratiorr invariant iff ail tirned scquences of the automaton obtained frorn the untirred
thc invariant. Considcr the problem in Fig. 8.2.
sequence satisfy
Is the linea.r duration invari:rnt 60 <
| +
19peak
-
Thus, if the gas burner automaton has only finitely many untirned transi tion sequences, then the satisfaction probiem of the linear duration invariant can be transforried into a finite mrmber of linear prograrrrming problems, and solved erffcctivcly. Unfortunately, this automaton carr producc infinitcly many untimed transition sequerrces) and they can be expressed in terms o{
JNonleak
(
0
satisficd by the untimcd sequence of transitions f r f of the gas burner
as
(fr)- U (fr)*f, where * stan
automaton?
Fig. 8.2. Satisfaction problem for an untimed
Is the linear dur:r,tion invariant
sequence 60
Fortunately, this problem can bc formulated and solvecl by usitrg iinr:ar prograrnming (see Fig. 8.3). Therefore, the problern of wlietlxlr att ttttl,itttt:rl sequence satisfies a linear duration invarianl, is rltt<:i
< 1 + 19./Lcak ./Nonleak < 0
sa,iisficrl lry cvrrry rrrrl,irn
(lr)-'/
130 8. Model Checking:
8.2 Real-Time
Linear Duration Invariants
Interestingly, any timed sequence obtained from a pair of transitions f r decreases the value of (19peak - JNonleak) by at least 11, since the automaton can stay in the state Nonleak for at least 30 time units and in the state Leak for at most 1 time unit. Thus, if the timed sequences obtained from repetition of f r k times, (f r)k, always cover a time interval which is not less than 60 time units and the values of (19peak - /Nonleak) given by them are not greater than 0, then repetition m times to give (f r)- (for arly tn ) k) satisfies the linear duration The above reasoning implies that if the timed sequences obtained from r)k always cover atime period not less than 60 time units, then the satisfaction problem for (f r)* can be reduced to a similar problem for
131
!{t';ut.
z-0
Therefore we can reduce the satisfaction problem of the linear duration invariant for the gas burner automaton to a finite number of linear programming problems. In fact, it can be reduced to four linear programming problems, which correspond to the untimed behaviors
invariant. (f
Automata
f, fr,
if
frf
and
frfr,
we exclude the plain behavior for the empty sequence. Their objective
functions have maximum values
k
-60, -40,
[J{r')0,
i,-o
which produces only finitely many untimed transition sequences. Flom the timing constraint that the automaton has to stay in Nonleak for at least 30 time units, it can be proved that the timed behavior obtained from (f r)2 always covers a time period not less than 60 time units. See Fig. 8.5.
If the linear duration invariant 60 <
| + 19Peak-
-fNonleak <
included in 2
I rf.t' I
Y'
it is also satisfied by every untimed transition
sequence of the
automaton included in
(f.).
and
-22,
respectively, and the answers are all positive. So we can prove the correctness of the design of the gas burner with respect to the simplified requirement by model checking. The observations in the above example can be easily generalized to cover other cases. For example, if there exists a timed sequence obtained from f r which increases the value of (tgpeak-/\onleak) by a positive amount, then the linear duration invariant will be violated eventually, since the repetition of f r wili eventually cover a time period not less than 60, and increase the value of (19peak - JNonleak) to go beyond any given bound.
In the following we elaborate and formalize the
0
is satisfied by every untimed transition sequence of the gas burner automaton
then
-4I
above observations,
and develop systematically an algorithm to check linear duration invariants against real-time automata. The notion of a real-time automaton is formalized in Sect. 8.2, and Sect. 8.3 formalizes the notion of a linear duration invariant. In Sect. 8.4 an algorithm is developed to reduce the satisfaction of a linear duration invariant for a (possibly infinite) regular language of untimed sequences into a finite set of linear programming problems. Section 8.5 briefly discusses possible generalizations of the algorithm.
.
8.2 Real-Time Automata Fig. 8,5. Reduction of a satisfaction problem Similarly, any timed sequence obtained frorn a pair of transitions r f also decreases the value of (igpeak-.fl\onleak) by at least 11, and tlre timed sequences obtained from f r f always cover a timer period not l
The n
1,32 8. Model Checking:
8.3 Linear Duration
Linear Duration Invariants
A. real-time automaton following conditions:
14.
is a tuple
(V,
T,low,zp) which satisfies the
1. V is a finite set of sfafes {P1,.. ., Pn},where the states are erclusi'ue and complete.
2.
T C V x V is a finite sel of transitions. If P : (Pt,Pi) is a transition, then P, is called the pre-state of p and P7 is called lhe post-state of p. We denote the indices of pre- and post-states by I and p', i.e. f, : i 6n6
i:
j.
8.3 Linear Duration Invariants A
LDI = c-in4l + Dl:rci.{Pi1c, where
The ualue of
denote the lower- and upper-bound timing constraints on the transitions, and we require, for any P €T,
00, where we accept r < oo for r € IR, and oo )
TSeq
A is a finite sequence of transitions of
:
-'{,
- PtPz"'Pn, where rn t 0, pt eT (I ( i (
rn) and
By i o:F o+, we express the fact that pi and pr+r are two consecutive transitions, which are linked to each other at state Pr*. The empty sequence (rn : 0) is written as e. Let Ln denote the set of untimed sequences of A- La is a regular language over the alphabet T, as il is accepted by a finite automaton (where every state is both an initial and an accepting state). A timed sequence of A is a finite sequence ,
1i
ff:'iy.
- L'j'-rti
.
The value of the linear function LF for a timed sequence TSeq is
rseq(LF) : D\-rci' Lemma 8.1 For any
ti,med sequences TSeqr, TSeq, and a state P,
(TSeqt^ rseqr)([P)
(-^-)
stands
TSeq([P1).
:
(TSeq2^ TSeqt)(JP)
for the concatenati,on
is
L'a'
I t; I up(p;) (1 < i < m).
Flom now on we assume thnt a (V,T,l,orn, tlJr), wlttrttr V
and the fact that addition
I
o[ Llul iutl,orrtiltort. Howervor, the value of IP (P e V) cirrr lrrr r:orrrprrl,trrl Irll ir,ny l,irnrx[ (or rtnl,irrr
r
= ll'r,.",
[P)
for ti'med sequences.
Rern,o,r'k. Ca,refirl readers may notice that a reordered timed sequence may viola,i,
and
Lowlp;)
commutative.
,
operator
Proof . This follows from the definition of TSeq(
PrPz"'P*
is givcrt.
,
LF ; D?:r"o.lPn
where
where
A:
:Diqoott
The l'inear functionin LDI is denoted by
d:Fo*, g
€
A
<m,an
: (pr,tt) (p",tt) "' (p^,t,n)
sequence of
- (pt,tr) Q",tt) "' (p^,t*)
TSeq([P1) 0.
[Pi (I < i < n) for a timed
is
seq
TSeq
l'inear duration i,nuariant for the real-time automaton ,4 is a DC formula
of the form
up:7-+(Ru{-})
sequence of
133
o cm1nt ci (1 1i < ,) and c are real numbers, and o Pi (1 < i < ,) are states of A.
3. The functions low:T -+R
An untimed,
Invariants
/1,,
)
,
134 8. Model Checking:
8.4
Linear Duration Inva,riants
(: DL, c,li6^uti), where ai : U I 1 < i I m ancl ff:'i1. TSeq(LF)
cminl( + L]:rc;'[P;1c is sati,sfied by the ti'med sequence TSeq of A if
4 f setl@) implies
If the maximal value of the objective function exceeds c, the linear duran tion invariant is violated by Seq. Otherwise, it is satisfied by Seq.
TSeq(LF) < c.
Otherwise, we say that the linear duration invariant is uiolatedby
TSer1.
I
=+ DT:t ci ' [Pi <
is sat'isf,ed by the unt'imed
A linear duration invariant LDI is satisfied by a set L c T* of untimed written L I LDI , it Seq I LDI fot every ,9eq € tr. Furthermore, a linear duration invariant LDI is satisfied by a real-time automaton A if it is satisfied by all untimed (and hence all timed) sequences of A, i.e. iff sequences,
The linear duration invariant ("*nn 4
135
The objective function of the linear programming problem is
The linear duration invariant
c,min
Reduction
c)
seEt"ence
Ln l: LDI
of A
.
S"'l:PtPr"'Pn, written
8.4 Reduction
as
Seq
I LDI
In this section we formalize the algorithm sketched in sect. 8.1, in order to
,
reduce
if it is satisfied by every timed sequence obtained from seq. otherwise, we say tlrat LDI is uiolatedby Ser1.
to a finite set of linear programming problems. In the following, we identify a regular expression with the language it
Theorem 8,1 The problem Seq
I LDI
is soluable using
denotes.
Li'near programming.
Proof. Let S"q : PtPz' ' ' P*Consider the timed sequence TSeq
LA ts LDI
: (pt,tt) (p",tr) "' (P-,t,
)
,
and consider each tr as a real variable. The constraints of the linear programminS; problem are obtained from the timing constraints of ,4,
A regular expression C(,1) constructed from the transitions of 7, the empty sequence e and the letter ,{, using union, concatenation and repetition, is called a regular contert. For a given regular language L I T* , C ('L) denotes the regular language obtained from C(/) by replacing every occurrence of l[ in C(X) with tr. Two regular languages -Lr and Lz of T are called congruently equi:ualent or simply equiualent with respect t'o LDI , written L1 :r,p17 L,2,
if for any regular context C(X),
low(p1)4ti1up(pi), for 1 ( of LDI
i 1m,
c(L,) l: LDr
and from the left-hand side of the implication in the definition
,
c^i,n
iff c(L')
LDI
.
=
Giverr .LD1, for sirnplir:ity we shall often drop the index LDI , and simply use lllSt(ril(l t)l :t,t)t. Irr l,lrrr lcsl, of'l,lris
=
1
TSeq(!)
G D[, t)
.
'l',\t't1,_,((')'l'5u11(() ;tnrl'1"\t't1,;(1,1")
'l',lrt1,(
l,lt)
136 8. Model Checking:
8.4
Linear Duration Invariants
and vice versa. In most case, we even prove
TSeq2(LF): TSeqt(LF),by
Theorem 8.2 For languages Lr, Lz C T*
137
:
: (LzLt). 2.(LtsLz)* : (LiL;). 3. (Lt(L;)). = ({.} u (r1(ri)(r;))).
showing
1. (LrLz)
TSeqr([P)
: TSeqt(fP),
for anv state P €
v.
A proof of equivalence can also be conducted at the level of untimed if we can find a correspondence between untimed sequences of and L2 which can be carried over to timed sequences.
sequences,
-L1
The problem
LA
Proof. A proof can be given by showing that each untimed sequence of an original language has a corresponding sequence in the equivalent language which contains the same letters but may have a different order among the letters, and vice versa. For example, for the second equivalence, it is obvious that
LDI
(Lru L2)* ) (LiL;)
=
is reduced to a finite set of linear programming problems in two steps. In the first step, we derive from L a an equivalent norm,al form,, and in the second step, we reduce the satisfaction problem of LDI for a normal form to a finite set of linear programming problems. In order to deflne the normal form, we need the following concepts:
1. An untimed sequence hpz...p^ of y' is called a finite terrn. Note that the empty sequence e is a finite term. 2. An i,nfi,nite term is an untimed sequence of A followed by a repetition of a single transition with zero as its lower-bound timing constraint, i.e. an infinite term has the form
PrPz"'P^P*, where /oto(p)
:
0.
3. A. normal form is a regular expression over the alphabet 7 of the form k
U to'
i:t
where -Li is either a fini,te term or an 'infi,ni:te term. Ls a special case 0, a regular expression for the empty language, is in normal form, as a
R,eduction
: l)?:, Lo.
Note that it is decidable whether a finite term satisfies .LD1 (Theorem 8.1). Therefore, the main part of the second step is to solve the problem of whether an infinite term satisfies LDL
8.4.1 Congruent Equivalence Reordering the elements of a timed scqllonco docs not charrgc th
and that by reordering the letters of an arbitrary string of (Lv U tr2)* into SeqySeq", where Seq, is a string containing only letters in -L1 and Seq2is a string containing only letters in L2, we can obtain the corresponding string
in
!
(LiL\).
By Theorem 8.2, the distribution law for the concatenation over the union and the idempotent law for the repetition in a regular language, we can transform any regular language into an equivalent finite union of regular expressions of the form
pt-..p^Seqi...S"qI. For example,
(np$ u (pzpn).)* pu TH8.2(2) = (np$). (pspq)** ps ps Idempotent ({.} U npip$)(pzp+)* = (pzp+)* psu ptpipi?sp+)*ps TH8.2(3), Distribution
= pb(psp4)* =
U
nprpip\Q3pa).
TH8.2(1).
(In the above equations, "TM" means "Theorem".) We now prove the following four theorems in order to reduce a regular expression of the form
pt...p-SeQi...S"si" to normal form. The first two theorerns are concerned with the equivalence between untirned sequences having 0 as the lower bound of the timing constraints. Tlr
8.3 #
(1,t1,2...
knn(p;,)
l),,,)* -
=0
Itip!,
"'
(rl
= 1,2,...,rrr,),
l)1,,.
tlr,cp'
138 8. Model Checking: Proof.
It
(prpr
8.4
Linear Duration Invariants
TSeqr(l)
is obvious that the right-hand side includes the left-hand side:
"'
P-)*
e pIpi " ' p;-.
For example,le\
: rseqr(fP). m:
'(fr I /2) TSeq2(LF):r" pL >cPr 't, lc*P2 'lt - TSeq''(LF), Sect.
2 and let
:
Theorem 8.4 If low(p1)
0 and
,i ,2 ,r,,
Corollary 8.1 # low(p6): 0 (i : 1,2,.
, \* \PrPz"'Pm) -
S"q
to
demonstrate a proof of the other half of the
equivalence. Let
l*in
: hPr "'
be the shortest time period which ,9eq covers, i.e. n
lnin : ltow(p). We can also obtain from Seq a timed sequence
be a timed sequence of pipi.According to the definition of a real-time automaton given in Sect. 8.2, up(pr) ) 0. We define
TSecl-o,
: (h,tt) (pz,tz) ''' (p-,t*)
,
where
k: lt2lup(pr)J and 6 : tz - k. 'up(n) ,
t;
i.e. we have
t[c*> o - ["p(p,) I low(p;) otherwise
,o, t
This seqllcncc has thc ntaximal vtrlue of -Lf' among all timed sequences of
tz:k'up(p1)+6.
Seq,
Then the following timed sequencc for pf
,
'l',9tr1 (1t1
Pm,
i:7
: (h,tr),(pr,tr)
collcsporrtls
*
P1'
The following two theorems are concerned with the equivalence of untimed with a positive lower bound on the timing constraints.
let
We shall use an example
=
and
Given an untimed sequence
pi.
(p, , t,,)
,m)
sequences
is trivial to show that
TSeq,
..
then
th"n
/ * *\ * \PtPz) : Pr'
TSeq,
n
c* : man{"F, I i : \,2, "',m},
is the corresponding timed sequence on the left-hand side. We omit further details of the proof.
)
in the introduction to
8.4.
corollary.
(pr,tr) (pz,ts) (pr,tr) (pr,o)
@Ipil
(asr'Pt- )r:-Pz )
By use of Theorems 8.3 and 8.4, we can directly derive the following
be a timed sequence on the right-hand side. Then
It
: TSeqt(l) : ttttz
where we have used the proof technique discussed
bt,tt) bt,tr) (p",ts)
Proof.
139
and
We can also prove that for any timed sequence TSeqt on the right-hand side there exists a timed sequence TSeq, on the left-hand side such that, for any state P,
TSeqr([P)
Reduction
,
rt,yt(1t1))u
to 7l9r'q,, sittt't'
w('
(p, , ,i)
('illt l)tov{'
,,,,,.,.(l,l|) l,',;,
.
t,
,
it
,
wlr('r'(, wt,
lll, '/15r11,,,,,,.(/,/") ,x, il'Holttt'/; il
,r,.
I40
8.4 Reduction
8. Model Checking: Linear Duration Invariants
l*m ) 0 and, TSeq*o,(LF) > 0, then for
any re4ular contert C(X) containi,ng o'n occurrence of X, C(Seq*) uiolates LDL
Theorern 8.5 A Proof . Since
Pj'Pj"
.t occurs in C (X), there is an untimed sequence
"'
Pj-S"qi firPt2
"
' Pt-
in C(Seqi), for any z ) 0, with a corresponding timed
^
TSeq"(i)
of the form
Proof. This follows directly from the definition of a normal
where TSeql is a timed sequence for pirpir''' pi- and TSeqt is a timecl quence for pr, prr "' Pt.The value of the linear function for TSeq6(i') is
:
Since
TSeqi(LF) +
)
TSeq-,,(LF)
i'
0 the value
TSeq*o,(LF) + TSeq(LF)
se-
.
of TSeqg(i)(LF) is a strictly monoton-
ically increasing function of z. Let
m
: L+ L(1" -
TSeqlQF)
-
respect to a given linear duration invariant LDI .The proofs of the closure properties are constructive, and they constitute the main parts of the algorithm for the clerivation of a normal form for a regular expression over the alphabet 7.
we now investigate closure properties of normal forms with
Theorem 8.7 The regular erpressions 0,e and p eT are'in normal form.
sequence
TSeqi TSeqi*o,TSeq,.
TSeqs(i)(LF)
8.4.2 Closure Properties of Normal Forms
Theorem 8.8 Normal forms are
i,
)
Since
k:
Theorem 8.9 If Lr,Lz e form equi,ualent to L1L2.
T* are in norrnal
fornr,, then there is a norrnal
Proof. Since -L1 and L2 are in normal form, we have TSeql(LF)l) I TSeq*",(LF))
.
mi
Lr
: U Lu (i:1,2)
,
where each tri1 is either a finite term or an infinite term. By distributing the concatenation over the union, we can transform to an equivalent regular expression
c
m.
l^,io
)
0, by using ft repetitions of Seq, where
l"^onl(.*tn1
Theorern 5.6 U l,-,1, ^*ak ' Deq
k:
DeQ
m2
j:t k:L
)
0 and TSeq-",(LF) <-0, then
,
lc*mll*tnl
n1
-L1-L2
U U LuL'n '
,
we obtain f seqs(k)(l) ) c^'i,, thereby making the left-hand side of LDI true. Therefore, folio: mar{k,m}, we have the result that TSeqs(i's) vio' ! lates LDI , and so does C(,Seq*).
.
Proof. Ln argument concerning this theorem was given in Sect. 8.1 when we derived the conclusion shown in Fig. 8.5; we shall not repeat this argument here.
closed wi'th respect to uni'on.
J:L
TSeqs(i)(LF) >
where
n
Proof. For any normal forms, trr and L2,the regular expression L1 U L2 is, n by definition, in normal form.
Then
for all
form.
We can show that for each
LtjLzx there is an equivalent normal form, by
considering the following three
cases:
t. LU and L2p are finite terms. By definition, so is L1iL2p. 2. One of L11 and L2p is a finite term and the other is infinite. By Theorem 8.2(1), the necessary permutations can be applied in order to obtain an equivalent infinite term for LtjL"n. 3. Both Ly and L2p ateinfinite terms, i.e. Lq - Seqrpi, with low(p1) : 0, and. L21, - S"qrpi, with low(p2) : 0. By Theorem 8'2(1), we obtain Lt jLzr,,
-
SeQt"
S"q, Pi Pi'.
a,lrlrlving Tlrcor
Ilv ltt
L1.i I',2tr',
L42 8. Model Checking:
8.5 Generalization I43
Linear Duration Invariants
Theorern 8.10 # L C T* is 'in normal form, then either there is a normal frtrrn for L* or the li,'near duration inuar'io,nt LDI i,s uiolated, bll L*. -Li is the normal form for tr. By Theorem 8.2(2),
lJ[, L* : LiL;.. . L;
Prool. Suppose
i < -,) is either a finite or an infinite term. We show that every tri has an equivalent normal form, unless it (and also ,L*) violates lDI. When we have done this, the proof is completed because (by Theorem 8.9) normal forms are closed with respect to concatenation. We consider the following cases: Srq
- hpz...p^is
a finite term. This part is split further into
three cases:
l^in:0 (for .9eq). By Corollary 8.1, Seq* is equivalent to a pj j, where 1< j < m) which is an infinite term. !-,1n Case b: ) 0 and TSeq^rr(LF) > 0. By Theorem 8.5, for any regu-
Case a:
(for some
lar context C (X), C (L;) violates LD I . So does tr*. Case c: l*tn ) 0 and TSeqn,*r(LF) < 0. By Theorem 8.6, we can transform Li into an equivalent concatenation of finite terms.
2. Lt - ptpz. .- p^p* is an infinite term. Let S"q : ptp"' finite term. By Theorem 8.2(3),
LI : (rj l
Theorem 8.1 demonstrates how to transform the satisfaction of LDI for a finite term into a linear programming problem. Here we show how to transform the satisfaction problem for an infinite term into a linear programming problem.
.
where ,L; (for 1 <
I. Lt -
8.4.4 Infinite Term
Seq Seq. p*)
..
P^, which is a
Let tr be an infinite term
L : prp""'p*p* where low(p) where
:
,
0. We introduce an extra state
<
p' : n-l 7, low(p'):0
and
Pral
and a new transition p/,
up(p'): cn,
and introduce a new linear invariant such that
LDI| derived
fuom
LDI by changing,L,F
LF, ; LF+cF[Pn+r. In other words, we simulate p* by ptpz-
..
p'
, and we have the result that
p^p* | LDI iff hpz. . . p^p' I LDI'
By transforming the satisfaction problem of
.
LDIt for
the finite term
.
PtPz
"'
PrrPl
There is an equivalent normal form for Seq* ,by Case 1, unless trDl is violated. Since e , Seq and p* are normal forms, and normal forms are closed with respect to union and concatenation (Theorems 8.7, 8.8 and 8.9), there is a normal form equivalent to ,Lf , unless LDI is violated.
into a linear programming problem, we can solve the satisfaction problem of LDI for the infinite term p1p2." g^p*.
tr A simple consequence of the closure properties is expressed in the follow-
8.5 Generalization
ing theorem.
Theorern 8.ll A'ny regular language ouer the alphabet T has an equiualent normal form, unless the li,near duration i:nuariant LDI is u'iolated. 8.4.3 An Algorithm Deriving Norrnal Forrns Since the proofs of the closure properties given in the previous scction are all constructive, it is easy to construct a recursivc algoritirrn wiri<:h r:a,n titke a regular expression over arr alphabct 7 as inprrt, anrl llnlrhr<:c a,rr
An easy generalization is to introduce an upper bound c^o, for duration invariant:
I in the linear
LDI - (ryi,n11.{c*n, * i cifPi?c. i:7
Tlur
*l
L44 8. Nlodel
Checking: Linear Duration Inveuiants
-P1 e
"'V P1, ancl Pl n P3 <+ 0,
P2Y
and therefore the duration of a disjunction of states (4) is equal to the sunl of the durations of the individual states. By Theorem 8.11, we Carr transform any regular language ovet T to a normal form unless thc linear cluration invariant is violated. Hence, the definitiorr of il real-time automaton (in Sect. 8.2) can be generalized in any possible way, as long as tire set of untimed sequences of the autornaton is regular. It is also not a difficult generalization to allow several states of the autornaton to be labeied with the same DC state variable, as the algcirithrn presentecl herc reqqires only that the DC state variables are complete and exclusive.
it
is possible to check whether a linear driration invariant holds for all subirrtervals with respcct to the timed sequences gerrerated by a real-time autornaton A, as one can add extra states a,nd transitions (with new upper and lower bounds) to A to sirnulate this. with this techrrique it can, for example, be checked whether
with
these gencralizations,
n(60 <
t! .+
20 fLeak
< l)
holcls for the the gas burner autornaton. Details are left for the rea,der.
In tlie literature, there are othcr interesting algorithms to check a li1-
ear cluration invariant against an automaton. For example, [70] rcdrrces the satisfaction problem of linear duration invariants with respect to tim,ed autom,ata ([6]) to tlte rnired i,nteger prograrnm,ino probleln) and 112] redrtces it to the linear programming probiern. Ref'erences [80, 81] solve this problenl for a subset ctf hybri,d auto'mata ([4, 99]), restrictions t-in linear cluration invariants to reduce the complexity of model checking are r:onsidered in [84, 159], and automata' [158] establishes a reduction for a network of real-time
9. State Tlansitions and Events
9.1 Introduction A real-time systern may comprise both states and events. A statc of a system characterizes a stable aspect of the systeln behavior. By sto,bl,c, we rlean that oncc the system entcrs a state, it will stay in that state throughout a period. An event of a systcm characterizes an in,sta'ntinterilction of the system with its environrnent. This can drive both the s}'stcrn and its environment to change their behavior dramatically. For example, in the casc of the gas burner, a flame failure causecl by the environment can bc taken as an event sent to the gas burner from the environment, which drives the gas burner to change its behavior from the norrnal (Nonl,eak) state to an abnormal (Lcak) state. Two a,pproaches to exten
Let ,9r and 52 be two different Boolean states of a rcal-time system. They characterize two distinct aspects of the system beliavior. ^9;(t) : 1, got i : I,2, rnea,ns that the system stays in Si at, t. We say that the systeill satisfns S,. at t when S;(t) - t. A, state. trtlls//i,on, of the sr-stem frorn 51 to 52 occtrrs at time f iff imrnerlia,t,
il 146 9. State Thansitions
9.1
I
and Events
Fig. 9.1. Automaton for refined design of the gas burner
This automaton has five states: Idle, Purge, Ignite, Burn and Failure, which rrake up a lefined Boolean state model of the gas burner. These five states characterize five erclu,s'iue aspects of the behavior of the gas burner, and form a completc characterization of the behavior of the gas burner. That is, at any time, the Bas burner is in one and only one of these states. This automaton responds to four events frorn its ent'ironrnent: HeatOn, Heatoff, DeFail and out30. Tire behavior of the automaton can be explained iriformally as follows, and a formal specification of the autrlmaton can be
found in Sect. 9.4. Idie: When the gas burner is in the Idle state, the gas is turned off, and thc gas burner awaits a hcat request. The burner will transfer to the Purge state on receiving a heat rcquest from its erivironment. In the atrtomaton, a hea,t requcst is denoted by the event HeatOn. Purge: 11 this state, the gas is still turned off, ancl the gas brrrrrcr pzluses for 30 seconds by first setting a tirnerr, and thcrr trarrslilrirrg 1,o t,lrc lgrritr-' state on recciving a tirnc-out sigrral rr,11r:r 30 s
liy
l,lrrr rrvrrrrl Ortl,ll0.l
lrt'lltt';tttlottt;t llris:rrtl,orrr;tlrtttl;t.lit'rtittl.o;tttrtttltl oltlYcvcttlstrrlivt'rl 'N*'tl'"f lrt lltr';rttlottt;tlolt"l;ttllt Iorr,srrllr;lrllr,;rl()rr;rrrrl()rrlil(1,;trr,li1',tr,'tlr;r'tlttlr;rtlttl :l r rrcl I in 1', I lrl I it tt,'r
147
Ignite: In the Ignite state, gas is supplied, and igniticin is performed rvith a pilot flarne. If the ignition succeeds, the gtrs burner trarrsfers to the Burn state. Otherwise, it transfers to the Failure state upon receiving an ignition failure signal, which is presumably detected as soon as the gas supply reaches a leak threshold. The detected failure is denotecl by the
For exattple, an event of flame failure in the gas burner can be identified by a state transition from Nonleak to Leak, if flame failure is the only cause of gas leakage in the gas burner. Let us considcr the gas burrrer exarrple again. A refirrement of the two design clecisions ofthe gas burner is given in [127]. A revised version ofthis refinement is shown as an autolnaton in Fig. 9.1.
Ignite
Introduction
event DeFail.
Burn: When the gas burner is in the Burn state, the flame is on. Thc gas burncr will remain in the Burn state until the heat lequest is cancclled (denoted by the everrt HeatOff) or a flame faihire is detected (denoted by the event DeFail). When the heat rcquest is cancelled, the gas is thcrr turrred off and the ldle state is entcrcd. Wherr a flarne failure occurs, the gas burner immediately transf'cls to the Failure state. Failure: In the Failure state, ignition failure and flame failurc are treated urgcrrtly. The gas valve is closed rvithin onc second, and tlien thc gas burncr transfers to the Idle state. (In the automaton, by assigning to thc transition from Failure to Idle a real-tirrrc constraint written as 1. 1, wc rnean that the transition from Failure to Idle must take place within one second iifter thc gas bur:ner enters the Failure state.) In the Failure state, i.e. during the treatment clf failures, it is assurned that gas is leaking. From thc above description, one can see that the automaton will not to the event HeatOrr unlcss it is in ldle, and it will transfer from Irllc to Purge when it responds to the cverrt HeatOn. Hence, as far as the behavior of the automaton is concerned. HeatOn can bc iderrtificd as the state transition of the autclmertorr from ldle to Purge. Similarly, Out30 can be identified as the statc transition from Purge to Ignite, and HeatOff as the state transition from Burrr to ldle. However, DeFail denotes Lwo causes of gas leaka,ge, namely ignition failure and flarne failure. When DeFail happens, the gas burner rnay bc in either the Ignite cir the Brirn statc, arid n'ill be driven to the Failure state by DeFail. The event DcFaii can therefore be identified as a forrnula (i.e. a disjunctiorr) of these two state transitions. State transitions are instarrt actions. Hence, they can be expressed as formulas that are true in point intervals. A formula expressing a statc transition from Sl to 52 rnust have a syntactic structure to indicate the source state ,S1 and the destirration state ,52 of the state transition. Howerver, in DC there is rro such folmula. Trvo kinds of atomic fcirmul:rs c:orrstnrr:tcrl frorn st,ates to cxllcss state transitions are intrciduced in S
l
i rolr,;rrr r;l ;rl l
trr,,r
li'l
148 9. State Ttansitions
9.2 Tlansition Formulas
and Events
s:1
The syntax and semantics of transition formulas are given in sect. 9.2, and extra axioms for transition formulas are given in Sect. 9.3. The extra axioms, together with the axioms and rules of Dc, make up a calculus to describe r.rd ,"uron about real-time systems in terms of both states and events. This ca,lcrrlus is called state transiti,on calculus. State transition calculus retains the result of relative completeness of DC. A formal description and verification of the refinement of the gas burner shown in Fig. 9.1 are presented in Sect. 9.4.
,9:0
\s
b-6
9.2 TYansition Formulas
,9:1
This section introduces transition formulas, and also demonstrates by examples how to use transition formulas to specify the behavior of real-time ,yrl"-, in terms of both states and events. Among the examples is a NOR
,9:0
blSe
circuit.
Fig. 9.2. Meaning
\ S, I S, \S and lS
9.2.1 Forrnulas
To the syntax of DC, we add the following two special symbols, and the following rule for building formulas:
r If
,5 is a state expression, then
\ s
and
/ s
\and Z
T,V,lb
- 6,bl F lfSl,
\S1^ lS2
for some d > 0,
\Idle
I .75 iff
T,V,le,e +
dl
F
lf,Sl, for some d > 0,
where the interpretatiot I and the talue assignment v are defined as in Chap. 3. Thus, \,5 or lS holds for an interval iff,5 has a constant presence in a left or right neighborhood of the beg'inn'ing or ending point, respectively,
\s
= \,s
(l:
S and
I S define a constant
tu
presence
rrsc
lPurge
A
/Purga.
The ev
o)
in a, Ieft aild a ilold l,Y1ltr, \ a,rltl irr ytoi,n,t. syrnllols <'t! ix rcslu:r:tivcly, right neighborhood,
\
A
sition formulas. For examples, the everrt HeatOn can be identified with a state transition from Idle to Purge, and hence HeatOn can be expressed as
\Idle
/S = 7S ^^(l:0).
The formula
,Sr is constantly present
describes a state transition of the automaton from Idle to Purge. Events identified with state transitions can be expressed in terms of tran-
of the interval. See Fig. 9.2. Two abbreviations are introduced here:
f
that
in a left neighborhood of a point and ,52 present in neighborhood is constantly a right of this point. Hence, when ,51 and 52 are distinct states, (\Srn /52) describes a state transition of the system from ,5r to Sz at a point. For example, means
and
T,V,lb,"l
of\S andlS on the interval fb,e]
are formulas, also called
The semantics of \ s and 7 S are defined in terms of lfsl as follows. Given an interpretationT, avalue assignment 7 and an interval [b,e],
ifi
et6
We can express instant state transitions in terms of \ ,5 and / S with propositional connectives. Let ,91 and 52 be states of a system. The formula
transition formrtlas.
T,V,lb,€l F\S
149
lr,,
\
(lgrril,c V Ilrrrrr) A
sirrr:r'i1, r'ir.tr
l,o ll;rilrttr'.
f
Fir,ilrrrrr,
lrr,irlr,rt,ilicrl wil,lr
l,wo sl,itlc l,t';t.lrsiliotrs: [j'otn rril,lr
ot'Burrr
150 9. State Tlansitions 9.2.2 Formulas
9.2 Ttansition
and Events
IS, tS' 6 and TS
J.91A tS2
\sn rz-s
is equivalent to
is true at a point iff the value of s changes from 1 to 0 at a point. That is, the systern leaves ,5 at that point' Similarly, \ -S n I S is true at a point iff the value of S changes from 0 to 1 at that poirrt. That is, the system enters state ,5 at the point. For these formulas, rn'e introduce the abbreviations
A /2,52
under the condition that 51 =* -,Sz is true. For the case of the automaton in Fig. 9.1, the formula
|Idle
A
f Purge to Purge. Moreover,
the formula
\-SAlS. |S
\,Si
describes a state transition of the automaton from Idle
JS = \S A.7-S I The meanings of
151
mearringful, and forms another description of a state transition of the system from,51 to 52. In fact, we prove in the next sectiorr that
For a state S of a system, the formula
ts
Formulas
{Idle + f Purge
and f S are illustrated in Fig' 9'3'
defines Purge as the only transition destination of Idle, and can form part of a formal specification of the automaton. Similarly, the formulas
{Purge + flgnite
S:1 and
jlgnite + t(Burn
.9:0 +s
s:1
V Failure),
can also become a part of a formal specification for the automaton, to define the condition that from Purge, the automaton can transfer only to Ignite, and from Ignite it can transfer either to Burn or to Failure. In circuit design, a Boolean-valued function ,9 over time can be used to model the voltage of a wire, where ,5(f) : 1 means that the wire ,S is connected to a power source (i.e. it is at a high voltage) at time l, while S(t) : 0 means a connection of the wire ,5 to ground (i.e. low voltage) at f The formula I S describes a falling edge of the wire voltage which represents an instant fall of the wire voltage from high to low. Similarly, f ,S describes a ri,si,ng ed,ge of the wire voltage, which represents an instant rise of the wire voltage from low to high. Circuit designers also use formulas to express the stability of a voltage. For cxample, -J-S is used to mean that the wire represented by S remains connected to ground at some time, and TS means a continuous connection of the wire to pclwer at sorne time. Thcse two frrrmulas can also be defined by the transition formulas .
s:0 ts Fig. 9.3. Meanings of {S and f S one can also describe state transitions in terms of I and ,52 be two states of a system. Consider the formula J.91 A
s
and
f s. Let st
tS2.
This formula holds at a point iff the systern lezrves St arr
-[q:= \-SA \,9A 1.9
l-S /.x.9.
Ifrorrr l,lrc rlcfirril,i<;,rrs, 1,5'irrr
9.3 Calculus for State Transitions
9. State Tlansitions and Events
t52
153
NoR circuit iff at that time both the inputs receive a falling signal, or one of the inputs receives a falling signal while the other is at low voltage. with
,9:1
the transition formulas, this statement can be formally expressed
s:0
f -(Inr V In2) L9
e
((JIn1A |In2) V (|In1 A IIn2) v (IIn1A
V
TS
consider a NoR circuit with one output wire and two input wires as shown in Fig. 9.5.
A
the proved. be can statements next section, these two one can also apply DC to specify and reason about the real-time behavior of combinational and sequential circuits [52]. Although we do not elaborate on r.eal-time issues of circuit design in this book, we indicate here how a transmission clelay ancl an i,nertio,l delay in a rising signal Out can be expressed in DC extended with transition formulas. For example,
Fig. 9.4. Meanings of L9 and TS
9.2.3 Example: NOR Circuit
IIn2) V (IIn1A tln2))' for the transition formulas in
In2) e ((f InlA f In2) v (f In1
After we have established a calculus
.9:0
+I"r))'
symmetrically, we can express a corresponding statement for a falling signal:
j-(Inr S:1
as
(f -(Inr v In2)^(l
: d)) <+ ((l:
d)
^ f Out)
specifies a transmission delay of d > 0 in the output rising signal of the NoR circuit, such that the time difference between an input rising signal and its corresponding output rising signal is d, and the formula
(f -(Inr v In2)^(lf-(In1 v In2)l
a))) e (((':
^(':
d)
^ f Out)
of d > 0 of the output rising signal of the NoR circuit. Namely, an input rising signal will not be propagated to the output wire unless the inputs are stable for d time units. similarly, we can specify the transmission and inertial delavs of the falling signals of the circuit by the specifies an inertial delay
Inr
formulas
Inz
({-(inr v In2)^(l = d)) <+ ((!':
Fig. 9.5. NOR circuit
d)
^
JOut)
and
Let Out, In1 and Inz be three Boolean-valued furrctions (i.e. Boolean
states), which denote the voltages ofthe output and input wires ofthe circuit. Thus, f out and.f out represent output signals of the circuit. If we neglect the propagation delay of signals in the circuit, then the functionality of the
circuit is specified by
f Out
<+
f -(In1 V In2)
({-(Inr v In2)^(lfln1
V
In2l A ((': a))) <+
((l:
d)
^ {Out),
respecitvely.
9.3 Catculus for State Tbansitions Tlur sl,irl,c l,r'ir,rrsilion t'trlcrrlrrs tlt'sclilrcrl lrt'r
and
{Out
<+
J-(Inr
V Irr2).
will lrt'itttrttttcrl l,o Llrc orrllrrtl, witt'. ltt lltt't'ottvltrl'iotrir,l l,ltt'oty ol't'otttlri tt;tlirttt;t.l t'itlrtils, il is rlillt'rl llllrl ;r tiriitrlt, riiP',lt;tl lr1rl'r';ttri ltl lltc ottl'pttl ol';r
Ilprrt
rliirl,llv
sigrrals wlrir:lr r:irrrsc lisirrg;r,rrrl ftr,llirrg o['l,lttr ottllrrrl,
propir,11;r,l
llorrp lrrovirlcs ptoposil,irtttitl ;t,xiottts [irr"1,lr
Lwp p,r.errps.'l'lrr, lirsl,
154 9. State Tlansitions
and Events
9.3.1 Proof Systern: Part
9.3 Calculus for State Tlansitions
I
Proof . We present proofs of two of these assertions only.
The formula
The first group of axioms provides a propositional calculus of the transitiorr formulas:
STI \1 and 71. ST2 \(,Sr v,9z) e 5.,5rv\Sz) and /(Stv,5r) e ?Stv 75). ST3 \-,S <+ -\.9 and 7-S c - 75 ST4 If Sr +,52, then\Sr =)\,Sz and 7St + 7Sz. .
The axiom ST1 formalizes the constant presence of 1 in terms of the transition formulas. sT2 and sT3 certify the distributivity of \and /over disjunction and negation. ST4 defines the monotonicity of \and / With this group of axioms, we can prove the following theorem.
(Sr V 5z)
c (\^9rV \,52) is proved as follows:
\ (,S1 v,92) c ((. :0)^ \(sl v &) Def(\ c ((.:0) N"91v\.9r) ST2 ^ <+ \ SlV \,S2 Def(\ The formula \ -,9 <+ ((l : 0) A - \.9)
.
is proved as follows:
\-,5 e (1.:0)A\-S Def(\ c (1.:0) A -\.9 ST3 e (!. :0) A (-(l = 0) v - \s) PL e (l:0) -((l:0)A\s) PL e (!.:0) ^A - \S Def(\.
Theorern 9.1
1. -\0 and -70. 2. \(Sr nSr) c KSrn\Sz) and 76tA,9r) e TStAlSr)' Proof. We present here proofs of - \ 0 and of the distributivity of \ over
We can also derive a propositional calculus for
conjunction only. A proof of the first case is
{S,
1,9, _tS and
Theorern 9.3
-\0 {+ -\-1 s --\1 <+ \1 € true
1.
ST4 ST3
Com,pleteness and Erclus'iueness
(tsv Js v Ts v.].s) e ((.:0) and -(xSA*tS), for x,x'€{t,+,T,1} and*f
PL ST1,
and a proof of the second case is
\(51 A 52) <+ \-(-SI1 V -,92) <+ -\(-,Sr V -,Sz) {} -5.-SrV\-,9r) s -(-\,51V -\.92) ++\,5r4\Sz
o
ST4 ST3 ST2 ST3 PL.
A similar propositional calculus for STl - ST4.
t(sr v,5r) tr(Sr v Sr)
\
S and ,v S can be derived from
\1++((.=0) and l1++((.:0). - \0 and - ,V0. \(,SrvSr) e(\.S1v\.9r) rt,ntl ,/(Srv Sr) e (lStv lSz)' an,d, l-S c((l=0) A-' lS). 1,. \-S<+((l:0)n-\S) 5. \ (,9r A ,92) e (\ o-A \,9r) tt,rt,il, / ('\r n,9':) <+ (l'9t A ,/ S')
.
I'ltt'tt'
-11, n<+(l:0)
Constant Zero
and -ll.
- 10, - J0, -T0 and f0 <+ (/:0).
1. 2. 3.
> ,\'2,
-fl,
4. Disjunct'ion
Theorem 9.2
^5'r
*t.
Constant One
n
(;. ll ,'ir
\
,5t )'f'' ,5;q n,rr,tl' ..'n ,\t
>'
l,\'t
.
c c
((tsrn t,sz)v (tsr n lsr) v (ljr^ f sr)), ((lsrn JSz) v (J,Sr n l5z) v (l,5,^ J,9r))
T(.91 v S') <+ (TS1 v TS2 v (+^914 r(^91 v,sz) (Is1 A 1,92).
e
,
tSz) v (t,9rn {52)) and
5. Negation f S <+J-S, JS <+t-S, T,5 e r-S and 1,5 <+ T-S. 6. Conju,nr:tion, t(^Sr n Sz) e ((tSrn t,9z) v (f Sr TS2) v (T,S1^ t,9z)) , n TS2) v (T,S1^ .l.,Sz)) , l(,Sr ,9r) e ((lSrn JSr) v (.1.S, ^ ^ 11.51 A,9r) c (1,9r A 'l'52) u,rr,d, l(,Sr A,5?) <) (1,5r V 1,9.j V (t,grA.l",9z)v (J,9rn t,gr)). 7. ( lott,tlrtt,rtt,r'r' ll ,\t.:'t,\"1., I.lt,t'rr, +,{1 .l) +,\,;,ruln'tt, +. {l,L f, l}
T,S.
155
156 9. State Ttansitions
9.3 Calculus for State Tlansitions
and Events
The statement
Proof . We present only the following proofs'
Proof of
-(f sA |s):
if Sr * -52, then
fs^ +s + \-,5n /zSA \ SA /-S + \ (-S A S)A /v (S A -S) =+ \oA lo + false prool sf
e
true
To prove
f0
<+
TH9.2(5) TH9.2(6)
J,51^ t,S2 <+ <+
TH9'2(2)'
(S1
Defo
f -(Inr
PL THe.2(2). we use the definition of
Iand
Theorem 9'2(1): <+
e
e ((tSlA tSz) v (t'9t n T'S2) v (TS1A f Sz))'
ts
rHe.2(5) TH9.2(6), (S1 + -Sr).
V
In2) e ((JIn1A.f In2)
V (JIn1 A
IIn2) V (-lln1A +Inr))
rHe.3(5)
{Inr)
TH9.3(a).
The formula
{-(In1
V In2)
THe.3(5) <+f(In1 VIn2) (f (IIn1A In2) THe.3(4). (f In1 IIn2) InlA In2) v A V e f f
9.3.2 Proof System: Part
II
The second group of axioms consists of two axioms to reason about the transition formulas with respect to the chop modality:
Nl \.9 <+ (\S^true) and 73 <+ (true^ lS). N2 ((l> 0)^ \S) <+ (true^lfSl)and (lS^Q >0))
<+ (lf,Sl^true).
Thc a,xionr Nl expresses the assertion that the truth of \ ^9 over an intcrva,l is rkrt
Defo TH9.2(6)
Dt'f(j).
Wr':rrr,r'r';rrlv lo tttrtvt'l,ltt't'r'ol'l,lrc ll'itlltttl'ttlri tttittlt'irr Slcl''
f -(In1 V In2) |(In1 V In2) (llnrn f In2) v (|In1 A IIn2)V (IIn1A
is proved by
e,L-S:
e \-SA /zS e \-,SA l--S e J-S
Def(|f)
|-(Inr V In2) <+ ((flnl A f In2) v (flnl A IIn2) v (-lln1A tln2))
,9r)
Defo \-(Sr^ n Sz)A /(51 n Sz) rHe.2(6) Sz) n (-,Sr v -,52)A /(Sr \ rHe.2(3)(5) (\-Sr V <+ \-S2)A /SA lSz (\-SrA <+ /Stn /Sz) PL V(\-szA /sr\ /s2) Def(f) (I52^ (t^9r^ lSr) <+ lSz)v v (1,914 SzA <+ 1(S2 -Sz)) / rHe.2(6)(1) v(t,924 l&A\(S1v-S1)) (\szv A (t,s1A \-sr)) <+ lsz rHe.2(3) v(tsz^ l& (\,Srv \-Sr)) ^ (,/Szn \-Sz))) (tSr e v(f ,sz^((/52^\^92)v \Sr)v (lst^ \-sr))) Pt (TS2v tsz)) v (tSz n (TS1v f ,S1)) Def(fi r) c (lSr ^((/Sr^ e (ts1^^ tsr)v (1,9r n -rS2)v (TS1^ ts2) PL. ,5
n ,zSz)
is proved by
<+ <+
Proof of f
\sr A l-st A \-sz A ,r'sz \ (,5r A -Sz)A lFSr A Sz)
a)\sr Alsz
r0 e (\1411) € (:0. t
(\Sr
The formula
(l:0),
Proof of t(,Sr n Sr)
(J,Sr n t,Sz) <+
is proved as follows:
Def('1,{)
- f1:
- t1 e -(\0A /1) <+-\0 Y -/7
r57
1)'2'
158 9. State Ttansitions
9.3 Calculus for State
and Events
Theorern 9.4 7.
or /S holds in, a prefir or suffir, respecti'uelA, of an i'nterual''it will hold,'in the i'nterual:
#\S
\,S^true) +\.9
2#\
and' (true^ ,ZS)
=+
,VS
'
S or / S hold's in an 'interual, it wi'll hold in any prefir or sffir, -(true ^
l-S) \S + -(\ -S lrue) and, 7S + 3. \S o'r I S holds in an 'interual iff there erists a left or ri'ght neighborhood of the begi,nni,ng or ending point, respect'iuely, of the interual where S takes the ual'ue 1 constarr'tly. That is, for any r ) 0, (({. = r) ^ \S) <+ (((l : r) n (true ^ lfSl)) ^true) <+
^true \.9 ^true ^true
N1
+
\s
N1.
9.3.3 Soundness and Relative Cornpleteness The proof systert of DC, together with
ST1
ST4, l{1 and N2, forms the
sound.
Proof . The reasoning used in the proof of the soundness of DC (Theorem 3.2) can also be applied to the proof of this theorem, provided we can first prove that the additional axioms, ST1 - ST4, N1 and N2, are sound. The soundness of any axiom (designated /) of ST1 - ST3, Nl and N2 can be formulated as the validity of /. That is, for any interpretation Z, value assignment V and
M
interval
* -5.-S^true): \S A (\-S ^true) ^ + (\ S ^true) A (( -.9 true ^ tnre) N1 IL17 + (\SA \-,S)^true ^true ST3 =+ false IL13. + false Proof of ((L:r)^\S) <+ (((l:r)n (true^lfSl))^true):
Proof of \S
[b, e],
T,V,lb,e) ts
O.
The soundness of ST4 is formulated as follows: if 51 ? Sz is valid in propositional logic, then for any interpretaLion T, value assignment V and interval [b, e],
I,V,lb,"l
F \,Sr +\,52
T,V,lb,el
I l&
and
(l=r)^\S N1 <+ (L : r) ^ \,9 ^true ^true : ^ N2. e (((. r) A true llSl )
+752.
Thtr pro
cv
! Flom N2, wo (jiur
n
Theorem 9.6 The state transition cak:ulus is
\.9 ^true) + \S:
\S
+ + \,g^true
(1.: r) ^ tS^(l > 0) Defo e (1. : ") ^ (\ -,9n ,v S) ^ (l > 0) ^true ^ : ^ (true N2. ((l r) n <+ li-Sl )) [,Sl
state transition calculus considered here. We formulate here the theorems of the soundness and relative completeness of the state transition calculus, and sketch their proofs.
(true^((l: r)n (lfsl ^true))).
Proof . We sketch proofs below. Proof of
.
Proof . We sketch a proof of the first assertion only, as the rest can be proved similarly.
.
und
(75^(l: r))
159
Theorem 9.5 For any r > 0: 1. (((.:r)^ IS^(!, > 0)) e (((t:r) A (true^ll-sl))^lfSl ^true). 2. ((!. : r)^ IS^(t,> 0)) <+ (((1, : r)A (true^llsl)) ^[-Sl ^true). s. ((!.: r)^TS^(L > 0)) <+ (((1.: r) A (true^[Sl))^l[.,5] ^true). 4. ((1.: r)^ )S^((. > 0)) <+ (((L: r) A (true^[-Sl))^ll-Sl ^true)
respecti,uely, of the i'nterual:
^
Tlansitions
lrtrl'w
Irir,s
ir virlrrr,rrl'r,il,lrr,r' I or' 0. Wr, slrirll rrol, ptt'sr.trl,
rlrrl,;r,ils
o['lltc lrroo['ltct'tr.
ll
160 9. State Transitions
9.4 Example:
and Events
Theorem 9.7 The state trans'it'ion calculus is relatiuely
o select k temporal variables, where k :22t , and o select 2k temporal propositional letters Xt,Xz,.-.,Xp and Y1 ,Y2,"',Yk' We index these temporal propositional letters with the k equivalence classes of the state expressions of the I state variables appearingin d. Let S be a state expression of the I state variables of /. Then
properA formal specification of the automaton can be given by formulating calculus' transition state the in events and ties of its states, state transitions Boolean The resulting formulas are considered nonlogical axioms to define Let automaton' the of state models of the behavior
Idle, Purge, Ignite, Burn and Failure
of the be the five state variables used to denote the corresponding states the are 9.4.2) in sect' etc. Autol(a), automaton. The formulas (referred to as following. 1.. State Completeness and Erclusiueness
(a) At any time, the automaton is in one of its five states:
o the formula\S is transformed to Xpsl , and r the formula /S is transformed to {s1 .
- ST4, N1 and N2 are transformed accordingly' For example, ST1 is transformed into The axioms ST1
lf
I v lfldleV
ll-ll
N1 is transformed into a set of formulas of the form
^true) and tq c
(true
^ ((l :
PurgeV lgnite V Burn V Failurel'
(b) At any time, the automaton is in at most
Xlrl and Yltl, 0) n X1s1)
161
9.4.1 Specification
complete.
Proof . we apply the same technique that was used in the proof of the relative completeness of DC (Theorem 5.1). To transform a formula / of I state variables ofthe state transition calculus into a formula of IL, we do the following:
X1s1 <+ (((l :
Automaton
(s, + -sz)l A St*Sz
v ll
one of the five states:
,
where,SrandSzrangeoverthesetofthefivestatevariables. 0) A
tq))
,
and ST4 is transformed into a set of formulas of the form
2. Euents and State Transiti'ons (a) Four events:
: (|Idle A fPurge) Out30' (|PurgeAflgnite) DeFail' ({(IgniteV Burn) A fFailure)
HeatOn X1sr1 =+
X;s,1 and {s,1 } }is,1'
where ,Sr and Sz range over the state expressions of the / state variables of S, and Sr + Sz holds in propositional logic. In order to follow the proof of Theorem 5.1, all lemmas and theorems established for Theorem 5.1 must be revised to conclude the necessary properties ofnot only the selected temporal variables, but also the selected propositional letters. We can therefore prove the relative completeness of the state transition calculus. However, the details of the proof are left to readers as an
exercise.
HeatOff' ({Burn
(b)
Seven state transitions:
Jldle + f Purge |Purge + flgnite jlgnite + f (BurnVFailure) |Burn + f(IdleVFailure) |Failure+fldle'
n
9.4 Example: Automaton
A f Idle) '
3. Real-ti'rn'e C orr'stru,i,n'ts (a) Th
s
ilfttl'
l,h
Pttt gr':
This section presents, in the state transition calculus, a formal specification and verification of the refinement of the gas burner example shown as an automaton in Fig. 9.1.
(f I'rrlgc " (/ = ;]0))
(lr)
'l\.r,1,1,rrrr,rrl,
f)
(f l'rrlgc
-
* lfl'rrrg
Orrt:|0)'
1f'rr tirilrrlr, tttttsl lrt' lirrislrtrrl wil,lril 6ltt'
ll'l"n,ilrrrr'fl
) (/':
l)
'
H1t'9ltrl:
762 9. State Tlansitions
and Events
9.4 Example: Automaton
The above three groups of formulas constitute a specification of the automaton. Let Auto denote the set of all formulas in these three groups. To verify the refinement, a deduction
1.
2.
Auto F DesrADesz must be established in the state transition calculus. This is done in the following subsection.
fi(X) F ft(ll l),this is covered by the base case F i?([ l). n(x) r fi(lfsl ^x): llsl ^fisl ^x^ll-sl ^ ll-sl DC17 =+ llsl ^x ^ ^true ^ |S ll-Sl /?(x). lls-ll
3. .R(x)
Failure is the only state of the automaton in which gas is leaking. Thus, we can introduce Leak as corresponding to Failure:
Leak
With this lemma, we can prove the following theorem. Theorem 9.8
Lemma 9.1 For any state erpressi,on S,
Auto F
([Sl ^true^ll-Sl) + ([s'| ^ .f,S^t.re^[-sl).
The base case l-
^x^[-sl) +
([s]l ^ JS^true^ll-s]).
Desl'l(fl,eakl .+ l.<1) and - l((lfl,eakl^[-Leakl^lfl,eakl) + l>30).
Proof. The case Auto
Auto l-
IL18
)
Des2
^ lf-Leakl ^ lfl,eakl ^ ]Leak^lf-Leakl ^lfl-eakl + ^ f Idle^[-Leakl ^flLeakl + ^ + (!,> 0) flIdlel ^true ^ lfl,eakl =+ (l > 0) ^ lfldlel ^true ^ ffl,eak 4 -Idlel + (t! > 0) ^ {Idle ^tme ^ lfl,eakl + (l > 0) ^ f Purge ^true ^ fl,eakl * true ^ fPurge ^ fPurgel ^true ^ fl,eakl * true^ f Purgc^ ffPurgel ^ l,rrur ^ [flca,k A -Prrrl4
THe.5(2) L3.
^x)v ([-sl ^x)), where the formula fi([ I v (llsl ^x)v (ll-.91 ^X)) fisl ^([ I v (fisl ^x) v (ll-sl ^x))^ [-sl F
Desl is established by using Auto3(b) and IL4.
in the following.
fisl
The inductive step is
R(x)
I
We sketch a deduction of
R([ l) is established as follows: ^ [-sl Def(
,
Des2
'l]
[sl ^ ll + [sl ^ [-S-ll 4 ar ) 0.((!. : r) n fsl ) ^ ll-Sl =+ 1r.(((. : r) n fisl) ^ JS^ [-S]l + [S]l ^ [S ^true ^ ll-,Sl
Desy A Des2
uh,ere
Proof. The proof is by induction using Theorem 3.5, and the induction hypothesis is
([sl
n([-Sl ^x)'
tr
Failure.
We present a lemma first.
/i(x)'
I-
[sl ^ [-sl ^x ^ [-sl ]S ^true ^ [-Sl ^x ^ [-,91 R([ ll) -''.? [Sl ^^.fS^true^[-Sl M. [Sl
9.4.2 Verification
i
163
a([-ll v (llsl
is:
([Sl ^ [,5^true^ll-Sl). Since lfSl ^ ([ I v ([Sl ^x) v ( [-Sl ^x)) ^ [-.91
+
* tttttt[fPrrrg
implies, by IL14,
trsl^lll^[-sl
v illsl ^([sl ^x)^ [-sl) v 0lsl ^([-sl] ^x) ^[-sl), it, srr[Tir:cs (lr.y l'1,) Lo lrtovrr Llrc [ollowirrg lltt<,t'r'it,st's itr ot rlct l,o csl,;rlrlisll irrrlrrt'l,ivo slr'p:
-' { I'rtrg
f Prrrg
)./.;10
1,lrc
liv ir
irrl lorlrtlitrp, I I rrri lrovr,,
itr ll,
I
w{, (';rn
t,r'rttr
THe.5(2)
Auto2(b)
rHe.5(i) Autol(b) LMg.1
Auto2(b) THe.5(1)
Autol(b) LMg.1 A rrt,o2(lr)
l,r'urr
l,o2 (i
A
rr
A
rrl,ol|(l
r,) )
tllt ivt' /)r',r', ll otrr I ltt' r'ottllrtsiott
oIrl it.ittt'rI
I
10. Superdense State Tlansitions
10.1 Introduction In the Boolean state model) we assume stat,e stabil'ity. That is, whenever a system enters a state, it will stay in the state throughout some period,
although the length of the period can be arbitrarily small. Therefore, a state transition is a transition of a system from one stable state to another, and two consecutive state transitions must pass through an intermediate stable state which separates these two state transitions from each other. For example, let
\Sr
A
zzsz and \S2
A
lS3
be two consecutive state transitions of a system as shown in Fig. 10.1. The transition \Sr A /Sz occurs at time C, and \S2 A lSz occurs at (t+d)' They are separated by a period of presence of the intermediate state sz. The distance between them (i.e. the length of the presence period of s2) is 6 > 0. Sz
,9r
\SrAlSz Fig. 10.1. Two transitions
d
t+6
Ss
\s, AlSz
sepa,rated by a stable state
As d can be arbitrarily small, one can ask the question of what coulta,in il situatirlrt with a, statcl trattsition from ,9r t
166
1
10. Superdense State Transitions Sr
I
Fig. 10.2. trffect of a superdense transition
\Sr
A
it
is interesting to allow the two corrsecutive state transitions
l,9z and \S:
A zz^9r
to happel irrstantaleously by assurling that the interme{iate statc
,S1 is
unstable and invisible, the result beeing the state transition
\,9r
A ,'2,9s
Introduction
167
consurnes rro time, tliey r:an also happen consecutively an
cAL(x,u)
5s
\Sr ^ l'5:
Thcrefore,
10.1
comilrunicate. A computation of a sequence of operations which is assunrecl to be tirntrlcss is called a su'perdense c.om'putati'on,. A super{ense computation is in fact an abstraction of a real-tirrlo (:()lrr putatiorr within a context with a grand time granularity. For instanctl, in Ilrt' digital control system, the cycle tirne of the computer may be nanostr<:otrtls, w-hilc the sampling period of the plant may be seconds. In other wor'
the Zeno phen'om'enon ()t fin,ite di'uergen'r:e 148]Superclense cornput:rtion also arises in the area of prograln rtlfitttlltrt'ltl O1e of the wcli-k1own algebraic laws for untirned programs is tlt
knorn'n as
.
.
These twcl consecutivc and instanttrneous state trarrsitions arc called .s?,Tterdense trans,iti,orts. In general, a finite Sequencle clf state tra,nsitions which takes place instantaneously will be callc
.superdensq we mean that cven a tirle point has a del]se structure, so that it carr host .i series of state transitiorrs. Thc superdcnse state transition is not only a corrceptual gcnerzr,lizatiorr of
an ordinary state transitiorr. It also has irnportant applications to real-tirne systems. We present in the followirrg subsection an application that motivatcs the introcluction of superdense state transitions.
10.1.1 Superdense Computation
In a digital control system, there is always a picce of prograrn, hostcd in a computer', that acts as a controller. The pl'ogram can periodically receive sarnpled outputs fiorn a plant, an
u); actuatorlu; wait 7,
where CAL(X,u) stands for a prograrn segment, rn'hich decides the current control signal from the current sampled data x ancl the previous control signal u. 7 is thc samplirrg period. Typically, the time spent in the calculation of control signals is negligible comparecl with the santpling pcriod T. So contrtil crrgin
T|1s, CAL(x,rr) lrc<:orrr<)s il sc(luolr(:r.o1's1;tl,crtt<'ttls wlritlt lttt't'xt't ttlt'tl ottt' lry 11r', l;r1, r'orrsrrrrrc rro lirrrt,.'l'lrc rcccivirrl,,;tttrl llx'scrrrlirryl (i.r'. st'rrsot/x ;tttrl;t.r'ltt;tlotltt) irr llri'l)l{)Jr,l'llll;ll. ri{'lr;tt;rllrl ll'rlrr (1,\l'(r,tt)';rtlrl,:;ittcc
Y': .r | 1:x:= X t2 are r:quivalent to the sirrgle assignmtlnt
x:=x+3. In older to retain the cornbine law for real-time progriillls, ollo lllily lrssllrr r(' tlat the execution of ari assignmcnt takes no timc. Ot,lrtlwis
x:-x*llx:-x*2. 1e1,i6rr r.rf sqlrrrrrlcrrsc r:orrrlrttlitl,iott is :trlolrlr:rl irr l'ls(t'r'r'l l l{)l ;rrrrl sl;rlt' <:hit,r'l,s fllll], ;rrrrl scrrr;rrrl i<' rrrorlcls ol'srtp<'trlt'ttsc t'rttttlrtt(:ll iott tr,rtrtt' itrl torlttccrl
A
itr f67,7:i,1)ll. ln llris r:lr;r1rit:r', w('('xl)l('sr-j supclrlt'ttst't'ttttt;rttl;t{iotr itt l)(l l,t' ttsitrg sttl rlt rl('lts(' sl -rl r' I l ;r ll\il i( )ll\. A sirrg,lt'slr'p ol-;r corrrprrl;rliotr r';ttt lrt't'x;rtt':l:;t'rl;ts;t rrl;llc ll;tttrlililrtt,;lttrl lrctrcr';t su1rr,r'rlr,tr:ic cottrpill;rlion r';ttt lrr','x;rt,'slt,',1;tll;r li,ttttttl;t ol :itt1t,'t,llttrl'' sl;rlt.l,r';trrsiliorr:;.'l'1r,,t{';lii()l il llr;rl llrl r;rlttc ol;t 1ttol',t;tttt t';rti;rlrlr',;ttt lrt' irrit.tp|r,1,',1;ilt:t r;l;rlr'. .\ tr';tl Vltltt,',1 r';rti;rlrl| x,rl ;t 1tl{,J',1:rlrl r';ttt Ilt:ttt1',r'tlr' ( r.;tlrtr,,lttt.itr1,, ll1,r,r:r,r'ttlt,,tr ,,l l lr,, ;,r,,1,,t;rttt lttc r:ttt lttlll lrll'l \ ;t:; ;t ltttl, li,'tt ol littr'. i
'll'ttrr,' t
Lll
168
10.1
10. Superdense State Tlansitions
For v € IR, the property
becomes a time-dependent property of x. It is reasonable to assume that the program is t'imely progressi'ue, and hence a program variable can only change its value finitely many times in
any finite period. Thus, the property x : v is f'ni'tely uariable, and can be taken as a Boolean state of the program. Let us use x : v as an overloaded notation to designate the program state which characterizes the property x : v. The assignment -- r 1I Af
can then be expressed as a formula of state transitions
\(*:v)A,7(x:v*1), where we assume that the initial value of x before the assignment is v. This formula defines the condition that the assignment first inherits a value (v) of x from its predecessor in the left neighborhood, and then passes the new value (v + 1) to its successor in the right neighborhood. Similarly, the assignment r
--.--.
O
can be expressed
\(*:v+1)
as
A7z(x:v*3)
if we assume that the initial value of x before the assignment is (v* 1). A superdense computation of the two consecutive assignments
x::xi1;x::xf2 :: x* 1) to (x :: x* 2) takes : (x v 1) f of the program is unstable no time. Thus, the intermediate state expressed as a superdense state and invisible. The computation can then be transition assumes that the passing of a value of x from (x
The chop moclality can chop a nonpoint interval into subintervals, but cannot chop a point. At a point, the chop modality degenerates into the conjunction connective. For example,
((\s' n ,r'l)^(\S,
n
lSz)) c ((\S'
^,vSz) ^
(\,5r
A ,V Sz)
. (\
Sz
n ,v
St)
that an interpretat'ion of states, 7, is given. Then we define the by stipulating that this formula is satisfied by T al a point t meaning i{I there exists a ref'necl interpretation of states (designated T')' In L', the point t of I rsexpanded into an interval lt,t + 5) of I' (for some d ) 0), such thatT'satisfies (\,Sr A /Sz) at time t and (\ Sz n /Sz) at time f *6, and the intermediate state sz holds stably throughout the interval (t, f + d), which links the two transitions in z/. This situation is sketched in Fig. 10.3. of .
,9,
Ss
v*3).
The result of these superdense state transitions is
\(*:r)A,V(x=vf3). I'
which expresses the assignmerrt r,-xfd -- r t
rrrtrlcr'llrc
ir,ssrrrrrlrl,iorr
lrig. lO.:|, llrirl, t,lrc irril,irr.l virlttc ol'x lrclirtc l,lrl
rt,stip,;tttttcttl, is v.
n ,zss))'
.
Suppose
followed by
l$=
(\S,
Thus, with the chop modality, one can express two simultaneous state transitions at a time point, but cannot express two consecutive state transitions at a time point. In order. to express superdense state transitions in Dc, we need a new modality to introduce a dense structure into a point. The new rnodality is called the superdense chop and is denoted by o. It can map a time instant \n a granrl,time space (called rnacro time in [73]) into anonpoint interval in a fi,nelime space (called mi,crotime in [73]), so that an instant action (such as the value passing of x) in a grand time space can take some time in a fine tirne space, and hence an unstable intermediate state (such as x : v * 1) of a superdense state transition in the grand time space can become stable in the fine lime space. To explain the meaning of the superdense chop, let us consider two state trarrsitions: (\,9r n I Sz) and (\,Sz n ,V Sz).Combining them with the superdense chop, we obtain the formula
\(*:v)Al(x:vf1). \(*:v*1)A
169
10.1.2 Superdense Chop
x:v
-- .I.
Introduction
5r
< / +d
llr'lirrr,rl ittllt';rrt'lirl.iott lirl l,lrl rittlrt't rlt'ttst' r'ltolt
,5s
170
10.2 Calculus for Superdense State
10. Superdense State Tbansitions
In the above explanation, both Z andT' are interpretations of states, and the relation between these two interpretations is quite similar to the relation between the value assignments )l and V' with which we introduce semantics for quantification over a global variable. In [60] and [163], it is indicated that the superdense chop can be defined by the original chop if we allow quantification over a state variable. A formal calculus for superdense state transitions, called superdense state trans'ition calculus, is presented in Sect. 10.2. Using this calculus, we define in Sect. 10.3 a real-time semantics for an OCCAM-like language with superdense computations.
Tlansitions I7I
In the semantic definition,
Pa,(t): Pr,(m+612)
(m
expresses the condition that every state variable
P (and
hence every statc) h;r,s
interval (m,m*6). The intermediate, invisilrkr value of P in a superdense state transition expressed by the superdensc
lSe\.9
10.2 Calculus for Superdense State TYansitions lO.z.L Syntax The superdense state transition calculus contains durations of states, i.e. /S, as terms, and transition formulas, i.e. \S and /5, as atom'ic formulas. The conventional connectives and quantifiers are also adopted. However, this calculus contains the superdense chop modality, o, instead of the original chop modality, ^.In other words, formulas of the superdense state transition calculus can be obtained from formulas ofthe state transition calculus presented in Chap. 9 by replacing ^ rvith o and vice versa. In this section we shall use the fact that if / is a formula of the superdense state transition calculus, and rfl^lol is obtained from / by replacing r with ^, then O[^1.] is a formula of the state transition calculus. Furthermore,
if /
does not contain any transition formulas becomes a formula of DC.
is valid for any consistent state,g (i.e. S is not equivalent to 0). Let T, V and [b, e] be an arbitrarily given interpretation, value assigrtrtrurl, and interval. We establish
I,V,lb,el f /So \S by letting m be an arbitrary point in lb,e),5 be an arbitrary positivrr |c;r,l number andT' be an interpretation obtained fronl by inserting an irit
:1
for
m
1t 1(m + d)
.
That is, state S can be taken as the intermediate state of the sull
(i.".\,,/ / $), then dl^l.l
/,sr \-$ is never satisfiable, since for any m and d, one cannot firrrl a valtttl
1O.2.2 Semantics The calcuhrs retains the Boolean state model. Only the semantics of o need to be explained, as all the other semantic definitions remain as in Chap. 9. The semantics of / o ty' is as follows. Given an interpretation Z, a value assignment V and an interval [b, e],
T,,V,lb,")
?
d.
=
4 and I',V,lm*d,e*d] F,r/,,
and for every state variable P, Itn' l,
t\,(t)
I constant and equal t<-i /S , is violated bv T' .Itt othrtr wor
\-S
10.2.3 Proof Systcrrr
rlt
iff there exist m € [b,e], d > 0 and Z/ such that
T',V,lb,"r)
tf 5' ir l l lll
interval (m,ml d) inserted to obtain I' sucb.that /S is satisfictl itr l/r,rrr,l and at the sarre time\-$ is satisfie
I
rtt,
,t) d) [irr'/ tt t ,\f')) lirl rrr - /- (rrr I ,l). :, (rrr, I
Irr t,his s
Sl)(ll
(r[1
tlrfr; r/r'1))
.i
] ((/,r trft;lr ltt).
I72
10.2 Calculus for Superdense State
10. Superdense State Transitions
SDC2 Suppose z is not free in
since the above three formulas contain no occurrences of
Ty'.
dz) e ((d' . da) v (dz. dz)) (Qz. (hv dz)) e ((dr . dr) v (,bz.,bz)) ((lr.d) . Q) c 1t.(qo tP)
(@'v
.
6z)
(true
.
Q!.1r.0 c =r.(t[ofi.
(6t .
d)
([sll^lfsl)
@3), then
(h . dz) and (62. dr) +
=>
(6s
.
Qt)
.
state ,s can become an intermediate state to link the two formulas on the intermediate @ A 75) and (\,s A d) if $ and 1., place no demands and link can states intermediate \ -S' Hence, we no /,5 state. However, axioms. the following introduce ,5 is cr.tnsistent,
(O
^,VS).
7/
(\S
^
4 and
4,))
e
\ / (O.
t!, rh)
173
and
,
and
<+ flsl
are provable in DC. The semantics of the transition
A
SDC4 If
true
\or I
(US:")^(/S:a)) # lS:(r+y) (n,y)0),
.
-
SDC3 It (62 =>
^true) I
Tbansitions
t'hen .
formulas\,5 and /S is as given in the state transition calculus described in Chap. 9. Therefore, the axioms ST1 ST4 can also be adopted here. However, axioms N1 and N2 cannot be used in the superdense state transition calculus, since they are expressed in terms of the original chop, ^. In fact, SDC4 SDC6 replace N1 and N2 in the context of
o.
We have the result that SDC1 - SDC7, together with tute the superdense state transition calculus.
ST1 ST4, consti-
1O.2.4 Theorems
SDC5
We prove the fbllowing theorems. In the proofs, predicate calculus is tacitly
('75 ' When
\-'9)
<+ false
assumed.
'
$ /, the formula \,S A /) merely places on a left neighborhood (\S o
the requirement that S holds. The same requirement is placed by
/)'
Theorem 10.1 (false.
Thus, we have:
sDc6 If \/
false
(\s . d) <+ 5.s ^d). @.lS) \,.7//,
/ /
@,
then
(O^/S). between . and ^ <+
and
dl^l.lis
provable in DC, then @ is provable in the
With SDCT we can, for examPle, Prove (true. true) <+ true,
((./S:r).(./,S:u)) tr .ll,sll) (>
false.
ll,cll
,
.l',9-
SDC3 SDC7.
Theorern 10'2 disappears if we are not concerned with
superdense state transition calculus.
([,sll
+
.d
* false r true * false
The difference the transition formulas.
SDCZ If
r false)
Proof . We present a proof for the first case.
/, then
Symmetrically, If
/) + false and (/
(r rq) (:r:,ir)0), a,rrrl
NSr.lSt)
c \Sr
^,7Sz).
Proof.
\.91r lS2
<+ (\,91 r l,r'rur) r (trtt (\,9r A (llrrc r l,r'rtt')) A 1,52 Sl)Cl6
{) \,sr A/,\,.r
slx17.
I
174
10. Superdense State Tlansitions
10.3 Real-Time
Corollary 10.1
Semantics
175
10.3 Real-Time Semantics
(\,S.true) <+\,S
In this section, an OCCAM-like notation and a real-time semantics of the notation are presented, where assignment statements and message passing of
and
(true.
communications are assumed to be timeless actions.
/S) c 75.
Proof. The first part of the corollary can be derived by letting ,91 be ,S and I Sz be 1 in Theorem 10.2. The second part can be derived similarly.
Theorem lO.3 If ((d n 7Sr).
(Sr n Sz) 'is consistent,
(\S'
^
?i)) <+ @.,,h)
l/
O
and\/ {,
then
delay, x,
y for
program uariables,
c,
d for
for arithmet'ical
by the following grammar:
5::: x,:
ST4, SDC3
n/)
ST2, SDC2 sT4, SDC3, SDCS ST4, SDC3 ST2, SDC2 sT4, SDC3, SDC5 SDC4.
r\,53) is consistent, then
((\S' nlSz).(\Ss nlS+)) e \S' nlSa,). Proof. From Theorem 10.3, we can derive
n,7S+))
(E) | c!(E) | c?x lwait I S;S I B -+ S S) I (c?x "-r Sflwait 7 -+ 5) I pY.S P :::3 1@ llP), where ,S stands for sequentiol processes, and P for parallel processes. The informal meanings of the statements can be given as follows. | (c?x -+ S[d?y -+
n
((\St ATSz).NSs
T € (0, oo) stand for a time
erpressi,ons of program variables, and B for Boolean erpress'ions of program variables. The syntax of the notation is given
.
($ n 7Sr). SS2 qr) <+ (d /((S1 ,S2) v ^(S1 -S2))) . N.92 d) ^ A i/) ^ <+ (d ^n 7(Sr, n^Sz)) r \,52 v ((d n 7(St n -Sz)) . (\S, /)) <+ (d n 7(& n Sr)) o \S2 nTl) ^ <+ (d n ./(& nsr)). (\((Sz ASr) v (,52 -Sr)) ^ <+ (d n /(St n sr)) o \(S2 51) ^ n -,51) ^1r) n /)) v ((d n 7(St n Sz)) . (\(S, <+ (d .7(Sr rt Sr)) . (\(S2 ^91) 4) ^ ^ + d.rh^
(,Sz
Let
channels, (E)
Proof.
Corollary 10.2 If
10.3.1 Program Notation
e \Sr.7S+).
Therefore, by Theorem 10.2, we can obtain the required
conclusion.
tr
* ,: (E) assigns
the value of (E) to x.
c!(E) sends the value of (E) on channel c. c?x receives a message from channel c, and assigns wait
7
delays the program for
T (T > 0) time
it to x.
units.
Sr;52 is the sequential composition of 51 and 52. (B -+ S) behaves like S if the values of the program variables satisfy B. Otherwise, B is false, and the process terminates imrnediately. (c?x -+ 51 [d?y -+ 52) is a choice. If a communication on c can be completed earlier than one on d, the first branch 5r is chosen; similarly, if a communication on d can be completed earlier than one on c, then the second branch 52 is chosen. If these two communications can be completed at the same time, the choice is random. (c?x *+ 51 fiwait T -+ 52) is also a choice. If a communication on c can be completed within 7 time units, the first branch is chosen. Otherwise, the second branch is chosen.
pY.S is a conventional recursion, where Y is the name of the recursion process and Y may occur in 5.1 We exclude finite divergent behavior of processes by assuming that any occurrence of Y in 5 is guarded by a wait statement, so that a process will not be engaged in infinitely many assignrnents or communications in a finite period. 2 allows a pa,rilllcl svstcm constructed from sequential processes. Shared verriirtrl
\/dr, $2 andl/rh,('2, then ((\s,.dr) (\,sr.dz))+ (\(srAs2) r(d1ndz)). ^ (rhr.,vS)) ((rltt ((th. /St) A At/z) . 16r ASr)). e
Theorem LO.4 U
Proof. We prove the first equivalence only.
(\Sr.dt) n (\Sz.dz) c (\,9' dr)^ \sz n dz) sDC6 TH9.1(2) <+ \(sr ^ ,52) A (h n dr) ^ r (r[1 (Sr tlt'2) A ,52) A SDC6. <+ \
twrxrrr s
tr
I Wr rlrn,ll roltttxiott,
ouc
rt,l, t,tt,t,lt
rrrrl, t,lnlrornt.r,
trttrl.
Iss,11, 1111
Llrr, rL,l,nils ol' Llrr, svtrl,ilx rt'rlttirtrrl l,o
lruilrl
a
L76
10.3 Real-Time
10. Superdense State Transitions
state uariables
10.3.2 Prograrn States
In order to model the behavior of real-time programs, program states
: {x,y,z,c,d,c!,
dl, c?, d?,
..
.}
are
,
where x, y and z, called program uari'ables, record the values of variables of a pro-
gram;
c and d, called trace uar,iables,2 record communication histories over individual channels; c! and cl! record readiness to send messages over channels; and c? and d? record readiness to receive messages over channels. The variables c!, dl, c? and d? are called readiness aariables. Let the real numbers IR be the value domain of the program variables. The domain of the communication traces of channels is the set of the finite sequence of the real numbers Trace
When
Let us extend the set of qlobal aariables) 8V, so that we have
1. v, v1, v2, . . . &s global variables to range over IR, and 2. h,h1,h2, . . . &s global vaiables to range over Trace. Accordingly, we extend the set of function symbols to include the concatenat'ion operator
x
Trace
-+
1. 0, 1 and every state variable are states. 2. If S and ,9t are states, so are -,S' S V S', lv.S and lh.S. By the definition above, a state is in fact a forrnula ofthe program and channel variables and of the global variables such as v and h, in a first-order logic with equality. In a formula, quantifiers are applied only to global variables. We shall use
\ar,or,. .. ,a^)^\br,b2, - . . ,bn) ) (or,o",. . . ,a^,bt,bz, "' ,b^) ' The operator
^ is assoc'iat'iue,
and has the empty sequence,
represent a state S which contains the program and channel va'ria,bles x, c, c! and c?, and free occurrences of v and h. An interpretation of a state is determined by an interpretation of the program and channel variables and a value assignment for those global variables which occur (freely) in the state. we also use 7 to stand for an interpretation of the program and channel variables, and use xTt cT, c!7 and c?a for the interpretations assigned by Z to x, c, c! and c?. We assume that
to
xr :lfime -+ R cl : 'lfime -+ Trace clz : llime -+ {0, 1} c?z : lfime -+ {0, 1}
Trace,
with the definition
0,
as
the left and
also the ri,qht :unit.
'
State erpressions (also simply called states) are generated from state variabies by the propositional connectives - and V, and also the quantifier l, since state expressions may contain global variables (".g. u and h). We can say the following:
,5(x, c, c!, c?, v, h)
truth values {0,1}
Trace
are generated from the program and channel variables
1. If x is a program variable, and (E) is an arithmetical expression of global variables v,v1)v2,... , then (x: (tr)) is a state variable. 2. If c is a trace variable and tr is a trace expression constructed, by using ^, from global variables h,h1 ,h2,... and arithmetical expressions of v, v1, v2, . . . , then (c : tr) is a state variable. 3. Any readiness variable is a state variable.
? lJ m'. n)0
n:0, IR' = {0}, where 0 stands for the empty sequence. Let the be the domain of channel readiness.
^:
177
PV by the following rules:
introduced into the superdense state transition calculus as state variables. We consider the following sel of prograrn and channel uariables:
PY
sv
Semantics
We car. introduce a trace variable to record the communir:ation historics of all channels of a process, if ordering among <:omnruni<:ittions over'
,
and that they are ,fi,nitely uariable for any interpretation T- That is, they cannot changc thcir values infinitely often in a finite period. 7 also assigns irrtcrpr<:ta,l,ions t
V(v)
<-
llli ;lnrl
V(lr)
r
'l\n,u:.
is interesting.
Of'r'lrtt'rit', V irlse;rsl'i11ttx vitlttlri I'o ollrt't 1';lolxrl v;l,ti;tlrlts,;ts trxlrlil,irrctl itt (llrrlrH. 2 rrrrtl il,
I7B
10.3 Real-Time
10. Superdense State Tlansitions
Given Z and y, the value of a state at any time is determined. Let ,9 be a state written as,S(x,c,c!,c?,v,h), and let I € lfirrre. We define,5 to have value 1 at I under I andV, ifr S (xa(t), ca(t), cl7(t),
7(t), V(v), U(h))
c?
Theorern 10.6
\(" : vr) n ./(*: v2))) <+ \(* : ((\(" : v1) n 7(*: v2)) o Cnt(x)) <+ f\(" : (Cnt(x)r [fx: <+ [x: vl "l) ([fx: vl r Cnt(x)) <+ [fx: vl (Cnt(x) .
3,
lV(v).
that
Proof.We merely sketch the proofs here. Observe first that
(\ (" : v) A ,7 (x : v)) . N(" <+ (\ (x : v) n 7(": v)) o \(*: <+ \ (x : v) o /(x: v2) c \(x : v)n /(x: v2) Observe next that rt (v
xr(t)
:
v'(")
((\(":
.
In fact, the state lv.(x: v) has value 1 at any time under any interpretation and value assignment, since for any interpretation Z, value assignment V and time f one can always find a value assignment V' which is v-equivalent to V and has V'(v)
As we have introduced first-order quantifications in state expressions, we need an additional axiom concerning the distributivity of \and,Zover the
existential quantifier: ST5
where
r
<+
lr.\S
and l1r.S <+ )r.lS,
stands for any global variable.
Vr.\S
' :n.(\
v) n
I
:
vr)A /(x: v) n l(x:
if (v:
.
\(x:
v1), then
v2))
,rr)) Def(\rl SDC4 SDC6.
v1), then by SDC5, the definition of
v)) r
l(*:
v1) n
l(*:
I
and SDC3,
v2))) e false.
The first two parts of Theorem 10.6 follow from the above two observations. A proof of the last two parts can be given as follows:
Cnt(x)olfx=vl
3v'.\(x : v') n (1. :0) A l(x : v/)) o\1 A [x: vl) Def(l),STl <+ fv'.(\(x : v') A ((. :0)A /(x : v/)) .N1 A [x: vl)) SDC2 e 3v/.(\(x : v') A ((.:0)) r lfx: vl) TH10.3 SDC2 <+ lv.\(x : v) n ((. :0)) o ffx : vl ST5 <+ \3v.(x : v) n (!. : 0)) o ffx : vl (lv.(x : v)) <+ 1 <+ \1 A (!. :0)) o lfx : vl ST1 + ((. :0) r [x : vl SDC7. <+ [x: vl define Cnt(c) ' :n.(\
and /Yr.S
<+
Yr./S.
(x
: v) A ,V (x:
expresses the continrril,y of statcs of x.
x
(c
:
h)A
I
(c
:
h))
similarly and prove the following theorem.
Theorern 10.7
The formula Cnt(x), defined by
Cnt(x)
v2))
We can
Theorem 10.5 <+
.
n
The following theorem is proved using ST5 and ST3.
\Vr.,S
ur))
<+
: v(t).
\12..9
l(x: v1) n /(x: v1) n
.
:
However, the state lv.(x : v) has value 1 at f under T andV, since we can construct a value assignment V' which is v-equivalent to 7 and has V'(v) - 2, so
179
.
is valid in a first-order logic with equality. For example, if, for a given T and V, we have xT(t) : 2 and 1/(v) then the state (x: v) has value 0 at f under 7 and V, since
xa(t)
Semantics
v))
r\(t::hr)A./(r,: hr))) c (\(":hl) Al(c:hz)). (C\.(,' = h1) n/(x - l,.r))o Orrt(r:)) <+ f\(<': hr) A /(c:h2)). (( rrrl (r') r ll c lr ll ) < I ll t' l,ll (Crit,(r:)
,
a,l a, lroiul; arrrl irr:l,s as
it
rt,rt,i,l
ol
r
for l)logrir,ln
(ll,'
lrllr(lrrl(r'))
{r ll,'
I'll.
180
10.3 Real-Time Semantics
10. Superdense State TYansitions
[c?x]r"'' [c?x]'
10.3.3 Program Semantics we shall use a technique given in [56], where the semantics of each process p is simultaneously defined by two formulas, [?]r", and [2]. These formuIas define the terminating behavior and the entire behavior, respectively, of P. The formula [P\ is prefir-closed. By prefir-closed, we mean that for any interpretation Z, value assignment V and interval lb,e), If
T,V,lb,"l
F [2],
F
lhr,h2.Syncr(ht,hr) V [c?x]r"',
where
Syncr(h1,hr)
= (^
Comml(h1,hz,t)
e,
\((c :
h1) A (d
[c? n -d? n
= hz))
-c!n
(c: hL) n (d : hr)l-,/\
t l((" :h1^v)
n (d
:
h2) A (x
In the formula Syncl(h1 ,h2) and henceforth, we
[2].
As indicated before, our aim is to show the expressive power of the superdense state transition calculus, so we shall nof concern ourselves with other details, for example, a proof of the continui,ty of the semantics of all program constructors, and hence the existence of a fixed point of a recursion. Furthermore, for simplicity, we also assume that a process has only one variable, say x or y, and two channels, say c and d, over which the process may communicate. It should not be difficult to generalize the semantics to more realistic cases by introducing process alphabets. For each process considered below, we state its semantics by defining the communications on its channels (c and d) and the evaluation of its variable
(x or y).
Sequential Process:
lh1,h2.(Synct(h1,h2) r lv.Comml(h1,h2,v))
and
then for any c, where b I c I
T,V,lb,"l
181
*,:
(E)
The assignment terminates immediately. neighborhood and passes
It
: v)).
use the abbreviation
[sl.=flv[sl The formula Syncr(h1,h2) therefore defines the behavior of the process while it is waiting to receive a value from channel c. The process first inherits the values (h1 and h2) of the histories of channels c and d, and keeps the readiness variable c? at 1 as long as its partner does not engage in communication (i.e. c! :0). During the waiting period (if any), the process will keep the channel histories of c and d constant, so that no communications over c and d are possible. Note that Synct deliberately avoids specifying the value of x in the waiting period, since it follows the assumption that only the initial and terminating values of a program variable are observable. The following definitions of Sync2, Syncr, Waitr and Wait2 follow the same assumption. The formula Comml(h1,hz,v) describes the time instant when v is received over channel c and assigned to x. Note that the trace of c is changed, while the trace of d is kept constant.
inherits a value of x from its left
the changed value
to its right neighborhood. The
communication histories of c and d do not change:
[x :: (E)]t"" ' :,t.(\ (x : v) n .r'6: (o)(v))) A Cnt(c) A Cnt(d) [x :: (E)] ' [*,: (tr)]t"',
Sequential Process:
c!
(E)
We assume that this process has y as its program variable and that it outputs messages over d. The semantics is described in a way similar to c?x:
: lhr,h2,v. [c!(n)] : lhr,h2,v. fcl(E)]1"'
where (E)(v) is the expression obtained from (E) by replacing x with v'
(Sync2(ht,hr,v)
o Comm2(h1,h2,v))
Sync2(hr,hz,v)
v
flcl(E)]1",,
where
Sequential Process: c?x We assume that this process can input messages from d also. As soon as this process synchronizes with its partner, it will receivc ?I Incssagc) rrpdate the communication history of cha,nncl c and assiglt th
Sync, (lt
1
,
h2,
\ v) : / \((.:hr)A(d=h2)A(y=v)) \n lf,,! A -rl! n -c? A (c : hr) A (d : hz)'ll-/
ilrr
(lrrrrrrr12(1r1,l12,
v) t ,r'(c
hr- (l,l)(v)) A (rl ',, lr,r) A (y
I82
10.3 Real-Time Semantics
10. Superdense State Tbansitions
Sequential Process: wait
?]t"' ' Waitl A ((':
: v * 1, then v-r 1)). (\(x : v/) n,7(*:v' +2))
This formula can be proved by showing that if v'
?
We assume that this process has x as its program variable and can input messages from both c and d. The process aiways terminates, and nothing happens to its program variable and channels until a time T > 0 has elapsed: flwait
183
T)
(\(" : v) n /(x:
coR10.2 \(x:v) n l$:v'+2) v/:v*l, \(x:v)n l$:v-13) and if v' f v i7,then by (x : v+ 1) + -(x : v/) and SDC5, (\(": ") A,r'(x: v+ 1)). (\(": v') A l(x:v'+2)) <+ fa,lsc. <+ <+
(In the above equations, "COR" means "Corollary".) Hence, by SDC2,
:".(\(x:v) A l(x: v* 1)).1v.(\(x: v) A,/(x: v+ 2)) n ,7(*: v'+2))) € 3v,"'.((\(x:v) n,V(x =v+1)).(\(":v/) <+ lv.(\ (x : v) n ,r'6: v + 3))
where
/ \tt":hr)A(d:h2) A(x:v)) \ Waitl3 fhr.h2.v. In [-q:A d?A(c:h1)A(d:hr)1. | \n/((. - hr) A (d: h2) A (x: v)) / When wait T controls y and the outputs of c and d, the semantics of .
wait
T
.
Sequential Process: (B -+ 5) We assume that this process contains x and can input from c and d.
[B -+ 5]t",
can be defined by Wait2 in a similar way:
/ \(t" -hr)A(d:h2,1A(v:v)) \ Wait2 i lh1,h2.v. I n [-c!A-d!A(c:h1)A(cl:hr)l| \n ltt" : hr)A (d : h2)A (y : v)) /
[B '+ .
s]
= NB A [S],",) v ((\-B)A Cnt(c) A Cnt(d) A Cnt(x)) = (\B ^ [S]) v ((\-B) A Cnt(c) n Cnt(d) A Cnt(x)),
where we assume that B can be expressed as a program state, i.e. a first-tlrtlcr formula of the program and channel variables.
* 5z)
Sequential Process: .Sr; 5z
Sequential Process: (c?x --+ 51 [d?x
The prefix of the behavior of Sr;52 consists of the prefix of the behavior of 5r and its terminating part, continued with &:
We assume that this process contains x and can input frclm c arl
[St;Sr]t"' 3 [Stnt.'. [52]t"'
[Sr;&n =
[5r] v ([Srn,"'. [5r]).
[c?x -+ 51[d?x
Now we can prove the combine law introduced in Sect. 10.1.1. Consider,
!h1
[x
:: x* l;x :: x+2] <+ [x :: x*3].
According to the semantic definitions of assignment and sequential composition, the equivalence above can be transformed to the formula
:".(\(x : v) n,V(x: v+ 1)).1v.(\(x : v + 3)) <+ -v.(\ (x : v) n l$:
v) n
l6=
vf
. [.S1]i,,' . [Sz]i"'
-1Srn '
.Svnr:r (h1 , h2 ) V lhr, h2.(Syn<:.,(h1, h2) o 3v.C)orIIlIIt (iI1, lr2, v)) V 3h1, lt2.(Svn
for example,
<1.
, h2 ,
r . r v)) lv.(lorrrrrr;j(h1,1r2, V !h1,lr2.(S.yrrt;,(h1,lr2)
[S1] [S''rll
'
wlterrc
2))
Synt:.,(lr1 , lr2)
.
;t,t tr
lr1)A (tl lr:r)) / \(t, \ \n 11,"lArl'iA 'r'lA 'rllAlr' lrr)A(rl 1",)ll-/
I
( lotrrrrr,r(lrr, lr,r, r,)
'((,'
lrl ) A
(rl l',
v) A
(r
v))
784
10.3 Real-Time
10. Superdense State Ttansitions
Sequential Process: (c?x --+ .S1fiwait
T
[5' ll &n,",
]
=
lhr,frr.((Syncr(trr,hr)A (l
[c?x
rsr
+
V lh1,h2.((Syncr(hr,hz)A ((
that Y may occur in 5. The terminating and complete behaviors of pY.s(Y) can be extracted from iterations of 5. Let 5i(Y) :5(5(...5(Y)...)) denote the zth iteration of 5. We also introduce denote
an auxiliary syntactical entity, called
[M]t", I [M] i
M, with
the definition
szn -
|
\v1[sn^[s,]) I)
We specify here bhe real-time properties of program termination and liveness. As we have discussed in Chap. 1, DC with contracting modalities is not able to formulate and prove unbounded liveness including termination. Only bounded liveness is discussed here. In Chap. 11, two expanding modalities are introduced, and unbounded liveness can therefore be treated there.
Partial Coruectness The partial correctness of a program
false
as
false.
M actsllke a miracle, from which one can derive any conclusion.3 The terminating and nonterminating behaviors of p,Y.s(Y) can be defined, using M and iterations of 5, by [/,Y.S(Y)],", 4 1n 10.[5"(&1)]t"' [pY.s(]')l '- rn ) O.tS"(M)1,
2 with Pre as its pre-condition and Post its post-condition can be formulated as
\Pre A[Pnr",) + /Post, where Pre and Post are first-order formulas of program and trace variables.
Bounded Terrnination The bounded termination of P with the pre-condition Pre holds if there exists
r)0suchthat
means an'i,nfi,ni'te disjunction of dt,dz," ' ' We sliall not discuss here how to define (lr1 > 0.0; in DC. References [39, 41, 60, 108, 110] have introduced an operator p into DC for this purpose'
where
lt
\((" : 0tn 1a = 1;11 \ t[s,]r", A ([Sznr", . WaiL2))\ (^ / (([5r]r." o Wair ,) n[Srn,",) \v )/ \((" : 0)n 1a = 1;11 \ / v ([s'] n ([&nr", . wair.z))\ | (^ I tt[S'jr"".WaiL1)^[Sr]) I I'
10.3.4 Program Specification
Sequential Process: PY-.S(Y)
we write 5(Y) to
185
The semantics o[ (S1 ll Sr) is
--+ E2)
We assume that this process contains x and can input from c and d'
*[c?x -+ S1[wait T -+ 32]1",
Semantics
(lri > 0.0;
[2]) =+ (!. < r) Let 5r (i:7,2) be two sequential processes, \Pre
.
^
51 : wait 2;c?x
Parallel Process: (.Sr ll 5z)
52:waitt:c!y; y':yf1.
We assume that 5r contains the variable x and can input from c and d, and that Sz contains y and can output to c and d. 51 and ,S2 syrlchronize the communication histories of the channels c and d first, by initializirrg them as 0, and then run in parallel. Any terminating process rn:r,intains its status (described by waitl for 51 ancl by wait2 for s:) unl,il th
t I,I,*'.,*" wait
sl;r,l
sirr
ir,
where 51 has the variable x and input c?, and orrtput r:!. L
?1 : 51 ll5'2.
&
has the variable
y and
186
L0.3 Real-Time
10. Superdense State Tlansitions
we can expect Lhat Pr always terminates in two time units, and y holds when
?r
:
1-1-
l
terminates:
\
Since the consequent part of the implication contains no occurrences of Z *e obtain, by replacing o with ^ in the consequent part of the
implication, the following DC formula:
((.:0)^((
v ((1.:0)^(t: v (((. : 0) ^ (l :
and
since\1
is true
(sTl),
: xr
1).
fzrn
+./(v:x*1)'
1 \(tt-0)n(Y:.')) v)A (x
[prnr",
=
ii]
r
. ^
((
<,,t)
'\ I
we do not present the proof of the simplification here, since derive program properties directly from program semantics' With the simplified semantics of Pr, we can prove
it
is tedious
(\Pre
\u tto:
Q)o
A
Consider, for example,
\
(l = 1)o (l < 1)) I (l :!)o((: r)) /
u
+ 1)) SDC6
Def()-
[2n) =1 n"4"Vh1, hr.([(. : hr) A (d : h2)l +
)"a"d ? tr1uso@otrue D"a"d ? -Qra"-d.
follows. By SDC3, we have Q)o
:
(!.
< r))
,
where [sdc is the counterpart of D in the context of the superdense chop, i.e.
Q<2)
+ I u tt,':
v) n (y
A program is not deadlocked if the communication traces of the program are expandable. A bounded liueness can therefore be established by proving an upper bound on the time period in which the communication traces of the program remain constant. Let P be a process which has channels c and d. P has r ) 0 as its upper bound of liveness under the pre-condition Pre, if
I
ri [Pr] tr
:
Bounded Liveness
Iu=,f.h1:;jll,l',l =ii],^(r=r))) \.1ii"ln-c?A(c:0)ll-n1t
/ ((=o).(l<1)
n ("
I
: v)n (Y = v + L)) /
( r" (. hl[ ; lll i',1
+]$:x*1),
* lv. 7((c:0) + 7$:x*1)
\
rv I : [[;.;:;;,iJ:1\?lili;,\,, \. l((":
["r] +
Q<2)
can be derived easily from the simplified [21]1,,, since
of Pt:
<+
+
[Ptnt",
In order to prove the above properties of 2r, we first simplify the semantics
rpn
.
is easily proved using DC. The property
and
r2rl,", <*
1)^(l < 1)) r)^ ((: 1))
Therefore, by use of SDC7, the conclusion
the termination properties can be simplified to:
[Zrn + ( <2)
[Prnt",
187
and
(\1^[2r]) + (52) e\1 A [Pr\t*) + 7(v
Semantics
.
53 = trr,Y.S1;Y .$n
e pY.S2;Y
ilrrrl .S'1
ll
.S,1
,
188
10. Superdense State TYansitions
We can prove that P2 always has 2 as an upper bound of liveness:
(\14 [pzn) +
l"4"Vh1,hz.([(c
11. Neighborhood Logic
: hr)A (d : h2)l + (' S2)) '
The proof from the semantic definition of Pz is too tedious to present here. Verification techniques with DC formulas as specifications have been investigated in 193]. This book will not cover this topic.
11.1 Introduction The chop-based interval temporal logics, such as ITL [43], IL and DC, are useful for the specification and verification of safety properties of real-time systems. In these logics, one can easily express properties such as
. "lf O holds for an interval, then there is a subinterval where iy' holds", and c "lf $ holds for an interval, then { holds for all subintervals". However, these logics cannot express (unbounded) liveness properties such AS
o
"eventually there is an interval where / holds", and r "/ will hold infinitely often in the future". Surprisingly, these logics cannot express even state transitions, and hence we had to introduce extra atomic formulas \,S and /S) in Chap. 9. The reason for this limitation is that the modality chop ^ , is a contracting modality, in the sense that the truth of O^(t on the interval [b,e] depends
only on subintervals of lb,el:
/^r/
holds on
fb, e]
iffthere exists m elb,el such that
/
holds on [b,m] and,ry' holds onfm,e):
oa m
l-l th
Hence, with ^, one cannot access any interval outside a given reference irrterval. Therefore, formulas constructed from the connectives of first-order logic arr
190
11.2 Syntax and
11. Neighborhood Logic
limit at a point must refel to neighborhood properties of the point, i.e. properties over superintervals of the point. To cope with this, an informal mathematical theory of real analysis was assumed in 1170] and also in other languages for specifying hybrid systems, e.g. in hybrid siatecharts [92], hybrid automata [ ] and TLA+ [76]. In order to improve the expressiveness of the chop-based interval temporal logic, people have introduced infinite intervals 197,1621 and erpanding modalities be formalized. The definition of a
[31, 103, 139, 148]. For example, [148] establishes a complete propositional calculus for three binary interval modalities: ^ (denoted by C in [148]), T and D. The last two are expanding in the sense that the truth value of formulas STtl,t and $Dt! on an interval [b, e] depends on intervals "outside" fb, e]:
/TTl holds on
[b, e]
iffthere exists c ) e such that
fTrlt
@
holds on [e,c] and
/
holds on fb,c]:
191
In this chapter, we present a first-order interval logic [165], which has two simple expanding modalities:
. Otd . Ord
reads "for some left neighborhood $", and reads "for some right neighborhood".
They are defined as follows:
r Q/ holds on [b, e] iff there exists d ) 0 such that @ holds on [b - d, b], and . O,Q holds on lb,e]itr there exists d ) 0 such that Q holds on [e,ef d]. With q and Or, one can reach left and right neighborhoods, respectively, of the beginning and ending points of an interval:
ooft abe
a,O
0
Semantics
d
bec 4)
to an expansion of a given interval in future time. Symmetrically, D refers to an expansion in past time:
Hence, T refers
/D{
holds on
iffthere exists n (
[b, e]
b such thal' O holds on [o,b] and
O
r/ holds on [o,e]:
ODrl'
4)
Liveness can be specified using these modalities [139], and there is a com-
When the interval is a point interval (i.e. b: e in the definitions), these neighborhoods can become the conventional left and right neighborhoods of a point, if we assume d > 0. We therefore call Q and O, the left and right neighborhood modalities, respectively. They are expanding modalities, and very similar to (A) and (A) of the six basic modalities of [44]. This first-order interval logic is cal\ed nei,ghborhood logi,c (abbreviated to NL). NL is adequate in the sense that the six basic unary modalities of [44] and the three binary modalities of l7a7l are expressible in NL. Similarly to the axiomatizalion of IL in 1271, we can give a complete proof system for NL. This proof system is much more intuitive than the propositional calculus for the modalities C,T and D given in [147]. On the basis of NL, we can also establish a duration calculus which can express state transitions, and liveness and fairness properties. In [165], notions from real analysis are also expressed in an Nl-based duration calculus.
plete axiomatization of a propositional modal logic of the three modalities C, T and D. Some of the axioms and rules of this logic are, however, complicated.
Interval modalities are not necessarily binary. In [1], there is a list of thirteen possible unary interval modalities, and in [44] it was shown that six of them are basic in the sense that the remainirrg trnary rnodalities carr bc derived from the basic ones in propositional l
47],
11.2 Syntax and Semantics Thcl syntax and scmantics of NL are similar to those of IL given in Chap. 2, cx<xpt that thc <:hop rno
ry'::.- .T l(i"@t,..,,/i,,)
I ,,hl,hVl, l('lr)r/ lq,/ lq,l,
192
11.3 Adequacy of Neighborhood Modalities
11. Neighborhood Logic
The semantics of the formulas Qd and Or$ are given below:
Table 11.1. The six basic modalities listed in
J ,V ,lb, el ? Otd iff there exists d ) 0; J ,V ,lb - 6,bl ts 4t J,V,lb,ell: o,Q iffthere exists d ) 0: J,V,le,e + d] F d,
Modality
where .7 and v are the interpretation and value assignment, as defined in Chap. 2 for IL. The notions of ualid'i'ty and sati'sfi'abil'ity are defined as for IL' We introduce the following abbreviations:
qd = Q,otd q"rl, = og/lJ, The modalities
reads "for some left neighborhood of the end point: /" Ty'" reads ,,for some right neighborhood of the start point:
of and oi
are called the conuerses of the modalities
Q
Or, respectively.
The following semantical calculations show the meaning of
Of
:
J,V,lb,"]? rytO lfr J,V, [b' F O,Orb "] d' ) 0: J,V,le,e + d'] qd iff there exists F iff there exists d ) 0: J,V,le - 6,")? O
144]
Intervals reachable from "reference interval"
(A)
Nonpoint right neighborhoods
(A)
Nonpoint left neighborhoods
(B)
Strict prefix intervals
(B)
Intervals which have the reference interval as a strict prefix
(E)
Strict suffix intervals
(tr)
Intervals which have the reference interval as a strict suffix
and
193
11.3 Adequacy of Neighborhood Modalities In this section, we show that the six basic unary interval modalities of [44] and the three binary interval modalities (i.e. C, T and D) of [1a8] can be defined in NL. The six basic modalities of [44] are denoted by the symbols listed in Table 11.1.
.
The meaning of these six unary modalities and the three binary modalities
^, T and D is given by:
J,V,[b,"] F (A)d itrthere exists &> ei J,V,le,") l,b 2. J ,V,lb,"l I (A)d itr there exists a 1b : J,V,la,bl l: d 3. J,V,[b,e]l @)Q iffthere exists a such that b 1a 1e and {f ,V,lb,a)l Q. 4. J,v,[b,"] F (B)ditrthereexists a>e: J,V,lb,")a6. 5. J,V, [b,e] [ (tr)/ iff there exists n such that b < a 1e and J,l ,la,e)l $. 1.
wherea:e-6. o
A similar calculation for Of establishes that
J ,V ,lb, ? Oi',! iff for some 6 ) 0: J ,V ,lb,b + dl F ti "]
'
6. J,V,[b,u]
wherea:b+6. 6 We use the same conventions for precedence of the morla,lities introduced in this chapter as for IL (see Sect.2.1). Hence, the trrra,rv tnoclalitics hiivtl the same precedence as n and O, ilrr
I
(tr)d itr there exists a 1b: J,V,la,"] ?
7. J,V,lb,"lts d^rb iffthere exists m €lb,elt 8.
J,V,lb,^]l
J ,V,lb,el ,bTr, if1 tlrcrc exists = n
) e'. ,/,V,le,ct,] ! /
!). .'I
l:
S and
O.
l/,V,lm,e)1,!.
and
J,V,lb,o,)C4t.
ir,rrrl
!/,V,lrt,,rr]
rltD'lt
'V,lb,t'l ifl'l,lrrrrrr cxisl,s rr z,
lt'. ,'/,V,ltr,,lt) !
ry'
I
i/r.
L94
11.4 Proof
11. Neighborhood Logic
i]..l
Theorern
(Ad,equacy) The aboue nin,e modalities can be erpressed'in
NL. Proof. The following equivalences establish the theorem. The validity of each of them can be easily concluded by using the semantic definitions.
(l )
In the following axiom and rule schemas, O is a parameter, which can be instantiated by either Q or O". As is usual when a schema is instantiated, the instantiation must be consistent for all occurrences of O in the schema. We adopt the abbreviations
0) guarantees that the right expansion is a nonpoin,f interval.
2. \A),b <+ q((l > 0)^,/), where (l > 0) guarantees that the left expansion is a nonpo'inf interval. 3. (B)d c 1r.((!.: r) n €,((l < r) d)), where of clefines an interval that ^has the same beginning point as the original interval, and (l ( r) stipulates that the defined interval is a strict subinterval of the original interval.
4. (Ft)O <+ 1r.((t.: r) n ry,(Q > ") d)). This equivalence is similar to that ^for (B)@, except that (l > r) is used to stipulate a strict superinterval of the original interval' 5. (E)d ++ -r.(((.: r) n q(Q < ") d)). This equivalence is similar to that ^for (B)@, except that here of defines
to stipulate a strict superinterval of the original interval'
7 O^4' Q 2r,y.((!: r *il AqW:,,)n O AO,((l': Y) Alh))), where (l : r -t !)) stipulates that the two consecutive right expansions of lengths r and y exactly cover the original interval' 8. OTrl, Q 1r,y.((L :r) n O'((l : v) A O AOt(Q' : r * U)Atl))), where (l : r * a) guarantees that the left expansion, of, exactly covers where
no1((!.: a) A O Aai(V.: r'r a) A i')))' (l : r ]' a) guarantees that the right expansion, of , exactly
covers
r
secti<11 w
-O-
-
-Ooo.
Interval length is nonnegative:
it
strl, o['
!.> 0.
o Rigid formulas are not connected to intervals:
NLA2 r
Od => /,
provided
/
is rigid.
A neighborhood can be of arbitrary length:
NLAS
r)0
+ 9(1.:r).
o Neighborhood modalities
can be distributed over disjunction and the exis-
tential quantifier:
+ (oo v o,.l)' NLA4 o(ov'l) a1r.$ + 1r.a$. o A neighborhood is determined by its length:
r
NLA5 o((!.: r) il + n((!.: r) + O) ^
.
Left and right neighborhoods of an interval always end and start, respectivelv, at the same point:
NLA6
11.4 Proof System Irr this
LI:
NLA1
the original interval and its left expansion, Q'
n
!o,.tt
To formulate the axioms and inference rules, we need the notions of fl,erible and rigid terms and formulas, as introduced for IL. A term is called "flexible" if it contains temporal variables or !. A formula is called "flexible" if it contains flexible terms or propositional letters. A term or formula is called "rigid" if it is not flexible. The axiom schemas of NL are:
the original interval and its right expansion, O''
9 $D{ € 1r,y.((l: r)
o: e Iq,iro:o"
1\-
-o.
an interval that has the same ending point as the original interval.
6 (tr)d + =r.((t.: r) n oi((l > r) d)) ihis equivalence is similar to that^for (E)/, except that (1. > r) is used
195
11.4.L Axiorns and Rules
1. (A)d <+ o,(((. > 0)^ d), where
System
QOq, -) nad.
196 r
11.4 Proof
11. Neighborhood Logic
NLAT
r) +
(d
e c(((':
We list and sketch proofs of a set of theorems which can help in understanding the calculus.
The first deduction to be derived is the monotonicity of n:
") ^ d)).
NLI
o Two consecutive left or right expansions can be replaced by a single left or right expansion, if the latter expansion has a length equal to the sum of the lengths of the two former expansions:
d =+
,h
I
Zr!
+
Zrlt
.
Proof.
l.
(r>OAy>0) + (o((l : r) no((l : y) Aod)) <+ o((!: r +y)^od)).
NLAS
L97
lL.4.2 Theorerns
Left neighborhoods of the ending point of an interval must be the same interval if they have the same length, and, similarly, right neighborhoods of the beginning point of an interval must be the same interval if they have the same length:
(!.:
System
4
=+
rh
assumption
2. -1b + -d 3. O-t! + O-d
1., 2.,
4. -Q-cb
3., PL.
) -Q-tft
PL NLM
The rule schemas of NL are:
NLM NLN MP G
If
6 .+
If
@ then !@.
/ If / If
and
O$
ry' then
+
Atl:.
(monotonicity) (necessity)
d + ,h then r/.
then (V")d.
(generalization)
1. (0 > 0) + 2. O (!.: 0) 3. O true
logic.
similarly to IL, the proof system also contains axioms of first-order predicate logic with equality, including Q1 and Q2 with side-conditions: e rs lree for r in p(r). and \either d is rigid or d(r) is nrodalitv
(:t
\ free )
Theorem 11.2
(Sound'ness)
,f lOthenlr!.
false.
o(l: 0) NLA3 (0 > 0), 1., MP
NLM.
The second part of NL2 is an instance of
NLA2.
tr
The following theorem proves the truth of the inverse of NLA4. '
where a formula is called modati,ty free if it contains neither Q nor O'. The proof system also has to include a first-order theory for the time and value domain, i.e. a first-order theory of real arithmetic. We shall discuss this issue in Sect. 11.5 with regard to the cornpleteness of IL and NL' The notions of proof, theore'm and deduct'ion are defined as for IL' The soundness of the NL proof system can be established by proving the sounclness of every axiom and rule. In [93], NL is encoded in PVS and the soundness of NL proved.
+
Prool. Note that a reference interval is neither a left nor a right neighborhood of itself when its length is nonzero. That is, Q and O, are not reflexive, and ,h => Od is not valid for an arbitrary formula /. So the proof of the first part is a little tricky:
(rnodus ponens)
The monotonicity and necessity rules are taken from modal logic, and the modus ponens and generalization rules are taken from first-order predicate
Ql Vr.d(r) + A\0) Q2 O@ + lr.d(r)
true. Ofalse O
NT,2
(ofv oID =, o(Ov rb). 1r.Ort' =+ O)n.Q. Proof. Proof of the first part:
NL3
7.d .+ G'v $) Od + O(6v ,h)
PL
2.
1.,
3.
PL
d' + (Ov ,l)) 4. arb =+ o(dv ',b) 5. (od v ori
)+
NLM
3., NLM o(d v 1r) 2.,4.,PL.
Proof of the second part:
+
l. S 2. O(b
1r.$
+
i\. Y.r.(Orf
.+ Q1:r.4t)
4.Yr.(Otlt > l-r.
l:r,.O,/r
PL
O1rll>
i
O'1r.r/) O1:r'.r/
-1 (1r.Qtlt -+ O!r.r/)
1., NLM 2.,G
PL, rr is not frcc in O1r.$ :|.,4., Ml'. t1
198
11.4 Proof
11. Neighborhood Logic
The modalities
NL4
n
.o => ao.
(od A tr?r) + o(d (nd .r',) ++ t(O ^'i)
1. 6'o0 +!aod +!-od 2. O"oq t, -o6
^rlt).
Proof. We present proofs of the first two parts only. Proof of the first part:
.o =+ =+
+
+
o(d v -d) NL2, PL Od v O-d NLA4 Def(!), PL. od
+
o(- o/A o -od) +oo(od A -od) * false
3. -"oq
ni/
o((d 1/) v (o ^-rhD ^ (o(d ^ v o(d^-,i/)) ^1b) Dd,) v (o-/^ (o(d^'/)
+ + + o(O 0 ^ ^
E,l, n{)
PL,NLM
^
Pr, PL, Def(n)'
n
6 + cd. NLs -"o4 e o6.
^
+c4 3.0
that
PL,NLM
r
PL, NL2, NLM
2.,PL.
^
n
From NLA6 and NLA7, we can derive more properties of combinations of
-.
r
is not free in
@:
NL6 a"rd e nO. (oo n o-a) € o(dn-ir). Proof. The proofs of these theorems are similar to those for NL5, and are n omitted here.
NLAT
1.,PL,
l..NL5(part 1).PL NL4 (O" : o a) NL4,NLM
o-O + !!@.
U).
Proof . Proof of the first part, where we assume
1. (L: r) n rf + c((t, : r) d) =, O"d ^ 2. 1r.((L : r) A 6)
NLA6, NL1
oo A 4"4, +od A tra1/NLA6,PL + .(d o ?/) NL4.
O, O and
O'u) <+ o(d^ a
=+ orP
NLA6(O"O:OOO)
Proof of the third part: The direction € follows from PL and NLM. The following proof estabIishes the direclion +:
NLA4
As explained above, O is not reflexive when the length of the reference interval is nonzero. However, O" is reflexive, and the intervals reachable by of and $ have the same ending and beginning points, respectively, as the reference interval. So we can prove the following theorem'
(od
- o@ A a'-op
tr
_}
Proof of the second part:
od A o4)
199
Proof of the second part: The direction + follows from the first part when NLM is applied. The following proof establishes the direction J:
and O have the typical relations of modal logic'
^
System
not free in C$
+ (1r.((.: n)) A d PL =+ 1r.((!.: r) n O) PL,r not free in 2.,3.,PL. 4. ,b =>
In order to understand the application of NLA8, we prove the following theorems. In the formulation of these theorems, we assume that (r > 0) and (v 2 o).
@
11.5 Completeness for an Abstract Domain
11. Neighborhood Logic
1. (!.:
r) + (o((!.: a) A od) <+ c(((.: r + y)
((:r\ NL7
5.
od))
1.."((1.: r) n c((!.:
c 2.
=+
(:,,:;.,o,] ?*a^."(((:y)n d))) ( ottn: r) n o((/: o) n Ol) \
3.
4.
^
\<+ O11f : r
(y>r)
l_U)A Oc((/
: fi
no))
-"11
^
od))
r) n o((1. : y -
r)^
Od)) NL7 (part 1)
:r) no((l :u - r)Aod)) : n) A a"o((|. : y - r) n oo
=+O(((.:y*n)nO$)
3. true + 4. Otrue +
)
+ ( U"rro: r)A o'((( = y)n od)))
(y>r) +
+
O'11t = -"11!.
e)
S.
\o ottl:e-r)^od) ) ( O"rto:r)A o"((( =a) AO)) \ \<+ Ottf : !/ - x)n O"(( ( = sl A il) ) .
Q"(!.: r)
((.
=
r)
o a ((.:
r)
6. o(((.:y*r)Aod)
NLM,PL NL5, PL
PL,l'{LA3 3., NLM 4., NL2, MP
O"(1.: r) n O'O((l : y - r) n a$) 5., NL5, PL y - r) od)) NLs + o(O (!.: r) ^o"(((.: : y - r)^^ od)) NLs + o o ((l : ") ^c((t!. 7. o"(((. : n) A ry((. :s) A od)) <+ o((l : a - r)A od) =+
Proof. Proof of the first part:
!:r
. (oy:il^oil
A
O((/
-
\
y1
n Oil) )
\ + (o(tt=fiAa6) :r*A)nOil) O'ttf \<+
NLA8, NLM, PL.
= Zraratnrll) reads "for all intervals: 'ry'". Theorern ll.3 (Ded,uct'ion) If a deducti,on f,Ol 4,, i,nuolues no appl'icati,on Dolb
of the general'izat'ion rule G i,n whi,ch the quantifi,ed uariable'is free in S, then
(=n
flJaf*Ib.
(otro=y)A6) o11f
:
y)A Oc(((
: il
A o))
\
C"11f
=
r-t !/)A O"((( :
!J) AOD
Prool. See [130].
NLAT
)
('rtn:s)^il
\ )
Nl7(part
1).
We now give a proof of the fourth part, Ieaving the proofs of the third and fifth parts to the reader. Assume y
2.,6.,PL.
A deduction theorem can be proved for NL which is similar to the deduction theorem for IL given in Chap. 2. The following abbreviation is useful for formulating the theorem:
NLAT
Proof of the second part:
\<+
1.,
n
=? <+ O"ttZ : r) \
\<+
201
) r:
11.5 Completeness for an Abstract Domain So far, real numbers (lR) have been used as the time and value domain for IL and NL, and we have indicated that each of the proof systems of IL and NL considered has to include a first-order theory of real arithmetic for its time and value domain. In this section, we discuss the issue of completeness of IL and NL with regard to the first-order theory chosen. Given a first-order theory of the domain of time and value, denoted by ,4, zr forrnula is A-uali,d if it is valid for any time and value domain satisfying
A. '[tr slrow l,lu, r:ttrtt,,,tl,r'l,ttr,r:ss of IL or I'{L 'with rr:spect to A-ualidi,ty, one must slrow llrir,l, ilrry;{ vrrlirl ll, or N[, frlrrrtula is 1lr
lotrrtritr.
202
11.5 Completeness for an Abstract
11. Neighborhood Logic
This completeness is called completeness fo'r an abstract d,ornain.
In this section, we assume that "4 always includes the following axioms. Dl Axioms for :: 1 l-
J, -_^
-
L.
2. (n:A) -+ (Y:r). 3. ((r: Y) n(A: z)) + (r: z). 4. ((rt = yr) n..' A (*,: U,)) ) (f"(*r,...,rn) : f (At,...,un)), where
5. (("r :
where
D2
/"
is an n-ary function symbol.
yr)
G'
A... A(rn : U)) * (G"(r1,...,rn) € Gn(At,...,?ln)),
is an n-ary relation symbol'
Axioms for
):
1.0>0.
2.(("> 0)n(y>0)) + (r+E)>0. 3.(r>a) c )z >0.(":(Y+z)). 4. -(n > ,A) <+ (a > *), where (E > r) = ((a 2
")
n -(Y
:
r)).
e y:(y*z).
The above axioms constitute a minimal first-order theory that can guarantee the completeness of IL and NL with respect to "4,-validity. However, they are far away from the "best" theory to characterize real numbers. For example, a singleton of 0 will satisfy all the above axioms. One may wish to introduce multipl'ication and di'uision, or to have additional axioms and rules that capture more features of real numbers, such as lhe infini,ht,de and the density of the reals, as follows.
D5
Axioms for infinitude:
D6
1:.((:r
If I
Theorem 11.4
(Soundness)
Theorem ll.5
(Completeness)
Q
thenF"q6.
If l"qd thenl
$.
theorem can be given by proving that each
axiom is sound and that each inference rule preserves soundness in the sense that it gives a sound formula when applied to sound formulas. A proof of the completeness theorem for IL can be found in [27]. One can first prove the completeness of the calculus with respect to a kind of Kripke model, and then map the interval models to the Kripke models. Following [27], a completeness proof for NL is given in [9]. Rernark. In [38], there is a similar completeness result for DC for an abstract domain. The main ideas are the following:
1. The induction rules IR1 and IR2 are replaced by an c,-'-rule to axiomatize the finite variability of states. Let us use {S, -,5} as the set of complete state expressions to explain the cu-rule. In Sect. 3.3, we introduced the
[l
rAi+'(s)
FAi(S) v ([Sl^F,40(S)) v
'l'lrc r,r t'ttlc t'ittt lrr' [irrrrrtrlirl'rttl
Axioms for
) u) )
Ln A-model Mn is a pair consisting of an ,4-set, i.e. D, and an interpre-
r-40(s) = :'
(n-rI)>*.
(rr:
r nntvp = {[b,e)lb,e €lDAb(e], . %r : GVar -+ D, . Jm(u) : Ilntvp -+ D, for u € TVar, and . Ju,(X) :llntvp -+ {tt,ff}, for X € PLetter.
abbreviations
1.1>0. 2.
Given ,4, a set lD is called an ,4-set if the function symbols and the relation symbols of IL or NL are defined over D and satisfy "4. When an " -set D is chosen as a time and value domain of IL or NL, we denote the set of time intervals of D by llntvp, denote a value assignment from global variables to D by Vp, and denote an interpretation with respect to ID by "fi1:
A proof of the soundness
D4 Axiom for -:
@-a):z
'. :)
A
(: "
U))
.
203
tation .7n. The truth value of aformula 6 of IL or NL for the.,4-model ,AZp' value assignment vp and interval [b, e] e llntvp is similar to the semantic definitions given in Sect,.2.2 for IL and Sect. 11.2 for NL. We write My1,Yyn,[b'e] fu d to denote that / is true for the given "4-model, value assignment and interval. Formula $ is A-ualid (written 11 il iff @ is true for any "4-model Mn, value assignment V11 and interval lb,el e llntvp. $ is A-satisfiablelff / is true for some ,A-model "Alp;, value assignment Vu and interval [b, e] e llntvpr. The proof systems of IL and NL are sound and complete with respect to the "A-models. For both IL and NL, we have:
Axioms for -l-:
7. (r -l0) : (y+r). 2. (r+y) : ". : (r-ta)+2. r*(:a+z) 3. a. (("+y) : @ +z)) -+ (Y : z).
D3
Domain
lf I
ll(l"A' (,5)), lirl
lrr,rr /l
(|
r'lr,)
,
its
rrrrv i
([-Sl-
F.4'(S)).
-1
204
11.6 NL-Based Duration
11. Neighborhood Logic
basis of the finite variability of states, we can calculate /S over an interval of llntvn, (given an '4-set lD and an interpretation -hr) by stunming the lengths of the subintervals where the valuc of S is the constant 1 rrnder Therefore, we can avoid thc concept of an integral w-hen we define
2. On the
"7p.
the semantics of ./S for an abstract
domain.
n
11.6 NL-Based Duration Calculus
[130] . )
The incluction mles for this Nl,-based Dc are restricted to fonnulas ,I{(x) havirrg a specific form. Let x be a propositional letter and @ be a formula in which X
rRr
Suppose two processes are competing fclr a resource and Si(l) : 1 denotes that process i (i:1,2) iras access to the resourcc at time f. Assume that s1 and Sz are mutually exclusive (i.e. -(S1 n ^92)). w-e can use thc following formula to specify an cqual clistribution of the resource in the sense that the two processes should eventually have the sarne access time
to the resource:
) 0. =:[..il.
where e and
7
>T
+
l/Sr
-
JSrl < .),
are regarded as global variables'
Liveness The following formula specifies that the state,S occurs infinitely often: tnf
(S)'
n'O'O'[Sll
.
For example, an oscillator is spccified for S bv
If H(ffi) and 11(x) =+ H(x vV;'-,(r^[fs;11)) t
205
Equal Distribution
Ve
An Nl,-based duration calculus can be established as an extension of NL irr the same way as DC was established as an extension of IL in Chap. 3' The indlction rules of DC mlst, however, be weakened when t|e DC is based on NL, as it turns out that the origirral induction rules for DC are nrlt sclund when the DC is an extension of NL [130]. (A counterexample is given in
Calculus
inf 15) n,n/(-S).
hen H (t rue)
Strong Fairness
and
IR2
If /1(ffi) and 11(x) .+ H(x vVl'([s,l^x)) then 11(true)
,
,S' are statc expressions which are complete. 11 the Nl,-based Dc, the deduction theorem and relative-r:ornpieteness result can also be proved 1130] in a way similar to the proofs presented in Cliaps. 3 and 5. Completeness {br an abstract dorrrain can aiso be proved if we replace the above IR1 and IR2 by the c"'-r'ule. As a possible applir:ation cif the Nl-bascd DC, we introduce belorv some icleas about liow tr.i ()xpress state transitions, liveness ancl fairness in-ithin this
where
51 , 52, . . . ,
If
,51 clenotes
a request for a resource and ,92 denotes a response from the
resource, then strong fairness requires that if rcquests occur infinitelv often then responses rnust occur infinitely s16.r. This can be formulated as
inf (Sy)
+
inf (Sz).
Weak Fairness The following formula express the condition thal a state
sto.bili,ze(S)
State Tbansitions The atomic fornrulas\S andf S given irr Chiip.9 r:art lrt: rlr:firrtrrl irt llttr Nl-basecl DC. The dcfinitirxis iLrtr
\,s'orll,sll ..',
/,\
ll,\'ll
1
after some tilne:
logical fiamework.
11.6.1 State TYansitions, Liveness and Fairness
s stabilizes to s -
where
- O'n' llSl *
,
[Sl- = [l] v lf,Sl as in Sect. 10.3.3. rc
wcak fair.ncss 1,lrr:r'c will lrc t<'slronsrr flrrm slrt,lt'i.1.'i.,.r'(,\1\
:
1,lie
irt.l (,5'.').
for a lesourcc stabilize, then resoilrce infinitely often:
206
11.6 NL-Ba^sed Duration Calculus
11. Neighborhood Logic
I1.6.2 Example: Delay-Insensitive Circuits A delay-insensitive circuit is a circuit which can behave correctly regardless of the delays in its components. Its components may have unknown delays, which may even vary with time because of, for example, dependences on data or temperature. In [52], there is a DC specification of a delay-insensitive circuit and a proof of its correctness. This specification contains a free (global) variable for each component, denoting a changeable delay. The introduction of these free variables makes the specification and also its correctness proof rather clumsy. However, by applving the Nl-based DC, we can model delay-insensitive circuits succinctly. Let us use an example to explain the main idea. Figure 11.1 shows a delayinsensitive oscillator, which has an input P and an output Q and consists of a C-gate and an inverter with unknown delays.
C-gate
Fig. 11.1. A delay-insensitive oscillator The input P and output Q are modeled by state variables
P and Q, i.e.
P,Q , lfime -+ {0,1}. The behavior of the C-gate is: if -(P ++ Q) then I will take the value of after a delay, and if P <+ Q then Q will retain its value after a delay. This can be specified in the Nl-based DC as CG ; CGL A CG2 A CG3 A CGa,
P
where
CGt
= tr,([Pn-Ql + qo,[Al)
CGz = n.(lf-P^ 0l + o'o,ll-Q]) cG:t = tr,,([P A Ql + q,o,,ll(jl) OG4 e tr,([-/'A ,Q] + O,,O,,l[ .Qll).
207
The behavior of the inverter is: P will take the complementary value of after a delay. This can be specified as 1G I IG1 A IG2, where Q
IGt' n"(llQl + O,o,ll-Pl) IGz = l"(ll-Ql + o,o,[Pl). An oscillator is a circuit whose output cannot be stable:
oC = inf (Q) n tn|1-91
.
The above circuit is an oscillator no matter what the initial values of P and Q are. That is, we can prove
(CG^IC) +
OC.
12. Probabilistic Duration Calculus
12.1 Introduction This chapter provides a DC-based approach to the analysis of the dependability of real-time systems. For a safe gas burner, a flame detector designed to detect failure of the flame of the burner is necessary. However, no flame detector is perfect. That is, no flame detector will always be able to detect a flame failure immediately. The dependability of a flame detector can be described by a probability function that depends on time. Therefore, undesirable behavior of a gas burner with an imperfect flame detector may not be avoidable; the dependability of the gas burner relies on the dependability of the flame detector. In this chapter we shall use a probabilistic automaton to model a faultprone implementation of a system, where transitions are attached to (historyindependent) probabi,lity functions, following an idea presented in [45, 77]. We shall also develop a probabilistic extension of DC. Using this extension, called probabilistic duration calculus (PDC), we can calculate and reason about the system dependability of an imperfect implementation. This chapter is based on 186, 87, 89, 90] and concentrates on discrete time. Transitions of a (discrete-time) probabilistic automaton can take place only at discrete time points. Each transition of a probabilistic automaton is labeled with a constant p (0 < p < l), which is the probability of the transition occurring in one time unit. A continuous-time version is presented in 1221. In Fig. 12.I, a (discrete-time) probabilistic automaton to model an abstract implementation of the gas burner is shown. For the gas burner automaton, we assume that the gas and the ignition are turned on at the start, and that the gas remains on throughout the time period of interest. The ignition is ideal and instant, so that the flame is established whenever ignition is applied. However, the flame may disappear at any discrete time point, and cause a gas lcakag
12.2 Probabilistic
12. Probabilistic Duration Calculus
2t0
Pt
(:
Ptz
1)
Pz
(:
o)
Leak
NonLeak Pzt
Automata
2I1
t2.2 Probabilistic Automata A probo,bilisti,c automaton is a tuple
PA: (V,zs,r),
where
1. V is a finite but nonempty erclusiue and complete set of state variables, i.e.
Prt
Pzz
!ret
F,ig. 12.1-. Probabilistic automaton: abstract implementation of a gas burner
P€V and
In this gas burner automaton, p1 and p2 ate the probabilities of the gas burner starting in Nonleak and Leak, respectively. By assumption, the gas burner always starts in Nonleak, and hence Pt = r and p2: 0'plr is the probability that the flame keeps burning for another time unit, i.e. the probutritity for the gas burner to remain in Nonleak for another time unit. The probability that the flame fails in one time unit is p12, i.e. the probability for lh" gur burner to transit from Nonleak to Leak in one time unit. Therefore, 0
( prr < 1, 0 < Ptz I land
P11
p
2. rs
p"r(
1, 0
I
Pzt
I
1 and Pzr
*
P22
:
thr1sc axi
lo csl,irrrir,l,c l,lrc lrlolrtrlrilil,y I'lrir,1,1'lrc ttrrlttittrtttcttl,s rlf' will lrr,violir.l,r'rl lrv llrc itttl,ottt;tlotr sltowtl irr lfi11. 12.1.
mass functi'on and must
Ep6yrs(P) = 1. Note that rs(P) is the probability that the automaton starts in state P.
3.
r : V xV
-+ [0,1] is called the single-step'p'robabi,lity transiti.on fun'cti'on and must satisfy the condition
Eqqyr(P,Q) :1, forevery
1'
Given this automaton as an implementation of the gas burner, it is interesting to know the satisfaction probability of this implementa,tion with respect to the two design decisions (Des1 A Des2) in a given time period' with PDc, we provide axioms and rules to calculate and reason about such saLisfaction probabilities. The continuous-time probabilistic automaton described in [22] preserves the Markov property (i.e. the property of history independence), but assigns to each transition a probability of choosing this transition and a density function to determine the probability that the automaton performs the chosen transition in any time Period. In Sect. 72.2, we shall present a mathematical definition of a (discretetime) probabilistic automaton, and introduce the satisfaction probability of a Dc formula with respect to a given automaton. In Sect. 12.3, er set of axioms and rules will be established in or
: V -+ [0, 1] is called the ini,ti,al prohab'ili,ty
satisfy the condition
since
04
-e,
forany P,Qe Vand P#Q.
I Pn : I,
in Nonleak the gas burner can, in one time unit, make either an idle transition, thereby staying in the Nonleak state, or make the other possible transition to reach Leak. similarly, the probability that a missing flame remains undetected for another time unit is p22, and.the probability that a missing flame is detected in one time unit is Pzt, and we have
=+
PeV.
The gas burner automaton of Fig. 12.1 is a tuple
V,
r
ze and
PA: (V,r6,r), where
are defined as follows:
1. The set V is given by
-
1z
{Nonleak,
Leak} and
Nonleak <+ -Leak.
2. The initial probability mass function is given by rs(Nonleak)
: Pt:1 and rs(Leak) : Pz:0.
3. The single-step probability transition function is given by r(Nonl
l,
-
= ptt
p12,
r(l,r'irli, l,r';r.li)'l)2.t, r
(l,r,rrh,
Nrrrrl,r'irli)
'l)'tr
.
,
212
12.2 Probabilistic
12. Probabilistic Duration Calcuhrs
L2,2.1 State Sequence The behavior of a probabilistic aritomaton PA c:an be defined by its state seqlrences. Given a positivc integer f, a sequence of states in V
defines a possible bchavior of PA for the first t tirne units. The automatorr starts in P1 and rerna,ins there for one time unit. Then it rnakes a tratrsiticin from Pr to Pz and remains in P2 fcir another one time urrit, and so cln. It cunpletes f - 1 trarrsitions artd sti,rys in P1 for one time unit. For state sequcrlces strch as o, wc also use the notation
\Pt,Pz,..-,Pt).
p,(o)
o 0 < pl(o) 1!, for o EoEy, 1t(o) : l.
:
ro(PL)' r(Pt, Pz)'
"''
r(P7-1, P1)'
o
€Vt,
a'nd
Proof . The first part is obvious frorn the definitions of p,, ro and r. The second part can be proved by inducticin on f using the following facts:
yt-rt - VLV : {rr^o,
I o1
€Vt
Aoz e
V}
p((Ncinl,eak)):pr =1
] state sequen ces of length J" : : p; yr((NonLeak. Norrleak) ) P1 Prr l p((Nonl,eak,Leak)) : py p1,2: pt2 I state sequen ces of length p((Lcak.Nonl-eak)) : Pz' Pzt :0 t p1(Leak. Leak)) : P:' Pz'z: 0 ) yr1(Leak))-Pz:0
Note that the sum of the probabilities of all state sequences of length 1 is 1 and that thc sum of the probabilities of all state sequences of icngth 2 is 1. Irr fact, given anv length I ) 0, the surn of the probabilities of all state sequences of length f is 1, as we shall prove belorv. Given arr arbitrary probabilistic automaton PA: (V,r"0, T) 1 the probability function
I V* -+ [0,1]
P) :
il,' r\l't r./i) il,t
p@)
.
n 12.2.2 Satisfaction ProbabilitY
r r
0
(!'r,/f,,
ry', we
The statement that the forrnula t/ holds for a given state sequence o € V*.
The probability that
/
holds for all state sequences
in v"
rn''here
I is a
ilonnegalive integer'. To this encl, rn'e assume that PA starts at time 0 arrd we consider discrete interpretations over the state variables in V over discrete tirne intervals [0, t] fcir the first I time units. A state sequence o € Vt of PA determines the presence and absence of tiie state variables in L/ in the first f timc units, and thus defines a disr:rete interpreta,tion (see Chap. 6) of the state Variables in V in thc interval [0,1]. For exarnple, the state sequence
(Nonleak, Leak) dcfirrcs a cliscrete irrterprctation inherval [0,2], [
is definctl as follows:
(t 1,,,(/',) r(/i./r,)
Ep6y 1,t(o^
For a given probabilistic automaton PA: (V,r6,r) and DC formula shall define the following concepts in this section:
calculate
lt\(t)
a,rry
and
For example, for the gas burner autolnaton strown in Fig. 12.1, rve cart
lr
Furthermorc, l
for
l:0,
the state scquence is empty (written 0). Tlie probability that PA starts in Pr is defined by the mzrss function as ro(Pr), and the probability that PA makes a transition from fl to P,a1 is defirred by the transition function as r(P,, P,+r). Theteforc, the probabilitv p,(o) that PA follows thc behavior o is
When
21'3
Theorem l2.L For u,n'u PA: (V,ro,r) and non'negat'iue'intetler t,
PrPz"'Pt
o:
Automata
7 for Leak
(anr1 thus
for Nonleak) in thc
/tt li,r o<. l<1 II|orI- l..:'2.
l.'lrr,rr'llr,'r;rlrr,',,1 l,r';rlil ;rl llrr,r'rrrl ;roirrl ol l{l,ll i:l ittlllr':rtrl ;rtrrl tlill rr,rl llrr,lrrrtlr,,l;r l)('l.nultl:r,rvll ltrr.inlltvrrl ltl,:'}1 1,r,,tirllrl llr;rl l,r';rli
;rlli,r.t
,/i)
;rrr,l l\r,trl,,';rl,;tt,'llt,
rrttl\ r,l;tll't;tli;rl,l,'r'
trlti,lt,,,rtlt
tll lllr'lllllllll;t
214
12.3 Probabilistic Duration Calculus: Axioms and
12. Probabilistic Duration Calculus
We say that, T. is cons,isten,t with the above state sequence in the interval This gerreralizes easily to arbitrary state sequences' [0,2]. ' A DC forrmrla ry' is called av-formula if @ contains onlv state variables in v, and does rrot contain temporal propositiorlal letters. The truth of 95 is therefore inclependent of the interpretation of temporal propositional letters and of state variables outside V. Fcir any v-formula @, value assignrnent v aild state sequen(:e o e J,rt, we say
that $
for o
hold,s
r,v,lo,tl
giuen' V,
written
o,V l:
Q,1f
c o,
where Z is any discrete interpretaticin consisterit with o for the state variables
in V in the interval [0,1]. In the follclwing text we shall always refer to an arbitrarily given value assignment, but, for simplicity, we shall not mention it explicitly' ihe probabil'ity tho't PA satisfi'es a V-form'ula $ ouer the i'n'te'rual l],t], denotecl bv p(d)lt], can be defincd as the sum of the probabilities of state
I
and satisfv /' scquences in of state Let Vt(O) be the set
sequences which are of lerrgth
Vi
which satisfy
@;
thcn
consider the probabilistic automaton PA defined in Fig. 12'1- The first design decision (Des1) for the gas burncr,
r(lfleakl
=+ !' < I)
is a V-formula, where J,r
-
{Nonleak,
Leak} and Nonleak g
-Leak
'
The set of state sequences of length 2 satisfying this formula is
:
{(Nonleak, Nonleak), (Nonleah, Leak), (Leak, Nonleak)}, and we have the result that tire satisfaction probability overr the interval [0,2] V2
(nes1)
is
p'(Des1)l2l: p, 'Ptt
*
Pt 'Pt'z
t Pz'pzt : I '
So the gas burner automaton shown in Fig. 12.1 represents a fully depcndable implerncntation of thc gas burner in thc first two time lrnits as far as the first design decision is coricerned. Si'ce (Vi,p) is a probabilistic space (Thec-rrern 12.1), thc following tlrtrrirem follows frcim thc defirrition of ihe satisfiltrti
Theorem 12.2 For rt,rr,'u I'''1 u'rtl' l)'"(l'
t 0 1- 1r(rfilll < l, .litr rr'rtt1 l . yr(lrrrr')l/l I
.[rttttttt'l'rt' 'l'
215
12.3 Probabilistic Duration Calculus: Axioms and Rules In
accordance
with the defirrition of the satisfaction probability given in
Sect. 12.2, this scction proposes a set of axioms and rules to calcula,te and reason about p,(4r)ltl with respect to an arbitrarily given probabilistic automaton
PA and V-formula /. Since il(/)[l] is a real number and J is a nonnegative integer, PDC is an exterrsion of real arithmetic and integer arithmetic. PDC is also an exterrsion of cliscrete-time DC u'hich can derive properties of V-forrnulas. The proof systenr for PDC presented here is not cornplete, but [40] provides a complete calculus for a probabilistic neighbor'hood logic.
12.3.L Syntax Syntacticallv, PDC extends real and integer arithructic with p(/)[t] as the additional terrns, where / ranges over the V-formulas of a given PA.
For exarnple, the following formulas are well-formed formulas of PDC with rcspect to the gas burner autornaton: 1.
tt?Dttl ? Eoev,(ilp(o).
Rules
p(GbR.er1)lt] - p, which expresses the condition that p is the probability that the gas burncr autclmatorr satisfies the requirentent itr the first t tirne
rrnits. ( (- Gb Req)ltl < p (- D e s y)ltl 1' p, (- D e s 2)lt] ), which expresses the condition that tire probability of violation of the requirement of the gas burrrer automaton is not greater than the sum of the probabilities of violation of tlie two clesign decisions. 3. Yt.(p(GbH.eq)ltl : 7 p"(-GbRe(l)ltl), which expresses how to calculate the satisfaction probability of the requirernent frorn its violation proba-
2. Y t.
11,
bility. In these exarnples, I is regarded as a global variable ranging ot'er nonnegative integers.
By proving the truth of the last tw-o fcrrmulas (2 and 3) above, one can estimate the dependability of the gas burner autornaton through tiie calcuIation of vioi:r,tion probabiiitics of the design decisions. hr the following, we shall use R,(p(il, t'bli)) as trn allbrcviation of Y
t. R
Q
t(
Oltl, 1,(r/) [r] ),
/i is ;r tcl;rliotr o{';ttillttttcl,itr. l,irl r,x;rrrlrl,,. llr,li,rrrrrrlirs 2;rrrrl ll;rlrovc t:;rtt
n,lrt'r'r'
1tl '(iltli,,1)
lrltiltlir,ll
I
1tl'l),;;r) I 7r( l)r';;') 1tl Iiltlitrl)
lrrr
rtlrlrtcviitlt'rl
a,s [trll
216
12.3 Probabilistic Duration Calculus: Axioms and
12. Probabilistic Duration Calculus
The axioms and rules of real arithmetic, integer arithmetic and Dc are taken as axioms and rules of PDC, as PDC extends these logics. In the following sections we list the additional axioms and rules for p, and assume that all formulas appearing in the scope of p' ate V-formulas' The proof system is presented in two parts, where the axioms a,nd rules in the first part are generic, and can be applied to any probabilistic automaton, while the axioms and rules in the second part are specific to a given automaton.
I
P(true)
:
t'@) +
F?6)
PA4
p'(GbReq)
- 1-
hold for the
sequences of length same sequences.
PA5
L'@)ltl
:
p(O
t !. :
l, the formulas / and (O A (. : t)
t)lt).
:
p(true
n(.:t)[t]: pt(L: r)lt] : t.
Furthermore, using PA2, we have
The additivity axiom of probability theory holds for PDC'
t'@v
p(Ir)ltl:a'
p(true)[l]
tt'(-GbRert)'
PA3 p(il + t QD :
p((^: t\t): r '
PDC2
Proof. From PA5, PA1 and PDC1, we have
: t.
From PA2, we can straightforwardly derive
p,Q
I t)ftl : r - p(t : r)[t] : o. n
rl') + P@ n'Q)'
A formula / holds for a state sequence of length i if and only if the formula : d) holds for any extension of the sequence to a length (f + d), where d is a nonnegative integer.
The satisfaction probability is monotone.
(d^ t
If $ =+ Ty', then P(il S tt(l')'
The following theorem can be easily derived from the above a,xioms and rules.
PA6
p(O ^ tl
:
d)
[f +
6]
:
p(illtl
.
Using this axiom, the following theorem can be proved.
: g. 2.0
PDCs
3.t@vjr) < 1t($)+u@).
Proof.
1. p(false)
PDCl
PA4 1 rr(d nth) S pk!) p(il + u(4') : tL(Ov 4') + p@ PA3 t. p(il: 1 * t'@v Ib) < p(d) ^rb) PAl, t1 +. p@) - 1 * p(O > t'(1,) ^$) p\h) 7.,4. 5 p,(d:1 * p(6A$): z.
Using this axiom, the following theorem can be proved.
1.
For any interval, S and -$ form an exclusive partition of all state sequences of any probabilistic automaton.
PA4
Proof. The proofs ofthe first five cases are trivial. The iast case can be proved as follows:
If we consider state
The DC formula "true" holds for state sequences of a1y probabilistic automaton in any interval.
PA2
217
n
12,3.2 Proof Systern: Part
PAf
Rules
4. If -(4) A iy'), then Lt(Ov ',lt) : p@) + lL(|,)5. If O e iy', then p(il : p\b) a. p(il : 1 * p(O A r!) -- t'(Ib) . .
p((O
^
l : t)^t/')lt+ dl <
p,@)ltl.
t'(@ t: t)^$)[t + 6] p(@ ^t (.: t)^1b A !.: t t d)[r + d] PA5 p(@ t, ! : t) ^ (rl,n l : d))[r + d] PDCI PA4 1 t'kh A ( = t) ',-f: d)[r + d]
: :
=1t,(tltn(-t,)ltl ,=
/,(,r)l/l
PA6 ['A]-r. t-J
218
12.4 Example: Gas Burner 2Ig
12. Probabilistic Duration Calculus
L2.3.3 Proof Systern: Part
In [90], PDC is extended with classical probability matrices, and the sat-
II
isfaction probabilities of many useful DC formulas, such as
The axioms and rules in this section refer to an arbitrarily given probabilistic automaton PA. We shall use the abbreviation
llPll' .
[Pl
^
t:7.
p(n_([Pll ^figl)), /,(o([P-ll ^ llQl )) , p(@ (true ^ IlPl )) ^ [8-ll), p(@ ^ (true ^ [P])) ^o [8] ) , ^
P([Pl')[1] : ro(P)'
For the transition probability function
PA8
It 6 =+ (true ^ liPl rhen 1r($^
r
of PA, we have
can be computed using matrix scalar products.
)
[8lt)[t + 1] : r(P,Q) ' tt@)lt).
L2.4 Exarnple: Gas Burner
Using these two axioms, we carl prove the following theorem'
1. re(P) :0 + /r(llPll^d):0. 2. r(P,Q) :0 + P(4^[P'11^[Ql'):0
PDC4
proof. The first part can be proved as follows. Let us assume r6(P)
I)
: [
3n4
1. From PA7, we can derive
pfllPl')[r]
:
p(n-[Pl), p(ollPl),
We refer to Sect. 7.2 fot the definition of lfPl'' For the initial probability mass function ol PA, we have
PA7
p(true^[P-llt),
In this section, we use PDC to give an estimate of the violation probability of GbReq with respect to the probabilistic automaton shown in Fig. 12.1. In obtaining this estimate, we assume that the time unit is one second, and we often reason informally in order to focus on the main ideas. Since
o;
(DeslADes2)
then
+
GbRerl,
we have
/,(llPl ^,il1t)
: /,(llPl'^([ I v [lPl) ^O)lt] PDcl
/r([Pl')[1] -0 When t :0, we have <
-GbReq
PDC3
Then, using PA4 and PDC1, we obtain
PA7.
p,(-GbReq)
/,(llPl ^d)tol = /,(([Pl ^d)^ (l:0))[0]
: p(false)[O] -0
PA5 PDC1
PDCI.
For the second part, let us assume
r(P,Q):0'
When
t)
1, using PAS we
p@^[Pl^[Ql')[t] : :
Therefore, the sum of the violation probabilities of the two design decisions is an upper bound on the violation probability of the requirement. In the next'two subsections, we use the proof system of PDC to derive recursive functions for the computation of the violation probabilities of the design decisions, i.e. we give programs (in terms of recursive functions) for computing pr(-Des1)lt) and p"(-Des2)[t] and prove the correctness of the Hence, using these programs, we can estimate the violation probability of
0.
0, we can follow the same reasoning
p(d,^liPl ^[0]lr)lol
S Lt(-DestV -Desz) I lt(-Dest) -l 1.t(-Des2).
p1'ograms.
can derive
when I
* (-Des1Y -Des2).
a,s
for tile first pil,r:t to llrrlvtr
= o.
the requirements as p(-GbReq)lt) < 1t(-De.s1)[f] + p'(-Des2)ltl. Thc
s l)t't2 l)r':t
|l
ll ", ( < 1) Il((lll,r,;rkfl ll ,l,cll:10). l l( ll l,r';rk
220
12.4 trxample: Gas
12. Probabilistic Duration Calculus
However, for the discrete-time domain, the second design decision, i.e. that the distance between two leaks is not less than 30 seconds' must be reformulated by taking into account the fact that each leak lasts for at least one second:
r((flLeakl ^if-Leakl ^fl,eakl)
+
('
> 32).
p,(-Des1)lt +
tr1(-Desr^
!.: l)lt + 1] :
fi
1)
p((Des1^(.: l) n-Dest)lt*
1], we expand Desl and exploit
the fact that
P]
(Des1- 1.: 1) A -Desr <+ (ffLeakl2 v (Des1^lf-Leakll ^lfl,eakl2)).
can be defined recursively by the program:
/'(o) - o /'(1) - o
From PDC1, we obtain
o
fi (r) ! pn'
Pzz'
and that the auxiliary function
n(t
gr
p,((Desl ^ !. : 1) n -Des1)[t
- L), fot t ) 2,
: p(lfl-eakl')[t + t] t
carr be defined recursively bv the program:
sr(o) - o
gt(1) - 1 gr(2) : Ptr gt(t I !) : pry Sr(t) + Prz' Pzy St(t -
1]
^ [L"uk]l')[t + 1]
,
and from PDC4 and PA8 we obtain
:
1), for I
)
2.
is easy to see that fi and 91 terminate for any natural number We now use PDC to prove that they compute the correct functions' We shall exploit the fact that
where
t)
0.
-Dest e O(lfl,eakl A l>1). The formula Desr is violated in the interval comprising the first I -F 1 time units if and only if Dest is violated in the first f time units or Desr holds for the first I time units but is violated in the full interval comprising the t * 1 time units: <+
+
p,(Des1^ ll-Leakll
p((Des y ^ (. :
It
-DesrAl:t+l
1t(-Des1)[t].
In the rest of this subsection and in the next subsection, we shall often apply the following expansion of J$:
To calculate
fr(2) .h(t +1) :
1],
u@ <+
p(Des1^ [f -Leakl
We show below that
Il
. ( (ll.ll ^@) \ \u iitiO^'lf-Leakl') v (nd-fLeakl'D nnil)'
11,(-Des1)ltl
and
:
The two formulas on the right-hand side above are mutually exclusive.
and from PA6 we have
Here we establish a recursive function to calculate p"(-Desl)lt]' In order to calculate p(-Des1)lt), we shall need an auxiliary function. Let
gr(t)
22L
Frorn PDC1 and PA5, we have
: F(-Desr^l: l)lt + 1] + p,((Des1^1.: l) n -Desr)[t *
12.4.1 Calculation of P'(-Des1)
ft(t) :
Burner
( ((-D"t,-( l)Al:r*1) \ \v 11n,.', ( - l)A .l)r'.sr A( : I I 1) )
l) n -Des1)[t + 1] prz .p22 . 1l(Desr ^ ll-Leakl t)[f
f)
-
1]
,
2.
In order to calculate p,(Des1^ lf-Leakl 1), we establish the expansion
/ lf-Leakl'
(Des1- rf-Leakr
\
lfl;:fi[-fi11]u\" - -Leaklr)/ lf-Leakl' \v
) <+ I v
1.a.r,
^
^
liLeaklr
fl
Using PDCI, we obtain pr(Des1^ lf-Leakl l )[t +
1]
/ t,(lf-Lcaklltlpr t1 t t] I r l,( l)t's1 - Ii-Lcakll'?)[t I ' l,(ll l,t';rli flr - Il-l,t';rkll I )[t + ll \ t1r(/),'s1 ll 'l,t';rliflr ll,r';rlilr
lf .lxraklr)[t
, ,,)
I
222
12. Probabilistic Duration Calculus
12.4 Example: Gas
Furthermore, from PDC2, PA8 and PDC4, we have the result that
yr(Des1^
/ = \* when J ) 2.
f-Leakll)[t + 1] P' ' P'\Des 1 lf -Leakl ' )[/] ' 'P21 ' P\Des, - lf-Leakl')lt 0,,
we ca., now establish the recursive cases for we have the result that p,(-Des1)lt +
1l
fi
Burner
12.4.2 Calculation of p(-Des2) The calculation of p(-Des2) can also be done recursively. To establish this, we show that the functions
\
)
- p,(-Des2)lrl : sz(t) p,(Des2)ltl fr(t)
and
91
, since when
I
)
2,
h2(t) k2(t)
: :
p,(Des2 A
1)) [i] 1))
(Des2^ f-Leakl
1"r\Des2 A (Des2
^
lfl,eakl
[t]
can be defined by mutual recursion as follows:
7l
( 111-Des 1)ltl ^ = \ n O,, ' Pzz' H(Des1 f-Leakl'
)[/
\ - t] /
'
p(Dea^ lf-Leakll)[t + 1] ' 1t(Desr - [-Leak-Jlt)l/] ( = \ * P'" 0,, 'Pzt ' lt(Desl lf-Leakl')lt -
e e
: (lnrt,l + k2(t) ifr:o olherwise I
ifr=o
(o
hr(f) :(1 t)
\ )
'
which establishes the recursive case for 91' In order to establish the base cases for fi and 9r, w€ observe first that 1. (-Desr n (1= 2)) 2. (-Des1 A (l < 1))
fr(t):r-s2(t) 9zu)
which establishes the recursive case for /1, and
ift:l lprt'hr(t * 1) + pzy kz(t - 1) otherwise (O ift:0orf:1 k2ft) : 1 ptr. kz(t -l) + p'rr" - p,., tf 2 < t <32 * ' p?? prr kz(t 1) ' hz(t if 32 < t. 30) + lpzz In this case also, it is not difficult to see that these programs all terminate for any natural number , > 0. We shall now prove that they compute the
lfl-eakl2 false
t) fi-Leak] n l{ :211 \ ^ 11oesr( -Leak .'' ^ t p-Leakll I v [-Leakl2 )/ ll \ <+ l 4. ((Dea ^ f-Leakl l) A (l' :1)) e f-Leakl 5. ((Des1^lf-Leaklt)n (l:0)) <+ false'
(
correct functions. The recursion formula for /2 is easy to justify, since from PA2 we have
lf
p(-Desz) - 1-
p,(Des2).
In order to justify the recursion formula for 92, we expand
Des2:
We can derive the following using PA5:
t.
1,r\-Des1)12]
: :
O
: 0 l) pt,. Z. 1t(Des1^ f-Leakl 12] = 4. p(Desy^lf-Leaklt)[1] :1 5. p'(Des1^lf-Leakll)[0] =O 2. p,(-Desr)lLl
223
1t(-Des1)[0]
PDC4 PDC I PDC1, PDC4, PAS, PA7 PA7 PDC1'
These account for all the base cases of /1 and p1, and we have now shown how to calculate the violation probability of Dest with respect to the imple-
mentation shown in Fig. 12.1.
(Des2
A/ > o) <+
Gi\z::;i"z::
[;"'Jiil,nr,,)
By using PDC1, we obtain 1L\Des2
A (. >
0) :- (
\+
A
(Des2 [-Leakl
' ))
'\Des2 trt(Des2 A(Des2-lfleaklI))
whir:h establishes the recursive case for 92. For the tra,sc r:a,se for 92, we must show
\ )'
that p(Des2)10): t.
224
225
which establishes the recursive case for h2. We leave the base cases for the
Since
reader.
p(l:0)l0l :1
To establish the two recursive cases for k2, we assume lhat expand Des2 as follows:
by PDC2, and
l: 0 + holds in
Burner
12.4 Example: Gas
12. Probabilistic Duration Calculus
Desz A (Des2
Dc, the base case can be established by using PA4 and PDc1,
as
we have
To establish the recursive case for h2, we assume that the length of the interval concerned is not less than 2, i.e. l) 2, and expand Des2 as follows:
l) Desz A (Des2^ ff-Leakl A \De:s2 \Des2
^ lf -Leak ll2 )) \ A(Des2lileaklt - p-t eaklrl)/ 1att,
'' \ v 1l"rr
1)) 1r(Des2 A (Des2^ lf-Leakl P'\Des2 A \Des 2 f-Leakl2
A(Des2- lfLeaklt
))
Desz A (Des2-
lf-Leakll)
)
\
Case: 2
es
:
^ lfl,eakl'?)) [t] p22.pt(Des2 A(Des2^lfleaklt))[,
A(Des2^ f-Leakl2) l t)) ^ (Des2 A (Des2^ f-Leakl fl-Leakl
<
!.
< 32. In this case we have
^ fl,eakl 1 ^ lf -Leakl 1) l (Des2 A (Des2 ^ flLeakl i)) ^ ll-Leakl '
)
(Des2^f-Leakll ^lfteat<11))[l] : pt - plt2
trr(Des2 A (Des2
as
pr
Case: !.
2, we can derive
)
'
[t]
-
1] + pt
:
1. Tiris establishes the first recursive case for 32. In this case we have
c
^ - [-Lt'r'kl')[/]\ : ( pllDcs2 A (Drs2 [l-Lt';'l<-Tlr))- [-l't'lklr;lt] ) \+ 1((Dt:s2A(l)t:s',- lfl,r';rkl')) ll\ ( t,,,' 1r(l)ts'; A(l)r's., ll l,t'rrkllr))lt \ , /,r, ' 1t(l)t's'; A ( /)r"v, ll l,r';rli llr))lt ll )
1))
pzz. 1l(Des2 A (Des2^ ffl,eakll))[t
Des2 A (Des2
)) [t]
^ fleakl
^ -Leakl 1 ^ lfl,eakl [f
((Des2 A (Des2^
.
ptz
r' .pt", k2.
1)
lf-Leaklt)) ^ [-Leakl2e ^ fl,eakll)
;r,rrrl, l,lrtrtrrirt c, a,lso
ltll)t's,; A (l)cs.,
[ .l,rrrlh'llr [lrrahllr))f/l .1r1" 1t,(l)t's,; A (/)r's,, ll l,r'rrkllr))l/ 1rir,'
.
< t < 32, the
and
Des2 A (Des2
l
A(Des2^ff-Leakll ^ lfteaklt)) <+ (f-Leakl ^ lfl,eakll)
pt(Des2 A
:
f
,
1].
result that
and
^ f-Leakl
-
Hence, by PA5, PDC1, PA7 and PA8, we have, when 2
#
p,(Des2 A (Des2
fl,eakll))^lfl,eakll
2 A (D es2
(Des2
Des2,
So, by use of PDC1 and PA8, when
1Det, A(Des2^
CASES:
-1;-teaklr))/'
lf-1,s3t1
c
lfl,eakl\ c
2. If Des2 ends with (fl-Leakl 1 ^ fl,eakl 1), then in order to keep Des2 (i.e. I ((lfl,eakl ^ f-Leakl ^ flLeakl ) + | > 32)) true, we must consider two
since Des2 is a constraint about the distance between two leaks, and the last t is irrelevant to this constraint' Thus, we have occurrence of Des2
\ ^ r - lfleakl'zll li-Leaklr lf t-eakl lt /
since both fl,eakl2 and lileakll are regarded as a single gas leakage and have the same effect on the truth of Des2. Hence, by PDC1 and PA8, we have, when t ) 2, the result that
However, in DC we have the result that
(Des2-'
A (Des2
We consider the two cases in the above disjunction:
p,(D
Hence, by PDC1,
: ( p1l.t, \+
1)
I. If Des2 ends with lfl,eakl 2, then we can prove in DC that
| : rr(l = 0)[0] < pr(Des2)f}l < I.
€. ( [v
lfl,eakl
^ lnesz A(Des2
(
Desz
^
l, ) 2 and
;l()l
12. Probabilistic Duration Calculus
226
References
and trt(Des2 A
=
( \+
(Des2^ lfl,eakl 1 )) [t] pr, ' p(Des2 A (Des2 ^ fleakl t ))[f r?? 'pp'
1t(Des2 A (Des2
- 1] - f-Leakll))[l -
30]
\ )
'
which establishes the second recursive case for kz. We leave the base cases for k2 for lhe reader. In [90], the recursions required to calculate pt(-Dest) and p,(-Desz) were derived in a more direct way by using probability matrices and the satisfaction probabilities of a set of useful DC formulas. The dependability of a communication protocol over an unreliable medium [45] was also calculated
in
feOl.
1. Allen J.F. (1984) Towards a General Theory of Action and Time' Artificial Intelligence 23:123-154
2. Chetcutiserandio N., L.F. del Cerro L.F. (2000) A Mixed Decision Method for Duration Calculus. Journal of Logic and Computation, 10(6):877-895
3. Alur R., Courcoubetis C., Dill D. (1990) Model-Checking for Real-Time 4.
Sys-
tems. In: Fifth Annual IEtrE Symposium on Logic in Computer Science. IEEE Press, Piscatawav, NJ, 414-425 Alur R., Courcoubetis C., Henzinger T.A., Ho P-H. (1993) Hybrid automata: An Algorithmic Approach to the Specification and Verification of Hybrid Systems. In: Grossman R.L., Nerode A., Ravn A.P., Rischel H. (Eds.) Hybrid Systems, Lecture Notes in Computer Science 736. Springer, Berlin, Heidel-
bery,209-229
5. Alur R., Dilt D. (1992) The Theory of Timed Automata. In:
de Bakker J.W., Huizing C., de Roever W.P., Rozenberg G. (Eds.) Real-Time: Theory in Practice. Lecture Notes in Computer Science 600. Springer, Berlin, Heidelberg,
45,73
6. Alur R., Dill D. (1994) A Theory of Timed Automata. Theoretical Computer Science 126:45-73
7. Alur R., Feder T., Henzinger T.A. (1991) The Benefits of Relaxing Punctuality. In: Tenth Annual ACM Symposium on Principles of Distributed Computing. ACM Press, New York, t39 152 8. Barua R. (2003) Completeness of a Combination of Neighbourhood Logic and Temporal Logic. Formal Aspects of Computing. To appear
9. Barua R., Roy S., Zhou C.C. (2000) Completeness of Neighbourhood Logic. Journal of Logic and Computation 10(2):27I-295 10. Berry G., Gonthier G. (1992) The Esterel Synchronous Programming Language: Design, Semantics, Implementation. Science of Computer Program-
ming 19:87'152 11. Bird R. (1976) Programs and Machines. Wiley, London 12. Braberma.n V.A., Dang V.H. (1998) On Checking Timed Automata for Linear Duration Invariants. In: Proceedings of the 19th IEEE Real-Time Systems Symposium. IEEE Press, Piscataway, NJ,264 273 13. Chakravorty G.,Pandya P.K. (2003) Digiiizing Interval Duration Logic. In: Hunt Jr., Warren A., Somenzi F. (Eds.) Computer Aided Verification (CAV 2003), Lecture Notes in Computer Science 2725. Springer, Berlin, Heidelberg,
167 179
14. Chan P., Dang V.H. (1995) Duration Calculus Specification of Scheduling for Ta"cks with Shared Resources. In: Kanchanasut K., Levv J.-J. (Eds.) Asian Computing Scicnce Conference 1995, Lecture Notes in Computer Science 1023. Springer, Borlin, Htri
228
R,eferences
229
Relerences
15. chellas B.F. (1980) Modal Logic: An Introrluction. cambridge tlniversitv Press, Carnbriclge
16. chcn 2.J., wang
J., Zhot c.c. (1995) An Abstraction of Hybrid control
Systcms. In: IEtrE Singapore International Conference on Intelligent Clontrol
and Instrumentation. IEEE Press, Piscatarvzry, NJ, 1 6 17. Dang V.H. (1998) Modelling and verification of Bipha,se lVl:r,rk Protocols in Durition Caicul's using PVS/DC-. In: Application of Concurrcncy to Systcm Design (CSD'98). IEEE Press, Piscatar'-ay, NJ, BB 98 1g. Dan[ V.H., Guclev D.P. (1999) Completencss and Decidability of a Fragmeni of Duration Calculus rvith ltcration. In: Thi:rgarajan P'S', Yap R" (Eds') A
IEtrE Press, Piscata;u'ay, NJ, 4 15 20. Dang V.H., Phan H.G. (1996) A Sarnpling Semantics of Duration calculus.
J"onsson 8., Pa,rrow J. (trds.) Formal Techniques in Real-Time and Fault Tolerant Syste[ts, Lccture Notes in Computcr Science 1135. Springer, Bcrlin, Hcidelberg, 188 207 21. Dang V.fi., $ru"g J. (1996) On f)esigt of Hybrid Control Systcrns usiilg I/O AutJrnata Model.i. In: Chandru V., Vinay V. (trds.) Foundations of Software Technology and Thcoretica,l cornputcr Science, Lecture Notes in computer Science 1180. Springcr, Berlin, Hcidelberg, 156 167 22. Dang V.H., Zhou c.c. (1999) Probabilistic suration calculus lbr continuous Timc. Forrnal Aspects of Comprrting l1(L):21 44 23. f)ierks H. (2003) cornpa,ring N{orlel-checking and Logic:rl Rea,soning for Rea'lTime Systerrs. Formal Aspccts of Cornputing. To appear 24. Dierks H., FehnLer A., Nlader A., Vaandragcr F.W. (1998) operational and Logical Sernantics for Polling Real-Timc systems. In: R.avn-A.P., R.is
In:
2g. Emer.son E.A., Lci c.-L.(1985) \,{od:r,lities for Model checking: Branching Tinre strikes Back. In: 12th symposium on Principles of Programrning Langu?iges. ACM Prcss, New York, 8'1 96 30. Eng"el M., Kubica M., \,{aclev J., Par'as D.L., R.av' A'P , v^n Sr:h.rrwc' A"J' (1g'g3) A Formal Approach to Computer Systcrns R.ccptit
Engel N{., Rischel H. (1994) D:rgstuhl-Seminar Specification Problem -'a, Dtrration Calculus Solution. Technical report, Derpartment of Computer Scierce, Technical Univcrsity of Denmark, Lyngbv Frdnzle M. (1996) Svnthesizing controllers from Duration calculus. In: ,Jonsson B., Parrorn J. (Eds.) Formal Techniques in R.eal-Time and Fault-Tolcrant Systems, Lecture Notes iil Computer Scicnce 1135. Springer, Berlin, Heidelberg, 168 187 Frtnzle M. (1997) controller Design fiom Temporal Logic: Undecidability Need Not Matter. PhD thesis, Institut fiir Informatik und Praktische IVIathematik der Christian-Albrechts-Universitet Kiel, Germany 31 Frrinzle M. (2002) Take it NP-Easy: Bounded Nlodel constnrction for Drrration Calculus. In: Damrn W., Olderog E.-R.. (trds.) Forrnal Techniques in Real-Time and Fault-Tolerant Systems, Lecture Notes in Computer Sr:ience 2,169. Springer, Berlin, Heidelbcrg, 245 264 .)J. FYdnzle \,'I. (2003) Nlodel-Checking Dense-Time Duration Calculus. Formal Aspects of Computing. To appeiu 36 Gao J.P., Xu Q.W. (1999) R,igorous Design of a Fault Diagrrosis and Isola,tion Algorithm. In: Antsaklis P.J., Kohn W., Lemmon M., Nerodc A., Sastrv S. (trcfs.) Hybrid Systerns V, Lecture Notcs in Cornputer Science 1567. Springcr, Berlin, Heideiberg, 100-121 George C., Xia Y. (1999) An Operational Semantics for Timed RAISE' In: Wing J., Woodcock J., Davies J. (Eds.) World Congress on Formal Methods (FM '99), Lecture Notes in Computer Scicrce 1709. Springcr, Berlin, Heidelberg, 1008 1027 3B Guclev D.P. (1998) A Calculus of Durations on Abstract Dornains: complete-
31.
ncss ancl Extensions. UNU/IIST R.eport No. 139, Ilternational Institute {br Software Technology, Macau 39. Guelev D.P. (2000) A Complete Fbagrnent of Higher-Order Duration g,calculus. In: Kapoor s., Prasad S. (trds.) Foundations of Software Technologv ancl Thcoretical comp[ter Scicnce, Lecture Notes in computer sr:ience 1974.
Springer, Berlin, Hcideiberg, 264 276 Guelc" D.P. (2000) Probabilistic Neighbourhood Logic. In: Joseph M. (Ed.) Formal Techniqucs in Real-Time and Fault-Tolerant systcms, Lecture Notes in Computer Science 1926. Springer, Berlin, Heidelberg, 264 275 47. Guclev D.P., Dang V.H. (1999) On the Compietcness and Decidability of Duration Calculus with Iteration. In: Thiagzr.rajan S.' Yap R,. (Eds.) Advanccs in Computing Science, Lecture Notes in Computer Science 1742. Springer, Berlin, Hcidelberg, 139 150 42. Guelcv D.P., Dang V.H. (2002) Prefix and Projection onto State in Drrra'tion Calculus. In: Asarin E., Maler O., Yovine S. (trds.) Electronic Notes in Theoretica,l Computer Science 65:6. Elsevier, Amsterdam 43 Halpern J., Moszkou,ski B., Nianna Z. (1983) A Hzrrd.nare Semantir:s bascrl on Temporal Intervals. In: Di:r,z J. (trd.) ICALP'83, Lecturc Notes in Cornpulcr Scicnce 154. Springer, Berlin, Heideiberg, 278 291 ,1,1. H:r,lpcrn J.Y., Shoham Y. (198G) A Propositional Nlodal Logic of Time Intervals. In: Proceedings of the First ItrEE Syrnposium on Logic in Computer Sciencc. IEEE Press, Piscatawav, NJ, 279 292 .15 FJa,rrscn H., .lonsson B. (1994) A Logic fbr R.easoning :rborr.t Time anrl R,eliaIrililv. l,'orrrr;rl Asp
40.
230
References
References
M.R. (1994) Nlodel-Checking Discrete Duration Calculus. Formal Aspects of Computing 64:826 845 48. Hansen \4.R.., Pandya P.K., Zhou C.C. (1995) Finite Divergence. Theoretical Computer Science 138:113 139 49. Hansen M.R., Sharp R. (2003) Using Interval Logics for Temporal Analysis of Securitv Protocols. In First ACM Workshop on Formal Methods in Security Engineering (FN{SE'03). ACNI Prcss, New York, 24 31 50. Hansen M.R.., Zhou C.C. (1992) Semantics and Completeness of Duration Caiculus. In: de Bakker J. W, Huizing C., de Roever W.-P., Rozenberg G.
47. Hansen
(Eds) Real-Time: Theory
in Practice, Lecturc
Notes
in Computer Sc:icnce
600. Sprirrger, Berlin, Heidclberg, 209 225 51. Hansen NI.R., Zhou C.C. (i997) Duration Calculus: Logical Foundations. Forrnal Aspects of Computing 9:283 330
J. (1992) A Real-Time Duration Sernantics for Circuits. In: TAU'92: 1992 Workshop on Timirrg Issues in the Specification nnd Synthesis of Digital Systems, Princeton Univcrsitv, Princt'-
65
Hopcroft J.E., Uilman J.D. (1979) Introduction to Automata Theory, Lan-
66.
gtages, and Computzrtion. Addison-Weslev, R,eading, Massachusetts Hughcs G.E., Crestwell M.,I. (1968) An Introduction to Modal Logic. R,outledge, London
67. Huizing
i).1.
54.
55.
56.
57.
58.
59.
60.
Harel D. (1987) Statesharts: A Visual Formalism for Complex Systerns. Science of Computer Programming 8:23L 274 Harel E., Lichtenstein O., Pnueli A. (1990) Explicit Clock Temporal Logic. In: 5th IEEE Symposirim on Logic in Computer Science. IEEE Press, Piscataway, NJ, 402 413 He J.F. (1994) Ilom CSP to Hybrid Systems. In: Roscoe A.W. (Ed.) A Classicai Mind: Ess:tys in H6nour of C.A.R. Hoare. Prentice Hall Intern:rtional, London, L77 790 He J.F. (1995) Provably Correct Systems: Modelling of Communication Languages and Design of Optimized Compilers. McGraw-Hill, New lbrk He J.F. (2000) An Integrated Approach to Hardware/Softrn'are Co-design. In: Yulin Feng, Notkin D., Gaudel NI.-C. (trds.) ICS 2000, 16th IFIP World Cornputer Congress 2000. Publishing House of Elcctronics Industry, Beijing, 11 16 He J.F., Bowen J. (1992) Time Interval Semantics and Implementtr,tion of a Real-Time Progr:rmming Langrrage. In: 1992 Euromicro Workshop on RealTime Systems. TEEE Press, Piscataway, N'I, 110 115 He .1.F., Verbovsky V. (2002) Integrating CSP and DC. In: Proceedings of the Bth IEEE International Conference on Enginecring of Complex Computcr Systems. IEEE Press, Piscatawa5', N,l, 47 54 Hc J.F., Xu Q.W. (2000) Advanced Fcatures of the Duration Calculus. In: Davies J., R.oscoe B., Woodcock J. (Eds.) \.'Iillennial Perspectives in Computer
Science. Palgrave Macmillan, Houndmills, Hampshirc, 133 146 61. He .I.F., Xu Q.W. (2000) An Operational Semantics of a Simulator Algorithm.
In: Arabnia H.R. (Ed.) Prococccdings of thc International Conference on Paral1cl and Distributed Processing Techniques :r,nd Applications. CSR,EA Press, Las Vcgas, 203 208
W.D., Zhou C.C. (1995) A Case Study of Optimization. Thc Computer Journal 38(9):734 746 63. Hoenicke J., Olderog tr.-R. (2002) CSP-OZ-DC: A Combination of Spccific:rtion Tcchniqlcs for Processes, Data ancl Time. Nordic .Jortrnitl of ()ornplrting 9(4):301 33a 64. Hong K.T., Dang V.H. (2001) Forrn:rl D
C., Gerth R., de Roever W.P. (1988) Modelling StateCharts
Be-
h:r,viour in a Fully-Abstract way. In: Dauchet M., Nivat XtI. (Eds.) CAAP'88, Lecture Notes in Computer Science 299. Springer, Berlin, Heidelberg, 271 294 68. Inal R. (1994) Ntlodular Specification of Real-Tirne Systems. In: 1994 Euromicro Workshop on Real-Time Systcns. IEEE Press, Piscataway, NJ, 16 21 69.
Jahanian F., N{ok. A.K.-L. (1986) Saletv Analysis of Timing Properties in Real-Time Systems. IEEE Transactions on Software Engineering 12(9):890
904 70. Kesten
Y., Pnueli A., Sifakis J., Yovine S. (1993) Integration Graphs: A Cla,ss of Decidablc Hybricl Systcms. In: Grossman R.L., Nerode A., Ravn A.P., Rischel H. (Eds.) Hybrid Systems, Lecture Notes in Computer Science 736.
52. Hansen M.R., Zhou C.C., Staunstrup
ton, NJ
237
71
Springer, Berlin, Heidelberg, 179 208 Kleuker C. (2000) Constraint Diagrams. PhD thesis, Oldenburg Universitv, Germany
Koymans R.. (1990) Spccilving Real-Time Properties with \{etric Temporal Logic. Real-Tirne Systems 2(4):255 299 73. Koyrnans R. (1992) Specifying Messagc Passing :r,nd Time-Critical Systems with Temporal Logic, Lecture Notes in Cornputcr Science 651. Springer, Berliri, Heidelberg 74. Kddramccs M. (1995) Transformzrtion of Duration Cak:ulus Specifications to DISCO La.nguage. Master's thesis, Tallinn Te
72.
Academia, Sinica BO
Li X.D.. Dang V.H. (1996) Checking Linear Duratioa Inviuiants bv
Lirrcar
Programming. In: Jaffar J., Roland H., Yap C. (Eds.) Concurrency and Par:rllclism, Programming, Nctworking, :rnd Securitv, Lecture Notes in Compritcr Scicncc 1179. Springer, Berlin, Heidelbcrg, 32L 332 t31 Li X.D., Dang V.H., Zheng T. (1997) Checking Hybricl Automata for Linear Duration Invariants. In: Shy:lmasundar R.K., Ileda K. (Eds.) Arlvances in Computing Science, ASIAN '97, Lecture Notcs irr Computer Science 13'15. Springer, Berlin, Hei
232
R,ef'erences
Refercnces
g4. Li Y., Dang V.H. (2002) checking Temporal Duration Propcrties of Timed Automata. .Journal of Computcr Science and Technology 17(6):689 698 85. Liu c.L., Layland. J.w. (1973) scheduling Algorithm for Multiprogramming in a Harcl R.eal-Time Environment. Journal of the ACI\I 20(i):a6 61 86. Liu Z. (Lgg6) specification and verification in DC. In: Joseph M. (trd.) Mathematics of Dependable systems, International series in computer Science. Prentice Hall, London, 782 228 g7. Liu 2., Nordahl J., sorensen E.v. (1995) composition and Refinement 6f Probabilistic Real-Timc systcrns. In: Mitchcll c., stavridou v. (Eds.) Mzr,thcmatics of Dependable Systems. Oxfbrd University Press, Oxford, 149 163 gB. Liu 2., R.avn A.P., Li X.S. (2003) unifying Proof Methodologies of Duration calculus arrcl Timed Linear Temporal Logic. Formal Aspects of computing. To appear 89. Liu 2., Rurrtr A.p., Sorensen E.V., Zhou C.C. (1993) A Probabilistic Dura,tion Calculus. In: Kopetz H., Kakuda Y. (Eds.) Depcndable Computing and FaultTolerant Svstcms Vol. 7: Responsivc computer systems. springer, Berlin, Hci delberg, 30 52 g0. Liu 2., Ravn A.P.,
Sl,rrensen
E.V., Zhot
c.c.
(1994) Towards a calculus of
Systems Dependability. High lntegritv Systems 1(1):49 75 91. Malcr O., Manna 2., Pnueli A. (1992) From Timed to Hybrid Systerns. In: de Bakker J.W., Huizing C., de R,oever W.P., Rozcnberg G. (Eds') R'eal-Titre: Theory in Practice, Lecture Notes in computer science 600. springcr, Berlin, Heidelberg, 147 184 g2. Manna 2., Pmreli A. (1993) Verifyirrg Hybrid systems. In: Grossman R.L., Nerode A., Ravn A.P., R.ischel H. (Eds.) Hybrid Systcms, Lecture Notcs in Computer Science 736. Springer, Berlin, Heidclberg, 4 35 g3. Mao X.G., Xu Q.W., Dang V.H., Wang J. (1996) Towards a Proof Assistant {br Interval Logics. UNII/IIST Report No. 77, International Institute fcrr Software Tcchnology, Macau 94. P.C. Nlasicro, A.P. R.avn, and H. Rischcl. (1993) Refincment of real-tirne specifications. ProCoS Technical R.eport ID/DTH PCNI 1/1, Departrnent of computer Science, Technical University of Denmark, Lyngbv
95. Midclelburg
c.A. (1998) Truth of Duration calculus Formulae in
Timed
Ftames. Fundamenta Informaticae,Journal 36(2 l3):235 263 96. Minsky \,{.L. (1967) Computation: Finite and Infinite Machines. Prentice Hall, Englewood Cliffs, NJ g7. Moizkorn'ski B. (1995) compositional Reasoning about Projected and Infinite Time. In: First International confcrence on Engineering of complex computer Systems. IEEE Press, Piscataway, NJ, 238 245 gB. MOrk S., Goclskesen J.C., Hansen M.R., Sharp R. (1996) A Timed Semarrtir:s for sDL. In: Gotzhein R., Bredereke J. (Eds.) Formal Description Techniques IX: Theory, Application and Tools. Chapman & Hall, London, 295 309 99. Nicollin X., Olivero A., Sifakis J., Yovine S. (1993) An Approach to the Description ancl Analysis of Hybrid Systems. In: Grossman R,'L', Nerocie A', R.avn A.P., R.ischel H. (trds.) Hybrid Systerns, Lecture Notes in Computer Science 736. Springer, Berlin, Heidelberg, 149 178 100. olderog E.-R.., Ravn A.P.. Skakkebak.I.u. (1996) R,cfining systc[r R.cqtrirtrrnents io progra,m Specifications. In: Hcitmcyu'O., \.tl'rr
London, 107 134
R.rrslrlry.1. (11)1):t) (Jscrs
(lrrirlc
liil llrc l'\"S S;ilt ilir';rliorr
101. Orvrc S., Slra,rrl<:rr N., irrrrl \,i'rilir';rliorr Syslcrn. l,:rrrl1rr;r1,,r'.;rttrl I'trtol ('ltcclicr'(lrll;t
rclr';rrrr') (llrtcr
233
volurnss). lllrr:hnical report, Computer Scicnce Lzrboratory, SRI International, I\tlenlo P:rrk, CA 102. Pandya P.K. (1996) some Extcnsions to Propositional \,{ean va,hrc calculus: ExpressiveDess arrtl Decidability. In: Kleinc Buening H. (Ed.) CSL'95, Lecture Notcs in Cornputer Science 1092. Springer, Bcrlin, Heidclberg, 434 451 103. Pandya P.K. (1996) Weak Chop Inverses and Liveness in Duration Calculus. In: Jonsson I]., Parrow J. (Eds.) Forrnal Techniques in Real-Time and FaultTolerant Systcurs, Lecture Notcs in Computer Scicnce 1135. Springcr, Berlin,
Heidelberg, 148 167 104. Pandya P.I{. (2001) Nlodel Checking CTL-lDC]' In: Margari:r T., Wang Yi (Eds.) Tools and Aigorithms lbr the Construction :r,nd Analysis of Systems, Lecture Notes in Computcr Science 2031. Springer, Berlin, Hcidelberg, 559 i)/J
105. P:r,ndya P.K. (2001) Spccifving and Deciding Quantified Discrete-Time Duration calculus Formulae using DC\ALID: An automata theoretical approach. In: Workshop on R.eal-Time Tools (RITOOLS'2001), Aalborg 106. Pandya P.K. (2002) Interval Duration Calculus: Exprcssiveness arrd Decidability. In: Asarin E., Maler O., Yovinc S. (Eds.) Electronic Notes in Theord,ical Computer Science 65:6. Elsevicr, Amsterdam 107. Pandya P.K., Dang V.H. (1998) Duration C:r,lculus with \Vcakly Monotonic: Time. In: Ravn A.P., R.ischcl H. (Eds.) Formal Techniques in Real-Time and F:rult-Tolera,nt Systems, Lecturc Notes in Computer Science 1486. Springer, Berlin, Heidelberg, 55 6,{ 108. Pandya P.K., Ramnkrishna Y.s. (1998) A R,ecursive Mean Value Calculus. In: Arvincl V., R.amanujalr R. (Eds.) FSTTCS 1998, Lecturc Notes in Computcr Science 1530. Springer, Bcrlin, Heidelberg, 257 268 109. Pancly:r, P.K., R.a,rnakrishna Y.S., Shyarnasundar R.K. (1995) A Compositiontrl sern:rntir:s of Estcrel in Duration calculus. Tcchnical rcport, cornputer scicnce Group, TIFR, Bombay 110. Pandya P.K., Wang H.P., Xu Q.W. (1998) Towar
l!i.
rrr;rl
i.rr ;rtrrl ('ottt;rttl;rtiorr, 156(1-2):320
344
li;rl,irr,,r.i, lr ,\ (:ll)(lll) Srrccirr'l rrcss (l;rp lrci u'ccrt Nrlorra,rlit'T,ogit: antl Dttr:zrtitlrt ('.r1, rrlrr', l'rrrrrl.rrrlrrl;r lrrlirt ttt;rlir';rr'. 'l l: I l0
231
Ref'crcnces
Rclcrcrrr:cs
119. Rabinovich t\. (2002) Finite Variabilitv Interpretation of Monadic Logic of Order. Tlreoretical Computcr Scicn<:r:, 275(1 2):III 725 120. R.asmussen T.M. (1999) Signed Interval Logic. In: Flum J., RodriguezArtalcjo M. (Eds.) Computer Science Logic, CSL'99, Lecture Notes in Cornpnter Science 1683. Springcr, Berlin, Heidelberg, 157 171 121. Rasmusscn T.M. (2001) Automa,ted Proof Support for Interval Logics. In: Nietwenhuis R,., Voronkov A. (Eds.) LPAR. 2001, Lccture Notes in Artificia,l Intelligence 2250. Springer, Berlin, Heidelberg, 3I7 326 122. Rasmussen T.M. (2001) Labelled Natural Deduction lbr Interva,l Logics. In: Fribourg L. (Ed.) Computer Scicncc Logic, CSL'01, Lecture Notes irr Computer Science 2142. Springcr, Berlin, Heideiberg, 308 323 123. R,asmusscn T.M. (2002) Interval Logic: Proof Theory and Theorern Proving. PhD thesis, Technical University of Denmark, Lyngby 124. Ravn A.P. (1995) Dcsign of Embedded Real-Time Computing Systems. Doctoral disserta,tion, Technical Univcrsity of Denmark, Lyngby 125. Ravn A.P., Erikscn T.J., Holdgaard M., Rischel H. (1998) Engineering of Rcal-Time Systems with zrn Experimcnt in Hybrid Control. In: Rozenbcrg G., Vaandragcr F.W. (Eds.) Embedded Systcms, Ler:ture Notcs in Computer Science 1494. Springer, Berlin, Hcidelberg, 316 352 126. R,avn A.P., Rischcl H. (1991) R.equiremcnts Capture lbr Embcdded R.ealTime Systerns. In: Proceedings of IMACS-MCTS'91 Symposium on Modclling and Control of Tcchnological Systerns, Villencuve d'Ascq, Francc, voiurne 2. IMACS, Paris, 147 152 127. R.avn A.P., R,ischel H., Hansen K.M. (1993) Spccifying and Verilying Requiremcnts of Real-Time Systems. IEEE Transactions on Software Engineering
t9(1):a1
55
128. Rischel H. (i992) A Duration Calculus Proof of Fischer's Mutual Exchrsion Protocol. ProCoS II, ESPR.IT BR,A 7071, Report No. DTH I{P., 111,, Department of Computer Science, Techrrical University of Dcnmark, Lyngby 129. R,oscoe A.W., Hoarc C.A.R.. (1988) The Lau's of OCCAN{ Programming. Theoretical Computer Science 60:177 229 130. Roy S., Zhou C.C. (1997) Notes on Neighbourhood Logic. UNII/IIST Rcport No. 97, International Instittte for Softwarc Technology, \,,Iacau 131 . Satpathy M., Dang V.I{., Pandva P.K. (1998) Some R.esults on the Der:idability of Duration Calculus under Synchronous Interpretation. In: R.avn A.P., R,ischel H. (Eds.) Formal Techniques in R,eal-Tirne and Fault-Tolcrant Systems, Lecture Notes in Computcr Science 1486. Springcr, Berlin, Heidclbcrg, 186 197 132. Schenke M. (1994) Specification and Tbansformation of Reactive Systerns with Timc Restrictions and Concurrency. In: Langmack H., dc Roever W.-P., Vytopil J. (Eds.) Formal Techniques in Rcal-Time and Fault-Tolerant Systems, Lecture Notes in Computer Scicnce 863. Springer, Bcrlin, Heidelberg, 605 620 133. Schenke M. (1995) Roquirements to Prograrns: A Developmcnt Mothodologv for Real Time Systems, Part 2. Tcchnical report, Fachbereich lnfcrrmatik, Universitiit Oldenburg, Gerrnany 134. Schenke M., Olderog E.-R.. (1995) Rcquirements to Progr;rms: A Dcveloprncnt Methodology for Real Time Systems, P:rrt l. Tc<:hni<::rl rcpott, Fa,r:lrb
2illr
136. Schnrrirlcr ( I . \rr ( ) \\i. (191)8) Towards a Forma'l Semantics of Vcrilog rrsirrt', Dur:rtiorr (l;rl, ulrrr. lrr: ll:tvtt A.P., R,ischel H. (Eds.) Fornal Te<:Iurirltrcs irr Real-'I.'irrrr' ;rrr,l l";rttll 'l'olr:t:rnt SYstems, Lecture Notes in Computelr St ictrr '' 1486. Slrrirrllr'r . li'r lirr. llrrirlrlberg, 282 293 137. Siewe F., l)rrrrli \'ll. (2(XX)) Ilrom Continuous Specification to Dis
Ii'rlirr. llcitllllrtrg, 92 97 .l.U (11)1) l) l,ir,<:rrcss and Fairness in Duration
139. Skakkebarl<
Calt:trlus. Itt: .l,,tr
Concurrcncy Theory, Ler:tult' N.l.r. in Computtt St it'ttt t' 8il(i. Springer Verlag, 283 298 1.40. Skakkebir:k.I.tl. (lf){) l) r\ \hrification Assistant lbr a Real-Timc Logir'. I'lrlr thesis, Tet:lirri<:rr,l I Jlrivclsilv of Dcnma,rk, Lyngbv 141. skakkcba:k.I.II., ll;rvrr i\.1)., R,ischel II., Zhou c.c. (1992) sp
8.,
P1rr.orv
.l.
(1,)rls.) (]ONC]UR.'94:
I
1'.
236
Relerenccs
References
152. Xu Q.W. (1997) Semantics and Verification of the Extended Phase TYansition Systems in the Duration Calculus. In: \tlaler O. (Ed.) Proceedings of International Workshop on Hybrid and Real-Time Systems, Lecture Notes in Computcr Scicncc 1201. Springer, Berlin, Heidelberg, 301 315 153. Xu Q.W., He W.D. (1996) Hierarchical Dcsign of a Chemical Concentration Control System. In: Alur R., Henzinger T.A., Sontag D.tr. (trds.) Hvbrid Svsterns III: Verification and Control, Lecturc Notcs in Computer Science 1066. Springer, Berlin, Heidelberg, 270 281 154. Xu Q.W., Swamp l{. (1998) Compositional Reasoning using AssumptionCommitment Paradigm. In: Languraack H., Pmreli A., dc R,ocver W.-P. (Eds.) Compositionality The Significant Differcnce, Lecture Notes in Computer Science 1536. Springer, Berlin, Heidelberg, 565 583 155. Xu Q.W., Y;r,ng Z.Y. (1996) Derivation of Control Programs: a Fleating Svstem. UNU/IIST Report No. 73, International Institute for Softr,vare Technology, N{a,cau
156. Yu H.Q., Pandya P.K., Sun Y.Q. (1994) A Calculus for Hybrid Sa,mpled Data Systems. In Langmack H., de Roever W.-P., Vvtopil J. (trds.) Forrlal Techniques in R,eal-Time and Fault-Toierant Systems, Lecture Notes in Computer Sr:icnce 863. Springer, Berlin, Heidelberg, 716 737 157. Yu X.Y., \Vang J.,Zhott C.C., Pandy:r P.K. (1994) Form:rl Design of Hvbrid Systems. In: Langmack H., de Roever W.-P., Vytopil J. (Eds) Formal Techniqucs in Real-Time and Fault-Tolerant Systems, Lecture Notes in Computer Science 863. Springer, Berlirr, Heidelberg, 738 755 158. Zhao J.H., Dang V.H. (1998) On Checking Real-Time Parallel Systems for Linear Duration Propcrtics. In: Ravn A.P., Rischel H. (Eds.) Formal Techniques in Real-Time and Fault-Tolerant Systems, Lecture Notes in Computcr Science 1486. Springer, Berlin, Hciclclbcrg, 24I 250 L59. Zltao J.H., Dang V.H. (2000) Checking Timed Automata for some Discretisable Duration Propcrtics. Journal of Corrrputcr Sciencc and Tcchnology, 15(5):423 429
160. Zlreng Y.H., Zhon C.C. (1994) A Formal Proof of the Deadline Driven Schedulcr. In: Langmack H., de Roever W.-P., Vytopil J.(Eds.) Formal Techniques in Reai-Time and Fault-Tolerant Systems, Lecture Notes in Computer Scicncc 863. Springer, Bcrlin, Heidellierg, 756 775 16l. Zhon C.C. (1993) Duration Calculi: An Ovcrview. In: Bjorner D., Broy M., Pottosin I.V. (trds.) Proceedings of Formal Methods in Progrnmming and Their Applications, Lecture Notes in Cornprrtcr Science 735. Springer, Berlin, Heidelberg, 256 266 162. Zhor C.C., Dang V.H., Li X.S. (1995) A Duration Calculus with Infinite Intervals. In: Reichel H. (Ed.) Fundamentais of Computation Theory, Lecture Notes in Cornputer Scir:ncc 965. Springer, Berlin, Hciddbcrg, 16 41 163. Zhou C.C., Guelev D.P., Zhan N. (2000) A Higher-Order Duration Calculus. In: Davies J., Roscoe 8., Woodcock,I. (Eds.) N{illennial Perspectives in Computer Science. Palgrave Macmillan, Houndmills, Hampshire, 407 416 1,64. Zhon C.C., Hansen M.R. (1996) Chopping a Point. In: Cooke J., He Jifeng, Wallis, P. (Eds.) BCS FACS 7th Refinement Workshop, Elcr:tronic Workshops in Computing. Springer, Berlin, Heidelberg 165. Zhou C.C., Hansen M.R. (i998) An Adeqtate First Orrl<:r T,ogir: of Trrtcrvals. In: Langmaack H., dc Roevcr W.-P., Prnrrli A. (Il
Bcrlin,
H
166. Zlrorr(j.(1., IIirrrsr,nN4.ll..,ll;rvrr A.l'., llisclrr,l ll.(11)l)l)l)rrr';rliorrSlrccilicirliorrs lirl Slr;r.r'r,rl l)roccrisors. lrr: \'tlopil .1. (l), 1.)lilrrrIosiurrr orr l,irrrr;rl 'l'r,r'lrrrrlrrls
'2:l'i
in R.ea,l-'l'irrrr';rn,l I,:rrrll 'lirlrrr':rrrt Systems, Lecture Notes in Computot St ictt, r' 571. Sprirrllr'r'. li'r lirr, l l,'irlr:llrrrrg, 21 32 167. Zhott (1.(l , ll;rrr:rcrr Nl.lt., Strstoft P. (1993) Decidability and f.lrrtlx:irl;rl'il ity Rtrsults lirr l)rrr;rli,,tr ( jrrlt:ultrs. In: Enjalbert P., Finkel A', \Va'gnrrl K \\1 (Eds.) S'l'Af lS'1):t, l,r.r'trrlc Notcs in Computer Scicnce 665. Sprirrgrrr', li'r'lirr, Heidelb
(iN
11.. [i,in'n A.P. (1991) ma,tion Pror:t'ssirrl', l,r'l lcrs tt0(5):269 276
168. Zhou
c.(i., llol.r'r,(l.i\
A Calculus of Duratiorrs.
lrrlirr
l,i \ S (199,1) A Nlcan Value Calculus of Durztt,iotrs. lrr A.W. (l'),1.) A (lll,ssica,l N{ind: Essays in Honour of C'A'll llr';rr'' Prentice IIall Irrl,r'r'rr;rliotral, Ltxrdol, 431 451 (l;tlt rrlrtr; 170. Zyott C.C., Ililvrr A.l'., IIarrs
169. Zhou C.(1., Roscoe
530
772. Zhort c.c., Zharrg.1.2., Y:rng L., Li X.S. (1994) Linear Duraliort Ittr';tti;tttl:;. In: Langmack tI., rkr R.oer.er w.-P., vvtopil J. (Eds.) Formal 1i{lrrrirlrr|s irr Real-Time a1d Finrlt-Tolerant Systems, Lecturc Notes in C)orttlrrtlcl St i,'tt,,' 863. Springer, Bcrlin, Heidelberg, 86 109
173. Zhn H.8., I-Ic J.F. (2000) A DC-based semantics for verilog. Irr: Nol,liirr l). Y1lin Feng, Gnudel N4.-C. (Eds.) Proceedings of International (lottli'tt'ttcc orr Software: Theory-:r,ndPractice. PublishingHouseof Electrrxri<:s lrrtlttsl tt.ll'r jing, 421 432
Abbreviations
- A2: axioms of lL,
A0
27
Autol(a) Auto3(b): specification of an automaton for the gas burner,
Nl, N2: axioms of state transition calculus, 157 N: necessity, inference rule of IL, 27 nert(X,S): the formula
processes, 9
-D6:
rL,27
161
COR: Corollary, 183 CSP: communicating sequential D1
MP: modus ponens, inference rule of
axioms for abstract domain,
202
DC: duration calculus, 14, 41 DCA1 DCA6: axioms of DC, 45 Desl: design decision 1 (gas burner), 11, 60
Des2: design decision 2 (gas burner),
xv(x^fisl)v(x^ll-sl), 49
NL: neighborhood logic,
NLA1 NLAS:
191
axioms of neighborhood
logic, 195 NLNI, NLN, MP, G: inference rules of
NL,
196
12, 60
d,Liner: deadline of p;, 69
PAl-PAB: axioms of PDC,
DNF(S): dis.junctive normal form for
PDC: probabilistic duration calculus,
s, lo2
216
209
PLC: programmable logic controller, 19 ProCoS: provable correct systems (ESPRIT BRA 3104, 7071), t4 Pr.R: periodic request, 71
E: axiom of IL,27 FAi (S)t finite alternation, 46
G: generalization, inference rule of IL, 27
Ql, Q2: axioms of IL,
28
Gbfueq: requirement (gas burner), 10, 60
H6: IL encoding of DC axioms for Q,9l
IR1, IR2: induction rules of DC, 45
- L3: axioms of IL, 27 LDI: linear duration invariant, 133 ,LF: lirrrrar firnction (in LDI), L33
L1
M:
rrronol
6l'r
otrililt,
irrli'r'cncc rrrlc
software engineering, 19
RDC: resfticted duration calculus, 99 RDCt(r), RDCz, RDCs: subsets of
TL: sel of valid IL formulas, 89 ILa.: DC instances of LL, 89 IL: interval logic, 23
J,M: Lcrrrrrnir,
R: axiom of [L,27 RAIStr: rigorous approach to industrial
DC formulas, 111 requirement of every process on every prefix interval, 73 reqr: requirement ofp; on an interval, -Req:
iJ
requirement of pr on all prefix intervals, 73 Il,urri: 2r is nrnning, 68 -Reqo:
ol ll,, ,9,'/i,:
sllrr',Irrlrrr sptx'ifir';r,l iorr, 7(i
240 SDC1
Abbreviations
- SDCT:
axioms for suPerdense
state transitions,
171
TLA: temporal logic of actions, TM: Theorem, 137
Symbol Index
9
ShP: shared processor, 68
SIL: signed interval logic, 17 Spec: assumptions in Liu and Layland's theorem, 78 ST1 ST4: axioms of state transition calculus, 154 Stdl: pr; has a standing request, 68
Urg,,: p; is more urgent than P;, Urgi,nt: urgency of processes. 74 $7,:
IL encoding of
68
@, 91
[-]r.., [-n:
/': meaning of n-ary function symbol, -25
Program semantics, 180
fl-l: point interval, 44 [.9]: .9 holds throughout nonpoint
FSymb: set of global function symbols,
interval, 44 [Sl': ,5 holds for interval of length
r)0,115 [Sl': S holds
for interva] of length r,
23
G": n-ary relation symbol, 23 G": meaning of n-ary relation symbol, 25
L23
ihe smallest integer greater than or equal to r,7l lrl: the la.rgest integer not exceeding $, 7L n: for all subintervals, 24 !o: for all prefix intervals, 39 O: for some subinterval, 24 Oo: for some prefix interval, 39 Q: for some left neighborhood, 191 Oi: for some left neighborhood of the end point, 192 O,: for some right neighborhood, 191 Of : for some right neighborhood of the sta,rt point, 192 r: superdense chop modality, 169
frl:
-:
chop,24 ^: concatenation of sequences, 133, 176 { -L: contraction closure of -L, 106 { S, t S, J5, T,9: transition formulas, 150 \S,lS, \ S, I S: transition formulas,
GVar: set of global variables,
23
Z: interpretation (duration calculus), 42
I,V,lb, e] I 6: semantics of formula,
43
Z[@]: semantics of formula, 43 Ilntv: set of all intervals, 25
.7: interpretation (interval logic), 25 J ,V,lb, I Q, semantics of a formula, 26
"]
.7[/]: semantics of a formula, ./[d]: semantics of a term, 25
26
.72: induced interpretation, 43
,La: regular language of A, 132 l: interval length. 23. 25 lotu: lower-bound timing constraint,
r32
M: two-counter machine,
114
N: set of natural numbers,
61
148
/5: state duration, 41 0: empty sequence, 176
:irl:
equivalence with respect
to
a
linear duration invariant, 135
I I
Qt d is valid, 26 Q: $ is provable, 29. 46
A: real-timc automaton,
132
C,
T, D: tttorlnlil,ics,
!"
rg" r,, ,i tf-Rt'y l\tttt'l,iott nytrtlrols, 2ll
190
P,Q, R,. . .: state variables,
?: parallel
41
process, 175
PA: probabilistic automaton, 210 PLetter: set of temporal propositional Ietters, 23 IR: real numbers, 24 R,Sym,h: sct of global
relation symbols,
23
,9: rrl,trl,e (rxl)r(!HHiolr
4l
242
Symbol Index
X,Y,. ..: temporal propositional letters,
,92: meaning of state exPression, 42
5: sequential process, ,Seq:
Index
175
untimed sequence of transitions'
fr ,.U,
z,...:
(global) variables, 23
132
SVar: set of state variables, 41
7:
f
set of transitions, 132
e:
lfime: time dornain, 4, 42 Trace: set of traces, 176 ?Seg: timed sequence of transitions,
r32 132
V: exclusive and complete set of state variables,211 Vt: set of all state sequences of length
t,2I3
V: value assignment, 25 u,u' ,, ..: temporal variables, 23 Val: set of all value assignments, 25 tr7: meaning of temporal variable, 25 XJr: meaning of temporal propositional letter, 25
f,29,
16
0: term,23 ttGt)lt], satisfaction probability of Q at
tine t,2t4
TVar: se| of temporal variables, 23 zp: upper-bound timing constraint,
F @: deduction of / from empty sequence, 132
p
:
(Pt., P1):
transition of real-time
automaton, 132 |-: pre-state of transition, 132 p-: post-state of transition, 132 o: computation of two-counter machine,
abstract doma,itt, 20, 20i|
completeness for abstract domain, 20
- semantics tlf rlur;rl ions, 203 adequacy of rruigltlrollrro
-
193
assumption-txlrrttttil,ttttrttt logic, 20 automaton, 9, 2(), l{)1, 146, 160
continuous tirtur lrrolrabilistic, 210 hybrid, 20, 144, l1)0
113
o: state sequence of probabilistic automaton, 212
r:
phase,105
probabilistit:, 16, 209
single-step probability transition
tion, 211 re: initial probability mass, fun<
211
211
constraint diagram,
19
19
continuity, l80 continuous time, 3,
100
axioms
-
duration ca,kltlus, interval logic, 27
neighborhoorl logi<:, 195 probabilistir:
2t6,2L8
basic coniunct, 102 Boolean state, see state bounded liveness, 187 bounded termination, 185 calculus
duration,
duration calculus, 40 probabilistic duration, 215 state transition, 1,47, 153, 157, L70 - superdense state transition, 170, 173 channel, I 75 see
channel variables, 176 chop, see modality, chop chop free, 28, 34 combine law, 167 cornrmrnicating sequential processes, 9,
l0 r:otn plr,l
4t
t'
contraction closure, see language contraction-closed language, see language
45
state transition <:illculus, 153, 157 superdense statc transitions, 171
-
languages),135 consistent state, see state
programma,blrr logi<: trtrrtroller (PLC),
real-time, 21., l2l-r, 131 timed, 7, 20, 131 , l,44
6,4,, q,. . .: formulas, 23
duration calculus, 20,97,204 interval logic, 20, 34,203 - neighborhood logic, 20,20L,203 complexity, 109 concatenation, 176 - of languages, 103 congruent equivalence (of regula,r
r'oI lt.r:l,iorr o{t st;a,tc
counter machine, 113 CSP, see communicating sequential processes
DC,
see duration calculus deadline, 69 deadline-driven scheduler, L, 4, 6, 67
decidability (of duration calculus),
99,
109
continuous time, 106 discrete time, 102, 106 decision procedure, 20
deduction duration calculus, 46, 48,90 interval logic, 28, 90 - neighborhood logic, 196 deduction theorem, 48 - duration calculus, 204 interval logic, 31 - neighborhood logic, 201
-
neighborhood-logic-based D C, 204 delay
inertial,153
- transmission,
153
clcliw-inscnsitivc <;irr:rrits, 206
d-firnr:tirttt, Il'r,
I4l-r
244
Index
Index free
density, 202
density funt:tion, 210 dependability, 16, 209, 226 discrete time, 3, 100
duration,
'
implementables, 20 probabilisttt'., 22, 209 RDC r(r), lll RDC z, Itl 111
variable, 23 25,176 113
Esterel, 1.9, 167 event, 4, 14,145 expansion-closed language, see language see
expressiveness
189
97, 110, 159, 168, 203 Fischer's mutual exclusion protocol, 19'
interpretation
-
integer programming, 20, 144
109 180
flexible {brmula, 27 terrr.,27 formula duration calculus, 43 interval logtc,23,26
-
neighborhood logic' 191 probabilistic duration calculus, 215 state transition calctrltrs, 118' 150, 170 sttpct rltrttsrr sl it,l't' I
i'l)
It
ilrlsil iott t:;ll< ttltts'
'
Liu and Layland's Theorem, 76
logic
mixed integer programming problem,
t44 modal logic, 10,
modality,
partition,
closed, 70 discrete, 99, 102, 213 infinite, 18, 190 left open, 70 lr:ngth, 70, 77, 23 l
opctt, 7{l lrlllix, lll). l:t, ll):l
29
10
chop, 11, 12, 17,24,26,157, 169, 170, 189, 190, 193
107
9
-
chop (discrete time), 99 contracting, 12, 17, L89 expanding, 12,17, I90 191
superdense chop, 17, 18, 169, 170 moda,lity licc, 196 rrrr,,lcl clrcr'ltitrg, 2(1. I25
;r olrct;tl.ot, lll rr:rl
rtr;rl tttttrrl'r'lr. (il
semantics, 19, 180
.. specification, 19, 185 states,176 variables, 175 verification, 19, 188 proof, 34 duration calculus, 46 interval logic, 28 neighborhood logic, 196 proof assistant, 20, 109 proof system duration calculus, 45 interval logic, 27 neighborhood logic, 194 neighborhood-logic-based DC, 204 probabilistic duration calculus, 216,
interval, 10, 190, 193 neighborhood, 13, 16, 17, 190, subinterval, ll,12,24
probability function, 212 probability matrix, 219 refinement, 19, L67
Markov property, 210 matrix scalar product, 219 mean value, 15, 745 metric temporal logic, iee temporal
211
predicate logic, 28, 34, 196 prefix interval, see interval probabilistic automaton, see automaton probabilistic duration calculus, 22, 215 probabilistic space, 213 program
liveness, 12, L3, 185, 204
discrete, 99, 102, 213 duration calculus, 42, 93, 96 interval logic, 25, 96
interval,
1"34,
143
2L6, 2t8 superdense state transitions, 171
periodic request, 69 phase automaton, 105 PLC automaton, 19 post-state, 126, I32 pre-state, 126,132 precedence, 24
sequence,134
neighborhood logic, 195 probabilistic duration calculus, 210,
infinite terrr, 136 infinitude, 202 initial probability mass function,
10
linear programming, 20, 126, I28,
45
175
partial correctness (of program), 185 pzutition of an interpretation, 107
135
hypothesis,45
L42
parallel processes,
satisfied or violated by arr untimed
base case, 45
l4l,
occAM, 19, t75 o'-rrrle, 20, 97, 203, 201
satisfied or violated by an automaton,
mles, 45, 90, 97, 203
weak, 205
203
language contraction-t:los
induction
fault tree, 19 finite alternation, 46 finite divergence, 77, 167 finite terrn, 136 finite variabiiitv, 15, t7, 42, 44, 45, 50,
fi.xed point,
136,
Kripke model,
implementables, 20
-
NOR circuit, 152 normal fbrm (of regular expression),
iteration operator, l8
sequence, 134
153 inference rules, 27
strong, 205
non-Zeno phenomenon, 15 nonelementary complexity, 109
.- satisfied or viol:r,ted by a timed
inertial delay, fairness, 12, I3r 201
variable,9
135
hybrid automaton, see automaton hvbrid statecharts, see statecharts hybrid system, 3, 9, 16 19, 190
letter,
neighborhood logic, 13, 189
linea,r duration inv:rriant, 125, 133 satisfied or violatcd by a language,
16
Hoare logic, 20
-
168, 190
suffix, 193
length,
Heine Borel theorem, 93
embedded systern, see hybrid svstem equivalence of DC formulas, 46
.- of chop-based interval logic, of discrerc RDC, 101
91
history independence,
neighborhood, 148, 151, 157, 159, 165,
70
signed int
Isabelle, 20
gas burner, 2,5,7, B, 10, 13, 44, 60, 101, 105, 1.25,146,160, 209, 2lL,219 global - function, 23, 24 relation, 23, 24
I{-triple,
explicit clock temPoral logic, temporal logic
see global
halting problem,
right opcn,
interval logic, sr:c irttclva,l
closed language, see language
function,
-
RDCs' 1I1 restricted (R.DC)' 99, toois, 20
-
r in 0,28, 34 X in $(X), 47
variable, 27
fully
see state
duration calculus, 3, t4,40 " applications, 18 - based on neighborhood logic, 204 discrete time,99 ' higher-order, 18, 20
*
for for
245
218
state transition calculus, 154, I57 superdense transitions, 171 punctuality) relaxing the, 118 PVS, 20 rlrr;r.rrl,ililr, 2ll, l|,1 lrisl ( l), ll l
246
Irrdcx
Index
for all (V),
24
global variable, 28 state variables, 177
RAISE,
-
superdense chop, 170 superdense state transition calculus,
19
readiness variable, 176 real analysis, 6, 16, 190, 191 real arithmetic, 24, 28, 34, 89, 196, 207
real time, 3 real-time automaton, see automaton real-time logic, 7 real-time prograrlming, 18, 167 real-time scheduler, 19 real-time semantics, 19 real-time specification, 19 real-time system, 1, 14, 18, 145, 148,
170
temporal propositional letter, 25 -- temporal variable, 25, 4I, 42
-
saquential processes. I 75 shared processor, 68 signed interval logic (SIL), see interval, signed interval logic single-step probability transition
function, soundness
state transition calculus, 159 restricted duration calculus (RDC), duration calculus
Boolean,4,
formula, 27, 35
-. tetm,27
stablility, 14, 165, 169 - superdense transition, 165, 170 -- transition, L4, 16, 1,32, 1.45, 149, 165, 189, 204
safety, 12, 189 satisfzr,ction probability,
2
-
13
satisfiability discrete time, 100
duration calculus, 43, 44,69,
111,
114, 118, 122, 125
interval logic, 26 neighborhood logic, 192 prefix intervals, 43 state transition calculus, 148 SDL, 19 semantics chop, 26
duration calculus, 41 formula (duration calculus), 43 interval logic, 24 inttrrva,l logi<:, t
l1) l
sl;tlc rlttt;rl.iorr. lll, il{lil
variable, 41, 43,68, L77 state transition, see state state transition calculus, 117, L53,157 state variable, 93 statecharts, 9, 167
hybrid, 190 structural induction,
94
srrperdense chop, see modality
superdense r:omputation, 17, 19, 166 superdcnse state transition, 165, 170 calculus, 170, 173 synchrony hypothesis, 17 syrrtax
dttration
<:a,l<:trhrs,
4.1
irrtcrval logi<:, 2li ttcigltlrorlrrtotl lol1ir:, ll)l plol,;rlrilisl ic rlrtt irl iorr r';tL ttlrts, sl;rll lr;rrlrili,rtr r'ltI ttltl;, I IX
170
temporal logic
explicit <:locli, i -. metric, 7 of actirirrs, f), ll){)
machine
temporal lxoposililrr;rl lcl lr,r, 23 temporal vari:rlr[,, :l:t, :1.1. ll, .,12, 89, term interval logir', 2ll, 2 l, 23
undecidability, Il7, 125 continuous time, 112 discrete time, 112
91
superderrsrr Lr';r,rrsil iorr cirlt:rrhrs, 170
untimed sequence,
validity
terminatiorr, llllr
-
theorem
duration r:alr:rrlrrs, .l(i, 5l -- interval lotl lo11ir',
I
132
{Xi
41
-
continuorrs time, 106 discrete time, 100, 106 duration calculus, 43, 44,69, 111, 114, 118, 122, 1.25
interval logic, 26 neighborhood logic, prefix intervals, 43
192
RDC,IO4 state transition calculus, 148 value assignment, 25, 170
z-equivalent, 25 variable, see global Verilog, 19
upper bourr<1, lil2
sequence, 212
,27
transition, see state, transition transition formula, 147, 1,48, 150, transmission delay, 153 two-counter machine, see counter
lower bourrl, li12
14
-
s4,29
;rrrsil iorr r:alculus,
timed sequ
distance between, 7 duration, 6, 10, 17, 41, 42, L70,203 expression, 41, 42, !77 real, 5, 14, 16
rigid
r
timed
consistent, 1,71, L72, 174 see
I
time (in rela,tiorr l,o sl,;rlc va,ria,bhs), time unit, 100, 102 timed autolt:rton, sr r' :r.rrl,otraton,
duration calculus, 45 47 interval logic, 29 neighborhood logic, 196, 203 - state transition calculus, 159 stability of state, 14, 165, 169 stable, 169 state, 4
19
regulir,r language, L02, 129, 131, 132 relation, see global relative completeness, 20, 204 duration calculus, 45, 89, 96, 97
S'
211
software-embedded system, see hybrid system
166, 209
real-time verification, reduction, 135 refinement, 20 regular context, 135
superclctrsc sl ;rl.r' L70
state expressir:n, 42 state transition calculus, 148 state variable, 41
217
12
I
5
TLA,
see
tcrrlrourl logir:, of actions
tools, 20 trace variabl
176
r-equivalence of value assignment, 25 Zeno phenomerot, L7, 167