#  Dr. Vered Gafni 1 Modeling Real-Time Systems.  Dr. Vered Gafni 2 Behavioral Model (Signature, Time) Signature: v 1 :D 1, v 2 :D 2,…,v n :D n S = (D.

## Presentation on theme: " Dr. Vered Gafni 1 Modeling Real-Time Systems.  Dr. Vered Gafni 2 Behavioral Model (Signature, Time) Signature: v 1 :D 1, v 2 :D 2,…,v n :D n S = (D."— Presentation transcript:

 Dr. Vered Gafni 1 Modeling Real-Time Systems

 Dr. Vered Gafni 2 Behavioral Model (Signature, Time) Signature: v 1 :D 1, v 2 :D 2,…,v n :D n S = (D 1  …  D n ) (states’ space) Time: (T, , 0) Behavior:  : T  S Discrete, Continuous

 Dr. Vered Gafni 3 Signature: E - a finite set of events (env. & reactions) Time domain: T={ (R + )  |  (t 0 t 1 t 2 …): (a)t 0 =0, t i  t i+1, i=0,1,… (b)  t  R +.  i. t  t i } Timed trace over (E,T) is an  -sequence:  T = (  0,t 0 ) (  1,t 1 ) (  2,t 2 ) … where:  i  2 E, (t 0 t 1 t 2 …)  T Controller Behavioral Model: Timed Traces Controller – a set of timed traces over E and T. finite variability, non-Zenon t0t0 t1t1 t2t2 00 11 22 Event – Instantaneous occurrence

 Dr. Vered Gafni 4 Environment events Model : {P 1, P 2,…P N } where P i : {R +  D i }, i=1..N Event – Boolean relation on P i becomes true/false. E.g.,  = def tr( p j  K) then occur(  ) = {t | p j (t)  K becomes true}. Environment & Controller Events non-Zenon Controller events Model – a set of (parallel) tasks (transition systems) over a set of variables Event –Assignment of a certain variable (write memory location). TempHigh = def tr( Temp  30  )

Process properties: TrainLocation : {0..100}Km GatePosition : (0-90)  SemaphoreState : {pass, stop} Process events: Tin = def tr(TrainLocation=x I ) Tout = def tr(TrainLocation=x O ) Close! = def tr(GatePosition=0°) Open! = def tr(GatePosition=90°) Example: Railroad Crossing Controller actions: close = def GatePort:=1 open = def GatePort:=0 pass = def LightsPort:=1 stop = def LightsPort:=0 xIxI xOxO 5 E={ T in, T out, close, close!, open, open!, stop, pass }

 Dr. Vered Gafni 6 General reactive software: controller comprises a set of (concurrent) tasks. reactive behavior of a task concerns: initiation, synchronization, termination. About Controller Computations & Events Computations: Asynchronous – take observable duration (initiation { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/12/3418011/slides/slide_6.jpg", "name": " Dr. Vered Gafni 6 General reactive software: controller comprises a set of (concurrent) tasks.", "description": "reactive behavior of a task concerns: initiation, synchronization, termination. About Controller Computations & Events Computations: Asynchronous – take observable duration (initiation

 Dr. Vered Gafni 7 Synchronous/Asynchronous Computations Formally, synchronous computation = executed in zero time, In practice, it is sufficient that the computation terminates before next environment event. Sequence of sync. computations is a sync. In practice, only finite sequences that respect “next event” rule. Finally, only the synchronous trace is of interest.

 Dr. Vered Gafni 8 System behavior: –Time step – time advances + an event set. –Reaction step – time freezes but new event set.  A trace always starts with: ( , 0)  A reaction step may follow only trace elements: ( , t) Super step – a sequence of reaction-steps (triggered actions) that follow a time step until stabilization (  =  ). Thus, a trace looks like: …  ( ,2.0)  ({p,q},3.1)  ({r},3.1)  ( ,3.1)  ({q,r},3.8)  … Synchronous trace time step reaction step time step super step

 Dr. Vered Gafni 9 Activation by occurrence of events (may occur simultaneously) t`tt`` {E 2 }{E 1 }{E 1, E 2, E 3 } In practice, observations are taken w.r.t. to a finite precision clock, hence  Discrete time (modeled by N),  Nearby events may get same time record, still order is preserved. …  ({p,q},53)  ({r},53)  ({u,w},62)  … So far: Event Driven Traces

 Dr. Vered Gafni 10 Global clock activation  signature includes periodic event ‘tick’. Events during (t i-1,t i ] considered at t i (order/repetition are lost). titi t i-1 t i+1 t i+2 E2E2 E3E3 E1E1 {E 1, E 2, E 3 } Time model N, but time-tag coincidences with index, hence represented by un-timed traces:  0  1  2 … where  i  2 E + ‘tick’ duration, Note:  k may consist of the event ‘tick’ solely. Clock Driven Execution Model

 Dr. Vered Gafni 11 Asynchronous Computation in Clock Driven Model

In practice …. 12 Clock driven synchronous model,  hence traces are untimed (time given by index) Clock + Event driven synchronous model, but external events are tagged with last RTC

 Dr. Vered Gafni 13 Hybrid Systems: continuous properties If 'pass' is accepted within 1 sec. then the speed remains steady till it exits the crossing. If 'pass' has not been accepted within 1 second then the train starts slowing down at a rate of 5m/s until 'pass' signal is accepted or otherwise until its speed zeroes. When the expected pass signal is accepted, the train accelerates again to 20m/s.

 Dr. Vered Gafni 14 Hybrid Systems: Time model & Variables Time model: T=[0,  ) - non-negative continuous (physical) time Variables Piecewise continuous (pwc)  Continuous range  Discrete range Events Non Zeno

 Dr. Vered Gafni 15 Hybrid models V = V d  V c (disjoint sets), S=D V (states, D unified domain)  E – set of events,  =2 E  flow={  |  : R   D Vc } s.t.: =  (t) is defined on interval [0,t  ] or [0,t  ), where t  >0. =  (t,v) is differentiable on (0,t  ) and lim t  t   (t,v)  D Vc trace: w 1 w 2 … s.t.:  k either: w k =((s k-1,t),,(s k,t)) -- , s k-1,s k  S, t  R  or: w k =((s k-1,t), ,(s k, t’)) -- s k-1,s k  S, t,t’  R ,  flow s.t.: s d k-1 =s d k, t’  t  t 

Download ppt " Dr. Vered Gafni 1 Modeling Real-Time Systems.  Dr. Vered Gafni 2 Behavioral Model (Signature, Time) Signature: v 1 :D 1, v 2 :D 2,…,v n :D n S = (D."

Similar presentations