Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

32
Composition Sayan Mitra Verifying cyberphysical systems [email protected]

Transcript of Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Page 1: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Composition

Sayan MitraVerifying cyberphysical systems

[email protected]

Page 2: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

β€’ HW3 outβ€’ Read chapter 5

Page 3: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

What is composition?

β€’ Complex models and systems are built by putting together components or modules

β€’ Composition is the mathematical operation of putting together

β€’ Leads to precise definition of moduleinterfaces

β€’ What properties are preserved undercomposition?

model of a network of oscillators [Huang et. al 14]

Powertrain model from Toyota [Jin et al. 15]

Page 4: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

β€’ Give an example of how you’ve built something more complex from simple components

β€’ Throughout the lecture, think if your notion ofcomposition is captured by what we define

Page 5: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Outline

β€’ Composition operation– Input/output interfaces

β€’ I/O automataβ€’ hybrid I/O automataβ€’ Examplesβ€’ Properties of composition

Page 6: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Composition of automata

β€’ Complex systems are built by β€œputting together” simpler subsystems

β€’ Recall π’œ = βŸ¨π‘‹, Θ, 𝐴, π‘«βŸ©β€’ π’œ = π’œ*||π’œ,β€“π’œ*,π’œ, are the component automata and β€“π’œis the composed automaton– || symbol for the composition operator

Page 7: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Composition: asynchronous modules

a

b

c

π’œ

d

e

f

β„¬π’œ||ℬ

a d

a e

a f

b d

b e

b f

c d

c e

c f

Page 8: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

composition: modules synchronize

a d

a e

a f

b d

b e

b f

c d

c e

c f

a

b

c

π’œ

d

e

f

ℬ

Page 9: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Composition of (discrete) automata

β€’ More generally, some transitions of π’œ and ℬ may synchronize, while others may not synchronize

β€’ Further, some transitions may be controlled byπ’œ which when occurs forces the corresponding transition of ℬ

β€’ Thus, we will partition the set of actions 𝐴 of π’œ = βŸ¨π‘‹, Θ, 𝐴, π‘«βŸ© into– 𝐻: internal (do not synchronize)– 𝑂: output (synchronized and controlled by π’œ)– 𝐼: input (synchronized and controlled by some other automaton)

β€’ 𝐴 = 𝐻 βˆͺ 𝑂 βˆͺ 𝐼‒ This gives rise to I/O automata [Lynch, Tuttle 1996]

Page 10: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Reactivity: Input enablingβ€’ Consider a shared action brakeOn controlled by π’œ1 and listend-to or

read by π’œ2

β€’ Input enabling ensures that when π’œ1 and π’œ2 are composed then π’œ2can react to brakeOn

Definition. An input/output automaton is a tuple π’œ =βŸ¨π‘‹, Θ, 𝐴, π’ŸβŸ© whereβ€’ 𝑋 is a set of names of variablesβ€’ Θ βŠ† π‘£π‘Žπ‘™(𝑋) is the set of initial statesβ€’ 𝐴 = 𝐼 βˆͺ 𝑂 βˆͺ 𝐻 is a set of names of actionsβ€’ π’Ÿ βŠ† π‘£π‘Žπ‘™ 𝑋 Γ—π΄Γ—π‘£π‘Žπ‘™ 𝑋 is the set of transitions and π’œ

satisfies the input enabling condition:E1. For each 𝒙 ∈ π‘£π‘Žπ‘™ 𝑋 , π‘Ž ∈ 𝐼 there exists 𝒙@ ∈ π‘£π‘Žπ‘™ 𝑋 such that 𝒙 β†’B 𝒙′

Controllerπ’œ*

Vehicle

π’œ,

π‘π‘Ÿπ‘Žπ‘˜π‘’π‘‚π‘›Pre ProxSensorCritEff (do nothing)

π‘π‘Ÿπ‘Žπ‘˜π‘’π‘‚π‘›Pre ???Eff accel := -5

MovePre …Eff …

π‘π‘Ÿπ‘Žπ‘˜π‘’π‘‚π‘›

Page 11: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Compatibility IOAA pair of I/O automata π’œ* and π’œ, are compatible if 𝐻I ∩ 𝐴K = βˆ… no unintended interactions𝑂I ∩ 𝑂K = βˆ… no duplication of authority

Extended to collection of automata in thenatural way

π’œ*

π’œ,d

e

f

a

b

c

π’œM

π’œN

Page 12: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Composition of I/O automaton

Definition. For compatible automata π’œ1 and π’œ2 their composition π’œ1 || π’œ2 is the structure 𝓐= 𝑋, Θ, 𝐴, π’Ÿ

– 𝑋 = 𝑋* βˆͺ 𝑋,– Θ = 𝒙 ∈ π‘£π‘Žπ‘™(𝑋) βˆ€ 𝑖 ∈ 1,2 : π’™βŒˆπ‘‹π’Š ∈ Ξ˜π‘–}– 𝐻 = 𝐻1 βˆͺ 𝐻2

– O = 𝑂1 βˆͺ 𝑂2– I = 𝐼1 βˆͺ 𝐼, βˆ– 𝑂– 𝒙, π‘Ž, 𝒙′ ∈ π’Ÿ iff for 𝑖 ∈ {1,2}

β€’ π‘Ž ∈ 𝐴I and (π’™βŒˆπ‘‹I, π‘Ž, 𝒙@βŒˆπ‘‹) ∈ π’ŸIβ€’ π‘Ž βˆ‰ 𝐴I π’™βŒˆπ‘‹I = π’™βŒˆπ‘‹I

} 𝐴 = 𝐻 βˆͺ 𝑂 βˆͺ 𝐼

Page 13: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Theorem. The class of IO-automata is closed under composition. If π’œ1and π’œ2 are compatible I/O automata thenπ’œ = π’œ1||π’œ2 is also an I/O automaton.Proof. Only 2 things to check- Input, output, and internal actions are disjoint---by construction- π’œ satisfies E1. Consider any state 𝒙 ∈ π‘£π‘Žπ‘™ 𝑋* βˆͺ 𝑋, and any input

action a ∈ 𝐼1 βˆͺ 𝐼, βˆ– 𝑂 such that a is enabled in 𝒙. - Suppose, w.lo.g. a ∈ 𝐼1- We know by E1 of π’œ1 that there exists π’™πŸ@ ∈ π‘£π‘Žπ‘™(𝑋*) such that π’™βŒˆπ‘‹* β†’B π’™πŸ@

- π‘Ž βˆ‰ 𝑂,, 𝐼,, 𝐻, (by compatibility)- Therefore, 𝒙 β†’B (π’™πŸ@ , π‘₯ 𝑋, is a valid transition of π’œ (by definition

of composition)

Page 14: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Example: Sending process and channel

Automaton Sender(u)variables internal

failed:Boolean := F output send(m:M)input failtransitions:

output send(m)pre ~failedeff

input failpre trueeff failed := T

Loc 1

failed

send(m)~failed

failtrue

failed := T

Sender Channelsend(m) receive(m)fail

ReceiverSystem

Page 15: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

FIFO channel & Simple Failure Detector

Automaton Channel(M)variables internal queue: Queue[M] := {}actions input send(m:M)

output receive(m:M)transitions:

input send(m)pre trueeff queue := append(m, queue)

output receive(m)pre head(queue)=m

eff queue := queue.tail

Automaton System(M)variables queue: Queue[M] := {}, failed: Boolactions input fail

output send(m:M), receive(m:M)transitions:

output send(m)pre ~failedeff queue := append(m, queue)

output receive(m)pre head(queue)=m

eff queue := queue.tailinput fail

pre trueeff failed := true

Automaton Sender(u)variables internal

failed:Boolean := F output send(m:M)input failtransitions:

output send(m)pre ~failedeff

input failpre trueeff failed := T

Page 16: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

COMPOSING HYBRID SYSTEMS

Page 17: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Hybrid IO AutomatonIn addition to interaction through shared actions hybrid input/output automata (HIOA) will allow interaction through shared variables

Recall a hybrid automaton π’œ = βŸ¨π‘‰, Θ, 𝐴, 𝑫, π‘»βŸ©

We will partition the set of variables 𝑉 of π’œ into– 𝑋: internal or state variables (do not

interact)

– π‘Œ: output variables

– π‘ˆ: input variables

β€’ 𝑉 = 𝑋 βˆͺ π‘Œ βˆͺ π‘ˆ

This gives rise to hybrid I/O automata (HIOA) [Lynch, Segala, Vaandrager 2002]

Plant

π‘₯* = 𝑓* π‘₯*, π‘₯,𝑦* = π‘₯*

Controller

π‘₯, = 𝑔 π‘₯,, π‘₯*𝑦, = π‘₯,

𝑦*𝑦,

Page 18: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Reactivity: Input trajectory enablingConsider a shared variable throttle controlled by π’œ1 and listened-to or read by π’œ2

Input trajectory enabling ensures that when π’œ1 and π’œ2 are composed then π’œ2can react to any signal generated by π’œ*

If the trajectories of π’œ, are defined by ordinary differential equations, then input enabling is guaranteed if π’œ* only generates piece-wise continuous signals (throttle)

Definition. An hybrid input/output automaton is a tuple π’œ = βŸ¨π‘‰, Θ, 𝐴,𝓓, π‘»βŸ© where

β€’ 𝑉 = 𝑋 βˆͺ π‘ˆ βˆͺ π‘Œ is a set of variables

β€’ Θ βŠ† π‘£π‘Žπ‘™(𝑋) is the set of initial states

β€’ 𝐴 = 𝐼 βˆͺ 𝑂 βˆͺ 𝐻 is a set of actions

β€’ π’Ÿ βŠ† π‘£π‘Žπ‘™ 𝑋 Γ—π΄Γ—π‘£π‘Žπ‘™ 𝑋 is the set of transitions

β€’ 𝑻 is a set of trajectories for 𝑉 closed under prefix, suffix, and concatenation

E1. For each 𝒙 ∈ π‘£π‘Žπ‘™ 𝑋 , π‘Ž ∈ 𝐼 there exists 𝒙@ ∈ π‘£π‘Žπ‘™ 𝑋 such that 𝒙 β†’B 𝒙′

E2. For each 𝒙 ∈ π‘£π‘Žπ‘™ 𝑋 ,π’œ should be able to react to any trajectory πœ‚ of π‘ˆ.

i.e, βˆƒ 𝜏 ∈ 𝑻 with 𝜏. π‘“π‘ π‘‘π‘Žπ‘‘π‘’ = 𝒙 such that 𝜏 ↓ π‘ˆ is a prefix of πœ‚ and either (a) 𝜏 β†“π‘ˆ = πœ‚ or (b) 𝜏 is closed and some π‘Ž ∈ 𝐻 βˆͺ 𝑂 is enabled at 𝜏. π‘™π‘ π‘‘π‘Žπ‘‘π‘’.

Controllerπ’œ*

Vehicle

π’œ,

π‘‘β„Žπ‘Ÿπ‘œπ‘‘π‘‘π‘™π‘’

Page 19: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Compatibility of hybrid automata

β€’ For the interaction of hybrid automata π’œ1 and π’œ2 to be well-defined we need to ensure that they have the right interfaces

β€’ compatibility conditions

Controller

π’œ*

Vehicle

π’œ,

Output π‘Žπ‘π‘π‘’π‘™ Input π‘Žπ‘π‘π‘’π‘™π‘Žπ‘π‘π‘’π‘™

π‘π‘Ÿπ‘Žπ‘˜π‘’π‘‚π‘›Output π‘π‘Ÿπ‘Žπ‘˜π‘’π‘‚π‘› Input π‘π‘Ÿπ‘Žπ‘˜π‘’π‘‚π‘›

π‘π‘œπ‘ π‘–π‘‘π‘–π‘œπ‘›

Page 20: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Compatibility HIOAA pair of hybrid I/O automata π’œ* and π’œ, are compatible if 𝐻I ∩ 𝐴K = βˆ… no unintended discrete interactions𝑂I ∩ 𝑂K = βˆ… no duplication of discrete authority𝑋I ∩ 𝑉K = βˆ… no unintended continuous interactions

π‘ŒI ∩ π‘ŒK = βˆ… no duplication of continuous authority

Extended to collection of automata in the natural way and captures most common notions of composition in, for example, Matlab/Simulink

Page 21: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Compositionβ€’ For compatible π’œ1 and π’œ2 their composition π’œ1 || π’œ2 is the

structure 𝓐= 𝑉, Θ, 𝐴, π’Ÿ, 𝒯‒ Variables 𝑉 = 𝑋 βˆͺ π‘Œ βˆͺ π‘ˆ

– 𝑋 = 𝑋1 βˆͺ 𝑋2, Y = π‘Œ1 βˆͺ π‘Œ2 ,π‘ˆ = π‘ˆ1 βˆͺ π‘ˆ, βˆ– π‘Œ

β€’ Θ = 𝒙 ∈ π‘£π‘Žπ‘™(𝑋) βˆ€ 𝑖 ∈ 1,2 : π’™βŒˆπ‘‹π’Š ∈ Ξ˜π‘–}β€’ Actions 𝐴 = 𝐻 βˆͺ 𝑂 βˆͺ 𝐼

– 𝐻 = 𝐻1 βˆͺ 𝐻2, O = 𝑂1 βˆͺ 𝑂2 ,I = 𝐼1 βˆͺ 𝐼, βˆ– 𝑂,β€’ 𝒙, π‘Ž, 𝒙′ ∈ π’Ÿ iff for 𝑖 ∈ {1,2}

– π‘Ž ∈ 𝐴I and (π’™βŒˆπ‘‹I, π‘Ž, 𝒙@βŒˆπ‘‹I) ∈ π’ŸI– π‘Ž βˆ‰ 𝐴I π’™βŒˆπ‘‹I = π’™βŒˆπ‘‹I

β€’ 𝒯: set of trajectories for V– 𝜏 ∈ 𝒯 iff βˆ€ 𝑖 ∈ 1,2 ,𝜏 ↓ 𝑉I ∈ 𝒯i

Page 22: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

π’œ,

οΏ½οΏ½* = 𝑓(π‘₯*, 𝑒,)

e

f

π’œM

π’œN

a1

a1

a1

a1

u2

e

f

u2

Page 23: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Closure under composition

β€’ Conjecture. The class of HIOA is closed under composition. If π’œ1 and π’œ2 are compatible HIOA then π’œ1||π’œ2 is also a HIOA.

β€’ Can we ensure that input trajectory enabled condition is satisfied in the composed automaton?

β€’ No, in general– Additional conditions are needed Plant

Input 𝑒}π‘₯* = 𝑒}

output 𝑦~ = π‘₯*

ControllerInput yοΏ½

π‘₯, = 𝑦~ + 1Output 𝑒} = π‘₯,

𝑦~𝑒}

Page 24: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Example 2: Periodically Sending Process

Automaton PeriodicSend(u)variables internal clock: Reals := 0, z:Reals, failed:Boolean := F signature output send(m:Reals)

input failtransitions:

output send(m)pre clock = u /\ m = z /\ ~failedeff clock := 0input failpre trueeff failed := T

trajectories:evolve d(clock) = 1, d(z) = f(z)invariant failed \/ clock≀u

Loc 1𝑑 π‘π‘™π‘œπ‘π‘˜ = 1𝑑 𝑧 = 𝑓(𝑧)

~failedβ‡’π’„π’π’π’„π’Œ ≀ 𝒖

send(m)clock = u /\ m = z /\ ~failed

clock := 0

clock:= 0

failtrue

failed := T

Page 25: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Time bounded channel & Simple Failure Detector

Automaton Timeout(u,M)variables: suspected: Boolean := F,

clock: Reals := 0signature input receive(m:M)

output timeouttransitions:

input receive(m)pre trueeff clock := 0; suspected := false;output timeoutpre ~suspected /\ clock = ueff suspected := true

trajectories:evolve d(clock) = 1invariant clock≀ u\/suspected

Automaton Channel(b,M)variables internal queue: Queue[M,Reals] := {}

clock: Reals := 0signature input send(m:M)

output receive(m:M)transitions:

input send(m)pre trueeff queue := append(<m, clock+b>, queue)output receive(m)pre head(queue)[1]=m∧

head(queue)[2]=clockeff queue := queue.tail

trajectories:evolve d(clock) = 1invariant βˆ€<m,d>∈queue:d β‰₯ clock

Page 26: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Example 3: Oscillator and pulse generator

pulseGen Oscillator

Page 27: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

pre:π‘›π‘œπ‘€β‰₯𝑇 οΏ½

οΏ½οΏ½ef

f:π‘›π‘œπ‘€β‰”0

Composed automatonOn,Mode

𝑑 π‘›π‘œπ‘€ = 1𝑑 π‘₯* = βˆ’π‘₯* π‘₯*, + 0.9π‘₯* + 0.9 βˆ’ π‘₯, + 1𝑑 π‘₯, = π‘₯* βˆ’ 2π‘₯,π‘›π‘œπ‘€ ≀ 𝑇�’

Off,Mode𝑑 π‘›π‘œπ‘€ = 1𝑑 π‘₯* = βˆ’π‘₯* π‘₯*, + 0.9π‘₯* + 0.9 βˆ’ π‘₯, + 0𝑑 π‘₯, = π‘₯* βˆ’ 2π‘₯,π‘›π‘œπ‘€ ≀ 𝑇���

pre:π‘›π‘œπ‘€β‰₯𝑇 οΏ½

Β’ef

f:π‘›π‘œπ‘€β‰”0

pulseGen

Oscillator1

Oscillator2

Oscillator3

Oscillator4

Oscillator6

Oscillator5

Cardiac oscillator network models, Grosu et al. CAV, HSCC 2007-2015

Page 28: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Restriction operation on exections

β€’ Sometimes it is useful to restrict our attention to only some subset of variables and actions in an execution

β€’ Recall the restriction operations π‘₯βŒˆπ‘‰ π‘Žπ‘›π‘‘ 𝜏 ↓ 𝑉‒ Let 𝛼 = πœΒ€π‘Ž*𝜏*π‘Ž, be an execution fragment of a hybrid automaton with

set of variables 𝑉 and set of actions 𝐴. Let 𝐴′ be a set of actions and 𝑉′ be a set of variables.

β€’ Restriction of 𝛼 to (𝐴′, 𝑉′), written as π›ΌβŒˆ(𝐴′, 𝑉′) is the sequence defined inductively as:– π›ΌβŒˆ 𝐴@, 𝑉@ = 𝜏 ↓ 𝑉@ if 𝛼 = πœβ€“ 𝛼 π‘Ž 𝜏 ⌈ 𝐴@, 𝑉@ =

β€’ 𝛼 ⌈ 𝐴@, 𝑉@ π‘Ž (𝜏 ↓ 𝑉@) if a ∈ 𝐴′‒ 𝛼 ⌈ 𝐴@, 𝑉@ π‘π‘œπ‘›π‘π‘Žπ‘‘ (𝜏 ↓ 𝑉@) if a βˆ‰ 𝐴@

β€’ From the definition it follows 𝛼. π‘™π‘ π‘‘π‘Žπ‘‘π‘’ βŒˆπ‘‰@ = π›ΌβŒˆ 𝐴′, 𝑉@ . π‘™π‘ π‘‘π‘Žπ‘‘π‘’ for any 𝐴@, 𝑉′

Page 29: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Properties of CompositionsProposition. Let π’œ = π’œ*||π’œ,. 𝛼 is an execution fragment of π’œ iffπ›ΌβŒˆ 𝐴I, 𝑉I , 𝑖 ∈ 1,2 are both execution fragments of π’œI.

β€’ Proof of the forward direction. Fix 𝛼 and i. We prove this by induction on the length of 𝛼.

β€’ Base case: 𝛼 = 𝜏. π›ΌβŒˆ 𝐴I, 𝑉I = 𝜏 ↓ 𝑉I by definition of composition 𝜏 ↓ 𝑉I ∈ 𝑇I. So, 𝜏 ↓ 𝑉I ∈ πΉπ‘Ÿπ‘Žπ‘”I

β€’ 𝛼 = 𝛼′ π‘Ž 𝜏 ⌈ 𝐴I, 𝑉I and π‘Ž ∈ 𝐴I and by induction hypothesis π›Όβ€²βŒˆ 𝐴I, 𝑉I ∈ πΉπ‘Ÿπ‘Žπ‘”I. Let π›Όβ€²βŒˆ 𝐴I, 𝑉I . lstate = 𝑣. By the definition of composition: 𝜏 ↓ 𝑉I ∈ 𝑇I. – It remains to show that π‘£βŒˆπ‘‰I β†’B 𝜏 ↓ 𝑉I . π‘“π‘ π‘‘π‘Žπ‘‘π‘’. Since π‘Ž ∈ 𝐴I, by the definition of

composition: π›Όβ€²βŒˆ 𝐴I, 𝑉I . lstate β†’B 𝜏 ↓ 𝑉I. π‘“π‘ π‘‘π‘Žπ‘‘π‘’

β€’ 𝛼 = 𝛼′ π‘Ž 𝜏 ⌈ 𝐴I, 𝑉I and π‘Ž βˆ‰ 𝐴I and by induction hypothesis π›Όβ€²βŒˆ 𝐴I, 𝑉I ∈𝐸π‘₯𝑒𝑐I. Let πœβ€² be the last trajectory in that execution.– Since π‘Ž βˆ‰ 𝐴I, by the definition of composition:𝜏@. π‘™π‘ π‘‘π‘Žπ‘‘π‘’ = 𝜏 ↓ 𝑉I. π‘“π‘ π‘‘π‘Žπ‘‘π‘’ . By concatenation

closure of Ξ€I, it follows that 𝜏@π‘π‘œπ‘›π‘π‘Žπ‘‘ 𝜏 ↓ 𝑉I ∈ Ξ€I. Therefore π›ΌβŒˆ 𝐴I, 𝑉I ∈ 𝐸π‘₯𝑒𝑐I.

Page 30: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

properties of executions of composed automata

β€’ 𝛼 is an execution iff π›ΌβŒˆ 𝐴I, 𝑉I , 𝑖 ∈ 1,2 are both executions.

β€’ 𝛼 is time bounded iff π›ΌβŒˆ 𝐴I, 𝑉I , 𝑖 ∈ 1,2 are both time bounded.

β€’ 𝛼 is admissible iff π›ΌβŒˆ 𝐴I, 𝑉I , 𝑖 ∈ 1,2 are both admissible.

β€’ 𝛼 is closed iff π›ΌβŒˆ 𝐴I, 𝑉I , 𝑖 ∈ 1,2 are both closed.

β€’ 𝛼 is non-Zeno iff π›ΌβŒˆ 𝐴I, 𝑉I , 𝑖 ∈ 1,2 are both time non-Zeno.

Page 31: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Summary

β€’ Composition operation– I/O interfaces: actions and variables– Reactivity/input enabling– (non) Closure under composition

β€’ Properties of executions preserved under composition

β€’ Inductive invariants

Page 32: Sayan Mitra Verifying cyberphysicalsystems mitras@illinois

Example Inductive Invariance ProofS:βˆ€<m,d>∈x.queue:x.clock ≀ d ≀ x.clock+bIs an invariant for the timed channel.

Proof. Use the theorem. β€’ Check start condition. Holds vacuously as x.queue ={}[Def ofinitial

states]β€’ Checktrajectorycondition.Considerany𝜏, let x = 𝜏.fstate and x’ =

𝜏.lstate and 𝜏.ltime = t. Assume x satisfies (1) and show that x’ also.– x.queue =x’.queue [trajectoryDef],Fix<m,d> inx.queue– x.clock ≀d[ByAssumption]– Supposex’.clock >d– x’.clock - x.clock >d- x.clock– t>d- x.clock,thenthereexiststβ€™βˆˆπœ.dom andt’<twhere𝜏(t’).clock=d– Byinvariant𝜏.ltime =t’whichisacontradiction– Also,since d ≀x.clock+b, d≀x’.clock+t+b

β€’ Checktransitions:– 𝒙 β†’π’“π’†π’„π’†π’Šπ’—π’†(π’Ž) 𝒙’.Followsfromassumption𝒙 ∈ 𝑺.– 𝒙 →𝒔𝒆𝒏𝒅(π’Ž) 𝒙’ …