Docsity

Real-time & Hybrid Systems Modeling & Verification: Implementation, Simulations & Composit, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 598: Modeling and Verification of Real-time and Hybrid Systems Fall 2008
Lecture 18— 26th October, 2008
Simulations and Composition
Prof. Sayan Mitra Scribe: YOUR NAME
18.1 Implementation Relations
One of the key ideas in formal modeling and verification is the notion of abstraction. In this lecture
we will study different kinds of abstraction relations for Hybrid I/O Automata and techniques for
proving these relations.
HIOAs A1and A2are comparable if they have the same external interface. That is, O1∪I1=O2∪I2
and U1∪Y1=U2∪Y2. For comparable HIOAs A1and A2, we say that A1implements A2, denoted
by A1≤A2, if TracesA1⊆TracesA2. That is, all external behaviors of A1are allso allowed external
behaviors for A2. Informally, A2is the abstract automaton and A1is the concrete automaton.
Of course, we can reason about more than two comparable automata modelling the system at
different levels of abstractions.
Example. In Figure 1automaton TSpec abstractly specifies that a timeout action must occur
within dtime of a fail. The Timeout automaton is the composition of a periodically sending process,
a timed channel, and a detector. How can we prove that if d≥u2 + bthen Timeout ≤TSpec.
18.2 Simulations
The standard technique for proving A1≤ A2is to demonstrate the existence of a simulation
relation. There are various different kinds of simulation relations and in the remainder of this
lecture we’ll study them.
18.2.1 Forward Simulation
Definition 1. Consider comparable HIOAs Aand B. A simulation relation from Ato Bis a relation
R ⊆ QA×QBsatisfying the following conditions, for all states xand yof Aand B, respectively:
1. (Start condition) If x∈ΘAthen there exists a state y∈ΘBsuch that xRy.
2. (Transition condition) If xRyand xa
→x0where ais an action and x0is a state of A, then Bhas
a closed execution fragment βwith β.f state =y,trace(β) = trace(α), and x0Rβ.lstate.
3. (Trajectory condition) If xRyand αis an execution fragment of Awith consisting of a single
closed trajectory and α.fstate =x, then Bhas a closed execution fragment βwith β.f state =y,
trace(β) = trace(α), and α.lstate Rβ .lstate.
1
pf3
pf4
pf5

Partial preview of the text

Download Real-time & Hybrid Systems Modeling & Verification: Implementation, Simulations & Composit and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE 598: Modeling and Verification of Real-time and Hybrid Systems Fall 2008

Lecture 18— 26 th^ October, 2008

Simulations and Composition

Prof. Sayan Mitra Scribe: YOUR NAME

18.1 Implementation Relations

One of the key ideas in formal modeling and verification is the notion of abstraction. In this lecture we will study different kinds of abstraction relations for Hybrid I/O Automata and techniques for proving these relations.

HIOAs A 1 and A 2 are comparable if they have the same external interface. That is, O 1 ∪ I 1 = O 2 ∪ I 2 and U 1 ∪ Y 1 = U 2 ∪ Y 2. For comparable HIOAs A 1 and A 2 , we say that A 1 implements A 2 , denoted by A 1 ≤ A 2 , if TracesA 1 ⊆ TracesA 2. That is, all external behaviors of A 1 are allso allowed external behaviors for A 2. Informally, A 2 is the abstract automaton and A 1 is the concrete automaton. Of course, we can reason about more than two comparable automata modelling the system at different levels of abstractions.

Example. In Figure 1 automaton TSpec abstractly specifies that a timeout action must occur within d time of a fail. The Timeout automaton is the composition of a periodically sending process, a timed channel, and a detector. How can we prove that if d ≥ u2 + b then Timeout ≤ TSpec.

18.2 Simulations

The standard technique for proving A 1 ≤ A 2 is to demonstrate the existence of a simulation relation. There are various different kinds of simulation relations and in the remainder of this lecture we’ll study them.

18.2.1 Forward Simulation

Definition 1. Consider comparable HIOAs A and B. A simulation relation from A to B is a relation R ⊆ QA × QB satisfying the following conditions, for all states x and y of A and B, respectively:

  1. (Start condition) If x ∈ ΘA then there exists a state y ∈ ΘB such that x R y.
  2. (Transition condition) If x R y and x →a x′^ where a is an action and x′^ is a state of A, then B has a closed execution fragment β with β.f state = y, trace(β) = trace(α), and x′^ R β.lstate.
  3. (Trajectory condition) If x R y and α is an execution fragment of A with consisting of a single closed trajectory and α.f state = x, then B has a closed execution fragment β with β.f state = y, trace(β) = trace(α), and α.lstate R β.lstate.

automaton TSpec(d: R+) signature output fail, timeout variables internal last timeout: R∞ := ∞ now: R := 0; suspected: B := false; failed: B := false transitions output fail pre ¬ failed eff last timeout := now + d failed := true output timeout pre failed ∧ ¬ suspected; eff suspected := true; last timeout := ∞ trajectories trajdef beforeF afterS invariant ¬ failed ∨ (failed ∧ suspected) evolve d(now) = 1 trajdef FnotS invariant failed ∧ ¬ suspected stop when now > = 0 ∧ now = last timeout evolve d(now) = 1

automaton Timeout(u1, u2, b: Real) where u1 > = 0 ∧ u2 > = 0 ∧ b > = 0 ∧ u2 > (u1 + b) signature internal send(m: M), receive(m: M) output fail, timeout variables p clock: R∞ := 0; t clock: R∞ := u suspected: B := false; failed: B:= false now: R := 0 queue: timed message Q := mtQ() transitions internal send(m) pre now > = 0 ∧ ¬ failed ∧ p clock = now eff p clock := now + u queue := enQ((m, now + b), queue) internal receive(m) pre now > = 0 ∧ m = earliest msg(queue) eff t clock := now + u queue := deQ(queue) output fail pre ¬ failed eff failed := true; p clock := ∞ output timeout pre now > = 0 ∧ ¬ suspected ∧ t clock = now eff suspected := true; t clock := ∞ trajectories trajdef traj stop when now > = 0 ∧ (now = p clock ∨ now = t clock ∨ now = earliest deadline(queue)); evolve d(now) = 1;

Figure 1: Simple Failure Detector.

Theorem 1. Let A and B be comparable HIOAs and let R be a simulation relation from A to B. Then A ≤ B.

Proof. We have to show that A ≤ B. Suppose δ is the trace of an execution of A; we prove that δ is also a trace of an execution of B.

Let α = τ 0 a 1 τ 1 a 2 τ 2... be an execution of A such that trace(α) = δ.

We consider cases:

Case 1: α is an infinite sequence. We can write α as an infinite concatenation α 0 _^ α 1 _^ α 2.. ., in which the execution fragments αi with i even consist of a trajectory only, and the execution fragments αi with i odd consist of a single discrete transition surrounded by two point trajectories. We define inductively a sequence β 0 β 1 β 2... of closed execution fragments of B such that x R β 0 .f state, β 0 .f state ∈ ΘB, and for all i, βi.lstate = βi+1.f state, αi.lstate R βi.lstate, and trace(βi) = trace(αi). Property 1 of Definition 1 ensures that there exists such a β 0 .f state

  1. If x →τ x′^ for some x′^ ∈ QA and τ ∈ TA then B has a closed execution fragment β with β.f state = F (x), trace(Traces) = trace(τ ), and β.lstate = F (x′).

18.2.3 Bisimulation

Definition 3. Let A and B be comparable HIOAs. A bisimulation between A to B is a relation R ⊆ QA × QB such that R is a forward simulation from A to B and R−^1 is a forward simulation from B to A.

That is, R satisfies the following conditions, for all states x ∈ QA and y ∈ QB if xRy then the following conditions hold:

  1. If x →a x′^ for some x′^ ∈ QA and a ∈ AA then y β =⇒ y′, such that x′^ R y′^ and trace(β) = a.
  2. If x →τ x′^ for some x′^ ∈ QA and τ ∈ TA then y =β⇒ y′, such that x′^ R y′^ and trace(β) = τ.
  3. If y →a y′^ for some y′^ ∈ QB and a ∈ AB then x =α⇒ x′, such that x′^ R y′^ and trace(α) = a.
  4. If y τ → y′^ for some y′^ ∈ QB and τ ∈ TB then x α =⇒ x′, such that x′^ R y′^ and trace(α) = τ.

Example: Forward simulation and bisimulation in transition systems.

18.2.4 Backward Simulation

Definition 4. Let A and B be comparable HIOAs. A backward simulation from A to B is a total relation R ⊆ QA × QB satisfying the following conditions, for all states x ∈ QA and y ∈ QB:

  1. If x ∈ Q 0 A and x R y then y ∈ Q 0 B.
  2. If x R y and x′^ a → x for some x ∈ QA and a ∈ AA, then B has a closed execution fragment β with β.lstate = y, trace(β) = trace(a), and x′^ Rβ.f state.
  3. If x R y and x′^ →τ x where x′^ ∈ QA and τ ∈ TA, then B has a closed execution fragment β with β.lstate = y, trace(β) = trace(τ ), and x′^ R beta.f state.

A relation R ⊆ X × Y is said to be image finite if for every x ∈ X the set {y ∈ Y | x R y} is finite.

Theorem 2. Let A and B be comparable HIOAs and let R be an image finite backward simulation relation from A to B. Then A ≤ B.

Image finiteness is necessary for proving inclusion of traces that are open sequences. See [KLSV05] for the proof.

Example. Need for backward simulation The following example illustrates the need for back- ward simulation relation.

History and prophecy relations are discussed in [KLSV05].

References

[KLSV05] Dilsun K. Kaynar, Nancy Lynch, Roberto Segala, and Frits Vaandrager. The Theory of Timed I/O Automata. Synthesis Lectures on Computer Science. Morgan Claypool, November 2005. Also available as Technical Report MIT-LCS-TR-917.