Predicate Abstraction: A Tutorial

Size: px
Start display at page:

Download "Predicate Abstraction: A Tutorial"

Transcription

1 Predicate Abstraction: A Tutorial Predicate Abstraction Daniel Kroening May

2 Outline Introduction Existential Abstraction Predicate Abstraction for Software Counterexample-Guided Abstraction Refinement Computing Existential Abstractions of Programs Checking the Abstract Model Simulating the Counterexample Refining the Abstraction D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 2

3 Model Checking with Predicate Abstraction A heavy-weight formal analysis technique Recent successes in software verification, e.g., SLAM at Microsoft The abstraction reduces the size of the model by removing irrelevant detail The abstract model is then small enough for an analysis with a BDD-based Model Checker Idea: only track predicates on data, and remove data variables from model Mostly works with control-flow dominated properties D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 3

4 Reminder Abstract Interpretation Abstract Domain Approximate representation of sets of concrete values S α γ Ŝ D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 4

5 Predicate Abstraction as Abstract Domain We are given a set of predicates over S, denoted by Π 1,..., Π n. An abstract state is a valuation of the predicates: Ŝ = B n The abstraction function: α(s) = Π 1 (s),..., Π n (s) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 5

6 Predicate Abstraction: the Basic Idea Concrete states over variables x, y: x = 2 y = 0 x = 2 y = 1 x = 0 y = 0 x = 1 y = 0 x = 1 y = 1 x = 1 y = 2

7 Predicate Abstraction: the Basic Idea Concrete states over variables x, y: x = 2 y = 0 x = 2 y = 1 x = 0 y = 0 x = 1 y = 0 x = 1 y = 1 x = 1 y = 2 Predicates: p 1 x > y p 2 y = 0

8 Predicate Abstraction: the Basic Idea Concrete states over variables x, y: x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 p 1, p 2 x = 0 y = 0 p 1, p 2 p 1, p 2 x = 1 y = 2 Predicates: p 1 x > y p 2 y = 0 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 6

9 Predicate Abstraction: the Basic Idea Concrete states over variables x, y: x = 2 y = 0 p 1, p 2 x = 1 y = 0 Predicates: p 1 x > y p 2 y = 0 x = 2 y = 1 x = 1 y = 1 p 1, p 2 x = 0 y = 0 p 1, p 2 p 1, p 2 x = 1 y = 2 Abstract Transitions? D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 6

10 Existential Abstraction 1 Definition (Existential Abstraction) A model ˆM = ( Ŝ, Ŝ0, ˆT ) is an existential abstraction of M = (S, S 0, T ) with respect to α : S Ŝ iff s S 0. α(s) = ŝ ŝ Ŝ0 and (s, s ) T. α(s) = ŝ α(s ) = ŝ (ŝ, ŝ ) ˆT. 1 Clarke, Grumberg, Long: Model Checking and Abstraction, ACM TOPLAS, 1994 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 7

11 Minimal Existential Abstractions There are obviously many choices for an existential abstraction for a given α. Definition (Minimal Existential Abstraction) A model ˆM = ( Ŝ, Ŝ0, ˆT ) is the minimal existential abstraction of M = (S, S 0, T ) with respect to α : S Ŝ iff s S 0. α(s) = ŝ ŝ Ŝ0 and (s, s ) T. α(s) = ŝ α(s ) = ŝ (ŝ, ŝ ) ˆT. This is the most precise existential abstraction. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 8

12 Existential Abstraction We write α(π) for the abstraction of a path π = s 0, s 1,...: α(π) = α(s 0 ), α(s 1 ),... D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 9

13 Existential Abstraction We write α(π) for the abstraction of a path π = s 0, s 1,...: α(π) = α(s 0 ), α(s 1 ),... Lemma Let ˆM be an existential abstraction of M. The abstraction of every path (trace) π in M is a path (trace) in ˆM. π M α(π) ˆM Proof by induction. We say that ˆM overapproximates M. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 9

14 Abstracting Properties Reminder: we are using a set of atomic propositions (predicates) A, and a state-labelling function L : S P(A) in order to define the meaning of propositions in our properties. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 10

15 Abstracting Properties We define an abstract version of it as follows: First of all, the negations are pushed into the atomic propositions. E.g., we will have x = 0 A and x 0 A D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 11

16 Abstracting Properties An abstract state ŝ is labelled with a A iff all of the corresponding concrete states are labelled with a. a ˆL(ŝ) s α(s) = ŝ. a L(s) This also means that an abstract state may have neither the label x = 0 nor the label x 0 this may happen if it concretizes to concrete states with different labels! D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 12

17 Conservative Abstraction The keystone is that existential abstraction is conservative for certain properties: Theorem (Clarke/Grumberg/Long 1994) Let φ be a CTL* formula where all negations are pushed into the atomic propositions, and let ˆM be an existential abstraction of M. If φ holds on ˆM, then it also holds on M. ˆM = φ M = φ We say that an existential abstraction is conservative for CTL* properties. The same result can be obtained for LTL properties. The proof uses the lemma and is by induction on the structure of φ. The converse usually does not hold. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 13

18 Conservative Abstraction We hope: computing ˆM and checking ˆM = φ is easier than checking M = φ. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 14

19 Back to the Example x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 x = 0 y = 0 p 1, p 2 p 1, p 2 p 1, p 2 x = 1 y = 2

20 Back to the Example x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 x = 0 y = 0 p 1, p 2 p 1, p 2 p 1, p 2 x = 1 y = 2

21 Back to the Example x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 x = 0 y = 0 p 1, p 2 p 1, p 2 p 1, p 2 x = 1 y = 2

22 Back to the Example x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 x = 0 y = 0 p 1, p 2 p 1, p 2 p 1, p 2 x = 1 y = 2

23 Back to the Example x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 x = 0 y = 0 p 1, p 2 p 1, p 2 p 1, p 2 x = 1 y = 2

24 Back to the Example x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 x = 0 y = 0 p 1, p 2 p 1, p 2 p 1, p 2 x = 1 y = 2 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 15

25 Let s try a Property x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 x = 0 y = 0 p 1, p 2 p 1, p 2 p 1, p 2 x = 1 y = 2 Property: x > y y 0 p 1 p 2

26 Let s try a Property x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 p 1, p 2 x = 0 y = 0 p 1, p 2 p 1, p 2 x = 1 y = 2 Property: x > y y 0 p 1 p 2 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 16

27 Another Property x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 x = 0 y = 0 p 1, p 2 p 1, p 2 p 1, p 2 x = 1 y = 2 Property: x > y p 1

28 Another Property x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 p 1, p 2 x = 0 y = 0 p 1, p 2 p 1, p 2 x = 1 y = 2 Property: x > y p 1

29 Another Property x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 p 1, p 2 x = 0 y = 0 p 1, p 2 p 1, p 2 x = 1 y = 2 Property: x > y p 1 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 17

30 Another Property x = 2 y = 0 p 1, p 2 x = 1 y = 0 x = 2 y = 1 x = 1 y = 1 p 1, p 2 x = 0 y = 0 p 1, p 2 p 1, p 2 x = 1 y = 2 Property: x > y p 1 But: the counterexample is spurious D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 17

31 SLAM Microsoft blames most Windows crashes on third party device drivers The Windows device driver API is quite complicated Drivers are low level C code SLAM: Tool to automatically check device drivers for certain errors SLAM is shipped with Device Driver Development Kit Full detail available at D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 18

32 SLIC Finite state language for defining properties Monitors behavior of C code Temporal safety properties (security automata) familiar C syntax Suitable for expressing control-dominated properties e.g., proper sequence of events can track data values D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 19

33 SLIC Example unlocked acq rel locked state { enum { Locked, Unlocked} s = Unlocked ; } KeAcquireSpinLock. entry { i f ( s==locked ) abort ; else s = Locked ; } KeReleaseSpinLock. entry { i f ( s==unlocked ) abort ; else s = Unlocked ; }

34 SLIC Example unlocked rel acq rel error locked acq state { enum { Locked, Unlocked} s = Unlocked ; } KeAcquireSpinLock. entry { i f ( s==locked ) abort ; else s = Locked ; } KeReleaseSpinLock. entry { i f ( s==unlocked ) abort ; else s = Unlocked ; } D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 20

35 Refinement Example do { KeAcquireSpinLock (); npacketsold = npackets; if (request) { request = request >Next; KeReleaseSpinLock (); npackets++; } } while(npackets!= npacketsold); KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 21

36 Refinement Example Does this code obey the locking rule? do { KeAcquireSpinLock (); npacketsold = npackets; if (request) { request = request >Next; KeReleaseSpinLock (); npackets++; } } while(npackets!= npacketsold); KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 21

37 Refinement Example do { KeAcquireSpinLock (); if ( ) { KeReleaseSpinLock (); } } while( ); KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 22

38 Refinement Example do { U KeAcquireSpinLock (); L L if ( ) { L L U U } } while( ); KeReleaseSpinLock (); L U U E KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 22

39 Refinement Example do { U KeAcquireSpinLock (); L L if ( ) { L L U U } } while( ); KeReleaseSpinLock (); L U U E KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 22

40 Refinement Example do { U KeAcquireSpinLock (); L L if ( ) { L L U U } } while( ); KeReleaseSpinLock (); L U U E KeReleaseSpinLock (); Is this path concretizable? D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 22

41 Refinement Example U L L L do { KeAcquireSpinLock (); npacketsold = npackets; if (request) { request = request >Next; L KeReleaseSpinLock (); U npackets++; } U } while(npackets!= npacketsold); L U U E KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 23

42 Refinement Example U L L L do { KeAcquireSpinLock (); npacketsold = npackets; if (request) { request = request >Next; L KeReleaseSpinLock (); U npackets++; } U } while(npackets!= npacketsold); L U U E KeReleaseSpinLock (); This path is spurious! D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 23

43 Refinement Example U L L L do { KeAcquireSpinLock (); npacketsold = npackets; if (request) { request = request >Next; L KeReleaseSpinLock (); U npackets++; } U } while(npackets!= npacketsold); L U U E KeReleaseSpinLock (); Let s add the predicate npacketsold==npackets D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 23

44 Refinement Example U L L L do { KeAcquireSpinLock (); npacketsold = npackets; b=true; if (request) { request = request >Next; L KeReleaseSpinLock (); U npackets++; } U } while(npackets!= npacketsold); L U U E KeReleaseSpinLock (); Let s add the predicate npacketsold==npackets D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 23

45 Refinement Example U L L L do { KeAcquireSpinLock (); npacketsold = npackets; b=true; if (request) { request = request >Next; L KeReleaseSpinLock (); U npackets++; b=b?false: ; } U } while(npackets!= npacketsold);!b L U U E KeReleaseSpinLock (); Let s add the predicate npacketsold==npackets D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 23

46 Refinement Example do { U KeAcquireSpinLock (); L b=true; L if ( ) { L L U U KeReleaseSpinLock (); b=b?false: ; } } while(!b ); L U U E KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 24

47 Refinement Example do { U KeAcquireSpinLock (); L b=true; b L if ( ) { L L U U KeReleaseSpinLock (); b=b?false: ; } } while(!b ); L U U E KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 24

48 Refinement Example do { U KeAcquireSpinLock (); L b=true; b L if ( ) { L U KeReleaseSpinLock (); b=b?false: ; b L U } } while(!b ); b L b U U E KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 24

49 Refinement Example do { U KeAcquireSpinLock (); L b=true; b L if ( ) { b L b U KeReleaseSpinLock (); b=b?false: ; b L!b U } } while(!b ); b L b U U E KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 24

50 Refinement Example do { U KeAcquireSpinLock (); L b=true; b L if ( ) { b L b U KeReleaseSpinLock (); b=b?false: ; b L!b U } } while(!b ); b L b U U E KeReleaseSpinLock (); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 24

51 Refinement Example do { U KeAcquireSpinLock (); L b=true; b L if ( ) { b L b U KeReleaseSpinLock (); b=b?false: ; b L!b U } } while(!b ); b L b U U E KeReleaseSpinLock (); The property holds! D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 24

52 Counterexample-guided Abstraction Refinement CEGAR An iterative method to compute a sufficiently precise abstraction Initially applied in the context of hardware [Kurshan] D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 25

53 CEGAR Overview C program 1.) Compute Abstraction 2.) Check Abstraction [no error] OK 4.) Refine Predicates 3.) Check Feasibility [feasible] report counterexample D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 26

54 Counterexample-guided Abstraction Refinement Claims: 1. This never returns a false error. 2. This never returns a false proof. 3. This is complete for finite-state models. 4. But: no termination guarantee in case of infinite-state systems D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 27

55 Computing Existential Abstractions of Programs C program 1.) Compute Abstraction 2.) Check Abstraction [no error] OK 4.) Refine Predicates 3.) Check Feasibility [feasible] report counterexample D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 28

56 Computing Existential Abstractions of Programs i n t main ( ) { i n t i ; } i =0; while ( even ( i ) ) i ++; void main ( ) { bool p1, p2 ; } p1=true; p2=true; while ( p2 ) { p1= p1? FALSE : * ; p2=!p2 ; } C Program D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 29

57 Computing Existential Abstractions of Programs i n t main ( ) { i n t i ; } i =0; while ( even ( i ) ) i ++; + p 1 i = 0 p 2 even(i) void main ( ) { bool p1, p2 ; } p1=true; p2=true; while ( p2 ) { p1= p1? FALSE : * ; p2=!p2 ; } C Program Predicates D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 29

58 Computing Existential Abstractions of Programs i n t main ( ) { i n t i ; } i =0; while ( even ( i ) ) i ++; + p 1 i = 0 p 2 even(i) void main ( ) { bool p1, p2 ; } p1=true; p2=true; while ( p2 ) { p1= p1? FALSE : * ; p2=!p2 ; } C Program Predicates Boolean Program D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 29

59 Computing Existential Abstractions of Programs i n t main ( ) { i n t i ; } i =0; while ( even ( i ) ) i ++; + p 1 i = 0 p 2 even(i) void main ( ) { bool p1, p2 ; } p1=true; p2=true; while ( p2 ) { p1= p1? FALSE : * ; p2=!p2 ; } C Program Predicates Boolean Program Minimal? D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 29

60 Predicate Images Reminder: Image(X) = {s S s X. T (s, s )} We need Îmage( ˆX) = {ŝ Ŝ ŝ ˆX. ˆT (ŝ, ŝ )} Îmage( ˆX) is equivalent to {ŝ, ŝ Ŝ2 s, s S 2. α(s) = ŝ α(s ) = ŝ T (s, s )} This is called the predicate image of T. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 30

61 Enumeration Let s take existential abstraction seriously Basic idea: with n predicates, there are 2 n 2 n possible abstract transitions Let s just check them! D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 31

62 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i)

63 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++;

64 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++; T i = i + 1

65 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++; T i = i + 1 p 1 p 2 p p 1 p 2 p

66 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++; T i = i + 1 p 1 p 2 p ? p 1 p 2 p

67 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++; T i = i + 1 p 1 p 2 p ? p 1 p 2 p Query to Solver i 1 i 2 even(i) i = i + 1 i 1 i 2 even(i ) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 32

68 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++; T i = i + 1 p 1 p 2 p p 1 p 2 p Query to Solver i 1 i 2 even(i) i = i + 1 i 1 i 2 even(i ) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 32

69 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++; T i = i + 1 p 1 p 2 p ? p 1 p 2 p Query to Solver i 1 i 2 even(i) i = i + 1 i 1 i 2 even(i ) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 32

70 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++; T i = i + 1 p 1 p 2 p p 1 p 2 p Query to Solver i 1 i 2 even(i) i = i + 1 i 1 i 2 even(i ) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 32

71 Enumeration: Example Predicates p 1 i = 1 p 2 i = 2 p 3 even(i) Basic Block i++; T i = i + 1 p 1 p 2 p p 1 p 2 p Query to Solver... and so on... D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 32

72 Predicate Images Computing the minimal existential abstraction can be way too slow Use an over-approximation instead Fast(er) to compute But has additional transitions Examples: Cartesian approximation (SLAM) FastAbs (SLAM) Lazy abstraction (Blast) Predicate partitioning (VCEGAR) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 33

73 Checking the Abstract Model C program 1.) Compute Abstraction 2.) Check Abstraction [no error] OK 4.) Refine Predicates 3.) Check Feasibility [feasible] report counterexample D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 34

74 Checking the Abstract Model No more integers! But: All control flow constructs, including function calls (more) non-determinism BDD-based model checking now scales D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 35

75 Finite-State Model Checkers: SMV 1 Variables VAR b0 argc ge 1 : boolean ; argc >= 1 VAR b1 argc le : boolean ; argc <= VAR b2 : boolean ; argv [ argc ] == NULL VAR b3 nmemb ge r : boolean ; nmemb >= r VAR b4 : boolean ; p1 == &array [ 0 ] VAR b 5 i g e 8 : boolean ; i >= 8 VAR b 6 i g e s : boolean ; i >= s VAR b7 : boolean ; 1 + i >= 8 VAR b8 : boolean ; 1 + i >= s VAR b 9 s g t 0 : boolean ; s > 0 VAR b10 s gt 1 : boolean ; s > 1... D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 36

76 Finite-State Model Checkers: SMV 2Control Flow program counter : 56 i s the t e r m i n a t i n g PC VAR PC: ; ASSIGN i n i t (PC) : = 0 ; i n i t i a l PC ASSIGN next (PC) : = case PC=0: 1; other PC=1: 2; other... PC=19: case goto ( w i t h guard ) guard19 : 26; 1: 20; esac ;... D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 37

77 Finite-State Model Checkers: SMV 3 Data TRANS (PC=0) > next ( b0 argc ge 1 ) = b0 argc ge 1 & next ( b1 argc le )= b1 argc le & next ( b2)=b2 & (! b30 b36 ) & (! b17! b30 b42 ) & (! b30! b42 b48 ) & (! b17! b30! b42 b54 ) & (! b54 b60 ) TRANS (PC=1) > next ( b0 argc ge 1 ) = b0 argc ge 1 & next ( b1 argc le ) = b1 argc le & next ( b2)=b2 & next ( b3 nmemb ge r )= b3 nmemb ge r & next ( b4)=b4 & next ( b 5 i g e 8 )= b 5 i g e 8 & next ( b 6 i g e s )= b 6 i g e s... D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 38

78 Finite-State Model Checkers: SMV 4 Property the s p e c i f i c a t i o n f i l e main. c l i n e 20 column 12 f u n c t i o n c : : v e r y b u g g y f u n c t i o n SPEC AG ( (PC=51) >! b23 ) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 39

79 Finite-State Model Checkers: SMV If the property holds, we can terminate If the property fails, SMV generates a counterexample with an assignment for all variables, including the PC D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 40

80 Simulating the Counterexample C program 1.) Compute Abstraction 2.) Check Abstraction [no error] OK 4.) Refine Predicates 3.) Check Feasibility [feasible] report counterexample D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 41

81 Lazy Abstraction The progress guarantee is only valid if the minimal existential abstraction is used. Thus, distinguish spurious transitions from spurious prefixes. Refine spurious transitions separately to obtain minimal existential abstraction SLAM: Constrain D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 42

82 Lazy Abstraction One more observation: each iteration only causes only minor changes in the abstract model Thus, use incremental Model Checker, which retains the set of reachable states between iterations (BLAST) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 43

83 Example Simulation int main() { int x, y; y=1; x=1; if (y>x) y ; else y++; assert(y>x); } Predicate: y>x main() { bool b0; // y>x b0=*; b0=*; if (b0) b0=*; else b0=*; assert(b0 ); }

84 Example Simulation int main() { int x, y; y=1; x=1; if (y>x) y ; else y++; assert(y>x); } Predicate: y>x main() { bool b0; // y>x b0=*; b0=*; if (b0) b0=*; else b0=*; assert(b0 ); } D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 44

85 Example Simulation int main() { int x, y; y=1; x=1; if (y>x) y ; else y++; assert(y>x); } D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 45

86 Example Simulation int main() { int x, y; y=1; x=1; if (y>x) y ; else y++; assert(y>x); } We now do a path test, so convert to SSA. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 45

87 Example Simulation int main() { int x, y; y 1 =1; x 1 =1; if (y 1 >x 1 ) y 2 =y 1 1; else y++; assert(y 2 >x 1 ); } D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 46

88 Example Simulation int main() { int x, y; y 1 =1; x 1 =1; if (y 1 >x 1 ) y 2 =y 1 1; else y++; y 1 = 1 x 1 = 1 y 1 > x 1 y 2 = y 1 1 (y 2 > x 0 ) } assert(y 2 >x 1 ); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 46

89 Example Simulation int main() { int x, y; y 1 =1; x 1 =1; if (y 1 >x 1 ) y 2 =y 1 1; y 1 = 1 x 1 = 1 y 1 > x 1 y 2 = y 1 1 } else y++; assert(y 2 >x 1 ); (y 2 > x 0 ) This is UNSAT, so ˆπ is spurious. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 46

90 Refining the Abstraction C program 1.) Compute Abstraction 2.) Check Abstraction [no error] OK 4.) Refine Predicates 3.) Check Feasibility [feasible] report counterexample D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 47

91 Manual Proof! int main() { int x, y; y=1; x=1; if (y>x) y ; else y++; } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 48

92 Manual Proof! int main() { int x, y; y=1; {y = 1} x=1; if (y>x) y ; else y++; } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 48

93 Manual Proof! int main() { int x, y; y=1; {y = 1} x=1; {x = 1 y = 1} if (y>x) y ; else y++; } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 48

94 Manual Proof! int main() { int x, y; y=1; {y = 1} x=1; {x = 1 y = 1} if (y>x) y ; else {x = 1 y = 1 y > x} y++; } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 48

95 Manual Proof! int main() { int x, y; y=1; {y = 1} x=1; {x = 1 y = 1} if (y>x) y ; else {x = 1 y = 1 y > x} This proof uses strongest post-conditions y++; {x = 1 y = 2 y > x} } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 48

96 An Alternative Proof int main() { int x, y; y=1; x=1; if (y>x) y ; else y++; } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 49

97 An Alternative Proof int main() { int x, y; y=1; x=1; if (y>x) y ; else } y++; {y > x} assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 49

98 An Alternative Proof int main() { int x, y; y=1; x=1; if (y>x) y ; else {y + 1 > x} } y++; {y > x} assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 49

99 An Alternative Proof int main() { int x, y; y=1; x=1; { y > x y + 1 > x} if (y>x) y ; else {y + 1 > x} y++; {y > x} } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 49

100 An Alternative Proof int main() { int x, y; y=1; { y > 1 y + 1 > 1} x=1; { y > x y + 1 > x} if (y>x) y ; else {y + 1 > x} y++; {y > x} } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 49

101 An Alternative Proof int main() { int x, y; y=1; { y > 1 y + 1 > 1} x=1; { y > x y + 1 > x} if (y>x) y ; else {y + 1 > x} y++; {y > x} We are using weakest pre-conditions here wp(x:=e, P ) = P [x/e] wp(s;t, Q) = wp(s, wp(t, Q)) wp(if(c) A else B, P ) = (B wp(a, P )) ( B wp(b, P )) The proof for the true branch is missing } assert(y>x); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 49

102 Refinement Algorithms Using WP 1. Start with failed guard G 2. Compute wp(g) along the path Using SP 1. Start at beginning 2. Compute sp(...) along the path Both methods eliminate the trace Advantages/disadvantages? D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 50

103 Predicate Refinement for Paths Recall the decision problem we build for simulating paths: x 1 = 10 y 1 = x y 2 = y y 2 30

104 Predicate Refinement for Paths Recall the decision problem we build for simulating paths: x 1 = 10 y 1 = x y 2 = y y 2 30 x 1 = 10

105 Predicate Refinement for Paths Recall the decision problem we build for simulating paths: x 1 = 10 y 1 = x y 2 = y y 2 30 x 1 = 10 y 1 = 20

106 Predicate Refinement for Paths Recall the decision problem we build for simulating paths: x 1 = 10 y 1 = x y 2 = y y 2 30 x 1 = 10 y 1 = 20 y 2 = 30

107 Predicate Refinement for Paths Recall the decision problem we build for simulating paths: x 1 = 10 y 1 = x y 2 = y y 2 30 x 1 = 10 y 1 = 20 y 2 = 30 false

108 Predicate Refinement for Paths Recall the decision problem we build for simulating paths: A 1 A 2 {}}{{}}{{}}{{}}{ x 1 = 10 y 1 = x y 2 = y y 2 30 x 1 = 10 y 1 = 20 y 2 = 30 false A 3 A 4

109 Predicate Refinement for Paths Recall the decision problem we build for simulating paths: A 1 A 2 {}}{{}}{{}}{{}}{ x 1 = 10 y 1 = x y 2 = y y 2 30 x 1 = 10 }{{} y 1 = 20 }{{} y 2 = 30 }{{} false }{{} A 1 A 2 A 3 A 4 A 3 A 4 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 51

110 Predicate Refinement for Paths For a path with n steps: A 1 A 2 A 3... A n true A 1 A 2 A 3 A n 1 false D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 52

111 Predicate Refinement for Paths For a path with n steps: A 1 A 2 A 3... A n true A 1 A 2 A 3 A n 1 false Given A 1,..., A n with i A i = false A 0 = true and A n = false (A i 1 A i) A i for i {1,..., n} D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 52

112 Predicate Refinement for Paths For a path with n steps: A 1 A 2 A 3... A n true A 1 A 2 A 3 A n 1 false Given A 1,..., A n with i A i = false A 0 = true and A n = false (A i 1 A i) A i for i {1,..., n} Finally, Vars(A i ) (Vars(A 1... A i ) Vars(A i+1... A n )) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 52

113 Predicate Refinement for Paths Special case n = 2: A B = false A A A B = false Vars(A ) (Vars(A) Vars(B)) D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 53

114 Predicate Refinement for Paths Special case n = 2: A B = false A A A B = false Vars(A ) (Vars(A) Vars(B)) W. Craig s Interpolation theorem (1957): such an A exists for any first-order, inconsistent A and B. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 53

115 Predicate Refinement with Craig Interpolants For propositional logic, a propositional Craig Interpolant can be extracted from a resolution proof ( SAT!) in linear time Interpolating solvers available for linear arithmetic over the reals and integer difference logic with uninterpreted functions Not possible for every fragment of FOL: x = 2y and x = 2z + 1 with x, y, z Z D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 54

116 Predicate Refinement with Craig Interpolants For propositional logic, a propositional Craig Interpolant can be extracted from a resolution proof ( SAT!) in linear time Interpolating solvers available for linear arithmetic over the reals and integer difference logic with uninterpreted functions Not possible for every fragment of FOL: x = 2y and x = 2z + 1 with x, y, z Z The interpolant is x is even D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 54

117 Craig Interpolation for Linear Inequalities 0 x 0 y 0 c 1 x + c 2 y with 0 c 1, c 2 Cutting-planes Naturally arise in Fourier-Motzkin or Simplex D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 55

118 Example A = (0 x y) (0 y z 1) B = (0 z x)

119 Example A = (0 x y) (0 y z 1) B = (0 z x) 0 y z 1 0 z x

120 Example A = (0 x y) (0 y z 1) B = (0 z x) 0 y z 1 0 z x 0 y x 1

121 Example A = (0 x y) (0 y z 1) B = (0 z x) 0 y z 1 0 z x 0 y x 1 0 x y 0 1

122 Example A = (0 x y) (0 y z 1) B = (0 z x) 0 y z 1 0 z x 0 y x 1 0 x y y z y z 1 0 x y 0 x z 1

123 Example A = (0 x y) (0 y z 1) B = (0 z x) 0 y z 1 0 z x 0 y x 1 0 x y y z y z 1 0 x y 0 x z 1 z x 1 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 56

124 Example A = (0 x y) (0 y z 1) B = (0 z x) 0 y z 1 0 z x 0 y x 1 0 x y y z y z 1 0 x y 0 x z 1 z x 1 Just sum the inequalities from A, and you get an interpolant! D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 56

125 Approximating Loop Invariants: SP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } The SP refinement results in sp(x=y=0, true) = x = 0 y = 0 a s s e rt ( y ==10); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 57

126 Approximating Loop Invariants: SP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } The SP refinement results in sp(x=y=0, true) = x = 0 y = 0 sp(x++; y++,...) = x = 1 y = 1 a s s e rt ( y ==10); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 57

127 Approximating Loop Invariants: SP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } The SP refinement results in sp(x=y=0, true) = x = 0 y = 0 sp(x++; y++,...) = x = 1 y = 1 sp(x++; y++,...) = x = 2 y = 2 a s s e rt ( y ==10); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 57

128 Approximating Loop Invariants: SP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } a s s e rt ( y ==10); The SP refinement results in sp(x=y=0, true) = x = 0 y = 0 sp(x++; y++,...) = x = 1 y = 1 sp(x++; y++,...) = x = 2 y = 2 sp(x++; y++,...) = x = 3 y = iterations required to prove the property. It won t work if we replace 10 by n. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 57

129 Approximating Loop Invariants: WP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } The WP refinement results in wp(x==10, y 10) = y 10 x = 10 a s s e rt ( y ==10); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 58

130 Approximating Loop Invariants: WP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } The WP refinement results in wp(x==10, y 10) = y 10 x = 10 wp(x++; y++,...) = y 9 x = 9 a s s e rt ( y ==10); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 58

131 Approximating Loop Invariants: WP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } The WP refinement results in wp(x==10, y 10) = y 10 x = 10 wp(x++; y++,...) = y 9 x = 9 wp(x++; y++,...) = y 8 x = 8 a s s e rt ( y ==10); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 58

132 Approximating Loop Invariants: WP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } The WP refinement results in wp(x==10, y 10) = y 10 x = 10 wp(x++; y++,...) = y 9 x = 9 wp(x++; y++,...) = y 8 x = 8 wp(x++; y++,...) = y 7 x = 7 a s s e rt ( y ==10); D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 58

133 Approximating Loop Invariants: WP i n t x, y ; x=y =0; while ( x!=10) { x ++; y ++; } a s s e rt ( y ==10); The WP refinement results in wp(x==10, y 10) = y 10 x = 10 wp(x++; y++,...) = y 9 x = 9 wp(x++; y++,...) = y 8 x = 8 wp(x++; y++,...) = y 7 x = 7... Also requires 10 iterations. It won t work if we replace 10 by n. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 58

134 What do we really need? Consider an SSA-unwinding with 3 loop iterations: x 1 = 0 y 1 = 0

135 What do we really need? Consider an SSA-unwinding with 3 loop iterations: x 1 = 0 y 1 = 0 1st It. x 1 10 x 2 = x 1 +1 y 2 = y 1 +1

136 What do we really need? Consider an SSA-unwinding with 3 loop iterations: x 1 = 0 y 1 = 0 1st It. x 1 10 x 2 = x 1 +1 y 2 = y nd It. x 2 10 x 3 = x 2 +1 y 3 = y 2 +1

137 What do we really need? Consider an SSA-unwinding with 3 loop iterations: 1st It. 2nd It. 3rd It. x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1

138 What do we really need? Consider an SSA-unwinding with 3 loop iterations: 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10

139 What do we really need? Consider an SSA-unwinding with 3 loop iterations: 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0

140 What do we really need? Consider an SSA-unwinding with 3 loop iterations: 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1

141 What do we really need? Consider an SSA-unwinding with 3 loop iterations: 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1 x 3 = 2 y 3 = 2

142 What do we really need? Consider an SSA-unwinding with 3 loop iterations: 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1 x 3 = 2 y 3 = 2 x 4 = 3 y 4 = 3 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 59

143 What do we really need? Consider an SSA-unwinding with 3 loop iterations: 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1 x 3 = 2 y 3 = 2 x 4 = 3 y 4 = 3 This proof will produce the same predicates as SP. D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 59

144 Split Provers Idea: P 1 P 2 P 3... P n Each prover P i only knows A i, but they exchange facts We require that each prover only exchanges facts with common symbols Plus, we restrict the facts exchanged to some language L D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 60

145 Back to the Example Restriction to language L = no new constants : 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10

146 Back to the Example Restriction to language L = no new constants : 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0

147 Back to the Example Restriction to language L = no new constants : 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 61

148 Back to the Example Restriction to language L = no new constants : 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1 x 3 = 2 y 3 = 2 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 61

149 Back to the Example Restriction to language L = no new constants : 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1 x 3 = 2 y 3 = 2 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 61

150 Back to the Example Restriction to language L = no new constants : 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1 x 3 = y 3 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 61

151 Back to the Example Restriction to language L = no new constants : 1st It. 2nd It. 3rd It. Assertion x 1 = 0 y 1 = 0 x 1 10 x 2 = x 1 +1 y 2 = y 1 +1 x 2 10 x 3 = x 2 +1 y 3 = y 2 +1 x 3 10 x 4 = x 3 +1 y 4 = y 3 +1 x 4 = 10 y 4 10 x 1 = 0 y 1 = 0 x 2 = 1 y 2 = 1 x 3 = y 3 x 4 = y 4 D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 61

152 Invariants from Restricted Proofs The language restriction forces the solver to generalize! Algorithm: If the proof fails, increase L! If we fail to get a sufficiently strong invariant, increase n. This does work if we replace 10 by n! D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 62

153 Invariants from Restricted Proofs The language restriction forces the solver to generalize! Algorithm: If the proof fails, increase L! If we fail to get a sufficiently strong invariant, increase n. This does work if we replace 10 by n!? Which L 1, L 2,... is complete for which programs? D. Kroening: SSFT12 Predicate Abstraction: A Tutorial 62

Software Verification using Predicate Abstraction and Iterative Refinement: Part 1

Software Verification using Predicate Abstraction and Iterative Refinement: Part 1 using Predicate Abstraction and Iterative Refinement: Part 1 15-414 Bug Catching: Automated Program Verification and Testing Sagar Chaki November 28, 2011 Outline Overview of Model Checking Creating Models

More information

Abstractions and Decision Procedures for Effective Software Model Checking

Abstractions and Decision Procedures for Effective Software Model Checking Abstractions and Decision Procedures for Effective Software Model Checking Prof. Natasha Sharygina The University of Lugano, Carnegie Mellon University Microsoft Summer School, Moscow, July 2011 Lecture

More information

Model Checking: An Introduction

Model Checking: An Introduction Model Checking: An Introduction Meeting 3, CSCI 5535, Spring 2013 Announcements Homework 0 ( Preliminaries ) out, due Friday Saturday This Week Dive into research motivating CSCI 5535 Next Week Begin foundations

More information

Counterexample-Guided Abstraction Refinement

Counterexample-Guided Abstraction Refinement Counterexample-Guided Abstraction Refinement Edmund Clarke Orna Grumberg Somesh Jha Yuan Lu Helmut Veith Seminal Papers in Verification (Reading Group) June 2012 O. Rezine () Verification Reading Group

More information

Lecture 2: Symbolic Model Checking With SAT

Lecture 2: Symbolic Model Checking With SAT Lecture 2: Symbolic Model Checking With SAT Edmund M. Clarke, Jr. School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 (Joint work over several years with: A. Biere, A. Cimatti, Y.

More information

Double Header. Model Checking. Model Checking. Overarching Plan. Take-Home Message. Spoiler Space. Topic: (Generic) Model Checking

Double Header. Model Checking. Model Checking. Overarching Plan. Take-Home Message. Spoiler Space. Topic: (Generic) Model Checking Double Header Model Checking #1 Two Lectures Model Checking SoftwareModel Checking SLAM and BLAST Flying Boxes It is traditional to describe this stuff (especially SLAM and BLAST) with high-gloss animation

More information

IC3 and Beyond: Incremental, Inductive Verification

IC3 and Beyond: Incremental, Inductive Verification IC3 and Beyond: Incremental, Inductive Verification Aaron R. Bradley ECEE, CU Boulder & Summit Middle School IC3 and Beyond: Incremental, Inductive Verification 1/62 Induction Foundation of verification

More information

Interpolant-based Transition Relation Approximation

Interpolant-based Transition Relation Approximation Interpolant-based Transition Relation Approximation Ranjit Jhala and K. L. McMillan 1 University of California, San Diego 2 Cadence Berkeley Labs Abstract. In predicate abstraction, exact image computation

More information

3-Valued Abstraction-Refinement

3-Valued Abstraction-Refinement 3-Valued Abstraction-Refinement Sharon Shoham Academic College of Tel-Aviv Yaffo 1 Model Checking An efficient procedure that receives: A finite-state model describing a system A temporal logic formula

More information

Automata-Theoretic Model Checking of Reactive Systems

Automata-Theoretic Model Checking of Reactive Systems Automata-Theoretic Model Checking of Reactive Systems Radu Iosif Verimag/CNRS (Grenoble, France) Thanks to Tom Henzinger (IST, Austria), Barbara Jobstmann (CNRS, Grenoble) and Doron Peled (Bar-Ilan University,

More information

Deductive Verification

Deductive Verification Deductive Verification Mooly Sagiv Slides from Zvonimir Rakamaric First-Order Logic A formal notation for mathematics, with expressions involving Propositional symbols Predicates Functions and constant

More information

Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies

Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies Tom Henzinger EPFL Three Verification Communities Model checking: -automatic, but inefficient

More information

SAT-Based Verification with IC3: Foundations and Demands

SAT-Based Verification with IC3: Foundations and Demands SAT-Based Verification with IC3: Foundations and Demands Aaron R. Bradley ECEE, CU Boulder & Summit Middle School SAT-Based Verification with IC3:Foundations and Demands 1/55 Induction Foundation of verification

More information

Information Flow Analysis via Path Condition Refinement

Information Flow Analysis via Path Condition Refinement Information Flow Analysis via Path Condition Refinement Mana Taghdiri, Gregor Snelting, Carsten Sinz Karlsruhe Institute of Technology, Germany FAST September 16, 2010 KIT University of the State of Baden-Wuerttemberg

More information

CEGAR:Counterexample-Guided Abstraction Refinement

CEGAR:Counterexample-Guided Abstraction Refinement CEGAR: Counterexample-guided Abstraction Refinement Sayan Mitra ECE/CS 584: Embedded System Verification November 13, 2012 Outline Finite State Systems: Abstraction Refinement CEGAR Validation Refinment

More information

Interpolation. Seminar Slides. Betim Musa. 27 th June Albert-Ludwigs-Universität Freiburg

Interpolation. Seminar Slides. Betim Musa. 27 th June Albert-Ludwigs-Universität Freiburg Interpolation Seminar Slides Albert-Ludwigs-Universität Freiburg Betim Musa 27 th June 2015 Motivation program add(int a, int b) { var x,i : int; l 0 assume(b 0); l 1 x := a; l 2 i := 0; while(i < b) {

More information

EFFICIENT PREDICATE ABSTRACTION OF PROGRAM SUMMARIES

EFFICIENT PREDICATE ABSTRACTION OF PROGRAM SUMMARIES EFFICIENT PREDICATE ABSTRACTION OF PROGRAM SUMMARIES Arie Gurfinkel, Sagar Chaki and Samir Sapra Carnegie Mellon Uni In NFM11 Presented by Nimrod Partush OUTLINE Introduction Predicate Abstraction CEGAR

More information

Understanding IC3. Aaron R. Bradley. ECEE, CU Boulder & Summit Middle School. Understanding IC3 1/55

Understanding IC3. Aaron R. Bradley. ECEE, CU Boulder & Summit Middle School. Understanding IC3 1/55 Understanding IC3 Aaron R. Bradley ECEE, CU Boulder & Summit Middle School Understanding IC3 1/55 Further Reading This presentation is based on Bradley, A. R. Understanding IC3. In SAT, June 2012. http://theory.stanford.edu/~arbrad

More information

Software Verification with Abstraction-Based Methods

Software Verification with Abstraction-Based Methods Software Verification with Abstraction-Based Methods Ákos Hajdu PhD student Department of Measurement and Information Systems, Budapest University of Technology and Economics MTA-BME Lendület Cyber-Physical

More information

Lecture Notes on Software Model Checking

Lecture Notes on Software Model Checking 15-414: Bug Catching: Automated Program Verification Lecture Notes on Software Model Checking Matt Fredrikson André Platzer Carnegie Mellon University Lecture 19 1 Introduction So far we ve focused on

More information

SMT and Its Application in Software Verification

SMT and Its Application in Software Verification SMT and Its Application in Software Verification Yu-Fang Chen IIS, Academia Sinica Based on the slides of Barrett, Sanjit, Kroening, Rummer, Sinha, Jhala, and Majumdar Assertion in C int main(){ int x;

More information

Lecture Notes: Axiomatic Semantics and Hoare-style Verification

Lecture Notes: Axiomatic Semantics and Hoare-style Verification Lecture Notes: Axiomatic Semantics and Hoare-style Verification 17-355/17-665/17-819O: Program Analysis (Spring 2018) Claire Le Goues and Jonathan Aldrich clegoues@cs.cmu.edu, aldrich@cs.cmu.edu It has

More information

Applications of Craig Interpolants in Model Checking

Applications of Craig Interpolants in Model Checking Applications of Craig Interpolants in Model Checking K. L. McMillan Cadence Berkeley Labs Abstract. A Craig interpolant for a mutually inconsistent pair of formulas (A, B) is a formula that is (1) implied

More information

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples Hoare Logic I Introduction to Deductive Program Verification Işıl Dillig Program Spec Deductive verifier FOL formula Theorem prover valid contingent Example specs: safety (no crashes), absence of arithmetic

More information

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements Axiomatic Semantics: Verification Conditions Meeting 12, CSCI 5535, Spring 2009 Announcements Homework 4 is due tonight Wed forum: papers on automated testing using symbolic execution 2 Questions? Review

More information

Complexity and algorithms for monomial and clausal predicate abstraction

Complexity and algorithms for monomial and clausal predicate abstraction Complexity and algorithms for monomial and clausal predicate abstraction Shuvendu K. Lahiri and Shaz Qadeer Microsoft Research Abstract. In this paper, we investigate the asymptotic complexity of various

More information

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for? Computer Engineering and Networks Overview Discrete Event Systems Verification of Finite Automata Lothar Thiele Introduction Binary Decision Diagrams Representation of Boolean Functions Comparing two circuits

More information

ESE601: Hybrid Systems. Introduction to verification

ESE601: Hybrid Systems. Introduction to verification ESE601: Hybrid Systems Introduction to verification Spring 2006 Suggested reading material Papers (R14) - (R16) on the website. The book Model checking by Clarke, Grumberg and Peled. What is verification?

More information

The Software Model Checker BLAST

The Software Model Checker BLAST The Software Model Checker BLAST http://mtc.epfl.ch/software-tools/blast/ BLAST 2.0 Team: Dirk Beyer, Tom Henzinger, Ranjit Jhala, and Rupak Majumdar Guest Lecture in Viktor Kuncak s Verification Class,

More information

Notes. Corneliu Popeea. May 3, 2013

Notes. Corneliu Popeea. May 3, 2013 Notes Corneliu Popeea May 3, 2013 1 Propositional logic Syntax We rely on a set of atomic propositions, AP, containing atoms like p, q. A propositional logic formula φ Formula is then defined by the following

More information

SAT-based Model Checking: Interpolation, IC3, and Beyond

SAT-based Model Checking: Interpolation, IC3, and Beyond SAT-based Model Checking: Interpolation, IC3, and Beyond Orna GRUMBERG a, Sharon SHOHAM b and Yakir VIZEL a a Computer Science Department, Technion, Haifa, Israel b School of Computer Science, Academic

More information

or simply: IC3 A Simplified Description

or simply: IC3 A Simplified Description Incremental Construction of Inductive Clauses for Indubitable Correctness or simply: IC3 A Simplified Description Based on SAT-Based Model Checking without Unrolling Aaron Bradley, VMCAI 2011 Efficient

More information

Static Program Analysis

Static Program Analysis Static Program Analysis Lecture 16: Abstract Interpretation VI (Counterexample-Guided Abstraction Refinement) Thomas Noll Lehrstuhl für Informatik 2 (Software Modeling and Verification) noll@cs.rwth-aachen.de

More information

Scalable and Accurate Verification of Data Flow Systems. Cesare Tinelli The University of Iowa

Scalable and Accurate Verification of Data Flow Systems. Cesare Tinelli The University of Iowa Scalable and Accurate Verification of Data Flow Systems Cesare Tinelli The University of Iowa Overview AFOSR Supported Research Collaborations NYU (project partner) Chalmers University (research collaborator)

More information

Tutorial 1: Modern SMT Solvers and Verification

Tutorial 1: Modern SMT Solvers and Verification University of Illinois at Urbana-Champaign Tutorial 1: Modern SMT Solvers and Verification Sayan Mitra Electrical & Computer Engineering Coordinated Science Laboratory University of Illinois at Urbana

More information

Bounded Model Checking with SAT/SMT. Edmund M. Clarke School of Computer Science Carnegie Mellon University 1/39

Bounded Model Checking with SAT/SMT. Edmund M. Clarke School of Computer Science Carnegie Mellon University 1/39 Bounded Model Checking with SAT/SMT Edmund M. Clarke School of Computer Science Carnegie Mellon University 1/39 Recap: Symbolic Model Checking with BDDs Method used by most industrial strength model checkers:

More information

Predicate abstrac,on and interpola,on. Many pictures and examples are borrowed from The So'ware Model Checker BLAST presenta,on.

Predicate abstrac,on and interpola,on. Many pictures and examples are borrowed from The So'ware Model Checker BLAST presenta,on. Predicate abstrac,on and interpola,on Many pictures and examples are borrowed from The So'ware Model Checker BLAST presenta,on. Outline. Predicate abstrac,on the idea in pictures 2. Counter- example guided

More information

Algorithmic verification

Algorithmic verification Algorithmic verification Ahmed Rezine IDA, Linköpings Universitet Hösttermin 2018 Outline Overview Model checking Symbolic execution Outline Overview Model checking Symbolic execution Program verification

More information

FAIRNESS FOR INFINITE STATE SYSTEMS

FAIRNESS FOR INFINITE STATE SYSTEMS FAIRNESS FOR INFINITE STATE SYSTEMS Heidy Khlaaf University College London 1 FORMAL VERIFICATION Formal verification is the process of establishing whether a system satisfies some requirements (properties),

More information

Chapter 4: Computation tree logic

Chapter 4: Computation tree logic INFOF412 Formal verification of computer systems Chapter 4: Computation tree logic Mickael Randour Formal Methods and Verification group Computer Science Department, ULB March 2017 1 CTL: a specification

More information

Integrating Induction, Deduction and Structure for Synthesis

Integrating Induction, Deduction and Structure for Synthesis Integrating Induction, Deduction and Structure for Synthesis Sanjit A. Seshia Associate Professor EECS Department UC Berkeley Students & Postdocs: S. Jha, W.Li, A. Donze, L. Dworkin, B. Brady, D. Holcomb,

More information

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17 Decision Procedures Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg Winter Term 2016/17 Jochen Hoenicke (Software Engineering) Decision Procedures Winter Term 2016/17 1 / 436 Program

More information

Equalities and Uninterpreted Functions. Chapter 3. Decision Procedures. An Algorithmic Point of View. Revision 1.0

Equalities and Uninterpreted Functions. Chapter 3. Decision Procedures. An Algorithmic Point of View. Revision 1.0 Equalities and Uninterpreted Functions Chapter 3 Decision Procedures An Algorithmic Point of View D.Kroening O.Strichman Revision 1.0 Outline Decision Procedures Equalities and Uninterpreted Functions

More information

LRA Interpolants from No Man s Land. Leonardo Alt, Antti E. J. Hyvärinen, and Natasha Sharygina University of Lugano, Switzerland

LRA Interpolants from No Man s Land. Leonardo Alt, Antti E. J. Hyvärinen, and Natasha Sharygina University of Lugano, Switzerland LR Interpolants from No Man s Land Leonardo lt, ntti E. J. Hyvärinen, and Natasha Sharygina University of Lugano, Switzerland Motivation The goal: Finding the right proof The tool: Make interpolation

More information

SMT BASICS WS 2017/2018 ( ) LOGIC SATISFIABILITY MODULO THEORIES. Institute for Formal Models and Verification Johannes Kepler Universität Linz

SMT BASICS WS 2017/2018 ( ) LOGIC SATISFIABILITY MODULO THEORIES. Institute for Formal Models and Verification Johannes Kepler Universität Linz LOGIC SATISFIABILITY MODULO THEORIES SMT BASICS WS 2017/2018 (342.208) Armin Biere Martina Seidl biere@jku.at martina.seidl@jku.at Institute for Formal Models and Verification Johannes Kepler Universität

More information

Verification using Satisfiability Checking, Predicate Abstraction, and Craig Interpolation. Himanshu Jain THESIS ORAL TALK

Verification using Satisfiability Checking, Predicate Abstraction, and Craig Interpolation. Himanshu Jain THESIS ORAL TALK Verification using Satisfiability Checking, Predicate Abstraction, and Craig Interpolation Himanshu Jain THESIS ORAL TALK 1 Computer Systems are Pervasive Computer Systems = Software + Hardware Software/Hardware

More information

Learning Abstractions for Model Checking

Learning Abstractions for Model Checking Learning Abstractions for Model Checking Anubhav Gupta June 2006 CMU-CS-06-131 School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Submitted in partial fulfillment of the requirements

More information

Soundness and Completeness of Axiomatic Semantics

Soundness and Completeness of Axiomatic Semantics #1 Soundness and Completeness of Axiomatic Semantics #2 One-Slide Summary A system of axiomatic semantics is sound if everything we can prove is also true: if ` { A } c { B } then ² { A } c { B } We prove

More information

Integrating Induction and Deduction for Verification and Synthesis

Integrating Induction and Deduction for Verification and Synthesis Integrating Induction and Deduction for Verification and Synthesis Sanjit A. Seshia Associate Professor EECS Department UC Berkeley DATE 2013 Tutorial March 18, 2013 Bob s Vision: Exploit Synergies between

More information

Formal Verification Techniques. Riccardo Sisto, Politecnico di Torino

Formal Verification Techniques. Riccardo Sisto, Politecnico di Torino Formal Verification Techniques Riccardo Sisto, Politecnico di Torino State exploration State Exploration and Theorem Proving Exhaustive exploration => result is certain (correctness or noncorrectness proof)

More information

5. Program Correctness: Mechanics

5. Program Correctness: Mechanics 5. Program Correctness: Mechanics Program A: LinearSearch with function specification @pre 0 l u < a @post rv i. l i u a[i] = e bool LinearSearch(int[] a, int l, int u, int e) { for @ (int i := l; i u;

More information

CS156: The Calculus of Computation

CS156: The Calculus of Computation Page 1 of 61 CS156: The Calculus of Computation Zohar Manna Winter 2010 Chapter 5: Program Correctness: Mechanics Page 2 of 61 Program A: LinearSearch with function specification @pre 0 l u < a @post rv

More information

Satisfiability Modulo Theories (SMT)

Satisfiability Modulo Theories (SMT) CS510 Software Engineering Satisfiability Modulo Theories (SMT) Slides modified from those by Aarti Gupta Textbook: The Calculus of Computation by A. Bradley and Z. Manna 1 Satisfiability Modulo Theory

More information

Property Checking of Safety- Critical Systems Mathematical Foundations and Concrete Algorithms

Property Checking of Safety- Critical Systems Mathematical Foundations and Concrete Algorithms Property Checking of Safety- Critical Systems Mathematical Foundations and Concrete Algorithms Wen-ling Huang and Jan Peleska University of Bremen {huang,jp}@cs.uni-bremen.de MBT-Paradigm Model Is a partial

More information

Design of Distributed Systems Melinda Tóth, Zoltán Horváth

Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Publication date 2014 Copyright 2014 Melinda Tóth, Zoltán Horváth Supported by TÁMOP-412A/1-11/1-2011-0052

More information

Alan Bundy. Automated Reasoning LTL Model Checking

Alan Bundy. Automated Reasoning LTL Model Checking Automated Reasoning LTL Model Checking Alan Bundy Lecture 9, page 1 Introduction So far we have looked at theorem proving Powerful, especially where good sets of rewrite rules or decision procedures have

More information

Proof Calculus for Partial Correctness

Proof Calculus for Partial Correctness Proof Calculus for Partial Correctness Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 7, 2016 Bow-Yaw Wang (Academia Sinica) Proof Calculus for Partial Correctness September

More information

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig First-Order Logic First-Order Theories Roopsha Samanta Partly based on slides by Aaron Bradley and Isil Dillig Roadmap Review: propositional logic Syntax and semantics of first-order logic (FOL) Semantic

More information

Symbolic Trajectory Evaluation (STE): Orna Grumberg Technion, Israel

Symbolic Trajectory Evaluation (STE): Orna Grumberg Technion, Israel Symbolic Trajectory Evaluation (STE): Automatic Refinement and Vacuity Detection Orna Grumberg Technion, Israel Marktoberdort 2007 1 Agenda Model checking Symbolic Trajectory Evaluation Basic Concepts

More information

Introduction to Model Checking. Debdeep Mukhopadhyay IIT Madras

Introduction to Model Checking. Debdeep Mukhopadhyay IIT Madras Introduction to Model Checking Debdeep Mukhopadhyay IIT Madras How good can you fight bugs? Comprising of three parts Formal Verification techniques consist of three parts: 1. A framework for modeling

More information

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory Motivation CS389L: Automated Logical Reasoning Lecture 10: Overview of First-Order Theories Işıl Dillig Last few lectures: Full first-order logic In FOL, functions/predicates are uninterpreted (i.e., structure

More information

Model Checking. Boris Feigin March 9, University College London

Model Checking. Boris Feigin March 9, University College London b.feigin@cs.ucl.ac.uk University College London March 9, 2005 Outline 1 2 Techniques Symbolic 3 Software 4 Vs. Deductive Verification Summary Further Reading In a nutshell... Model checking is a collection

More information

Floyd-Hoare Style Program Verification

Floyd-Hoare Style Program Verification Floyd-Hoare Style Program Verification Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 9 Feb 2017 Outline of this talk 1 Overview 2 Hoare Triples 3

More information

State-Space Exploration. Stavros Tripakis University of California, Berkeley

State-Space Exploration. Stavros Tripakis University of California, Berkeley EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2014 State-Space Exploration Stavros Tripakis University of California, Berkeley Stavros Tripakis (UC Berkeley) EE

More information

Overview. overview / 357

Overview. overview / 357 Overview overview6.1 Introduction Modelling parallel systems Linear Time Properties Regular Properties Linear Temporal Logic (LTL) Computation Tree Logic syntax and semantics of CTL expressiveness of CTL

More information

The Eager Approach to SMT. Eager Approach to SMT

The Eager Approach to SMT. Eager Approach to SMT The Eager Approach to SMT Sanjit A. Seshia UC Berkeley Slides based on ICCAD 09 Tutorial Eager Approach to SMT Input Formula Satisfiability-preserving Boolean Encoder Boolean Formula SAT Solver SAT Solver

More information

Axiomatic Semantics: Verification Conditions. Review of Soundness of Axiomatic Semantics. Questions? Announcements

Axiomatic Semantics: Verification Conditions. Review of Soundness of Axiomatic Semantics. Questions? Announcements Axiomatic Semantics: Verification Conditions Meeting 18, CSCI 5535, Spring 2010 Announcements Homework 6 is due tonight Today s forum: papers on automated testing using symbolic execution Anyone looking

More information

Constraint Solving for Program Verification: Theory and Practice by Example

Constraint Solving for Program Verification: Theory and Practice by Example Constraint Solving for Program Verification: Theory and Practice by Example Andrey Rybalchenko Technische Universität München Abstract. Program verification relies on the construction of auxiliary assertions

More information

Abstraction for Falsification

Abstraction for Falsification Abstraction for Falsification Thomas Ball 1, Orna Kupferman 2, and Greta Yorsh 3 1 Microsoft Research, Redmond, WA, USA. Email: tball@microsoft.com, URL: research.microsoft.com/ tball 2 Hebrew University,

More information

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and shows how a program can sometimes be systematically constructed

More information

Quantifiers. Leonardo de Moura Microsoft Research

Quantifiers. Leonardo de Moura Microsoft Research Quantifiers Leonardo de Moura Microsoft Research Satisfiability a > b + 2, a = 2c + 10, c + b 1000 SAT a = 0, b = 3, c = 5 Model 0 > 3 + 2, 0 = 2 5 + 10, 5 + ( 3) 1000 Quantifiers x y x > 0 f x, y = 0

More information

An overview of SLAM. Albert Oliveras, Enric Rodríguez-Carbonell. Deduction and Verification Techniques Session 5 Fall 2009, Barcelona

An overview of SLAM. Albert Oliveras, Enric Rodríguez-Carbonell. Deduction and Verification Techniques Session 5 Fall 2009, Barcelona An overview of SLAM Albert Oliveras, Enric Rodríguez-Carbonell Deduction and Verification Techniques Session 5 Fall 2009, Barcelona Anoverviewof SLAM p.1 Overview of the session TheSLAMloop SLAM components:

More information

Predicate Abstraction via Symbolic Decision Procedures

Predicate Abstraction via Symbolic Decision Procedures Predicate Abstraction via Symbolic Decision Procedures Shuvendu K. Lahiri Thomas Ball Byron Cook May 26, 2005 Technical Report MSR-TR-2005-53 Microsoft Research Microsoft Corporation One Microsoft Way

More information

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Today s class will be an introduction

More information

Testing with model checkers: A survey

Testing with model checkers: A survey COMPETENCE NETWORK SOFTNET AUSTRIA Testing with model checkers: A survey SNA-TR-2007-P2-04 Gordon Fraser, Franz Wotawa, Paul E. Ammann SNA TECHNICAL REPORT NOVEMBER 2007 Competence Network Softnet Austria,

More information

Topics in Verification AZADEH FARZAN FALL 2017

Topics in Verification AZADEH FARZAN FALL 2017 Topics in Verification AZADEH FARZAN FALL 2017 Last time LTL Syntax ϕ ::= true a ϕ 1 ϕ 2 ϕ ϕ ϕ 1 U ϕ 2 a AP. ϕ def = trueu ϕ ϕ def = ϕ g intuitive meaning of and is obt Limitations of LTL pay pay τ τ soda

More information

Introduction. Pedro Cabalar. Department of Computer Science University of Corunna, SPAIN 2013/2014

Introduction. Pedro Cabalar. Department of Computer Science University of Corunna, SPAIN 2013/2014 Introduction Pedro Cabalar Department of Computer Science University of Corunna, SPAIN cabalar@udc.es 2013/2014 P. Cabalar ( Department Introduction of Computer Science University of Corunna, SPAIN2013/2014

More information

CS156: The Calculus of Computation

CS156: The Calculus of Computation CS156: The Calculus of Computation Zohar Manna Winter 2010 It is reasonable to hope that the relationship between computation and mathematical logic will be as fruitful in the next century as that between

More information

Beyond Quantifier-Free Interpolation in Extensions of Presburger Arithmetic

Beyond Quantifier-Free Interpolation in Extensions of Presburger Arithmetic Beyond Quantifier-Free Interpolation in Extensions of Presburger Arithmetic Angelo Brillout, 1 Daniel Kroening, 2 Philipp Rümmer, 3 Thomas Wahl 2 1 ETH Zurich 2 Oxford University 3 Uppsala University Deduction

More information

Theorem Proving beyond Deduction

Theorem Proving beyond Deduction Theorem Proving beyond Deduction Specification and Verification with Higher-Order Logic Arnd Poetzsch-Heffter (Slides by Jens Brandt) Software Technology Group Fachbereich Informatik Technische Universität

More information

Internals of SMT Solvers. Leonardo de Moura Microsoft Research

Internals of SMT Solvers. Leonardo de Moura Microsoft Research Internals of SMT Solvers Leonardo de Moura Microsoft Research Acknowledgements Dejan Jovanovic (SRI International, NYU) Grant Passmore (Univ. Edinburgh) Herbrand Award 2013 Greg Nelson What is a SMT Solver?

More information

Refinement of Trace Abstraction

Refinement of Trace Abstraction Refinement of Trace Abstraction Matthias Heizmann, Jochen Hoenicke, and Andreas Podelski University of Freiburg, Germany Abstract. We present a new counterexample-guided abstraction refinement scheme.

More information

Ranking Verification Counterexamples: An Invariant guided approach

Ranking Verification Counterexamples: An Invariant guided approach Ranking Verification Counterexamples: An Invariant guided approach Ansuman Banerjee Indian Statistical Institute Joint work with Pallab Dasgupta, Srobona Mitra and Harish Kumar Complex Systems Everywhere

More information

Introduction to Axiomatic Semantics

Introduction to Axiomatic Semantics #1 Introduction to Axiomatic Semantics #2 How s The Homework Going? Remember that you can t just define a meaning function in terms of itself you must use some fixed point machinery. #3 Observations A

More information

Computation Tree Logic (CTL) & Basic Model Checking Algorithms

Computation Tree Logic (CTL) & Basic Model Checking Algorithms Computation Tree Logic (CTL) & Basic Model Checking Algorithms Martin Fränzle Carl von Ossietzky Universität Dpt. of Computing Science Res. Grp. Hybride Systeme Oldenburg, Germany 02917: CTL & Model Checking

More information

Mid-Semester Quiz Second Semester, 2012

Mid-Semester Quiz Second Semester, 2012 THE AUSTRALIAN NATIONAL UNIVERSITY Mid-Semester Quiz Second Semester, 2012 COMP2600 (Formal Methods for Software Engineering) Writing Period: 1 hour duration Study Period: 10 minutes duration Permitted

More information

Temporal Logic. Stavros Tripakis University of California, Berkeley. We have designed a system. We want to check that it is correct.

Temporal Logic. Stavros Tripakis University of California, Berkeley. We have designed a system. We want to check that it is correct. EE 244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2016 Temporal logic Stavros Tripakis University of California, Berkeley Stavros Tripakis (UC Berkeley) EE 244, Fall 2016

More information

Formal Specification and Verification. Specifications

Formal Specification and Verification. Specifications Formal Specification and Verification Specifications Imprecise specifications can cause serious problems downstream Lots of interpretations even with technicaloriented natural language The value returned

More information

Axiomatic Semantics. Operational semantics. Good for. Not good for automatic reasoning about programs

Axiomatic Semantics. Operational semantics. Good for. Not good for automatic reasoning about programs Review Operational semantics relatively l simple many flavors (small vs. big) not compositional (rule for while) Good for describing language implementation reasoning about properties of the language eg.

More information

Hoare Logic: Reasoning About Imperative Programs

Hoare Logic: Reasoning About Imperative Programs Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2018 Programming Paradigms Functional. (Haskell, SML, OCaml,... ) main paradigm:

More information

MODEL CHECKING. Arie Gurfinkel

MODEL CHECKING. Arie Gurfinkel 1 MODEL CHECKING Arie Gurfinkel 2 Overview Kripke structures as models of computation CTL, LTL and property patterns CTL model-checking and counterexample generation State of the Art Model-Checkers 3 SW/HW

More information

Semantic Equivalences and the. Verification of Infinite-State Systems 1 c 2004 Richard Mayr

Semantic Equivalences and the. Verification of Infinite-State Systems 1 c 2004 Richard Mayr Semantic Equivalences and the Verification of Infinite-State Systems Richard Mayr Department of Computer Science Albert-Ludwigs-University Freiburg Germany Verification of Infinite-State Systems 1 c 2004

More information

First-order resolution for CTL

First-order resolution for CTL First-order resolution for Lan Zhang, Ullrich Hustadt and Clare Dixon Department of Computer Science, University of Liverpool Liverpool, L69 3BX, UK {Lan.Zhang, U.Hustadt, CLDixon}@liverpool.ac.uk Abstract

More information

CTL Model checking. 1. finite number of processes, each having a finite number of finite-valued variables. Model-Checking

CTL Model checking. 1. finite number of processes, each having a finite number of finite-valued variables. Model-Checking CTL Model checking Assumptions:. finite number of processes, each having a finite number of finite-valued variables.. finite length of CTL formula Problem:Determine whether formula f 0 is true in a finite

More information

Gödel s Incompleteness Theorems

Gödel s Incompleteness Theorems Seminar Report Gödel s Incompleteness Theorems Ahmet Aspir Mark Nardi 28.02.2018 Supervisor: Dr. Georg Moser Abstract Gödel s incompleteness theorems are very fundamental for mathematics and computational

More information

Satisfiability Modulo Theories

Satisfiability Modulo Theories Satisfiability Modulo Theories Bruno Dutertre SRI International Leonardo de Moura Microsoft Research Satisfiability a > b + 2, a = 2c + 10, c + b 1000 SAT a = 0, b = 3, c = 5 Model 0 > 3 + 2, 0 = 2 5 +

More information

Course Runtime Verification

Course Runtime Verification Course Martin Leucker (ISP) Volker Stolz (Høgskolen i Bergen, NO) INF5140 / V17 Chapters of the Course Chapter 1 Recall in More Depth Chapter 2 Specification Languages on Words Chapter 3 LTL on Finite

More information

An Introduction to Z3

An Introduction to Z3 An Introduction to Z3 Huixing Fang National Trusted Embedded Software Engineering Technology Research Center April 12, 2017 Outline 1 SMT 2 Z3 Huixing Fang (ECNU) An Introduction to Z3 April 12, 2017 2

More information

Constraint Logic Programming and Integrating Simplex with DPLL(T )

Constraint Logic Programming and Integrating Simplex with DPLL(T ) Constraint Logic Programming and Integrating Simplex with DPLL(T ) Ali Sinan Köksal December 3, 2010 Constraint Logic Programming Underlying concepts The CLP(X ) framework Comparison of CLP with LP Integrating

More information

SAT/SMT/AR Introduction and Applications

SAT/SMT/AR Introduction and Applications SAT/SMT/AR Introduction and Applications Ákos Hajdu Budapest University of Technology and Economics Department of Measurement and Information Systems 1 Ákos Hajdu About me o PhD student at BME MIT (2016

More information