Diapositive 1 - Nicolas Ayache

config name level. F1 D1 init min? .. max? F2 D1 fill min? .. max? F1 D2 no filler min? .. max? F2 D2 drain min? .. max? System States: variable values for each.
630KB taille 3 téléchargements 217 vues
                           Verifying SystemC with Scenario

Nicolas Ayache Loïc Correnson Franck Védrine

DTSI

VECoS '08 – 3­4 juillet

1/?

Different techniques for System Verification Abstract Interpretation: 1 process e

                          

φe(x)

Model Checking: N processes ∀ρ, φ(ρ)

ρ

φ(ρ)

Simulation: N processes DTSI

VECoS '08 – 3­4 juillet

2/?

SystemC Example: Tank

Filler +1

                           hi

on off

level lo

Drainer

Controller

3 processes: Filler, Drainer, Controller 4 shared variables: level, hi, lo, faucet

0/­5 faucet

Interesting variable : level

DTSI

VECoS '08 – 3­4 juillet

3/?

What is happening? Eventually, Periodic Behavior level

                           900

600

t

Goal: Eventually, level (± δ)  [600 ; 900]

DTSI

VECoS '08 – 3­4 juillet

4/?

Our Approach for Verification

« Abstract Interpretation for N processes »                            « Scenario: Abstract Interpretation and Model Checking cooperating » « Scenario: the Engineering point of view »

DTSI

VECoS '08 – 3­4 juillet

5/?

Abstract Interpretation of N processes Processes: translated into LTS of waiting points if faucet = 0

1 2

                          

faucet

D1/F1: Drainer/Filler waits faucet D2/F2: Drainer/Filler waits clock

clock

level change

System States: variable values for each  waiting points tuple

DTSI

config F1  D1 F2  D1 F1  D2 F2  D2

VECoS '08 – 3­4 juillet

name init fill no filler drain

level min? .. max? min? .. max? min? .. max? min? .. max?

6/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

                          

if faucet = 0

clock

DTSI

name init fill no filler drain

level

D2 clock

level change

config F1  D1 F2  D1 F1  D2 F2  D2

D1 faucet

level change

level ? ? ? ?

VECoS '08 – 3­4 juillet

7/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

                          

if faucet = 0

clock

DTSI

name init fill no filler drain

level

D2 clock

level change

config F1  D1 F2  D1 F1  D2 F2  D2

D1 faucet

level change

level 0 .. 0 ? ? ?

VECoS '08 – 3­4 juillet

F1  D1

0 .. 0

8/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

                          

if faucet = 0

clock

DTSI

name init fill no filler drain

level

D2 clock

level change

config F1  D1 F2  D1 F1  D2 F2  D2

D1 faucet

level change

level 0 .. 0 ? ? ?

VECoS '08 – 3­4 juillet

F2  D1

0 .. 0

9/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

clock

DTSI

name init fill no filler drain

+1

                          

if faucet = 0

level

D2 clock

level change

config F1  D1 F2  D1 F1  D2 F2  D2

D1 faucet

level change

level 0 .. 0 0 .. 902 ? ?

VECoS '08 – 3­4 juillet

F2  D1

0 .. 0 0 .. 1 ... 0 .. 902

widening narrowing

10/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

                          

if faucet = 0

clock

DTSI

name init fill no filler drain

level

D2 clock

level change

config F1  D1 F2  D1 F1  D2 F2  D2

D1 faucet

level change

level 0 .. 0 0 .. 902 ? ?

VECoS '08 – 3­4 juillet

F2  D2

901 .. 902

11/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

D1 faucet

+1

                          

if faucet = 0

clock

level

D2 clock ­5

level change

config F1  D1 F2  D1 F1  D2 F2  D2

DTSI

name init fill no filler drain

level change

level 0 .. 0 0 .. 902 ? 593 .. 902

VECoS '08 – 3­4 juillet

F2  D2

901 .. 902 897 .. 902 ... 593 .. 902

widening narrowing

12/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

                          

if faucet = 0

clock

DTSI

name init fill no filler drain

level

D2 clock

level change

config F1  D1 F2  D1 F1  D2 F2  D2

D1 faucet

level change

level 0 .. 0 0 .. 902 ? 593 .. 902

VECoS '08 – 3­4 juillet

F2  D1

593 .. 599

13/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

clock

DTSI

name init fill no filler drain

+1

                          

if faucet = 0

level

D2 clock

level change

config F1  D1 F2  D1 F1  D2 F2  D2

D1 faucet

level change

level 0 .. 0 0 .. 902 ? 593 .. 902

F2  D1

593 .. 599



VECoS '08 – 3­4 juillet

14/?

Abstract Interpretation of N processes Filler if faucet = 0

F1

F2

Drainer faucet

                          

if faucet = 0

clock

DTSI

name init fill no filler drain

level

D2 clock

level change

config F1  D1 F2  D1 F1  D2 F2  D2

D1 faucet

level change

level 0 .. 0 0 .. 902 ? 593 .. 902

Fixpoint!

VECoS '08 – 3­4 juillet

15/?

Abstract Interpretation: Results level

2 phases Fill: level    0   .. 902                            Drain: level  593 .. 902

902

593

t

Alternating Behavior Eventually, level (± δ)  [600 ; 900]

DTSI

VECoS '08 – 3­4 juillet

16/?

What is really happening level

902

                          

593

t

3 phases:

DTSI

Fill0

level (± δ)   0 .. 600 ↗

Fill

level (± δ)  600 .. 900 ↗

Drain

level (± δ)  600 .. 900 ↘

VECoS '08 – 3­4 juillet

17/?

Scenarios  (Meta­Processes as Observer Automata) Scenario wait lo; loop { wait hi; wait lo; }

DTSI

config F2  D1 F2  D2

name fill drain

level 0 .. 902 593 .. 902

Synchronized Product (for free)

lo S1

S2 hi

                           System w/o Scenario

S3 lo

config S1  F2  D1 S2  F2  D1 S3  F2  D2

VECoS '08 – 3­4 juillet

name fill0 fill drain

level 0 .. 602 593 .. 902 593 .. 902

18/?

Scenario: Engineering point of view S

E

Scenario  (a set of) System traces

Observation: wait E

                          

Imperative Programming Language Sequence: S1;S2

Test: t? S1:S2

DTSI

S1

S2

S1 t

S2

Loop: Loop S

S

Assignment: x := exp

VECoS '08 – 3­4 juillet

19/?

Scenario: Engineering point of view S

E

Scenario  (a set of) System traces

Observation: wait E

                          

Behavior Specification Assertion: assert t

Cut:

DTSI

assume t

t

fail

t

Union: S1|S2

S1 S2

Non­determinism: x := random()

VECoS '08 – 3­4 juillet

20/?

More specification

Eventually, level (± δ)  [600 ; 900]

                           Monotony

wait(lo); loop { wait clock; assert 590 level  910; }

while (!lo) { int mark = level; wait clock; assert mark  level; }

The Specification?

Computed Properties

DTSI

VECoS '08 – 3­4 juillet

21/?

Conclusion

«Abstract Interpretation and                            Model Checking cooperating » « Methodology and Formalism for Software Engineering »

DTSI

VECoS '08 – 3­4 juillet

22/?