CLASSI C CLASSI C CLASSI C Modelling , Specification , and - - PowerPoint PPT Presentation

classi c classi c classi c modelling specification and
SMART_READER_LITE
LIVE PREVIEW

CLASSI C CLASSI C CLASSI C Modelling , Specification , and - - PowerPoint PPT Presentation

CLASSI C CLASSI C CLASSI C Modelling , Specification , and Verification using UPPAAL Kim Guldstrand Larsen Finite State Machines Modelling using UC UC b Modelling processes A process is the execution of a sequential program.


slide-1
SLIDE 1

Modelling, Specification, and Verification

Kim Guldstrand Larsen

using UPPAAL

CLASSI C CLASSI C CLASSI C

slide-2
SLIDE 2

Modelling using Finite State Machines

slide-3
SLIDE 3

3

Kim G. Larsen

UC UC b

Modelling processes

A process is the execution of a sequential program. modeled as a finite state machine (LTS)

transits from state to state by executing a sequence of atomic actions.

a light switch LTS

  • noffonoffonoff ……….

a sequence of actions or trace

slide-4
SLIDE 4

4

Kim G. Larsen

UC UC b

Modelling Choices

  • Who or what makes the choice?
  • Is there a difference between input and output actions?
slide-5
SLIDE 5

5

Kim G. Larsen

UC UC b

Non-deterministic Choice Tossing a coin Possible traces?

Both outcomes possible Nothing said about relative frequency If coin is fair, the outcome is 50/50

slide-6
SLIDE 6

6

Kim G. Larsen

UC UC b

Non-Deterministic Choice modelling failure

How do we model an unreliable communication channel which accepts packets, and if a failure occurs produces no output, otherwise delivers the packet to the receiver? Use non-determinism...

slide-7
SLIDE 7

7

Kim G. Larsen

UC UC b

Internal-Actions

Spontaneous actions Internal actions Tau-actions Internal transitions can be taken on the initiative of a

single machine without communication with others

slide-8
SLIDE 8

8

Kim G. Larsen

UC UC b

Extended FSM

  • EFSM =

FSM + variables + enabling conditions + assignments

  • Transition still atomic
  • Can be translated into

FSM if variables have bounded domain

  • State: control location

+ variable values: (state,amount,capacity)

  • (s0,5,10)
slide-9
SLIDE 9

9

Kim G. Larsen

UC UC b

Parallel Composition: interleaving

2 states 3 states 2*3 states Lecturer = Speaker || Flipper Speaker Flipper from Flipper from Speaker

slide-10
SLIDE 10

10

Kim G. Larsen

UC UC b

Process Interaction ! = Output, ? = Input Handshake communication Two-way

Coffee Machine Lecturer University= Coffee Machine || Lecturer

  • LTS?
  • How many states?
  • Traces ?

4 states 4 states 4 states:Interaction constrain overall behavior synchronization results in internal actions

slide-11
SLIDE 11

Adding Tim e

slide-12
SLIDE 12

Informationsteknologi

Collaborators

@UPPsala

Wang Yi

Paul Pettersson

John Håkansson

Anders Hessel

Pavel Krcal

Leonid Mokrushin

Shi Xiaochun

@AALborg

Kim G Larsen

Gerd Behrman

Arne Skou

Brian Nielsen

Alexandre David

Jacob I. Rasmussen

Marius Mikucionis

Thomas Chatain

@Elsew here

Emmanuel Fleury, Didier Lime, Johan Bengtsson, Fredrik Larsson, Kåre J Kristoffersen, Tobias Amnell, Thomas Hune, Oliver Möller, Elena Fersman, Carsten Weise, David Griffioen, Ansgar Fehnker, Frits Vandraager, Theo Ruys, Pedro D’Argenio, J-P Katoen, Jan Tretmans, Judi Romijn, Ed Brinksma, Martijn Hendriks, Klaus Havelund, Franck Cassez, Magnus Lindahl, Francois Laroussinie, Patricia Bouyer, Augusto Burgueno, H. Bowmann, D. Latella, M. Massink, G. Faconti, Kristina Lundqvist, Lars Asplund, Justin Pearson...

slide-13
SLIDE 13

Informationsteknologi

Real Tim e System s

Plant

Continuous

Controller Program

Discrete

Eg.: Realtime Protocols

Pump Control Air Bags Robots Cruise Control ABS CD Players Production Lines

Real Time System

A system where correctness not only depends on the logical order of events but also on their timing!!

Real Time System

A system where correctness not only depends on the logical order of events but also on their timing!!

sensors actuators

slide-14
SLIDE 14

Informationsteknologi Real Tim e Model Checking

sensors actuators

a c b 1 2 4 3 a c b 1 2 4 3 1 2 4 3 1 2 4 3 a c b

UPPAAL Model

Model

  • f

environment (user-supplied / non-determinism) Model

  • f

tasks (automatic?)

Plant

Continuous

Controller Program

Discrete

SAT φ ?? SAT φ ??

slide-15
SLIDE 15

Informationsteknologi

??

Real Tim e Control Synthesis

Plant

Continuous

Controller Program

Discrete

sensors actuators

a c b 1 2 4 3 a c b 1 2 4 3 1 2 4 3 1 2 4 3 a c b

Partial UPPAAL Model

Model

  • f

environment (user-supplied)

Synthesis

  • f

tasks/scheduler (automatic)

SAT φ !! SAT φ !!

slide-16
SLIDE 16

Informationsteknologi Real-tim e Model-Based Testing

sensors actuators

Plant

Continuous

Controller Program

Discrete

a c b 1 2 4 3 a c b 1 2 4 3 1 2 4 3 1 2 4 3 a c b

UPPAAL Model

inputs

  • utputs

Test generation (offline or

  • nline) wrt.

Design Model

Conform s-to?

slide-17
SLIDE 17

Informationsteknologi

UPPAAL

Graphical Design Tool

  • timed automata =
  • state machines

+

  • clocks
  • communication
  • datatypes
  • user defined functions
  • cost variable

Graphical Design Tool

  • timed automata =
  • state machines

+

  • clocks
  • communication
  • datatypes
  • user defined functions
  • cost variable
slide-18
SLIDE 18

Informationsteknologi

UPPAAL

Graphical Simulator

  • visualization

and recording

  • inexpensive fault detection
  • inspection of error traces
  • Message Sequence Charts
  • (Gannt Charts)

Graphical Simulator

  • visualization

and recording

  • inexpensive fault detection
  • inspection of error traces
  • Message Sequence Charts
  • (Gannt Charts)
slide-19
SLIDE 19

Informationsteknologi

UPPAAL

Verifier

  • Exhaustive & automatic

checking of requirements

  • .. including validating, safety, liveness,

bounded liveness and response properties

  • .. generation of debugging information

for visualisation in simulator.

  • Optimal scheduling for cost models

Verifier

  • Exhaustive & automatic

checking of requirements

  • .. including validating, safety, liveness,

bounded liveness and response properties

  • .. generation of debugging information

for visualisation in simulator.

  • Optimal scheduling for cost models
slide-20
SLIDE 20

Informationsteknologi

“I m pact

UPPAAL downloads

y = 3,236x2 - 13,841x + 582,21

5000 10000 15000 20000 25000 9 9 7 9 9 1 1 3 7 1 1 1 3 1 7 1 1 1 2 3 2 7 2 1 1 3 3 3 7 3 1 1 4 3 4 7 4 1 1 5 3 5 7 5 1 1 6 3 6 7 Date Total number of Dowloads

UPPAAL downloads

100 200 300 400 500 600 700 1999 2000 2001 2002 2003 2004 2005 2006 Year Downloads per month

Google:

UPPAAL: 134.000 SPIN Verifier: 242.000 nuSMV: 57.700 > 1.500 Google Scholar Citations (Rhapsody/Esterel < 3.500)

slide-21
SLIDE 21

Informationsteknologi

I m pact

Academic Courses @

DTU, MCI, IT-U (DK) Chalmers, Linköping,Lund, Chalmers, Mälardalarn (S) Nijmegen, Twente, CWI (NL) Upenn, Northumbria(US) Braunschweig, Oldenborg, Marktoberdorf (D) Tsinghua, Shanghai, ISS, NUS (Asia)

slide-22
SLIDE 22

Informationsteknologi

I m pact

Tutorials Given @

Estonian School (01) IPA Fall Days (01) FTRTFT (02) CPN (02) SFM (02) MOVEP (02) DISC School (03) MOVEP (04) PRISE (04) PDMC (05) ARTIST2 (05) EMSOFT (05) RTSS (05) TECS week (06) TAROT (06) ARTS (06) GLOBAN (06) ARTIST ASIAN SCH (07)

slide-23
SLIDE 23

Informationsteknologi

I m pact

Company Downloads

Mecel Jet Symantec SRI Relogic Realwork NASA Verified Systems Microsoft ABB Airbus PSA Saab Siemens Volvo Lucent Technologies

slide-24
SLIDE 24

Tim ed Autom ata

Alur & Dill 1 9 8 9

slide-25
SLIDE 25

Informationsteknologi

UC UCb

Dum b Light Control

WANT: if press is issued twice quickly

then the light will get brighter; otherwise the light is turned off.

Off Light Bright

press? press? press? press?

slide-26
SLIDE 26

Informationsteknologi

UC UCb

Dum b Light Control

Off Light Bright

press? press? press? press?

Solution: Add real-valued clock x

x:= 0 x·3 x> 3

Alur & Dill 1990

slide-27
SLIDE 27

Informationsteknologi

UC UCb

Tim ed Autom ata

review

n m a Alur & Dill 1990

Clocks: x, y

x< = 5 & y> 3 x := 0

Guard

Boolean combination of integer bounds

  • n clocks

Reset

Action performed on clocks

Transitions

( n , x= 2.4 , y= 3.1415 ) ( n , x= 3.5 , y= 4.2415 )

e(1.1)

( n , x= 2.4 , y= 3.1415 ) ( m , x= 0 , y= 3.1415 )

a

State

( location , x= v , y= u )

where v,u are in R

Action

used for synchronization

Discrete Trans Delay Trans

slide-28
SLIDE 28

Informationsteknologi

UC UCb

Tim ed Autom ata

Off Light Bright

press? press? press? press? x:= 0 x·3 x> 3

Alur & Dill 1990

Synchronizing action Guard Conjunctions

  • f x~ n

x: real- valued clock Reset Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) States: ( location , x= v) where v∈R States: ( location , x= v) where v∈R

slide-29
SLIDE 29

Informationsteknologi

UC UCb

Tim ed Autom ata

Off Light Bright

press? press? press? press? x:= 0 x·3 x> 3

Alur & Dill 1990

Synchronizing action Guard Conjunctions

  • f x~ n

x: real- valued clock Reset Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) States: ( location , x= v) where v∈R States: ( location , x= v) where v∈R

slide-30
SLIDE 30

Informationsteknologi

UC UCb

Tim ed Autom ata

Off Light Bright

press? press? press? press? x:= 0 x·3 x> 3

Alur & Dill 1990

Synchronizing action Guard Conjunctions

  • f x~ n

x: real- valued clock Reset Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) States: ( location , x= v) where v∈R States: ( location , x= v) where v∈R

slide-31
SLIDE 31

Informationsteknologi

UC UCb

Tim ed Autom ata

Off Light Bright

press? press? press? press? x:= 0 x·3 x> 3

Alur & Dill 1990

Synchronizing action Guard Conjunctions

  • f x~ n

x: real- valued clock Reset Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) States: ( location , x= v) where v∈R States: ( location , x= v) where v∈R

slide-32
SLIDE 32

Informationsteknologi

UC UCb

Tim ed Autom ata

Off Light Bright

press? press? press? press? x:= 0 x·3 x> 3

Alur & Dill 1990

Synchronizing action Guard Conjunctions

  • f x~ n

x: real- valued clock Reset Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 2.51 ( Light , x= 2.51 ) press? ( Bright , x= 2.51 ) States: ( location , x= v) where v∈R States: ( location , x= v) where v∈R

slide-33
SLIDE 33

Informationsteknologi

UC UCb

I ntelligent Light Control

Off Light Bright

press? press? press? x:= 0 x·3 x> 3

Off Light Bright

press? press? press? press? X:= 0 X< = 3 X> 3

x·100

x= 100 x:= 0

x·100

x= 100 x:= 0 x:= 0 press? x:= 0

Using I nvariants

x:= 0

slide-34
SLIDE 34

Informationsteknologi

UC UCb

n m a

Clocks: x, y

x< = 5 & y> 3 x := 0

Transitions

( n , x= 2.4 , y= 3.1415 ) ( n , x= 3.5 , y= 4.2415 )

e(1.1)

( n , x= 2.4 , y= 3.1415 )

e(3.2)

x< = 5 y< = 10

Location Invariants

g1 g2 g3 g4

Tim ed Autom ata review

I nvariants

I nvariants ensure progress!! I nvariants ensure progress!!

slide-35
SLIDE 35

Informationsteknologi

UC UCb

I ntelligent Light Control

Off Light Bright

press? press? press? x:= 0 x·3 x> 3

x·100

x= 100 x:= 0

x·100

x= 100 x:= 0 x:= 0 press? x:= 0

Using I nvariants

Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 4.51 ( Light , x= 4.51 ) press? ( Light , x= 0 ) delay 100 ( Light , x= 100)

τ

( Off , x= 0) Transitions: ( Off , x= 0 ) delay 4.32 ( Off , x= 4.32 ) press? ( Light , x= 0 ) delay 4.51 ( Light , x= 4.51 ) press? ( Light , x= 0 ) delay 100 ( Light , x= 100)

τ

( Off , x= 0) Note: ( Light , x= 0 ) delay 103 Note: ( Light , x= 0 ) delay 103

X

Invariants ensures progress Invariants ensures progress

x:= 0

slide-36
SLIDE 36

Informationsteknologi

UC UCb

Exam ple

Reachable?

a b c

W ith tw o clocks

slide-37
SLIDE 37

Informationsteknologi

UC UCb

Exam ple

Reachable? x y

(L0,x= 0,y= 0)

a b c

W ith tw o clocks

slide-38
SLIDE 38

Informationsteknologi

UC UCb

Exam ple

Reachable? x y

(L0,x= 0,y= 0)

ε(1.4)

(L0,x= 1.4,y= 1.4)

a b c

ε(1.4)

W ith tw o clocks

slide-39
SLIDE 39

Informationsteknologi

UC UCb

Exam ple

Reachable? x y

(L0,x= 0,y= 0)

ε(1.4)

(L0,x= 1.4,y= 1.4)

a

(L0,x= 1.4,y= 0)

a b c

ε(1.4)

a

W ith tw o clocks

slide-40
SLIDE 40

Informationsteknologi

UC UCb

Exam ple

Reachable? x y

(L0,x= 0,y= 0)

ε(1.4)

(L0,x= 1.4,y= 1.4)

a

(L0,x= 1.4,y= 0)

ε(1.6)

(L0,x= 3.0,y= 1.6)

a

(L0,x= 3.0,y= 0)

a b c

ε(1.4)

a a

ε(1.6)

W ith tw o clocks

slide-41
SLIDE 41

Informationsteknologi

UC UCb

Netw orks

Light Controller & User

Off Light Bright

press? press? press? x:= 0 x·3 x> 3

x·100

x= 100 x:= 0

x·100

x= 100 x:= 0 x:= 0 press? x:= 0

Rest Busy

y≥10

y:= 0

y·10

press! press! y:= 0

Transitions: ( Off, Rest, x= 0, y= 0 ) delay 20 ( Off, Rest, x= 20, y= 20 ) press?! ( Light, Busy, x= 0, y= 0 ) delay 2 ( Light, Busy, x= 2, y= 2) press?! ( Bright, Rest, x= 0, y= 0) Transitions: ( Off, Rest, x= 0, y= 0 ) delay 20 ( Off, Rest, x= 20, y= 20 ) press?! ( Light, Busy, x= 0, y= 0 ) delay 2 ( Light, Busy, x= 2, y= 2) press?! ( Bright, Rest, x= 0, y= 0)

Synchronization

x:= 0

slide-42
SLIDE 42

Informationsteknologi

UC UCb

Netw orks of Tim ed Autom ata

( a’la CCS)

l1 l2

a!

x> = 2 x := 0

m1 m2

a?

y< = 4

………….

Two-way synchronization

  • n complementary actions.

Closed Systems!

Two-way synchronization

  • n complementary actions.

Closed Systems!

(l1, m1,………, x= 2, y= 3.5,…..) (l2,m2,……..,x= 0, y= 3.5, …..) (l1,m1,………,x= 2.2, y= 3.7, …..) 0.2 tau Example transitions If a URGENT CHANNEL

slide-43
SLIDE 43

Tim ed Autom ata

Form ally

slide-44
SLIDE 44

Informationsteknologi

UC UCb

slide-45
SLIDE 45

Informationsteknologi

UC UCb

slide-46
SLIDE 46

Informationsteknologi

UC UCb

slide-47
SLIDE 47

Informationsteknologi

UC UCb

slide-48
SLIDE 48

Informationsteknologi

UC UCb

Tim ed Autom ata: Exam ple

guard reset-set location

a

action

slide-49
SLIDE 49

Informationsteknologi

UC UCb

Tim ed Autom ata: Exam ple

a a a

guard reset-set location

a

action

slide-50
SLIDE 50

Informationsteknologi

UC UCb

Tim ed Autom ata: Exam ple

3 ≤ x

a

Invariant

slide-51
SLIDE 51

Informationsteknologi

UC UCb

Tim ed Autom ata: Exam ple

3 ≤ x

a a a a

Invariant

slide-52
SLIDE 52

Brick Sorting

slide-53
SLIDE 53

Informationsteknologi

UC UCb

LEGO Mindstorm s/ RCX

Sensors: temperature,

light, rotation, pressure.

Actuators: motors, lamps, Virtual machine:

− 10 tasks, 4 timers,

16 integers.

Several Programming

Languages:

− NotQuiteC, Mindstorm, Robotics, legOS, etc.

3 input ports 3 output ports 1 infra-red port

slide-54
SLIDE 54

Informationsteknologi

UC UCb

A Real Real Tim ed System

Controller Program

LEGO MINDSTORM

The Plant

Conveyor Belt & Bricks

slide-55
SLIDE 55

Informationsteknologi

UC UCb

First UPPAAL m odel

Sorting of Lego Boxes

Conveyer Belt

Exercise: Design Controller so that black boxes are being pushed out

Boxes

Piston

Black Red

9 18 81 90 99

Blck Yel remove eject

Controller

Ken Tindell

MAI N PUSH

slide-56
SLIDE 56

Informationsteknologi

UC UCb

NQC program s

task PUSH{ while(true){ wait(Timer(1)>DELAY && active==1); active=0; Rev(OUT_C,1); Sleep(8); Fwd(OUT_C,1); Sleep(12); Off(OUT_C); } } task PUSH{ while(true){ wait(Timer(1)>DELAY && active==1); active=0; Rev(OUT_C,1); Sleep(8); Fwd(OUT_C,1); Sleep(12); Off(OUT_C); } } int active; int DELAY; int LIGHT_LEVEL; int active; int DELAY; int LIGHT_LEVEL; task MAIN{ DELAY=75; LIGHT_LEVEL=35; active=0; Sensor(IN_1, IN_LIGHT); Fwd(OUT_A,1); Display(1); start PUSH; while(true){ wait(IN_1<=LIGHT_LEVEL); ClearTimer(1); active=1; PlaySound(1); wait(IN_1>LIGHT_LEVEL); } } task MAIN{ DELAY=75; LIGHT_LEVEL=35; active=0; Sensor(IN_1, IN_LIGHT); Fwd(OUT_A,1); Display(1); start PUSH; while(true){ wait(IN_1<=LIGHT_LEVEL); ClearTimer(1); active=1; PlaySound(1); wait(IN_1>LIGHT_LEVEL); } }

slide-57
SLIDE 57

Informationsteknologi

UC UCb

A Black Brick

slide-58
SLIDE 58

Informationsteknologi

UC UCb

Control Tasks & Piston

GLOBAL DECLARATI ONS: const int ctime = 75; int[ 0,1] active; clock x, time; chan eject, ok; urgent chan blck, red, remove, go;

slide-59
SLIDE 59

Informationsteknologi

UC UCb

From RCX to UPPAAL – and back

Model includes

Round-Robin Scheduler.

Compilation of RCX

tasks into TA models.

Presented at ECRTS

2000 in Stockholm.

From UPPAAL to

RCX: Martijn Hendriks.

Task MAI N

slide-60
SLIDE 60

Informationsteknologi

UC UCb The Production Cell in LEGO

Course at DTU, Copenhagen

Production Cell Rasmus Crüger Lund Simon Tune Riemanni

slide-61
SLIDE 61

Light Control I nterface

slide-62
SLIDE 62

Informationsteknologi

UC UCb

Light Control I nterface

Control Program User I nterface Light endhold! endhold! touch! touch! starthold! starthold! press? press? release? release? L+ + / L--/ L:= 0 L+ + / L--/ L:= 0

slide-63
SLIDE 63

Informationsteknologi

UC UCb

Light Control I nterface

Control Program User endhold! endhold! touch! touch! starthold! starthold! press? press? release? release? L+ + / L--/ L:= 0 L+ + / L--/ L:= 0

slide-64
SLIDE 64

Informationsteknologi

UC UCb

Netw orks of Tim ed Autom ata

( a’la CCS)

l1 l2

a!

x> = 2 x := 0

m1 m2

a?

y< = 4

………….

Two-way synchronization

  • n complementary actions.

Closed Systems!

Two-way synchronization

  • n complementary actions.

Closed Systems!

(l1, m1,………, x= 2, y= 3.5,…..) (l2,m2,……..,x= 0, y= 3.5, …..) (l1,m1,………,x= 2.2, y= 3.7, …..) 0.2 tau Example transitions If a URGENT CHANNEL

slide-65
SLIDE 65

Informationsteknologi

UC UCb

Netw ork Sem antics

A X ) s s , , S S ( T T

⊆ → × =

2 1 2 1 2 1⎪

X

⎪ ⎪

X

⎪ ⎪

X

⎪ ⎪

X

2 1 2 1 1 1 1

s ´ s s s ´ s s

⎯→ ⎯ ⎯→ ⎯

μ μ

⎪ ⎪

X

⎪ ⎪

X

´ s s s s ´ s s

2 1 2 1 2 2 2

⎯→ ⎯ ⎯→ ⎯

μ μ

⎪ ⎪

X

⎪ ⎪

X

´ s ´ s s s ´ s s ´ s s

a a

2 1 2 1 2 2 2 1 1 1

⎯→ ⎯ ⎯→ ⎯ ⎯→ ⎯

τ

⎪ ⎪

X

⎪ ⎪

X

´ s ´ s s s ´ s s ´ s s

) d ( e ) d ( e ) d ( e

2 1 2 1 2 2 2 1 1 1

⎯ ⎯ → ⎯ ⎯ ⎯ → ⎯ ⎯ ⎯ → ⎯

! ?

where

slide-66
SLIDE 66

Informationsteknologi

UC UCb

Netw ork Sem antics

( URGENT synchronization)

A X ) s s , , S S ( T T

⊆ → × =

2 1 2 1 2 1⎪

X

⎪ ⎪

X

⎪ ⎪

X

⎪ ⎪

X

2 1 2 1 1 1 1

s ´ s s s ´ s s

⎯→ ⎯ ⎯→ ⎯

μ μ

⎪ ⎪

X

⎪ ⎪

X

´ s s s s ´ s s

2 1 2 1 2 2 2

⎯→ ⎯ ⎯→ ⎯

μ μ

⎪ ⎪

X

⎪ ⎪

X

´ s ´ s s s ´ s s ´ s s

a a

2 1 2 1 2 2 2 1 1 1

⎯→ ⎯ ⎯→ ⎯ ⎯→ ⎯

τ

⎪ ⎪

X

⎪ ⎪

X

´ s ´ s s s ´ s s ´ s s

) d ( e ) d ( e ) d ( e

2 1 2 1 2 2 2 1 1 1

⎯ ⎯ → ⎯ ⎯ ⎯ → ⎯ ⎯ ⎯ → ⎯

! ?

where

+ U r g e n t s y n c h r

  • n

i z a t i

  • n

∀d’ < d, ∀u∈ UAct: ¬ ( s1 → → ∧ s2 → → )

e(d’) u! e(d’) u?

slide-67
SLIDE 67

Informationsteknologi

UC UCb

Control Program

Light Control Netw ork

endhold! endhold! touch! touch! starthold! starthold! press? press? release? release?

slide-68
SLIDE 68

Informationsteknologi

UC UCb

Validation Light Controller

slide-69
SLIDE 69

Druzba: The Show er Problem

slide-70
SLIDE 70

Informationsteknologi

UC UCb

The Druzba MUTEX Problem

Kim Gerd

slide-71
SLIDE 71

Informationsteknologi

UC UCb

The Druzba MUTEX Problem

slide-72
SLIDE 72

Informationsteknologi

UC UCb

The Druzba MUTEX Problem

Using the light as semaphor

slide-73
SLIDE 73

Overview of the UPPAAL Toolkit

slide-74
SLIDE 74

Informationsteknologi

UC UCb

UPPAAL’s architecture

Linux, W indow s, Solaris, MacOS

slide-75
SLIDE 75

Informationsteknologi

UC UCb

GUI

Editor Sim ulator Verifier

slide-76
SLIDE 76

Informationsteknologi

UC UCb

Train Crossing

River Crossing Gate Stopable Area [10,20] [7,15] Queue [3,5]

slide-77
SLIDE 77

Informationsteknologi

UC UCb

Train Crossing

River Crossing Gate Stopable Area [10,20] [7,15] Queue [3,5]

appr, stop leave go empty nonempty hd, add,rem

el el

Communication via channels and shared variable.

slide-78
SLIDE 78

Tim ed Autom ata in UPPAAL

slide-79
SLIDE 79

Informationsteknologi

UC UCb Declarations

Constants Bounded integers Channels Clocks Arrays Templates Processes Systems Constants Bounded integers Channels Clocks Arrays Templates Processes Systems

slide-80
SLIDE 80

Informationsteknologi

UC UCb

Declarations in UPPAAL

The syntax used for declarations in UPPAAL is similar to

the syntax used in the C programming language.

Clocks:

− Syntax: − clock x1, …, xn ; − Example: − clock x, y;

Declares tw o clocks: x and y.

slide-81
SLIDE 81

Informationsteknologi

UC UCb

Declarations in UPPAAL ( cont.)

Data variables

− Syntax: − int n1, … ;

I nteger w ith “default” dom ain.

− int[l,u] n1, … ;

I nteger w ith dom ain “l” to “u”.

− int n1[m], … ;

I nteger array w . elem ents n1 [ 0 ] to n1 [ m -1 ] .

− Example: − int a, b; − int[0,1] a, b[5][6];

slide-82
SLIDE 82

Informationsteknologi

UC UCb

Declarations in UPPAAL ( cont.)

Actions (or channels):

− Syntax: − chan a, … ;

Ordinary channels.

− urgent chan b, … ;

Urgent actions ( see later)

− Example: − chan a, b; − urgent chan c;

slide-83
SLIDE 83

Informationsteknologi

UC UCb

Declarations UPPAAL ( cont.)

Constants

− Syntax: − const int c1 = n1; − Example: − const int[0,1] YES = 1; − const bool NO = false;

slide-84
SLIDE 84

Informationsteknologi

UC UCb

Tim ed Autom ata in UPPAAL

invariants Guards Synchronizations Resets Discrete Variables

slide-85
SLIDE 85

Informationsteknologi

UC UCb

Tim ed Autom ata in UPPAAL

invariants Guards Synchronizations Resets

Discrete Variables

x := Expr

inv :: x Expr|x Expr|inv,inv = < <=

c d c d

g :: g |g |g,g g :: x Expr|x y Expr g :: Expr op Expr { , , , , }

  • p

{ , , , , ,! } = = ⊗ ⊗ + = ⊗∈ < <= == >= > ∈ < <= == >= > =

d

i: Expr Expr :: i|i[Expr]| n| Expr| Expr Expr| Expr Expr| Expr *Expr| Expr/Expr| (g ?Expr :Expr) = = − + −

slide-86
SLIDE 86

Informationsteknologi

UC UCb

Expressions

used in guards, invariants, assignments, synchronizations properties, used in guards, invariants, assignments, synchronizations properties,

slide-87
SLIDE 87

Informationsteknologi

UC UCb

Expressions

slide-88
SLIDE 88

Informationsteknologi

UC UCb

Operators

slide-89
SLIDE 89

Informationsteknologi

UC UCb

Guards, I nvariants, Assignm ents

Guards:

It is side-effect free, type

correct, and evaluates to boolean

Only clock variables,

integer variables, constants are referenced (or arrays of such)

Clocks and differences are

  • nly compared to integer

expressions

Guards over clocks are

essentially conjunctions (I.e. disjunctions are only allowed over integer conditions) Assignm ents

It has a side effect and is

type correct

Only clock variable,

integer variables and constants are referenced (or arrays of such)

Only integer are assigned

to clocks I nvariants

It forms conjunctions of

conditions of the form x<e

  • r x<=e where x is a clock

reference and e evaluates to an integer

slide-90
SLIDE 90

Informationsteknologi

UC UCb

Synchronization

Binary Synchronization

Declared like:

chan a, b, c[3];

If a is channel then:

a! = Emmision

a? = Reception

Two edges in different

processes can synchronize if one is emitting and the

  • ther is receiving on the

same channel. Broadcast Synchronization

Declared like

broadcast chan a, b, c[2];

If a is a broadcast channel:

a! = Emmision of broadcast

a? = Reception of broadcast

A set of edges in different

processes can synchronize if

  • ne is emitting and the others

are receiving on the same b.c.

  • channle. A process can always

emit. Receivers MUST synchronize if they can. No blocking.

slide-91
SLIDE 91

Informationsteknologi

UC UCb

More on Types

Multi dimensional arrays

− e.g. int b[4][2];

Array initialiser:

− e.g. int b[4] := { 1, 2, 3, 4 };

Arrays of channels, clocks, constants.

− e.g. − chan a[3]; − clock c[3]; − const k[3] { 1, 2, 3 };

Broadcast channels.

− e.g. broadcast chan a;

slide-92
SLIDE 92

Informationsteknologi

UC UCb

Tem plates

Templates may be

parameterised:

int v; const min; const max

int[0,N] e; const id

Templates are instantiated

to form processes:

P:= A(i,1,5);

Q:= A(j,0,4);

Train1:=Train(el, 1);

Train2:=Train(el, 2);

slide-93
SLIDE 93

Informationsteknologi

UC UCb

Extensions

Select statem ent

  • models a non-deterministic

choise

  • x : int[0,42]

Types

  • Record types
  • Type declarations
  • Meta variables:

not stored with state meta int x; Forall / Exists expressions

  • forall (x:int[0,42]) expr

true if expr is true for all values in [ 0,42] of x

  • exists (x:int[0,4]) expr

true if expr is true for some values in [ 0,42] of x Example: forall (x:int[0,4])array[x];

slide-94
SLIDE 94

Informationsteknologi

UC UCb

Urgency & Com m itm ent

Urgent Channels

No delay if the

synchronization edges can be taken !

No clock guard allowed. Guards on data-variables. Declarations:

urgent chan a, b, c[3]; Urgent Locations

No delay – time is freezed! May reduce number of

clocks! Com m itted Locations

No delay. Next transition MUST

involve edge in one of the processes in committed location

May reduce considerably

state space

slide-95
SLIDE 95

Queries : Specification Language

slide-96
SLIDE 96

Informationsteknologi

UC UCb

Logical Specifications

Validation Properties

Possibly: E< > P

Safety Properties

Invariant: A[ ] P

  • Pos. Inv.:

E[ ] P

Liveness Properties

Eventually: A< > P

Leadsto: P Q

Bounded Liveness

Leads to within: P · t Q

The expressions P and Q must be type safe, side effect free, and evaluate to a boolean. Only references to integer variables, constants, clocks, and locations are allowed (and arrays of these).

slide-97
SLIDE 97

Informationsteknologi

UC UCb

Logical Specifications

Validation Properties

Possibly: E< > P

Safety Properties

Invariant: A[ ] P

  • Pos. Inv.:

E[ ] P

Liveness Properties

Eventually: A< > P

Leadsto: P Q

Bounded Liveness

Leads to within: P · t Q

slide-98
SLIDE 98

Informationsteknologi

UC UCb

Logical Specifications

Validation Properties

Possibly: E< > P

Safety Properties

Invariant: A[ ] P

  • Pos. Inv.:

E[ ] P

Liveness Properties

Eventually: A< > P

Leadsto: P Q

Bounded Liveness

Leads to within: P · t Q

slide-99
SLIDE 99

Informationsteknologi

UC UCb

Logical Specifications

Validation Properties

Possibly: E< > P

Safety Properties

Invariant: A[ ] P

  • Pos. Inv.:

E[ ] P

Liveness Properties

Eventually: A< > P

Leadsto: P Q

Bounded Liveness

Leads to within: P · t Q

slide-100
SLIDE 100

Informationsteknologi

UC UCb

Logical Specifications

Validation Properties

Possibly: E< > P

Safety Properties

Invariant: A[ ] P

  • Pos. Inv.:

E[ ] P

Liveness Properties

Eventually: A< > P

Leadsto: P Q

Bounded Liveness

Leads to within: P · t Q

· t · t

slide-101
SLIDE 101

Informationsteknologi

UC UCb

Train Crossing

River Crossing Gate Stopable Area [10,20] [7,15] Queue [3,5]

appr, stop leave go empty nonempty hd, add,rem

el el

Communication via channels and shared variable.

slide-102
SLIDE 102

Informationsteknologi

UC UCb

Gear Controller

w ith MECEL AB

Lindahl, Pettersson, Yi 1998

V

  • l

v

  • S

a a b Network Canbus GearBox Engine Interface Clutch GearControl

Flow graph

slide-103
SLIDE 103

Informationsteknologi

UC UCb

Gear Controller

w ith MECEL AB

Requirem ents

Volvo Saab GearBox Engine Interface Clutch GearControl

slide-104
SLIDE 104

Informationsteknologi

UC UCb

UPPAAL 3 .4

Gate Tem plate I ntQueue

int[0,N] list[N], len, i;

slide-105
SLIDE 105

Informationsteknologi

UC UCb

UPPAAL 3 .6 ( 3 .5 ) w ith C-Code

Gate Tem plate Gate Declaration

slide-106
SLIDE 106

Informationsteknologi

UC UCb

Case-Studies: Controllers

Gearbox Controller [ TACAS’98] Bang & Olufsen Power Controller

[ RTPS’99,FTRTFT’2k]

SIDMAR Steel Production Plant [ RTCSA’99,

DSVV’2k]

Real-Time RCX Control-Programs [ ECRTS’2k] Experimental Batch Plant (2000) RCX Production Cell (2000) Terma, Verification of Memory Management for

Radar (2001)

Scheduling Lacquer Production (2005) Memory Arbiter Synthesis and Verification for a

Radar Memory Interface Card [ NJC’05]

slide-107
SLIDE 107

Informationsteknologi

UC UCb

Case Studies: Protocols

Philips Audio Protocol [ HS’95, CAV’95, RTSS’95,

CAV’96]

Collision-Avoidance Protocol [ SPIN’95] Bounded Retransmission Protocol [ TACAS’97] Bang & Olufsen Audio/ Video Protocol [ RTSS’97] TDMA Protocol [ PRFTS’97] Lip-Synchronization Protocol [ FMICS’97] Multimedia Streams [ DSVIS’98] ATM ABR Protocol [ CAV’99] ABB Fieldbus Protocol [ ECRTS’2k] IEEE 1394 Firewire Root Contention (2000) Distributed Agreement Protocol [ Formats05] Leader Election for Mobile Ad Hoc Networks

[ Charme05]

slide-108
SLIDE 108

Informationsteknologi

UC UCb w w w .uppaal.com