Abstract Interpretation of CTL Properties Caterina Urban, Samuel - - PowerPoint PPT Presentation

abstract interpretation of ctl properties
SMART_READER_LITE
LIVE PREVIEW

Abstract Interpretation of CTL Properties Caterina Urban, Samuel - - PowerPoint PPT Presentation

Abstract Interpretation of CTL Properties Caterina Urban, Samuel Ueltschi, Peter Mller Computation Tree Logic Branching-time logic ::= p | | | A(true U black) E(blue U black) AX | EX | A( U )


slide-1
SLIDE 1

Abstract Interpretation of CTL Properties

Caterina Urban, Samuel Ueltschi, Peter Müller

slide-2
SLIDE 2

Computation Tree Logic

  • Branching-time logic
  • Goal: Automatically check CTL properties of programs

‐ Infer sufficient preconditions ‐ Handle existential properties

2

A(true U black) E(blue U black)

 ::= p |  |  |  | AX  | EX  | A( U ) | E( U ) | AG  | EG 

slide-3
SLIDE 3

Example

  • CTL specification
  • Inferred precondition

3

while( rand() ) { x := 1 y := y + 1 x := 0 } while( true ) { }

A( true U x = 0 ) x = 0

slide-4
SLIDE 4

Maximal Trace Semantics

  • Contains all finite and infinite traces of a program

4

while( rand() ) { x := 1 y := y + 1 x := 0 } while( true ) { } x=0, y=0 1 x=0, y=0 x=0, y=0 x=0, y=0 5 5 5 x=0, y=0 … 5 5 x=2, y=3 1 x=2, y=3 x=2, y=3 x=2, y=3 5 5 5 x=2, y=3 … 5 5 x=0, y=0 1 x=1, y=0 x=1, y=1 x=0, y=1 2 4 3 x=0, y=1 … 5 1 x=2, y=3 1 x=1, y=3 x=1, y=4 x=0, y=4 2 4 3 x=0, y=4 … 5 1 x := 0 y := y + 1 x := 1 1 2 3 4 5

slide-5
SLIDE 5

Program Semantics for CTL

  • For a given CTL formula  and a set
  • f program traces, define a partial

function  from states to ordinals

  • A program satisfies a CTL formula 

for all traces starting from an initial state  if and only if dom()

  • If defined for an until-formula 1 U 2,

() yields the number of steps until 2 holds (ranking function)

5

A( true U x = 0 )

() = 0 if (x)=0 and undefined

  • therwise

E( true U x = 0 )

x := 0 y := y + 1 x := 1 1 2 3 4 5 () = 0 if (x)=0 and 3 otherwise

slide-6
SLIDE 6

Piecewise-defined Ranking Functions

Earlier work by Caterina Urban and Antoine Miné [SAS’13, SAS’14, ESOP’14]

6

Program Semantics for CTL Σ ⇀ Abstract semantics

x

slide-7
SLIDE 7

Abstract Domain: Decision Trees

  • Piecewise-defined functions are represented as decision trees

7

x 2 4 4

4 if x  4 f(x) = 7 – x if x  2 

  • therwise

x  4 4 x  2  7 – x

slide-8
SLIDE 8

Static Analysis

  • Map each point to a function over-approximating concrete semantics
  • Analysis is performed backward for each constituent formula

8

x := 0 y := y + 1 x := 1 1 2 3 4 5

A( true U x = 0 )

x x x

slide-9
SLIDE 9

Static Analysis

For universal formulas, merge preserves undefinedness

9

x

A( true U x = 0 )

x x

x := 0 y := y + 1 x := 1 1 2 3 4 5

x x 1 x 2 x 3

slide-10
SLIDE 10

Conditional Statements

10

if( x >= 2 ) { y := 1 } else { y := 0 }

A( true U y = 1 )

x 2 x 2

1 x  2 NIL  x < 2 NIL

x 2

x  2 2 

slide-11
SLIDE 11

Conditional Statements

11

if( x >= 2 && x%2 == 0 ) { y := 1 } else { y := 0 }

A( true U y = 1 )

x 2 x 2

1 x  2  x%2 = 0 NIL 

x 2

true  NIL x < 2  x%2 = 1 NIL x  2 NIL true NIL

For universal formulas, merge preserves undefinedness

slide-12
SLIDE 12

x  2  x%2 = 0 NIL x < 2  x%2 = 1 NIL x < 2 NIL true NIL

Conditional Statements

12

if( x >= 2 || x%2 == 0 ) { y := 1 } else { y := 0 }

E( true U y = 1 )

x 2 x 2

1  true 2 NIL

For existential formulas, merge preserves definedness

x 2

Unsound!

slide-13
SLIDE 13

x  2  x%2 = 0 NIL x < 2  x%2 = 1 NIL false NIL x  2 NIL

Conditional Statements

13

if( x >= 2 || x%2 == 0 ) { y := 1 } else { y := 0 }

E( true U y = 1 )

x 2 x 2

1  x  2 2 NIL

For existential formulas, merge preserves definedness

x 2

slide-14
SLIDE 14

Soundness

A program satisfies a CTL formula  for all traces starting from an initial state  if dom( (

) )

14

slide-15
SLIDE 15

Evaluation

  • Implementation in FuncTion static analyzer

‐ C-like input language ‐ Available at https://github.com/caterinaurban/function

  • Evaluated on test cases and benchmarks from the literature and

SV-COMP competition

  • Abstract domains

‐ Polyhedra for constraints ‐ Affine functions and ordinals for leaves of decision trees

15

slide-16
SLIDE 16

Experimental Results

16

slide-17
SLIDE 17

Summary

  • Theory for analyzing CTL properties with abstract interpretation
  • Automatic inference of sufficient preconditions
  • Implementation in FuncTion static analyzer:

https://github.com/caterinaurban/function

  • Future work: extension to LTL

17