ModellierungundAnalysehybriderSysteme_SS13_first_solution
ModellierungundAnalysehybriderSysteme_SS13_first_solution
First Exam
Monday, July 29, 2013
n
Sign here:
tio
• Do not open the exam until we give the start signal.
• Please place your student identity card on your desk for identification purposes.
• Please use a separate sheet for each task. If you need more sheets, indicate this by a
hand signal.
So
• You are not allowed to use auxiliary material except for a pen. In particular, switch
off your electronic devices! Cheating disqualifies from the exam.
Good luck!
Name: Student number:
First, the ball raises with decreasing velocity until it starts to fall. When it hits the ground,
it bounces and starts to raise again. We model the bouncing as a discrete event, inversing
n
the sign of the velocity and reducing its absolute value by 50%.
(1) Please define the missing components of the following hybrid automaton to model the
bouncing ball:
x = 10 ∧ v = 10 ẋ =
v̇ =
l0
tio
(2) Is the above automaton Zeno-free? Explain your answer!
lu
(3) Is the above automaton a linear hybrid automaton? Justify your answer!
Solution:
l0
x = 10 ∧ v = 10 ẋ = v x=0∧v <0
v̇ = −g v := −0.5v
x≥0
(2) No. Since the ball loses the half of its kinetic energy upon bouncing, the time between two
successive bounces converges to 0 when time proceeds. Thus all paths of this automaton
are time-convergent. Those paths that contain infinitely many discrete steps, for example
the path having only time steps of maximal durations, are Zeno paths.
(3) Our model is not a linear hybrid automaton, because its behaviour is not linear: the
derivative of x is not constant.
Name: Student number:
(1) Please define the operational semantics of timed automata by formalizing the rules for
time evolution and discrete transitions.
x=0 `0 x=1
ẋ = 1 x := 0
n
We want to check whether T satisfies the TCTL formula EGEF ≤1 (x = 1).
(i) How many abstract states are generated by the state space abstraction? Explain!
Solution:
(1)
system? Why?
ν |= g
tio
(ii) Which of the abstract states have a self-loop in the corresponding region transition
t > 0 ν 0 = ν + t ν 0 |= Inv(l)
t
Rule Time
(l, ν) → (l, ν 0 )
So
(2) (i) By the transformation of the TCTL formula to a CTL formula a new clock z is
introduced with cz = 1 the maximal constant to which z is compared to in the CTL
formula (T is only extended with the new clock z but z is not compared to any
value in the extension). The largest constant to which x is compared to in the CTL
formula or in the automaton is also cx = 1.
Note that the automaton has a single location. Therefore, the abstraction defines
two states (l0 , ν) and (l0 , ν 0 ) to be equivalent if
• either ν(x) > cx ∧ ν 0 (x) > cx or
Therefore, the state space will define the following 18 abstract states:
z
15 16 17 18 1 : x=0∧z =0
2 : 0<x<1∧z =0
n
1 11 12 13 14
3 : x=1∧z =0
4 : x>1∧z =0
5 6 7 8 9 10 5 : x=0∧0<z <1
6 : 0<x<1∧0<z <1∧x<z
0 1
0
2
tio
3
1
4 x
7
8
9
10
11
12
13
14
15
:
:
:
:
:
:
:
:
:
0<x<1∧0<z <1∧x=z
0<x<1∧0<z <1∧x>z
x=1∧0<z <1
x>1∧0<z <1
x=0∧z =1
0<x<1∧z =1
x=1∧z =1
x>1∧z =1
x=0∧z >1
lu
16 : 0<x<1∧z >1
17 : x=1∧z >1
18 : x>1∧z >1
(ii) Only state 18 has a self-loop for two reasons: Firstly, the discrete transition changes
the abstract state from one satisfying x = 1 to another one with x = 0, therefore
there are no self-loops representing discrete steps (if there would be one than the
So
system would be Zeno). Secondly, in order to avoid abstract paths that represent
only time-convergent paths, no time-step-representing self-loops are added to the
states 1-17. However, there is a self-loop on state 18 to represent infinite stay in
the upper-unbounded region.
Name: Student number:
(1) Please explain the differences between rectangular automata and timed automata.
(3) Please transform the following initialized rectangular automaton into an initialized sin-
gular automaton. You may skip irrelevant parts of the result like unreachable locations,
invariant components that are satisfied by all states reachable in the given location, etc.
`0 `1
x=0 x≥2
n
ẋ ∈ [1, 2] ẋ ∈ [−2, 0]
x := 0
x ∈ [0, 4]
Solution:
tio
(1) In a rectangular automaton, the derivative of a variable can be defined by an interval,
however, all variable derivatives in a timed automaton should be 1. For a discrete transi-
tion, a rectangular automaton may reset a variable nondeterministically to a value from
an interval, however, a timed automaton can only reset a variable to value 0.
(2) We call a rectangular automaton initialized, if for each discrete transition e and each
variable x the following holds: if the derivative of x in the source location of e differs
from the derivative of x in the target location of e, then x is reset by e.
lu
(3)
xu ≥ 2
xl := 0, xu := 0
So
`0 `00 `1
xl = 0 ẋl = 1 xu = 4 ẋl = 1 true ẋl = −2
xu = 0 ẋu = 2 xu := 4 ẋu = 0 xl := 0, xu := 0 ẋu = 0
xu ≤ 4 xl ≤ 4
Name: Student number:
(1) Is the bounded reachability problem decidable for linear hybrid automata (with linear
behavior)? Prove your answer!
(2) Which state set representation did we use for linear hybrid automata? How can the
operations for union, intersection, membership and test for emptiness be computed for
that representation?
x≥2
n
`0 x := 0 `1
x=0 ẋ = 1 ...
y=0 ẏ = −1
x ≤ 3 ... y ≤ 3
tio
Let I be the representation of the initial state set {(l0 , ν) ∈ Σ | ν(x) = ν(y) = 0}.
Compute the forward time closure Tl0+ (I) (or hIi%l0 in the notation of the lecture notes).
Don’t forget to reduce the result using quantifier elimination.
Solution:
lu
(1) Yes, the bounded reachability problem is decidable on linear hybrid automata, because
paths of bounded length can be encoded in linear real arithmetic, which is a decidable
logic.
(2) Assume that the linear hybrid automaton A has N locations `1 , . . . , `N . We may represent
the a state set of A by N tuples h`1 , ϕ1 i, . . . , h`N , ϕN i such that ϕ1 , . . . , ϕN are linear
real arithmetic formulas. For two state set representations S1 = {h`1 , ϕ1 i, . . . , h`N , ϕN i}
So
and S2 = {h`1 , ψ1 i, . . . , h`N , ψN i}, and a state s = h`i , νi of A, the operations can be
computed as follows:
T`+
0
(I) = h`0 , ∃x0 .∃y 0 .∃t.(t ≥ 0 ∧ x0 = 0 ∧ y 0 = 0 ∧ x = x0 + t ∧ y = y 0 − t ∧ x ≤ 3)i
= h`0 , x + y = 0 ∧ x ≥ 0 ∧ x ≤ 3i .
Name: Student number:
(1) Please complete the following table with the information whether for the given subclasses
of hybrid automata the reachability and bounded reachability problems are decidable or
not!
Automata subclass Is the reachability Is the bounded reach-
problem decidable? ability problem decid-
able?
Timed automata
Initialized rectangular automata
Rectangular automata
n
Linear hybrid automata
General hybrid automata
(2) Please specify in pseudo-code the general (i.e., representation-independent) algorithm for
Solution:
(1)
Automata subclass
tio
forward reachability computation (i.e., to compute the set of states reachable from a given
initial state set). Use I to represent the set of initial states, Reach(R) to represent the
set of states reachable in one step from R, and the notations for standard set operations.
(2)
(2) Please describe the two representations that we discussed in the lecture for polytopes.
(3) How can we compute the convex hull of the union of two polytopes in those representa-
tions?
(4) Using polytopes to represent state sets, in the approximation of a flow pipe segment we
used bloating. What is it and what do we need it for?
n
Solution:
spaces. tio
(2) Polytopes can be represented in two ways.
(3) If both of the polytopes are V-polytopes, say P1 : {v1 , . . . , vn } and P2 : {u1 , . . . , um },
then the convex hull of their union can be represented by the V-polytope conv(P1 ∪ P2 ) :
{v1 , . . . , vn , u1 , . . . , um }. If at least one of the polytopes is not a V-polytope, we may
converse it into a V-polytope and use the previous method to compute their convex hull.
lu
(4) To compute a polytope over-approximation of a flow pipe segment, say from time t1 to
t2 , we first compute the reachable sets R1 and R2 at time t1 and t2 respectively, and
compute a convex hull of R1 ∪ R2 which is a polytope P . However, the convex hull P
does not include some non-linear trajectories from R1 to R2 , therefore we need to bloat
P to P + such that all trajectories are included in P + .
So