Model Checking & Program Analysis Markus Mller-Olm Dortmund - - PDF document

model checking program analysis
SMART_READER_LITE
LIVE PREVIEW

Model Checking & Program Analysis Markus Mller-Olm Dortmund - - PDF document

Model Checking & Program Analysis Markus Mller-Olm Dortmund University Overview Introduction Model Checking Flow Analysis Some Links between MC and FA Conclusion Apology for not giving proper credit to other


slide-1
SLIDE 1

Model Checking & Program Analysis

Markus Müller-Olm Dortmund University

MOVEP'02, Nantes, June 17-21, 2002 2

Overview

Introduction Model Checking Flow Analysis Some Links between MC and FA Conclusion

Apology for not giving proper credit to

  • ther researchers' work in this tutorial !
slide-2
SLIDE 2 MOVEP'02, Nantes, June 17-21, 2002 3

Purposes of Automatic Analysis

Optimizing compilation Validation/Verification

Type checking Functional correctness Security properties . . .

Debugging

MOVEP'02, Nantes, June 17-21, 2002 4

Fundamental Limit

Rice's Theorem [Rice,1953]: All interesting semantic questions about programs from a universal programming language are undecidable.

slide-3
SLIDE 3 MOVEP'02, Nantes, June 17-21, 2002 5

Example: Detection of Constants

read(new); π; write(new) write(new) can be replaced by write(k) for some constant k ⇔ π terminates Hence: Constant Detection is undecidable read(new); π; write(k)

?

MOVEP'02, Nantes, June 17-21, 2002 6

Two Solutions

Weaker formalisms

  • analyze abstract

models of systems

  • e.g.: automata, labelled

transition systems,...

Approximate analyses

  • yield sound but, in

general, incomplete results

  • e.g.: detects some

instead of all constants

Model checking Flow analysis Abstract interpretation Type checking

slide-4
SLIDE 4 MOVEP'02, Nantes, June 17-21, 2002 7

Weaker Formalisms

Abstract model Exact analyzer for abstract model Program

Exact Approximate

main() { x=17; if (x>63) { y=17;x=10;x=x+1;} else { x=42; while (y<99) { y=x+y;x=y+1;} y=11;} x=y+1;
  • ut(x);
} MOVEP'02, Nantes, June 17-21, 2002 8

Overview

Introduction Model Checking Flow Analysis Some Links between MC and FA Conclusion

slide-5
SLIDE 5 MOVEP'02, Nantes, June 17-21, 2002 9

Model Checking

G( F Φ → Ψ)

OK Error trace

  • r

Finite-state structure Temporal logic formula Model Checker

MOVEP'02, Nantes, June 17-21, 2002 10

What is a Model Checker?

M φ

  • an automatic procedure for deciding

where

  • M is a model structure
  • φ

is a (temporal-logic) formula

means satisfaction

slide-6
SLIDE 6 MOVEP'02, Nantes, June 17-21, 2002 11

M φ

  • Model Structures
MOVEP'02, Nantes, June 17-21, 2002 12

Model Structures

  • wn

¬ use

  • wn

use ¬ own ¬ use

Kripke structure Labeled Transition System

release acquire end start

Kripke Transition System

release acquire end start P ¬Q P Q ¬P ¬Q

slide-7
SLIDE 7 MOVEP'02, Nantes, June 17-21, 2002 13

Kripke Structures

= ⊆ × → ( , , ), where states transition relation, total : 2 interpretation atomic propositions

AP

K S R I S R S S I S AP

  • wn

¬ use

  • wn

use ¬ own ¬ use

MOVEP'02, Nantes, June 17-21, 2002 16

M φ

  • Temporal Logics
slide-8
SLIDE 8 MOVEP'02, Nantes, June 17-21, 2002 17

Temporal Logics

Linear-Time Logics

formulas specify properties of program paths state satisfies property if all paths starting in this

state do

Branching-Time Logic

can specify properties sensitive to branching has (or can simulate) path quantifiers A and E

MOVEP'02, Nantes, June 17-21, 2002 18

Branching vs. Linear-Time Logics

LT logics cannot distinguish P and Q:

P and Q have same execution paths

BT logics can:

P [coin] <tea> true

but Q [coin] <tea> true coin tea coffee P coin tea coffee coin Q

slide-9
SLIDE 9 MOVEP'02, Nantes, June 17-21, 2002 19

A Linear-Time Logic: PLTL

1.

  • wn the resource

before using it

2.

release the resource in finite time ( )

  • wn

F

  • wn

⇒ ¬ use U own ¬ PLTL formulas

1 2 1 2

:: | | | | p X U φ φ φ φ φ φ φ = ¬ ∨

Abbreviations

  • wn

¬ use

  • wn

use ¬ own ¬ use

: : ( ) : F trueU G F WU U G φ φ φ φ φ ψ φ ψ φ = = ¬ ¬ = ∨

MOVEP'02, Nantes, June 17-21, 2002 20

Linear-Time Modalities

G φ: φ . . . φ φ φ φ

Generally

X φ: φ . . .

neXt

F φ: φ . . .

Finally

φ U ψ: φ . . . φ ψ φ

Until

φ WU ψ: φ U ψ or G φ

Weak Until

slide-10
SLIDE 10 MOVEP'02, Nantes, June 17-21, 2002 21

ψ φ ψ φ φ φ

Until

φ

Linear-time: blue nodes

satisfy v φ U ψ

Branching-time: blue

nodes satisfy v A(φ U ψ)

MOVEP'02, Nantes, June 17-21, 2002 22

ψ φ ψ φ φ φ

Weak Until

φ

Linear-time: blue nodes

satisfy v φ WU ψ

Branching-time: blue

nodes satisfy v A (φ WU ψ)

slide-11
SLIDE 11 MOVEP'02, Nantes, June 17-21, 2002 23

A Branching-Time Logic: CTL

1.

  • wn the resource

before using it

2.

release the resource in finite time ( )

  • wn

AF

  • wn

⇒ ¬ ( ) A use U own ¬ State formulas φ

1 2

:: | | | | p E A φ φ φ φ ψ ψ = ¬ ∨

Path formulas ψ

1 2

:: | | | F X U G ψ φ φ φ φ φ =

  • wn

¬ use

  • wn

use ¬ own ¬ use

MOVEP'02, Nantes, June 17-21, 2002 24

Duality

Path quantifiers are duals:

¬A φ = E¬φ ¬E φ = A¬φ

Until and weak until are almost duals (on

paths):

¬(φ U ψ) = ¬ψ WU (¬φ ∧ ¬ψ) ¬(φ WU ψ) = ¬ψ U (¬φ ∧ ¬ψ)
slide-12
SLIDE 12 MOVEP'02, Nantes, June 17-21, 2002 25

Modal mu-Calculus

a branching-time logic with local modalities…

φ : all successor states satisfy φ ◊ φ : some successor state satisfies φ

… and fixpoint formulae.

µ X. φ(X) : minimum fixpoint formula ν X. φ(X) : maximum fixpoint formula

Fixpoint formulae can be nested

Alternation: µX.(νY.X∧Y)

MOVEP'02, Nantes, June 17-21, 2002 26

Local Modalities for Labelled Edges

[a] φ: φ φ φ <a> φ: φ

. . . . . . . . . . . .

a a a a a a

slide-13
SLIDE 13 MOVEP'02, Nantes, June 17-21, 2002 27

Computing Fixpoint Formulae

On finite structures, meaning of fixpoint

formulae can be computed by computing Kleene chains until stabilization:

µ : ⊥,f(⊥),f(f(⊥),f(f(f(⊥))), . . . ν : ,f(),f(f()),f(f(f())), . . .

f is a function on state sets derived from the body of the fixpoint formula.

MOVEP'02, Nantes, June 17-21, 2002 28

CTL and Modal mu-Calculus

CTL-formulae can inductively be transformed

to modal mu-calculus formulae

Global modalities can be expressed by

fixpoint formulae, e.g.:

( ) X.( ( X true)) ( ) X.( ( X)) A U E U φ ψ µ ψ φ φ ψ µ ψ φ = ∨ ∧ ∧ = ∨ ∧

◊ ( ) X.( ( X)) ( ) X.( ( ( X false))) A WU E WU φ ψ ν ψ φ φ ψ ν ψ φ = ∨ ∧ = ∨ ∧ ∨

slide-14
SLIDE 14 MOVEP'02, Nantes, June 17-21, 2002 29

M φ

  • Model Checking Approaches
MOVEP'02, Nantes, June 17-21, 2002 30

Global vs. Local Model Checking

Global model checking problem

Given: finite model structure M, formula φ Determine: {s | s φ}

Local model checking problem

Given: finite model structure M, formula φ, and

state s in M

Determine, whether s φ or not

slide-15
SLIDE 15 MOVEP'02, Nantes, June 17-21, 2002 31

Model Checking Approaches

  • Iterative model checking
  • Automata-theoretic model checking
  • Tableau-based model checking
MOVEP'02, Nantes, June 17-21, 2002 32

Iterative Model Checking

  • Good for global model-checking of

branching-time logics

  • Idea: Compute semantics of formula on

given model by structural induction on the formula

  • Reduce modalities to their fixpoint definition
  • Compute the fixpoints by Kleene chains
  • Alternating fixpoints lead to backtracking

(→ proceedings)

slide-16
SLIDE 16 MOVEP'02, Nantes, June 17-21, 2002 33

Iterative Model Checking of CTL

Annotate each state with those subformulas

ψ of φ with s ψ.

Use structural induction on φ. Use backwards propagation to compute

modalities A(φ U ψ) and A(φ WU ψ).

MOVEP'02, Nantes, June 17-21, 2002 34

ψ φ ψ φ φ φ

Model Checking A(φUψ)

1.

Mark all nodes v with v ψ

2.

Mark all unmarked nodes w with w φ and all successors marked

3.

Iterate 2. until stabilization

φ

slide-17
SLIDE 17 MOVEP'02, Nantes, June 17-21, 2002 35

ψ φ ψ φ φ φ

Model Checking A(φWUψ)

1.

Mark all nodes with v φ or v ψ

2.

Unmark all nodes v with v ψ and some unmarked successor

3.

Iterate 2. until stabilization

φ

MOVEP'02, Nantes, June 17-21, 2002 36

Automata-theoretic MC

Good for linear-time logics Idea: reduce model-checking to non-

emptiness problem of an automaton

slide-18
SLIDE 18 MOVEP'02, Nantes, June 17-21, 2002 37

Automata-theoretic MC

Construct (Büchi-) automaton, Aφ, from φ

Aφ accepts paths satisfying φ

Construct (Büchi-) automaton, AM, from M

AM accepts paths exhibited by M M M M

M iff L(A ) L(A ) iff L(A ) L(A ) iff L(A A )

φ φ φ

φ ⊆ ∩ = ∅ × = ∅

  • MOVEP'02, Nantes, June 17-21, 2002
38

Automata-theoretic MC

Construct (Büchi-) automaton, Aφ, from φ

Aφ accepts paths satisfying φ

Construct (Büchi-) automaton, AM, from M

AM accepts paths exhibited by M

Compute automaton AM× Aφ

Complementation & product construction

Decide L(AM× Aφ)=∅ by reachability analysis

slide-19
SLIDE 19 MOVEP'02, Nantes, June 17-21, 2002 40

Automaton for F(P)∧G(Q) (Finite Maximal Paths Interpretation)

Complementation Automata construction, Determinization, and Minimization F(P) & G(Q) {},{P} 3 2 1 {P,Q} {},{P},{Q},{P,Q} {},{P} 2 {},{P} {},{P} 1 3 {P,Q} {},{P},{Q},{P,Q} {Q},{P,Q} {Q} {Q},{P,Q} {Q} MOVEP'02, Nantes, June 17-21, 2002 41

A Successful Model-Check for formula F(P)∧G(Q)

1 2 3 Q P,Q Q 1 2 3 4 {Q} {P,Q} {Q} 11 34 12 33 32 {Q} {P,Q} {Q} {P,Q} {P,Q} {P,Q} {P,Q} Corresponding automaton: Product automaton: Kripke structure:
slide-20
SLIDE 20 MOVEP'02, Nantes, June 17-21, 2002 42

A Failing Model-Check for formula F(P)∧G(Q)

1 2 3 4 {Q} {P,Q} {} 11 24 12 33 32 {Q} {P,Q} {} {P,Q} {P,Q} {P,Q} {P,Q} 1 2 3 Q P,Q Corresponding automaton: Product automaton: Kripke structure: MOVEP'02, Nantes, June 17-21, 2002 43

Tableau-Based Model-Checking

Idea: solve local model checking problem by

sub-goaling

Try to construct a proof tree that witnesses sφ If no proof tree can be found, then sφ For proof tree construction, tableau rules are

given that reduce goals to sub-goals

slide-21
SLIDE 21

Some Tableau Rules

[ ]

1 1

a BOX if {s ,..., } { | } ,...,

a n n

s s t s t s s φ φ φ =  → ฀ ฀

  • 2

AND s s s φ φ φ φ ∧

1 1 2
  • 2

OR1 s s φ φ φ ∨

1 1
  • 2

OR2 s s φ φ φ ∨

1 2
  • a

DIAMOND if

a

s s t t φ φ  →

  • MOVEP'02, Nantes, June 17-21, 2002
45

Tableau Rules for Fixpoints

Fixpoint formulas are analyzed with unfolding

rules, e.g.,

If fixpoint formula sequent re-appears later:

µ : unsuccessful leaf ν : successful leaf

Special care needed for nested fixpoints

(→ proceedings)

  • X. (X)
  • UNFOLD

(

  • X. (X))

s s µ φ µ φ µ φ

slide-22
SLIDE 22

X.( [b]X)

  • X. a true

b X φ ν ψ ψ µ = ∧ = ∨

s t a b b

s φ

  • [ ]

b s ψ φ ∧

  • s

ψ

  • a true

b s ψ ∨

  • a true

s true t

[ ]

b s φ

  • s

φ

  • A Model Check by Tableau

ν ⇒ successful !

  • MOVEP'02, Nantes, June 17-21, 2002
49

Typical Profile of Model Checking Techniques

X X

Global

X X X

Tableau methods

X X

Automata- theoretic

X

Iterative Local Linear-time Branching- time

slide-23
SLIDE 23 MOVEP'02, Nantes, June 17-21, 2002 50

State-Explosion Problem

State-Explosion

number of states grows exponentially in number of

components or variables

Techniques for fighting state-explosion

symbolic model-checking incremental construction of state space abstraction symmetry reductions partial-order methods compositional methods … MOVEP'02, Nantes, June 17-21, 2002 51

Other Classes of Systems

Infinite-state systems Timed systems Hybrid systems Probabilistic systems . . .

Learn more about such systems this week !

slide-24
SLIDE 24 MOVEP'02, Nantes, June 17-21, 2002 52

Overview

Introduction Model Checking Flow Analysis Some Links between MC and FA Conclusion

MOVEP'02, Nantes, June 17-21, 2002 53

From Programs to Flow Graphs

x := 17 x := 10 x := x+1 x := 42 y := 11 y := x+y x := y+1 x := y+1
  • ut(x)
y := 17 ma main() in() { x=17; { x=17; if (x if (x>63) >63) { y=1 { y=17;x=10; 7;x=10;x=x+1 x=x+1;} ;} else else { x=4 { x=42; 2; whi while le (y<9 (y<99) 9) { y { y=x+y;x= =x+y;x=y+1;} y+1;} y=1 y=11;} 1;} x=y+1 x=y+1;
  • ut(x
  • ut(x);
); }
slide-25
SLIDE 25 MOVEP'02, Nantes, June 17-21, 2002 54

Dead Code Elimination

Goal:

find and eliminate assignments that compute

values which are never used

Fundamental problem:

undecidability hence: use approximate algorithm; ignore guards

Technique:

propagate set of non-needed variables backwards

through the flow graph

MOVEP'02, Nantes, June 17-21, 2002 55

{x,y} {y} {x} {x,y} {x} ∅ {x,y} {x,y} {x} {x,y} x := 17 x := 10 x := x+1 x := 42 y := 11 y := x+y x := y+1 x := y+1

  • ut(x)

y := 17 {x} ∅ ∅ ∅ {x} ∅

slide-26
SLIDE 26 MOVEP'02, Nantes, June 17-21, 2002 56

{x,y} {y} {x} {x} ∅ {x} x := 17 x := 10 x := x+1 x := 42 y := 11 y := x+y x := y+1 x := y+1

  • ut(x)

y := 17 {x} ∅ ∅ ∅ {x} ∅

MOVEP'02, Nantes, June 17-21, 2002 57

Remarks

Forward vs. backward analyses Bitvector analyses

backward: live/dead variables, very busy

expressions,

forward: reaching definitions, available

expressions

Computation strategies

slide-27
SLIDE 27 MOVEP'02, Nantes, June 17-21, 2002 58

Flow Equations for Dead Code

Succ[ ]

DeadIn[ ] (DeadOut[ ] [ ]) \ [ ] DeadOut[ ] DeadIn[ ] Mod Use

j i

i i i i i i

= ∪ = ∩

x := y+z . . .

DeadIn[ ] (DeadOut[ ] { }\{ , } i i x y z = ∪

Succ[ ]

DeadOut[ ] DeadIn[ ]

j i

i i

= ∩

j1 jk

Succ[ ] DeadOut[ ] (DeadOut[ ] Mod[ ]) \ Use[ ] j i i j j j = ∪

General equations: Equations may be combined… …or replaced by inequations:

DeadOut[ ] (DeadOut[ ] Mod[ ]) \ Use[ ] , for Succ[ ] i j j j j i ⊆ ∪ ∈ MOVEP'02, Nantes, June 17-21, 2002 59

Data-Flow Frameworks

Correctness

generic properties of frameworks can be studied

and proved

Implementation

efficient, generic implementations can be

constructed

slide-28
SLIDE 28 MOVEP'02, Nantes, June 17-21, 2002 60

Data-Flow Frameworks

a complete lattice (D,) of data-flow facts a space F of transfer functions f: D →D

Id∈F closed under composition

initial value init∈D a control-flow graph with set of entry/exit

nodes

mapping assigning transfer functions fi to flow

graph nodes i

MOVEP'02, Nantes, June 17-21, 2002 61

Framework for dead variables

Var 1 2 1 2

lattice 2 Var control flow program graph initial value function space { : | ,d : ( ) ( ) \ } ( ) ( Mod[ ]) \ Use[ ]

i i

D f D D d f d d d d f f d d i i ⊆ ∅ → ∃ = ∪ = ∪ ∩

slide-29
SLIDE 29 MOVEP'02, Nantes, June 17-21, 2002 62

What Data Flow Algorithms Compute

Forward Analysis

Computes maximal solution w.r.t. (D,) of

Backward Analysis

Computes maximal solution of

This is called the maximal fixpoint solution MFP[i]

Pred( )

Entry In[ ] (In[ ])

  • therwise
j i j

init i i f j

∈  =  

Succ( )

Exit Out[ ] (Out[ ])

  • therwise
j i j

init i i f j

∈  =  

MOVEP'02, Nantes, June 17-21, 2002 63

Assessing Data Flow Frameworks

Abstraction MOP-solution Execution Semantics MFP-solution sound? how precise? sound? precise?

slide-30
SLIDE 30 MOVEP'02, Nantes, June 17-21, 2002 64

x := 17 x := 10 x := x+1 x := 42 y := 11 y := x+y x := y+1 x := y+1

  • ut(x)

y := 17 {x,y} {x} {x,y}

MOP[ ] { , } { } { } v x y x x = ∩ =

v infinitely many such paths

MOVEP'02, Nantes, June 17-21, 2002 65

Meet-Over-All-Paths Solution

Forward Analysis Backward Analysis

Paths[ , )

MOP[ ] : F ( )

p entry i p

i init

=

Paths( , ]

MOP[ ] : F ( )

p i exit p

i init

=

slide-31
SLIDE 31 MOVEP'02, Nantes, June 17-21, 2002 66

Coincidence Theorem

Definition: A framework is distributive if f(X)= {f(x)|x∈X} for all X⊆D, f∈F. Theorem: In any distributive framework, MOP[i]=MFP[i] for all program points i. Theorem: All bitvector frameworks are distributive.

MOVEP'02, Nantes, June 17-21, 2002 67

Lattice for Constant Propagation

  • 1

2 . . .

  • 2

. . .

  • 1

inconsistent value unknown value

slide-32
SLIDE 32 MOVEP'02, Nantes, June 17-21, 2002 68

Constant Propagation Framework

lattice Var ( { }) Var ConstVal ' : : ( ) '( ) pointwise meet ( ) f.a. x Var control flow program graph initial value function space { : | monotone} [ ( ( )

CP i i

D x x x x f D D f d x e f f d ρ ρ ρ ρ → ∪ = → ⇔ ∀ = ∈ → =

  • ⊥,

  • )]

if annotated with :

  • therwise

d i x e d  =    

MOVEP'02, Nantes, June 17-21, 2002 69

x := 17 y := 3 x := 3 z := x+y

  • ut(x)

x := 2 y := 2 (3,2,5) (2,3,5)

MOP[ ] ( , ,5) v = ⊥ ⊥

( ( ), ( ), ( )) x y z ρ ρ ρ

slide-33
SLIDE 33 MOVEP'02, Nantes, June 17-21, 2002 70

(⊥,⊥,⊥) x := 17 y := 3 x := 3 z := x+y

  • ut(x)

x := 2 y := 2 (⊥,⊥,⊥) (⊥,⊥,⊥) (2,3,⊥) (3,2,⊥) (2,⊥,⊥) (3,⊥,⊥)

MOP[ ] ( , ,5) v = ⊥ ⊥ M FP[ ] ( , , ) v = ⊥ ⊥ ⊥

( ( ), ( ), ( )) x y z ρ ρ ρ

MOVEP'02, Nantes, June 17-21, 2002 71

Correctness Theorem

Definition: A framework is monotone if f(x)f(y) for all x,y∈D, xy. Theorem: In any monotone framework, MFP[i]MOP[i] for all program points i. Remark: Any "reasonable" framework is monotone.

slide-34
SLIDE 34 MOVEP'02, Nantes, June 17-21, 2002 72

Assessing Data Flow Frameworks

Abstraction MOP-solution Execution Semantics MFP-solution

sound sound precise, if distrib.

MOVEP'02, Nantes, June 17-21, 2002 73

Where Flow Analysis Looses Precision

Execution Semantic MOP MFP Widening Narrowing

Loss of Precision

slide-35
SLIDE 35 MOVEP'02, Nantes, June 17-21, 2002 74

Overview

Introduction Model Checking Flow Analysis Some Links between MC and FA Conclusion

MOVEP'02, Nantes, June 17-21, 2002 75

Some Links between MC and FA

  • Flow Analysis via Model Checking
  • Model Checking via Flow Analysis
  • Synergy of MC and FA
slide-36
SLIDE 36

Model-Checker Flow graph transformer Interpretation flow graph Kripke structure formula yes/no annotation of Kripke structure nodes data flow information for flow graph nodes yes/no data-flow problem Design & Programming

Flow Analysis via Model Checking

MOVEP'02, Nantes, June 17-21, 2002 77

Dead-Code Elimination

Flow Graph Transformation:

y := x+y

Mod(y), Use(x), Use(y)

Dead X ( use( ) WU (mod( ) use( )))

x

x x x = ¬ ∧ ¬

Formula specifying "x is dead": Note: more direct specification than in the

data flow framework

slide-37
SLIDE 37 MOVEP'02, Nantes, June 17-21, 2002 78 x := 17 x := 10 x := x+1 x := 42 y := 11 y := x+y x := y+1 x := y+1
  • ut(x)
y := 17 exit x

Check: Dead X ( use( ) WU (mod( ) use( ))) x x x = ¬ ∧ ¬

Mod(x) Mod(x) Mod(x), Use(x) Mod(x) Mod(y) Mod(y), Use(x), Use(y) Mod(x), Use(y) Mod(x), Use(y) Use(x) Mod(y) End MOVEP'02, Nantes, June 17-21, 2002 79

Model Checking via Flow Analysis

Evaluation of (CTL) modalities can be seen

as a data flow analysis

CTL model-checking is iterated flow analysis

slide-38
SLIDE 38 MOVEP'02, Nantes, June 17-21, 2002 80

Framework for E(φ U ψ)

lattice {0,1} 1 control flow Kripke structure ( , , ) initial nodes Nodes s with s initial value 1 function space { .0, .1, . } . if , ( 1 ) .0 if , 1

i i

D S R I x x x x x x i i f f d x i i ψ λ λ λ λ ψ φ λ ψ φ = = = B

 

1

Why the Framework computes E(φ U ψ)

MOP[ ] 1 iff s E( U ) v φ ψ =

  • 1

1

MFP[ ] v =

ψ φ,¬ψ φ,¬ψ ¬φ,¬ψ

. x x λ . x x λ

λx.0

1 ψ 1 φ,¬ψ φ,¬ψ φ,¬ψ

. x x λ . x x λ . x x λ

slide-39
SLIDE 39 MOVEP'02, Nantes, June 17-21, 2002 82

Model Checking E(φ U ψ)

. x x λ

ψ φ ψ φ φ φ φ

.0 x λ . x x λ . x x λ . x x λ . x x λ

1

MOVEP'02, Nantes, June 17-21, 2002 85

The Model-Extraction Problem in Software Model-Checking

Abstract model Model Checker Program

void add(Object o) { buffer[head] = o; head = (head+1)%size; } Object take() { … tail=(tail+1)%size; return buffer[tail]; }

Gap

Use techniques from abstract interpretation and program analysis to extract a finite-state model from program Idea:

slide-40
SLIDE 40

Bandera: [Dwyer, Hatcliff, et. al.]

An open tool set for model-checking Java source code

Checker Inputs Checker Outputs

Optimization Control

Transformation & Abstraction Tools

Model Checkers Java Source

void add(Object o) { buffer[head] = o; head = (head+1)%size; } Object take() { … tail=(tail+1)%size; return buffer[tail]; }

Bandera Temporal Specification Graphical User Interface Error Trace Mapping

Bandera

taken from Bandera tutorial of John Hatcliff http://www.cis.ksu.edu/santos/bandera MOVEP'02, Nantes, June 17-21, 2002 98

Conclusion

Overview on fundamentals of

Model Checking Flow Analysis Some links

slide-41
SLIDE 41 MOVEP'02, Nantes, June 17-21, 2002 99

Just the Beginning. . .

More complex properties Theory of Abstract Interpretation Interprocedural Flow Analysis Parallel Programs

MOVEP'02, Nantes, June 17-21, 2002 100

Any Questions?