• Ingen resultater fundet

Finite State

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "Finite State"

Copied!
34
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

Finite State

Model Checking

(2)

Informationsteknologi

UCb

Finite State Model Checking

TOOL TOOL

System Description A

Requirement F Yes,

Prototypes

Executable Code Test sequences No!

Debugging Information

Tools: visualSTATE, SPIN, Statemate, Verilog, Formalcheck,...

Finite State Systems

CTL

(3)

Informationsteknologi

UCb

From Programs to Networks

P1 :: while True do

T1 : wait(turn=1) C1 : turn:=0

endwhile

||

P2 :: while True do

T2 : wait(turn=0) C2 : turn:=1

endwhile

P1 :: while True do

T1 : wait(turn=1) C1 : turn:=0

endwhile

||

P2 :: while True do

T2 : wait(turn=0) C2 : turn:=1

endwhile

Mutual Exclusion Program

(4)

Informationsteknologi

UCb

From

Network

Models to Kripke Structures

I1 I2 t=0

T1 I2 t=0

T1 T2 t=0

I1 T2 t=0

I1 C2 t=0

T1 C2 t=0

C1 I2

t=1 T1 T2

t=1

C1 T2 t=1

T1 I2 t=1

I1 T2 t=1 I1 I2

t=1

(5)

Informationsteknologi

UCb

CTL Models =

Kripke Structures

(6)

Informationsteknologi

UCb

Computation Tree Logic, CTL

Clarke & Emerson 1980

Syntax

(7)

Informationsteknologi

UCb

Path

p

p

p

s s1

s2 s3...

The set of path starting in s

(8)

Informationsteknologi

UCb

Formal Semantics

( )

(9)

Informationsteknologi

UCb

CTL, Derived Operators

. . .

. . .

. . .

. . .

p

p p

AF p

. . .

. . .

. . .

. . . p

EF p

possible inevitable

(10)

Informationsteknologi

UCb

CTL, Derived Operators

p p

p

. . .

. . .

. . .

. . .

AG p

p p p p

p p

. . .

. . .

. . .

. . .

EG p

p

always

potentially always

(11)

Informationsteknologi

UCb

Theorem

All operators are derivable from

• EX f

• EG f

• E[ f U g ]

and boolean connectives

All operators are derivable from

• EX f

• EG f

• E[ f U g ]

and boolean connectives

[ f U g ] ¬ E [ ¬ g U ( ¬ f ¬ g ) ] ¬ EG ¬ g

A

(12)

Informationsteknologi

UCb

Example

p p

q

p,q

EX p

1 2

3

4

(13)

Informationsteknologi

UCb

Example

p p

q

p,q

AX p

1 2

3

4

(14)

Informationsteknologi

UCb

Properties of MUTEX example ?

I1 I2 t=0

T1 I2 t=0

T1 T2 t=0

I1 T2 t=0

I1 C2 t=0

T1 C2 t=0

C1 I2

t=1 T1 T2

t=1

C1 T2 t=1

T1 I2 t=1

I1 T2 t=1 I1 I2

t=1

[ ]

[ ]

( )

[ ]

[C A C U C A C U C ]

AG

C EG

AF(C T

AG[

C (C

AG

2 1

1 1

1 1

1 1

2 1

¬

¬

¬

¬

)]

) HOW toIN GEN DECIDERAL E

(15)

CTL Model Checking

Algorithms

(16)

Informationsteknologi

UCb

Fixpoint Characterizations

p p

p EX EF

EF ≡ ∨

or let A be the set of states satisfying EF p then

A EX

A ≡ p

in fact A is the smallest such set (the least fixpoint)

(17)

Informationsteknologi

UCb

Example

p

q

p,q

EF q

A

A

∨ EX q

p

1 2

3

4

(18)

Informationsteknologi

UCb

Fixed points of monotonic functions

„ Let τ be a function 2S2S

„ Say τ is monotonic when

„ Fixed point of τ is y such that

„ If τ monotonic, then it has

least fixed point μy. τ(y)

greatest fixed point νy. τ(y)

) ( )

( implies

x y

y

x ⊆ τ ⊆ τ

y y ) =

τ (

(19)

Informationsteknologi

UCb

Iteratively computing fixed points

„ Suppose S is finite

The least fixed point μy. τ(y) is the limit of

The greatest fixed point νy. τ(y) is the limit of

L

(false) ( (false))

false τ τ τ

L

(true) ( (true))

true τ τ τ

Note, since S is finite, convergence is finite

(20)

Informationsteknologi

UCb

Example: EF p

„ EF p is characterized by

„ Thus, it is the limit of the increasing series...

) (

. p EX y

y p

EF = μ

p EX p p p

EX(p EX p)

. . .

(21)

Informationsteknologi

UCb

Example: EG p

„ EG p is characterized by

„ Thus, it is the limit of the decreasing series...

) (

. p EX y

y p

EG = ν

p EX p p

p

EX(p EX p)

...

(22)

Informationsteknologi

UCb

Example, continued

p

q

p,q

EF q

p

1 2

3

4

} 3 , 2 , 1 {

} 3 , 2 , 1 {

} 3 , 2 {

3 2 1

0

=

=

=

=

A A A

Ø A

) (

. q EX y

y q

EF =

μ

(23)

Informationsteknologi

UCb

Remaining operators

)) (

( . )

(

)) (

( . )

(

) (

.

) (

.

y AX p

q y

q U p A

y EX p

q y

q U p E

y AX p

y p

AG

y AX p

y p

AF

=

=

=

=

μ μ ν

μ

(24)

Informationsteknologi

UCb

Properties of MUTEX example ?

I1 I2 t=0

T1 I2 t=0

T1 T2 t=0

I1 T2 t=0

I1 C2 t=0

T1 C2 t=0

C1 I2

t=1 T1 T2

t=1

C1 T2 t=1

T1 I2 t=1

I1 T2 t=1 I1 I2

t=1

)]

)]

1

1 1

AF(C

AF(C T

AG[

(25)

Informationsteknologi

UCb

(26)

Informationsteknologi

UCb

(27)

Informationsteknologi

UCb

)) ( }

' )

' , '.(

|

({s s s s R s Q Sat φ

(28)

Informationsteknologi

UCb

p SCC

SCC SCC

EG p

More Efficient Check

(29)

Informationsteknologi

UCb

Example

p q

p

p,q

EG p

q

p

(30)

Informationsteknologi

UCb

Example

p

p

p,q

EG p

p

Reduced Model

(31)

Informationsteknologi

UCb

Example

p

p

p

EG p

p

Non trivial Strongly Connected Component

(32)

Informationsteknologi

UCb

Properties of MUTEX example ?

I1 I2 t=0

T1 I2 t=0

T1 T2 t=0

I1 T2 t=0

I1 C2 t=0

T1 C2 t=0

C1 I2

t=1 T1 T2

t=1

C1 T2 t=1

T1 I2 t=1

I1 T2 t=1 I1 I2

t=1

[ C1]

EG ¬

(33)

Informationsteknologi

UCb

Properties of MUTEX example ?

I1 I2 t=0

T1 I2 t=0

T1 T2 t=0

I1 T2 t=0

I1 C2 t=0

T1 C2 t=0

T1 T2 t=1 T1 I2

t=1

I1 T2 t=1 I1 I2

t=1

[ C1]

EG ¬

Reduced Model

which are the non-trivial SCC’s?

(34)

Informationsteknologi

UCb

Complexity

However Ssys may be EXPONENTIAL in number of parallel components!

--

FIXPOINT COMPUTATIONS may be carried out using

ROBDD’s

(Reduced Ordered Binary Decision Diagrams) Bryant, 86

However Ssys may be EXPONENTIAL in number of parallel components!

--

FIXPOINT COMPUTATIONS may be carried out using

ROBDD’s

(Reduced Ordered Binary Decision Diagrams) Bryant, 86

Referencer

RELATEREDE DOKUMENTER

The application of the developed software has also been demonstrated, by performing bounded model checking on an RSL specification, using both the RSL translator and the

The presented consistency checking algorithm is divided to three sub-algorithms: the sequence diagrams extension algorithm described in section 5.6, the execution of behavioral

Lecture: Symbolic methods for finite-state model checking 2.+3. Exercise class: Circuit

Furthermore is a tool developed to assist in generating concrete models from the generic model, that are both valid and constrained to help reduce the state space to be searched

I Input din and output popCount I Both connected to the datapath I We need some handshaking I For data input and for

I Extends class AnyFlatSpec with ChiselScalatestTester I Has the device-under test (DUT) as parameter of the..

Figure 2.1: Model of finite state machine with datapath. FSMD model expresses both datapath operations as well as control operations. However it makes a clear distinction between

• linear in the size of the formula, given a fixed Kripke structure,. • linear in the size of the Kripke structure, given a