where I
n − 1
= [l
I
k
, l
I
k
] if
r
n
= r
n − 1
= k,
and I
n − 1
= I
k
if i k = r
n − 1
B r
n
, and I
n − 1
= [c, d] if
i = r
n − 1
B r
n
.
3
.
4
.
4
. Parallel operator p
q=pq; trueqp; true With the parallel construct, the processes p and
q are executed over a sequence of macrostates synchronously, and can be modelled by true con-
currency. In fact, the parallel operator presented here is very close to conjunction. The basic differ-
ence between p
q and pq is that the former allows processes both p and q to be able to specify
their own intervals while the latter only permits one of them, either p or q, to do so. For instance,
T
f
= 2
T
f
= 3 holds but T
f
= 2 T
f
= 3 is obvi-
ously false.
3
.
4
.
5
. Conditional statement if b then p else q
def b p ¬b q
if b then p def
if b then p else empty where b is a boolean state term consisting of
constants, variables, propositions, and boolean connectives.
3
.
4
.
6
. Unit assignment operator x e
def skip x = e
where x be a variable, and e an expression term. The unit assignment assigns value e to x at the
next state, and, in the meantime, it specifies the length of the interval over which the assignment
takes place to be 1.
3
.
4
.
7
. Terminations and iterations 1 finp
def empty p
2 keepp def
more p 3 haltp
def empty l p
4 while b do p def
b p fin¬b 5 repeat p until ¬b
def p; while b do p
6 for k = m to n do p def
if n B m then empty else p; for k = m + 1 to n do p
where m and n are static variables or constants while k is a static variable. The finp, keepp,
and haltp have similar meanings to fin
c
p, keep
c
p, and halt
c
p but are concerned with the discrete macrostate sequences. finp holds over
an interval if p holds at the final microstate over an interval, whereas keepp holds over an inter-
val as long as p holds at all states ignoring the end microstate of the final macrostate. haltp holds
over an interval if and only if p holds at the end microstate of the final macrostate.
The while, repeat and for constructs facilitate iterations. Their meanings are similar to their
meanings in imperative programming languages. In particular, while b do p holds over an interval if
and only if the interval can be partitioned into finitely or infinitely many subintervals on each of
which b p holds b evaluated at the starting microstate, and ¬b holds eventually at the final
microstate s
− k
, s
+ k
but evaluated with the right limit state s
+ k
if any. Otherwise, the formula p is executed repeatedly ad infinitum.
The temporal operators are called next , projection prj , chop ;, chop star , continuous
chop ;
c
, continuous e6entually 2
c
, continuous always
c
, always
, sometimes 2. weak next Õ and continuous parallel
c
3
.
5
. Precedence rules In order to avoid an excessive number of paren-
theses, the following precedence rules are used: 1 first: ¬; 2 second: 2
c
,
c
, d, Õ, 2,
; 3 third: ×
, Ö; 4 fourth: = , ; 5 fifth: , ,
c
; 6 sixth: , l ; 7 seventh:;
c
;, prj.
4. Examples of hybrid systems
In this section, we illustrate how HPTL can be used to model hybrid systems. Two examples: ion
flow and antigen-antibody interaction are mod- elled by the formalisms.
4
.
1
. Ion flow through 6oltage-gated channels We first model a non-linear hybrid system — ion
flow through voltage-gated channels during action potential depolarisation and repolarisation. Ini-
tially the system is resting. At the start the mem- brane potential is approximately − 70 mV. the
Na
+
activation gate is closed, the Na
+
activation gate is open and the K
+
gate is closed. During the depolarisation phase at a threshold of about − 55
mV the Na
+
activation gate opens with the poten- tial rising. Repolarisation begins at around + 30
mV when the Na
+
inactivation gate closes and the K
+
gate opens. Finally there is the repolarisation stage when the potential returns to − 70 mV. Both
polarisation and depolarisation are exponential processes. The model does not take into account
leakage channels and Na
+
pumps. The overall situation is similar to that of a thermostat control
system in a processing plant. Here, the temperature of a plant is controlled through a thermostat, which
continuously senses the temperature and turns a heater on and off Nicollin et al., 1992; Alur et al.,
1993.
The membrane potential is governed by differen- tial equations. During depolarisation, the mem-
brane potential, denoted by the variable x, decreases according to the exponential function
xu, t = ue
− kt
, where t is the time, u is the initial potential, and k is a constant determined by the
circumstances; when repolarisation is occurring, the potential follows the function xu, t =
u e
− kt
+ h1 − e
− kt
, where h is another system constant. Suppose that the initial potential is u
M
. We wish to keep the potential between u
M
and u
m
0 5 u
m
5 u
M
. We now model this system in HPTL:
p
1
def
c
x;= −kxhalt
c
x = u
m
p
2
def
c
x;=hX−xhalt
c
x = u
M
q def x = u
M
x = u
M
x = u
m
x = u
m
x = u
M
then the formula: p
1
, p
2 +
prj qp
1
, p
2
, p
1 +
prj q models the ion flow. It is clear that the first disjunct
models the situation in which the process starting with p
1
and followed by p
2
is repeatedly executed, whereas the second disjunct models the case in
which the process p
1
is firstly executed, then the process starting with p
2
and followed by p
1
is repeated. We require that the following hold:
c
u
m
5 x 5 u
M
.
4
.
2
. Antigen – antibody interaction This example, similar to the well-known cat and
mouse example presented in Manna and Pnueli 1993, is a constant slope hybrid system. More
detailed aspects of immune system modelling is to be found in Bell and Holcombe 1998. At time
t = 0, antigen is introduced and increases towards the threshold X. L time units later, the antibody
response starts.
The following formulas of HPTL describe the possible scenarios:
p
1
def
c
x = x e
kt c
y = y halt
c
t = L, p
2
def
c
x = x e
kt − y
y
= y
e
rt
halt
c
x = 0x = X, q def = t = 0 x
= D y
= D x
= x y
= y
2
x = 0 infection clears
x = X nasty outbreak of blue spots. Thus, the following projection construct models
the system: p
1
, p
2
prj q where the continuous variables, x and y, represent
the amounts of Ag and Ab respectively. Further details of X-machine models of aspects of the
immune system can be found in Bell 1999.
5. Conclusions