Our Real-Time Reactive System

Real-Time Reactive System CCS with Time Delays
Wai Leung Sze (Stephen)
Swansea University
VINO 18th July 2011
Overview
• Introduction of real-time reactive system
• Describing the real-time reactive system
• Timed CCS (TCCS)
Introduction of Real-Time
Reactive System
What is Real-Time Reactive
System
•
A real-time (reactive) system is a system whose
correct behaviour depends on
a) the logical order in which the events are performed
b) and timing of the events.
•
Example:
“the air-bag system in a car”
Expected Behaviour: inflate the air bags in case of a car crash
Order: when the car is crashed
Time: at that moment
(within 50milliseconds)
What is Real-Time Reactive
System
•
Another Example: “control program”
loop
read the sensors’ values at regular intervals
depending on the sensors’ values, trigger the relevant actuators
forever
•
•
Control programs are usually non-terminating
The “idling mode” : during the time between
consecutive reading of values of the sensors
Describing the Real-Time
Reactive System
Our Real-Time Reactive System
A light switch:
•
If the switch is off, and is pressed once, then the light will
turn on.
•
If the switch is pressed again ‘soon’ after the light was
turned on, then the light becomes brighter.
•
•
Otherwise, the light is turned off by the next button press.
The light is also turned off by a button press when it is
bright.
Our Real-Time Reactive System
CCS:
def
Off = press.Light
def
Bright = press.Off
def
Light = press.Off + press.Bright
Our Real-Time Reactive System
CCS:
def
Off = press.Light
def
Bright = press.Off
def
Light = τ.press.Off + press.Bright
Our Real-Time Reactive System
Timed CCS:
def
Off = press.Light
def
Bright = press.Off
def
Light = ε(1.4).τ.press.Off + press.Bright
In general: ε(d), where d is a non-negative real number that
specifies the amount of time delay.
Timed Labelled Transition
System (TLTS)
Timed Labelled Transition
System (TLTS)
Additive:
Without Delay:
Deterministic:
Timed CCS (TCCS)
The Syntax
Everything remains the same as CCS, but one extra prefix:
“ε(d)”
where d is a non-negative real number.
Note: ε(0).P is the same as P
The Syntax
Everything remains the same as CCS, but one extra prefix:
“ε(d)”
where d is a non-negative real number.
Note: ε(0).P is the same as P
Remark: In the rest of the book, only guarded expressions are
considered.
Exercise
Consider the following Timed CCS expression,
Which constants are guarded and which are not?
Exercise
Consider the following Timed CCS expression,
Which constants are guarded and which are not?
Answer:
First K1 - guarded
K2 - not guarded
First K3 - guarded
Second K2 - not guarded
K4 - guarded
Second K3 - not guarded
Overall: not guarded
SOS Rules for Timed CCS
SOS rules for TCCS includes all rule from CSS plus the following:
means ε(0).P is the same as P
SOS rules for timed CCS
Exercise
Answer is given on the board
SOS rules for timed CCS
Parallel Composition
Suppose we now have a fast user of the light switch:
Synchronize with the light switch in Off State:
The whole system is delayed by 0.3
Parallel Composition
Two possible actions:
a) to perform press immediately
b) wait for the time delay ε(1.1)
and perform the action τ
Maximal-Progress Assumption
•
It is the design decision of TCCS that evolution of
processes must obey this assumption
•
If a process is ready to perform an action that is entirely
under its control immediately then it will do so without
further delay
Therefore,
is the right action.
Parallel Composition SOS Rule
Parallel composition SOS rule for TCCS
The predicate NoSync(P, Q, d) means that no
synchronization between P and Q becomes available
within a time delay of d (not including d)
Summary
• Introduction of real-time reactive system
• Describing the real-time reactive system
• Timed CCS (TCCS)
Thank you
Acknowledgement
•
Luca Aceto, Anna Ingólfsdóttir, Kim Larsen and Jirí
Srba: Reactive Systems - Modelling, Specification and
Verification