Disjunctive relational abstract interpretation for interprocedural program analysis

Size: px
Start display at page:

Download "Disjunctive relational abstract interpretation for interprocedural program analysis"

Transcription

1 Disjunctive relational abstract interpretation for interprocedural program analysis Nicolas Halbwachs, joint work with Rémy Boutonnet Verimag/CNRS, and Grenoble-Alpes University Grenoble, France R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 1 / 30

2 Standard program analysis Goal: compute (an upper approximation of) the reachable states of a program (S,S 0, ) A = S 0 {s s A,s s } Trace partitioning: Assume S is partitioned: S = S 1 S 2... S k, and let A i = A S i,i = 1..k: A i = (S 0 S i ) {s S i s A j,s s } j=1..k a system of recursive semantic equations R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 2 / 30

3 Numerical program analysis A numerical state: n variables a vector X N n (N = Z or Q) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 3 / 30

4 Numerical program analysis A numerical state: n variables a vector X N n (N = Z or Q) Example of semantic equations A 0 = N 2 x=0; y=0; A 1 = A 0 [x 0][y 0] while A 2 = A 1 A 6 x<=100 do A 3 = A 2 (x 100) if?? then x=x+2 A 4 = A 3 [x x + 2] else x=x+1; y=y+1 A 5 = A 3 [x x + 1][y y + 1] endif A 6 = A 4 A 5 endwhile A 7 = A 2 (x 101) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 3 / 30

5 Numerical abstract domains y x R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 4 / 30

6 Numerical abstract domains y Polyhedra x + 2y 8 x y + 8 x 13 y 2x + 4 x + 2y 28 x R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 4 / 30

7 Numerical abstract domains y Polyhedra relational x + 2y 8 x y + 8 x 13 y 2x + 4 x + 2y 28 x R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 4 / 30

8 Numerical abstract domains y Intervals x [0,13] y [0,12] x R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 4 / 30

9 Numerical abstract domains y Intervals not relational x [0,13] y [0,12] x R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 4 / 30

10 Numerical abstract domains y Octagons weakly relational 0 x 13 0 y 12 4 x + y x y 8 x R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 4 / 30

11 An example with polyhedra x := 0 ; y := 0; while x 100 do if?? then x:= x+2 else x:= x+1; y:=y+1; endif endwhile R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 5 / 30

12 An example with polyhedra x := 0 ; y := 0; x=y=0 while x 100 do if?? then x:= x+2 else x:= x+1; y:=y+1; endif endwhile R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 5 / 30

13 An example with polyhedra x := 0 ; y := 0; x=y=0 while x=y=0 x 100 do if?? then x:= x+2 else x:= x+1; y:=y+1; endif endwhile /0 R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 5 / 30

14 An example with polyhedra x := 0 ; y := 0; x=y=0 while x=y=0 x 100 do if?? then x:= x+2 x=2, y=0 else x:= x+1; y:=y+1; x=1, y=1 endif endwhile /0 R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 5 / 30

15 An example with polyhedra x := 0 ; y := 0; x=y=0 while x=y=0 x 100 do if?? then x:= x+2 x=2, y=0 else x:= x+1; y:=y+1; x=1, y=1 endif 1 x 2, x+y=2 endwhile /0 y x R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 5 / 30

16 An example with polyhedra x := 0 ; y := 0; x=y=0 while x 100 do if?? then x:= x+2 y 1 2 x else x:= x+1; y:=y+1; endif 1 x 2, x+y=2 endwhile R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 5 / 30

17 An example with polyhedra x := 0 ; y := 0; x=y=0 while 0 y x, x+y 1 x 100 do if?? then x:= x+2 y 1 2 x else x:= x+1; y:=y+1; endif 1 x 2, x+y=2 endwhile R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 5 / 30

18 An example with polyhedra x := 0 ; y := 0; x=y=0 while 0 y x, x+y 1 x 100 do if?? then x:= x+2 0 y x y Widening 1 2 x else x:= x+1; y:=y+1; endif 1 x 2, x+y=2 endwhile R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 5 / 30

19 An example with polyhedra x := 0 ; y := 0; x=y=0 while x 100 do 0 y x 100 if?? then x:= x+2 else x:= x+1; y:=y+1; endif endwhile R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 6 / 30

20 An example with polyhedra x := 0 ; y := 0; x=y=0 while x 100 do 0 y x 100 if?? then x:= x+2 0 y x else x:= x+1; y:=y+1; 1 y x 101 endif endwhile R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 6 / 30

21 An example with polyhedra x := 0 ; y := 0; x=y=0 while x 100 do 0 y x 100 if?? then x:= x+2 0 y x else x:= x+1; y:=y+1; 1 y x 101 endif 0 y x 102,2 x + y 202 endwhile R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 6 / 30

22 An example with polyhedra x := 0 ; y := 0; x=y=0 while 0 y x 102,x + y 202 x 100 do 0 y x 100 if?? then x:= x+2 0 y x else x:= x+1; y:=y+1; 1 y x 101 endif 0 y x 102,2 x + y 202 endwhile 0 y,101 x 102,x + y 202 R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 6 / 30

23 Motivation Relational domains (polyhedra, octagons, congruences,...) are too expensive to scale up (on huge monolithic programs) interprocedural analysis especially interesting (analyse medium size procedures once and for all) Bottom-up interprocedural analysis (build a procedure summary independently of the calling context) little used, because too imprecise with non-relational domains take advantage of relational domains to build precise relational procedure summaries R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 7 / 30

24 Interprocedural program analysis How to deal with procedures and calls? Inlining Top-down: at each call, analyse the procedure in the context of its actual parameters. Bottom-up: analyse the procedure once and for all, synthesize a summary to be used at each call. Hybrid strategies: mix the two, e.g., compute a summary in the simplest aliasing context (no aliases), compute a new summary when a call with possible aliases is encountered. R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 8 / 30

25 From state analysis to relational analysis State analysis: Starting from a set S 0 of initial states, compute at each control point i, the set A i = {s S i s 0 S 0,s.t.,s 0 s} Relational analysis: Starting from a set S 0 of initial states, compute at each control point i, the relation R i = {(s 0,s) S 0 S i s 0 S 0,s 0 s} R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 9 / 30

26 From state analysis to relational analysis State analysis: Starting from a set S 0 of initial states, compute at each control point i, the set A i = {s S i s 0 S 0,s.t.,s 0 s} Relational analysis: Starting from a set S 0 of initial states, compute at each control point i, the relation R i = {(s 0,s) S 0 S i s 0 S 0,s 0 s} Important fact: s.r i is a necessary condition on s 0 for point i to be reachable from s 0 R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 9 / 30

27 Relational analysis of a procedure Procedures: All parameters are supposed to be passed by reference (but we ignore pointer manipulation, and we entrust existing analyses to detect aliasing problems). Global variables considered as additional parameters. R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 10 / 30

28 Relational analysis of a procedure Procedures: All parameters are supposed to be passed by reference (but we ignore pointer manipulation, and we entrust existing analyses to detect aliasing problems). Global variables considered as additional parameters. Relational analysis: Duplicate each parameter x with an auxiliary variable x 0, to record its initial value Perform a standard analysis of the body, starting from x = x 0 for each parameter x Project away local variables from the result at return point to obtain a relational summary R(X 0,X) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 10 / 30

29 Example: div proc div (a, b, q, r: int){ assume a 0 && b 1; a0=a ; b0=b ; q0=q ; r0=r; q=0 ; r=a; while(r b){ r = r-b ; q = q+1 ; } } R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 11 / 30

30 Example: div proc div (a, b, q, r: int){ assume a 0 && b 1; a0=a ; b0=b ; q0=q ; r0=r; q=0 ; r=a; while(r b){ r = r-b ; q = q+1 ; } } Standard Analysis r 0 q 0 b r + 1 a = a0 b = b0 R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 11 / 30

31 Example: div proc div (a, b, q, r: int){ assume a 0 && b 1; a0=a ; b0=b ; q0=q ; r0=r; q=0 ; r=a; while(r b){ r = r-b ; q = q+1 ; } } Standard Analysis r 0 q 0 b r + 1 a = a0 b = b0 precondition a0 0 lost! R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 11 / 30

32 Widening limited by precondition A precondition is obviously an invariant (a procedure may not modify the initial values of its parameters!) one can limit (i.e., intersect) the widening by the precondition. Example (cont.): Intersect the result of the widening with a0 0 b0 1 R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 12 / 30

33 Example: div proc div (a, b, q, r: int){ assume a 0 && b 1; a0=a ; b0=b ; q0=q ; r0=r; q=0 ; r=a; while(r b){ r = r-b ; q = q+1 ; } } Standard Analysis r 0 q 0 b r + 1 a = a0 b = b0 precondition a0 0 lost! With limited widening r 0 q 0 b r + 1 a q + r a = a0 b = b0 Better than expected, but still imprecise, as a summary R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 13 / 30

34 Disjunctive summaries Convex summaries are not expressive enough General disjunctions of polyhedra are difficult to manage (ex.: inclusion) Idea: disjunctive refinement by partitioning preconditions precondition P partitioned into P 1 P 2... P m Disjunctive summary R = R 1 R 2...R m with P i = X.R i, i = 1..m R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 14 / 30

35 Example of disjunctive summary proc div (a, b, q, r: int){ assume a 0 && b 1; a0=a ; b0=b ; q0=q ; r0=r; q=0 ; r=a; while(r b){ r = r-b ; q = q+1 ; } } Standard analysis: r 0 q 0 b r + 1 With limited widening: r 0 q 0 b r +1 a q +r R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 15 / 30

36 Example of disjunctive summary proc div (a, b, q, r: int){ assume a 0 && b 1; a0=a ; b0=b ; q0=q ; r0=r; q=0 ; r=a; while(r b){ r = r-b ; q = q+1 ; } } Partitioning according to a0 b0, b0 a0 + 1 (entering the loop or not) Standard analysis: r 0 q 0 b r + 1 With limited widening: r 0 q 0 b r +1 a q +r R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 15 / 30

37 Example of disjunctive summary proc div (a, b, q, r: int){ assume a 0 && b 1; a0=a ; b0=b ; q0=q ; r0=r; q=0 ; r=a; while(r b){ r = r-b ; q = q+1 ; } } Standard analysis: r 0 q 0 b r + 1 With limited widening: r 0 q 0 b r +1 a q +r Partitioning according to a0 b0, b0 a0 + 1 (entering the loop or not) Result: either b0 1 a0 0 and q = 0 r = a or a0 b0 1 and r 0 q 0 q + r 1 b r + 1 a + 1 b + q R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 15 / 30

38 Partitioning preconditions Refinement according to local reachability: Let R k (P) be the result at control point k of a relational analysis from precondition P. It relates the initial values X 0 and the current values X. Then, R 0 k = X.R k(p) is a necessary condition on X 0 for the point k to be reachable. R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 16 / 30

39 Partitioning preconditions Refinement according to local reachability: Let R k (P) be the result at control point k of a relational analysis from precondition P. It relates the initial values X 0 and the current values X. Then, R 0 k = X.R k(p) is a necessary condition on X 0 for the point k to be reachable. Rk 0 P, thanks to widening limited by precondition, but if Rk 0 P, any constraint c of R0 k not satisfied by P, may be used to split the precondition P into P = P c and P = P c and point k is not reachable from P. R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 16 / 30

40 Partitioning preconditions: example Example: From the the precondition P = (a0 0 b0 1), the analysis of div provides R = (a = a0 b = b0 r b 1 q 0 a q + r) at the loop entry. Now, R 0 = (a,b,q,r).r = (a0 b0 1) Since a0 b0 is not satisfied by the precondition P, it provides the (obvious) refinement P = (a0 b0 1), P = (b0 1 a0 0) that we used before. R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 17 / 30

41 Postponing loop feedback The problem: In the div example, our partitioning separates the cases when the loop is entered at least once or not. In the former case, our analysis provides (a0 b0 1) (r 0 q 0 q + r 1 b r + 1 a + 1 b + q) We should find q 1 (the loop is executed at least once) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 18 / 30

42 Postponing loop feedback The problem: In the div example, our partitioning separates the cases when the loop is entered at least once or not. In the former case, our analysis provides (a0 b0 1) (r 0 q 0 q + r 1 b r + 1 a + 1 b + q) We should find q 1 (the loop is executed at least once) The explanation: At loop exit, the semantic equation is R exit = (R in R feedback ) cond feedback in cond exit while R in cond = /0 R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 18 / 30

43 Postponing loop feedback The problem: In the div example, our partitioning separates the cases when the loop is entered at least once or not. In the former case, our analysis provides (a0 b0 1) (r 0 q 0 q + r 1 b r + 1 a + 1 b + q) We should find q 1 (the loop is executed at least once) The explanation: At loop exit, the semantic equation is R exit = (R in R feedback ) cond feedback in cond exit while R in cond = /0 The solution: Compute instead R exit = (R in cond) (R feedback cond) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 18 / 30

44 Postponing loop feedback Previous result: (r 0 q 0 q + r 1 b r + 1 a + 1 b + q) New result: (r 0 q 1 b r + 1 a + 1 b + q + r) Better than expected R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 19 / 30

45 Using procedure summaries Let p be a procedure, with a call k : q(a) ; k :... where A = (a1,a2,...,a n ) are the actual parameters. Let R k be the relation computed at point k. Let F = (f 1,f 2,...,f n ) be the formal parameters of q, and (S 1,...,S m ) be a summary of q. R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 20 / 30

46 Using procedure summaries Let p be a procedure, with a call k : q(a) ; k :... where A = (a1,a2,...,a n ) are the actual parameters. Let R k be the relation computed at point k. Let F = (f 1,f 2,...,f n ) be the formal parameters of q, and (S 1,...,S m ) be a summary of q. Then, the relation at return point k is m R k = A. R k [A/A ] S l [F/A][F 0 /A ] where l=1 R k [A/A ] is the result of renaming in R k each variable a i as a i S l [F/A][F 0 /A ] is the result of renaming in S l each variable f i as a i and each variable fi 0 as a i R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 20 / 30

47 Partitioning preconditions (cont.) Refinement according to called procedure summary Since the relation at return point of a call is a, its a good idea to make some of its terms empty. Preconditions of the call: P l = ( F.S l ),l = 1..m Making C l = A.R k [A/A ] P l [F 0 /A ] empty: refine the precondition of the caller X.C l is a necessary condition (on initial values in the caller) for C l to be not empty. Use it to split the precondition, as before. R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 21 / 30

48 Example, a recursive procedure McCarthy s 91 function proc f91 (x,y: int) { var z, t: int ; 1:if (x > 100) 2: y = x -10 ; 3:else { 4: z = x + 11 ; 5: f91 (z, t) ; 6: f91 (t, y) ; 7:} } R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 22 / 30

49 Example, a recursive procedure McCarthy s 91 function proc f91 (x,y: int) { var z, t: int ; 1:if (x > 100) 2: y = x -10 ; 3:else { 4: z = x + 11 ; 5: f91 (z, t) ; 6: f91 (t, y) ; 7:} } Semantic equations (without parameters duplication) R = R 2 R 7 R 2 = (x 101 y = x 10) R 7 = (x 100) ( t.r(x + 11,t) R(t,y)) 22mm] R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 22 / 30

50 Example, a recursive procedure McCarthy s 91 function proc f91 (x,y: int) { var z, t: int ; 1:if (x > 100) 2: y = x -10 ; 3:else { 4: z = x + 11 ; 5: f91 (z, t) ; 6: f91 (t, y) ; 7:} } Semantic equations (without parameters duplication) R = R 2 R 7 R 2 = (x 101 y = x 10) R 7 = (x 100) ( t.r(x + 11,t) R(t,y)) 22mm]Standard analysis: R 2 = (x 101 y = x 10) R 7 = (x 100 y + 9 x y 91) R = (x y + 10 y 91) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 22 / 30

51 Example, a recursive procedure (cont.) Standard analysis: R 2 = (x 101 y = x 10) R 7 = (x 100 y + 9 x y 91) R = (x y + 10 y 91) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 23 / 30

52 Example, a recursive procedure (cont.) Standard analysis: R 2 = (x 101 y = x 10) R 7 = (x 100 y + 9 x y 91) R = (x y + 10 y 91) Since y.r 2 = (x 101), split the initial precondition into (x 101) and (x 100). R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 23 / 30

53 Example, a recursive procedure (cont.) Standard analysis: R 2 = (x 101 y = x 10) R 7 = (x 100 y + 9 x y 91) R = (x y + 10 y 91) Since y.r 2 = (x 101), split the initial precondition into (x 101) and (x 100). Result: (x 101 y = x 10) or (x 100 y 91) not much better R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 23 / 30

54 Example, a recursive procedure (cont.) Now, refine according to the summary at the first recursive call, i.e., according to (x ). R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 24 / 30

55 Example, a recursive procedure (cont.) Now, refine according to the summary at the first recursive call, i.e., according to (x ). Final result: (x 101 y = x 10) or (90 x 100 y = 91) or (x 89 y = 91) most precise summary R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 24 / 30

56 Implementation Method implemented by Rémy Boutonnet in his prototype analyzer MARS (Mars Abstract interpretation Research System) Based on CLANG, takes a significant subset of C Uses the Apron library of abstract domains Applies a standard data-flow analysis to identify pure value parameters and pure result parameters, which don t need to be duplicated Recursive procedures not yet taken into account R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 25 / 30

57 Experiments Goal: Compare the interprocedural analysis to a standard analysis of inlined programs, answer the following questions: The construction of summaries involves several analyses, does it induce a significant overhead? Does the bottom-up approach result in a significant loss of precision? Problems: Find an interesting benchmark (numerical programs with procedures) How to compare the precision? R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 26 / 30

58 Experiments (cont.) Use of the Mälardalen benchmark (worst case execution time), 19 programs sometimes augmented with statement counters Precision: Compare the results at the end of the main program (after projection on the variables of the main) Qualitative comparison: is the result of interprocedural analysis better ( ), worse ( ), equal (=), or incomparable (<>) w.r.t. the one of inlining analysis? Quantitative comparison: compare the number of constraints R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 27 / 30

59 First experimental results Interprocedural analysis faster on 13 programs over 19 (average speedup 2.9). Most procedures called once. The speedup increases rapidly with the number of calls. Some precision lost on 3 programs (worst: from 32 to 12 constraints) Some precision gained on 5 programs (best: from 1 to 6 constraints) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 28 / 30

60 Future work Extend to modular analysis of procedures with memories (objects, reactive software) R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 29 / 30

61 Future work Extend to modular analysis of procedures with memories (objects, reactive software) A reactive module X : input variables Y : output variables M : memory variables M = M 0 ; forever { read(x); (Y,M) = Step(X,M); write(y); } M X Step Y R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 29 / 30

62 Future work X Can we construct a summary of each module (including an invariant on the memory) and use these summaries to analyse the whole system? M X 1 Step 1 M 1 Y 1 X 2 M 2 Step 2 Y 2 Y R. Boutonnet, N. Halbwachs (Verimag) Disjunctive relational abstract interpretation 30 / 30

Program verification

Program verification Program verification Data-flow analyses, numerical domains Laure Gonnord and David Monniaux University of Lyon / LIP September 29, 2015 1 / 75 Context Program Verification / Code generation: Variables

More information

Compilation and Program Analysis (#8) : Abstract Interpretation

Compilation and Program Analysis (#8) : Abstract Interpretation Compilation and Program Analysis (#8) : Abstract Interpretation Laure Gonnord http://laure.gonnord.org/pro/teaching/capm.html Laure.Gonnord@ens-lyon.fr Master, ENS de Lyon Nov 7 Objective Compilation vs

More information

Static Program Analysis using Abstract Interpretation

Static Program Analysis using Abstract Interpretation Static Program Analysis using Abstract Interpretation Introduction Static Program Analysis Static program analysis consists of automatically discovering properties of a program that hold for all possible

More information

«ATutorialon Abstract Interpretation»

«ATutorialon Abstract Interpretation» «ATutorialon Abstract Interpretation» Patrick Cousot École normale supérieure 45 rue d Ulm 75230 Paris cedex 05, France Patrick.Cousot@ens.fr www.di.ens.fr/~cousot VMCAI 05 Industrial Day VMCAI 05 Industrial

More information

Proofs of Correctness: Introduction to Axiomatic Verification

Proofs of Correctness: Introduction to Axiomatic Verification Proofs of Correctness: Introduction to Axiomatic Verification Introduction Weak correctness predicate Assignment statements Sequencing Selection statements Iteration 1 Introduction What is Axiomatic Verification?

More information

The Assignment Axiom (Hoare)

The Assignment Axiom (Hoare) The Assignment Axiom (Hoare) Syntax: V := E Semantics: value of V in final state is value of E in initial state Example: X:=X+ (adds one to the value of the variable X) The Assignment Axiom {Q[E/V ]} V

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

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

Week 4-5: Binary Relations

Week 4-5: Binary Relations 1 Binary Relations Week 4-5: Binary Relations The concept of relation is common in daily life and seems intuitively clear. For instance, let X be the set of all living human females and Y the set of all

More information

Generation of Basic Semi-algebraic Invariants Using Convex Polyhedra

Generation of Basic Semi-algebraic Invariants Using Convex Polyhedra Generation of Basic Semi-algebraic Invariants Using Convex Polyhedra Generation of Invariant Conjunctions of Polynomial Inequalities Using Convex Polyhedra R. Bagnara 1, E. Rodríguez-Carbonell 2, E. Zaffanella

More information

Generation of. Polynomial Equality Invariants. by Abstract Interpretation

Generation of. Polynomial Equality Invariants. by Abstract Interpretation Generation of Polynomial Equality Invariants by Abstract Interpretation Enric Rodríguez-Carbonell Universitat Politècnica de Catalunya (UPC) Barcelona Joint work with Deepak Kapur (UNM) 1 Introduction

More information

Programming Languages and Compilers (CS 421)

Programming Languages and Compilers (CS 421) Programming Languages and Compilers (CS 421) Sasa Misailovic 4110 SC, UIUC https://courses.engr.illinois.edu/cs421/fa2017/cs421a Based in part on slides by Mattox Beckman, as updated by Vikram Adve, Gul

More information

Week 4-5: Binary Relations

Week 4-5: Binary Relations 1 Binary Relations Week 4-5: Binary Relations The concept of relation is common in daily life and seems intuitively clear. For instance, let X be the set of all living human females and Y the set of all

More information

Precise Interprocedural Analysis through Linear Algebra

Precise Interprocedural Analysis through Linear Algebra Precise Interprocedural Analysis through Linear Algebra Markus Müller-Olm FernUniversität Hagen, LG Praktische Informatik 5 58084 Hagen, Germany mmo@ls5csuni-dortmundde Helmut Seidl TU München, Lehrstuhl

More information

EDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach

EDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach EDA045F: Program Analysis LECTURE 10: TYPES 1 Christoph Reichenbach In the last lecture... Performance Counters Challenges in Dynamic Performance Analysis Taint Analysis Binary Instrumentation 2 / 44 Types

More information

Proving Programs Correct

Proving Programs Correct Proving Programs Correct Page 1 of 9 Proving Programs Correct How can we be sure that a piece of code does what we want it to do? One way is to try testing the code on a large group of data. Another is

More information

Abstract Interpretation and Static Analysis

Abstract Interpretation and Static Analysis / 1 Abstract Interpretation and Static Analysis David Schmidt Kansas State University www.cis.ksu.edu/~schmidt Welcome! / 2 / 3 Four parts 1. Introduction to static analysis what it is and how to apply

More information

Analysis of a Boost Converter Circuit Using Linear Hybrid Automata

Analysis of a Boost Converter Circuit Using Linear Hybrid Automata Analysis of a Boost Converter Circuit Using Linear Hybrid Automata Ulrich Kühne LSV ENS de Cachan, 94235 Cachan Cedex, France, kuehne@lsv.ens-cachan.fr 1 Introduction Boost converter circuits are an important

More information

An Abstract Interpretation Approach. for Automatic Generation of. Polynomial Invariants

An Abstract Interpretation Approach. for Automatic Generation of. Polynomial Invariants An Abstract Interpretation Approach for Automatic Generation of Polynomial Invariants Enric Rodríguez-Carbonell Universitat Politècnica de Catalunya Barcelona Deepak Kapur University of New Mexico Albuquerque

More information

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics Dynamic Semantics Operational Semantics Denotational Semantic Dynamic Semantics Operational Semantics Operational Semantics Describe meaning by executing program on machine Machine can be actual or simulated

More information

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University Intelligent Agents Formal Characteristics of Planning Ute Schmid Cognitive Systems, Applied Computer Science, Bamberg University Extensions to the slides for chapter 3 of Dana Nau with contributions by

More information

Verification of Real-Time Systems Numerical Abstractions

Verification of Real-Time Systems Numerical Abstractions Verification of Real-Time Systems Numerical Abstractions Jan Reineke Advanced Lecture, Summer 2015 Recap: From Local to Global Correctness: Kleene Iteration Abstract Domain F # F #... F # γ a γ a γ a Concrete

More information

Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE

Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE 6341 1 Outline Introduction What are axiomatic semantics? First-order logic & assertions about states Results (triples)

More information

Fast Acceleration of Ultimately Periodic Relations

Fast Acceleration of Ultimately Periodic Relations Fast Acceleration of Ultimately Periodic Relations Marius Bozga 1, Radu Iosif 1, Filip Konečný 1,2 1 VERIMAG / CNRS / University of Grenoble, France 2 Brno University of Technology, Czech Republic Fast

More information

Sorting. Chapter 11. CSE 2011 Prof. J. Elder Last Updated: :11 AM

Sorting. Chapter 11. CSE 2011 Prof. J. Elder Last Updated: :11 AM Sorting Chapter 11-1 - Sorting Ø We have seen the advantage of sorted data representations for a number of applications q Sparse vectors q Maps q Dictionaries Ø Here we consider the problem of how to efficiently

More information

Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants

Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants Deepak Kapur 1 Zhihai Zhang 2 Matthias Horbach 1 Hengjun Zhao 3 Qi Lu 1 and ThanhVu Nguyen 1 1

More information

Mechanics of Static Analysis

Mechanics of Static Analysis Escuela 03 III / 1 Mechanics of Static Analysis David Schmidt Kansas State University www.cis.ksu.edu/~schmidt Escuela 03 III / 2 Outline 1. Small-step semantics: trace generation 2. State generation and

More information

An Abstract Domain to Infer Ordinal-Valued Ranking Functions

An Abstract Domain to Infer Ordinal-Valued Ranking Functions An Abstract Domain to Infer Ordinal-Valued Ranking Functions Caterina Urban and Antoine Miné ÉNS & CNRS & INRIA, Paris, France urban@di.ens.fr, mine@di.ens.fr Abstract. The traditional method for proving

More information

Enhancing the Updatability of Projective Views

Enhancing the Updatability of Projective Views Enhancing the Updatability of Projective Views (Extended Abstract) Paolo Guagliardo 1, Reinhard Pichler 2, and Emanuel Sallinger 2 1 KRDB Research Centre, Free University of Bozen-Bolzano 2 Vienna University

More information

Modular Lattices for Compositional Interprocedural Analysis. by Ghila Castelnuovo

Modular Lattices for Compositional Interprocedural Analysis. by Ghila Castelnuovo Tel Aviv University Raymond and Beverly Sackler Faculty of Exact Sciences School of Computer Science Modular Lattices for Compositional Interprocedural Analysis by Ghila Castelnuovo under the supervision

More information

Nested Interpolants. Matthias Heizmann Jochen Hoenicke Andreas Podelski. Abstract. 1. Introduction. University of Freiburg, Germany

Nested Interpolants. Matthias Heizmann Jochen Hoenicke Andreas Podelski. Abstract. 1. Introduction. University of Freiburg, Germany c ACM 2010. This is the author s version of the work. t is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in Principles of Programming

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

Non-linear Interpolant Generation and Its Application to Program Verification

Non-linear Interpolant Generation and Its Application to Program Verification Non-linear Interpolant Generation and Its Application to Program Verification Naijun Zhan State Key Laboratory of Computer Science, Institute of Software, CAS Joint work with Liyun Dai, Ting Gan, Bow-Yaw

More information

Verification of Recursive Programs. Andreas Podelski February 8, 2012

Verification of Recursive Programs. Andreas Podelski February 8, 2012 Verification of Recursive Programs Andreas Podelski February 8, 2012 1 m(x) = x 10 if x > 100 m(m(x + 11)) if x 100 2 procedure m(x) returns (res) `0: if x>100 `1: res:=x-10 else `2: x m := x+11 `3: res

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

The Trace Partitioning Abstract Domain

The Trace Partitioning Abstract Domain The Trace Partitioning Abstract Domain XAVIER RIVAL and LAURENT MAUBORGNE École Normale Supérieure In order to achieve better precision of abstract interpretation based static analysis, we introduce a

More information

Abstract Interpretation II

Abstract Interpretation II Abstract Interpretation II Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 11 13 May 2016 Course 11 Abstract Interpretation II Antoine

More information

Design of Embedded Systems: Models, Validation and Synthesis (EE 249) Lecture 9

Design of Embedded Systems: Models, Validation and Synthesis (EE 249) Lecture 9 Design of Embedded Systems: Models, Validation and Synthesis (EE 249) Lecture 9 Prof. Dr. Reinhard von Hanxleden Christian-Albrechts Universität Kiel Department of Computer Science Real-Time Systems and

More information

Simplifying Loop Invariant Generation Using Splitter Predicates

Simplifying Loop Invariant Generation Using Splitter Predicates Simplifying Loop Invariant Generation Using Splitter Predicates Rahul Sharma, Isil Dillig, Thomas Dillig, and Alex Aiken Department of Computer Science Stanford University {sharmar,isil,tdillig,aiken}@cs.stanford.edu

More information

CSE20: Discrete Mathematics

CSE20: Discrete Mathematics Spring 2018 Summary Today: Induction, Program Correctness Reading: Chap. 5 Division Theorem Theorem: For every integer a and positive integer d 1, there exist integers q, r such that a = qd + r and 0 r

More information

Simplifying Loop Invariant Generation Using Splitter Predicates

Simplifying Loop Invariant Generation Using Splitter Predicates Simplifying Loop Invariant Generation Using Splitter Predicates Rahul Sharma, Isil Dillig, Thomas Dillig, and Alex Aiken Department of Computer Science Stanford University {sharmar,isil,tdillig,aiken}@cs.stanford.edu

More information

Software Verification

Software Verification Software Verification Grégoire Sutre LaBRI, University of Bordeaux, CNRS, France Summer School on Verification Technology, Systems & Applications September 2008 Grégoire Sutre Software Verification VTSA

More information

Central Algorithmic Techniques. Iterative Algorithms

Central Algorithmic Techniques. Iterative Algorithms Central Algorithmic Techniques Iterative Algorithms Code Representation of an Algorithm class InsertionSortAlgorithm extends SortAlgorithm { void sort(int a[]) throws Exception { for (int i = 1; i < a.length;

More information

Model for reactive systems/software

Model for reactive systems/software Temporal Logics CS 5219 Abhik Roychoudhury National University of Singapore The big picture Software/ Sys. to be built (Dream) Properties to Satisfy (caution) Today s lecture System Model (Rough Idea)

More information

Computational Models - Lecture 4

Computational Models - Lecture 4 Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push

More information

DFA of non-distributive properties

DFA of non-distributive properties DFA of non-distributive properties The general pattern of Dataflow Analysis GA (p)= i if p E { GA (q) q F } otherwise GA (p)= f p ( GA (p) ) where : E is the set of initial/final points of the control-flow

More information

Verification of analog and mixed-signal circuits using hybrid systems techniques

Verification of analog and mixed-signal circuits using hybrid systems techniques FMCAD, November 2004, Austin Verification of analog and mixed-signal circuits using hybrid systems techniques Thao Dang, Alexandre Donze, Oded Maler VERIMAG Grenoble, France Plan 1. Introduction 2. Verification

More information

Section 1 (closed-book) Total points 30

Section 1 (closed-book) Total points 30 CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes

More information

Precise Program Analysis through (Linear) Algebra

Precise Program Analysis through (Linear) Algebra Precise Program Analysis through (Linear) Algebra Markus Müller-Olm FernUniversität Hagen (on leave from Universität Dortmund) Joint work with Helmut Seidl (TU München) CP+CV 4, Barcelona, March 8, 4 Overview

More information

Compositional May-Must Program Analysis: Unleashing the Power of Alternation

Compositional May-Must Program Analysis: Unleashing the Power of Alternation Compositional May-Must Program Analysis: Unleashing the Power of Alternation Patrice Godefroid Aditya V. Nori Sriram K. Rajamani Sai Deep Tetali Microsoft Research pg, adityan, sriram, v-saitet@microsoft.com

More information

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11.

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11. Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 1 Overview We ll develop proof rules, such as: { I b } S { I } { I } while b do S end { I b } That allow us to verify

More information

Denotational Semantics

Denotational Semantics 5 Denotational Semantics In the operational approach, we were interested in how a program is executed. This is contrary to the denotational approach, where we are merely interested in the effect of executing

More information

Program verification. 18 October 2017

Program verification. 18 October 2017 Program verification 18 October 2017 Example revisited // assume(n>2); void partition(int a[], int n) { int pivot = a[0]; int lo = 1, hi = n-1; while (lo

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

Interprocedural Analysis: Sharir-Pnueli s Call-strings Approach

Interprocedural Analysis: Sharir-Pnueli s Call-strings Approach Interprocedural Analysis: Sharir-Pnueli s Call-strings Approach Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 04 September 2013 Outline 1 Motivation

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

We define a dataflow framework. A dataflow framework consists of:

We define a dataflow framework. A dataflow framework consists of: So far been talking about various dataflow problems (e.g. reaching definitions, live variable analysis) in very informal terms. Now we will discuss a more fundamental approach to handle many of the dataflow

More information

Course 311: Michaelmas Term 2005 Part III: Topics in Commutative Algebra

Course 311: Michaelmas Term 2005 Part III: Topics in Commutative Algebra Course 311: Michaelmas Term 2005 Part III: Topics in Commutative Algebra D. R. Wilkins Contents 3 Topics in Commutative Algebra 2 3.1 Rings and Fields......................... 2 3.2 Ideals...............................

More information

Compositional May-Must Program Analysis: Unleashing the Power of Alternation

Compositional May-Must Program Analysis: Unleashing the Power of Alternation Compositional May-Must Program Analysis: Unleashing the Power of Alternation Patrice Godefroid Microsoft Research Redmond pg@microsoft.com Aditya V. Nori Microsoft Research India adityan@microsoft.com

More information

An Entailment Checker for Separation Logic with Inductive Definitions

An Entailment Checker for Separation Logic with Inductive Definitions An Entailment Checker for Separation Loic with Inductive Definitions Radu Iosif, Cristina Serban Université de Grenoble Alpes, CNRS, VERIMAG July 18, 2018 Cristina Serban (VERIMAG) An Entailment Checker

More information

Automatic Generation of Polynomial Invariants for System Verification

Automatic Generation of Polynomial Invariants for System Verification Automatic Generation of Polynomial Invariants for System Verification Enric Rodríguez-Carbonell Technical University of Catalonia Talk at EPFL Nov. 2006 p.1/60 Plan of the Talk Introduction Need for program

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

Proving Inter-Program Properties

Proving Inter-Program Properties Unité Mixte de Recherche 5104 CNRS - INPG - UJF Centre Equation 2, avenue de VIGNATE F-38610 GIERES tel : +33 456 52 03 40 fax : +33 456 52 03 50 http://www-verimag.imag.fr Proving Inter-Program Properties

More information

Program verification. Hoare triples. Assertional semantics (cont) Example: Semantics of assignment. Assertional semantics of a program

Program verification. Hoare triples. Assertional semantics (cont) Example: Semantics of assignment. Assertional semantics of a program Program verification Assertional semantics of a program Meaning of a program: relation between its inputs and outputs; specified by input assertions (pre-conditions) and output assertions (post-conditions)

More information

Worst-Case Execution Time Analysis. LS 12, TU Dortmund

Worst-Case Execution Time Analysis. LS 12, TU Dortmund Worst-Case Execution Time Analysis Prof. Dr. Jian-Jia Chen LS 12, TU Dortmund 02, 03 May 2016 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 1 / 53 Most Essential Assumptions for Real-Time Systems Upper

More information

Dataflow Analysis - 2. Monotone Dataflow Frameworks

Dataflow Analysis - 2. Monotone Dataflow Frameworks Dataflow Analysis - 2 Monotone dataflow frameworks Definition Convergence Safety Relation of MOP to MFP Constant propagation Categorization of dataflow problems DataflowAnalysis 2, Sp06 BGRyder 1 Monotone

More information

Flat counter automata almost everywhere!

Flat counter automata almost everywhere! Flat counter automata almost everywhere! Jérôme Leroux and Grégoire Sutre Projet Vertecs, IRISA / INRIA Rennes, FRANCE Équipe MVTsi, CNRS / LABRI, FRANCE Counter-automata verification A simple counter-automata:

More information

CSE 331 Software Design & Implementation

CSE 331 Software Design & Implementation CSE 331 Software Design & Implementation Kevin Zatloukal Summer 2017 Lecture 2 Reasoning About Code With Logic (Based on slides by Mike Ernst, Dan Grossman, David Notkin, Hal Perkins, Zach Tatlock) Recall

More information

Generalizing Data-flow Analysis

Generalizing Data-flow Analysis Generalizing Data-flow Analysis Announcements PA1 grades have been posted Today Other types of data-flow analysis Reaching definitions, available expressions, reaching constants Abstracting data-flow analysis

More information

Hoare Calculus and Predicate Transformers

Hoare Calculus and Predicate Transformers Hoare Calculus and Predicate Transformers Wolfgang Schreiner Wolfgang.Schreiner@risc.uni-linz.ac.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.uni-linz.ac.at

More information

CS 4407 Algorithms Lecture 3: Iterative and Divide and Conquer Algorithms

CS 4407 Algorithms Lecture 3: Iterative and Divide and Conquer Algorithms CS 4407 Algorithms Lecture 3: Iterative and Divide and Conquer Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline CS 4407, Algorithms Growth Functions

More information

Timed Automata. Semantics, Algorithms and Tools. Zhou Huaiyang

Timed Automata. Semantics, Algorithms and Tools. Zhou Huaiyang Timed Automata Semantics, Algorithms and Tools Zhou Huaiyang Agenda } Introduction } Timed Automata } Formal Syntax } Operational Semantics } Verification Problems } Symbolic Semantics & Verification }

More information

Computational Homology in Topological Dynamics

Computational Homology in Topological Dynamics 1 Computational Homology in Topological Dynamics ACAT School, Bologna, Italy MAY 26, 2012 Marian Mrozek Jagiellonian University, Kraków Outline 2 Dynamical systems Rigorous numerics of dynamical systems

More information

Section Summary. Relations and Functions Properties of Relations. Combining Relations

Section Summary. Relations and Functions Properties of Relations. Combining Relations Chapter 9 Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations Closures of Relations (not currently included

More information

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Definition: A binary relation R from a set A to a set B is a subset R A B. Example: Chapter 9 1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R A B. Example: Let A = {0,1,2} and B = {a,b} {(0, a), (0, b), (1,a), (2, b)} is a relation from A to B.

More information

Modularity in Lattices: A Case Study on the Correspondence between Top-Down and Bottom-Up Analysis

Modularity in Lattices: A Case Study on the Correspondence between Top-Down and Bottom-Up Analysis Modularity in Lattices: A Case Study on the Correspondence between Top-Down and Bottom-Up Analysis G. Castelnuovo 1, M. Naik 2, N. Rinetzky 3, M. Sagiv 1, and H. Yang 3 1 Tel Aviv University 2 Georgia

More information

Static Analysis in Disjunctive Numerical Domains.

Static Analysis in Disjunctive Numerical Domains. Static Analysis in Disjunctive Numerical Domains. Sriram Sankaranarayanan, Franjo Ivančić, Ilya Shlyakhter, Aarti Gupta NEC Laboratories America, 4 Independence Way, Princeton, NJ Abstract. The convexity

More information

Foundations of Computation

Foundations of Computation The Australian National University Semester 2, 2018 Research School of Computer Science Tutorial 6 Dirk Pattinson Foundations of Computation The tutorial contains a number of exercises designed for the

More information

Formal Reasoning CSE 331. Lecture 2 Formal Reasoning. Announcements. Formalization and Reasoning. Software Design and Implementation

Formal Reasoning CSE 331. Lecture 2 Formal Reasoning. Announcements. Formalization and Reasoning. Software Design and Implementation CSE 331 Software Design and Implementation Lecture 2 Formal Reasoning Announcements Homework 0 due Friday at 5 PM Heads up: no late days for this one! Homework 1 due Wednesday at 11 PM Using program logic

More information

Binary Decision Diagrams and Symbolic Model Checking

Binary Decision Diagrams and Symbolic Model Checking Binary Decision Diagrams and Symbolic Model Checking Randy Bryant Ed Clarke Ken McMillan Allen Emerson CMU CMU Cadence U Texas http://www.cs.cmu.edu/~bryant Binary Decision Diagrams Restricted Form of

More information

A Tutorial on Program Analysis

A Tutorial on Program Analysis A Tutorial on Program Analysis Markus Müller-Olm Dortmund University Thanks! Helmut Seidl (TU München) and Bernhard Steffen (Universität Dortmund) for discussions, inspiration, joint work,... 1 Dream of

More information

A Short Introduction to Hoare Logic

A Short Introduction to Hoare Logic A Short Introduction to Hoare Logic Supratik Chakraborty I.I.T. Bombay June 23, 2008 Supratik Chakraborty (I.I.T. Bombay) A Short Introduction to Hoare Logic June 23, 2008 1 / 34 Motivation Assertion checking

More information

Lecture 3. Dynamical Systems in Continuous Time

Lecture 3. Dynamical Systems in Continuous Time Lecture 3. Dynamical Systems in Continuous Time University of British Columbia, Vancouver Yue-Xian Li November 2, 2017 1 3.1 Exponential growth and decay A Population With Generation Overlap Consider a

More information

SCICO: Model pp (col. fig: NIL) ARTICLE IN PRESS

SCICO: Model pp (col. fig: NIL) ARTICLE IN PRESS + Model pp. (col. fig: NIL) Science of Computer Programming xx (xxxx) xxx xxx www.elsevier.com/locate/scico Automatic generation of polynomial invariants of bounded degree using abstract interpretation

More information

Operational Semantics

Operational Semantics Operational Semantics Semantics and applications to verification Xavier Rival École Normale Supérieure Xavier Rival Operational Semantics 1 / 50 Program of this first lecture Operational semantics Mathematical

More information

ADVANCED ROBOTICS. PLAN REPRESENTATION Generalized Stochastic Petri nets and Markov Decision Processes

ADVANCED ROBOTICS. PLAN REPRESENTATION Generalized Stochastic Petri nets and Markov Decision Processes ADVANCED ROBOTICS PLAN REPRESENTATION Generalized Stochastic Petri nets and Markov Decision Processes Pedro U. Lima Instituto Superior Técnico/Instituto de Sistemas e Robótica September 2009 Reviewed April

More information

Programming Languages

Programming Languages CSE 230: Winter 2008 Principles of Programming Languages Lecture 7: Axiomatic Semantics Axiomatic Semantics over low Graphs c {P} if P P {P } {Q} c if Q Q {Q} {Q } Ranjit Jhala UC San Diego Relaxing specifications

More information

Given a string manipulating program, string analysis determines all possible values that a string expression can take during any program execution

Given a string manipulating program, string analysis determines all possible values that a string expression can take during any program execution l Given a string manipulating program, string analysis determines all possible values that a string expression can take during any program execution l Using string analysis we can verify properties of

More information

Trace Diagnostics using Temporal Implicants

Trace Diagnostics using Temporal Implicants Trace Diagnostics using Temporal Implicants ATVA 15 Thomas Ferrère 1 Dejan Nickovic 2 Oded Maler 1 1 VERIMAG, University of Grenoble / CNRS 2 Austrian Institute of Technology October 14, 2015 Motivation

More information

Crash course Verification of Finite Automata CTL model-checking

Crash course Verification of Finite Automata CTL model-checking Crash course Verification of Finite Automata CTL model-checking Exercise session - 07.12.2016 Xiaoxi He 1 Reminders Big picture Objective Verify properties over DES models Formal method Absolute guarantee!

More information

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S)

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S) Lecturecise 22 Weak monadic second-order theory of one successor (WS1S) 2013 Reachability in the Heap Many programs manipulate linked data structures (lists, trees). To express many important properties

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

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

Tute 10. Liam O'Connor. May 23, 2017

Tute 10. Liam O'Connor. May 23, 2017 Tute 10 Liam O'Connor May 23, 2017 proc Search(value g : G, value s : V g, value k : K, result v : T, result f : B) Where a graph g : G is dened as a 4-tuple (V, Γ, κ, λ) containing a set of vertices V,

More information

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation CISC 4090 Theory of Computation Context-Free Languages and Push Down Automata Professor Daniel Leeds dleeds@fordham.edu JMH 332 Languages: Regular and Beyond Regular: Captured by Regular Operations a b

More information

Asymptotic Algorithm Analysis & Sorting

Asymptotic Algorithm Analysis & Sorting Asymptotic Algorithm Analysis & Sorting (Version of 5th March 2010) (Based on original slides by John Hamer and Yves Deville) We can analyse an algorithm without needing to run it, and in so doing we can

More information

Lecture 4. Quicksort

Lecture 4. Quicksort Lecture 4. Quicksort T. H. Cormen, C. E. Leiserson and R. L. Rivest Introduction to Algorithms, 3rd Edition, MIT Press, 2009 Sungkyunkwan University Hyunseung Choo choo@skku.edu Copyright 2000-2018 Networking

More information

MATH 433 Applied Algebra Lecture 14: Functions. Relations.

MATH 433 Applied Algebra Lecture 14: Functions. Relations. MATH 433 Applied Algebra Lecture 14: Functions. Relations. Cartesian product Definition. The Cartesian product X Y of two sets X and Y is the set of all ordered pairs (x,y) such that x X and y Y. The Cartesian

More information

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and 7 RC Simulates RA. We now show that DRC (and hence TRC) is at least as expressive as RA. That is, given an RA expression E that mentions at most C, there is an equivalent DRC expression E that mentions

More information

The Octagon Abstract Domain

The Octagon Abstract Domain 1 The Octagon Abstract Domain Antoine Miné École Normale Supérieure de Paris, France, mine@di.ens.fr, http://www.di.ens.fr/~mine arxiv:cs/0703084v2 cs.pl] 16 Mar 2007 Abstract This article presents a new

More information