[kernel] Parsing slice_no_body.i (no preprocessing) [eva] Analyzing an incomplete application starting at h [eva] Computing initial state [eva] Initial state computed [eva:initial-state] Values of globals at initialization G ∈ [--..--] [kernel:annot:missing-spec] slice_no_body.i:21: Warning: Neither code nor specification for function f, generating default assigns from the prototype [eva] computing for function f <- h. Called from slice_no_body.i:21. [eva] using specification for function f [eva] Done for function f [eva] computing for function f <- h. Called from slice_no_body.i:22. [eva] Done for function f [eva] computing for function f <- h. Called from slice_no_body.i:23. [eva] Done for function f [eva] computing for function f <- h. Called from slice_no_body.i:24. [eva] Done for function f [eva] computing for function g <- h. Called from slice_no_body.i:26. [eva:alarm] slice_no_body.i:12: Warning: signed overflow. assert c + 1 ≤ 2147483647; [eva:alarm] slice_no_body.i:13: Warning: signed overflow. assert -2147483648 ≤ c * 2; [eva:alarm] slice_no_body.i:13: Warning: signed overflow. assert c * 2 ≤ 2147483647; [eva] computing for function f <- g <- h. Called from slice_no_body.i:15. [eva] Done for function f [eva] Recording results for g [eva] Done for function g [eva] Recording results for h [eva] done for function h [from] Computing for function g [from] Computing for function f <-g [from] Done for function f [from] Done for function g [from] Computing for function h [from] Done for function h [from] ====== DEPENDENCIES COMPUTED ====== These dependencies hold at termination for the executions that terminate: [from] Function f: \result FROM a [from] Function g: \result FROM c [from] Function h: G FROM \nothing \result FROM \nothing [from] ====== END OF DEPENDENCIES ====== [slicing] initializing slicing ... [pdg] computing for function g [pdg] done for function g [pdg] computing for function h [pdg] done for function h int G; /*@ assigns \result; assigns \result \from a; */ int f(int a); Print slice = g_slice_1: /**/int g(/* <[---], [---]> */ int c) { /* <[---], [---]> */ int __retres; /*@ assert Eva: signed_overflow: c + 1 ≤ 2147483647; */ /* <[---], [---]> */ /* <[---], [---]> */ int x = c + 1; /*@ assert Eva: signed_overflow: -2147483648 ≤ c * 2; */ /*@ assert Eva: signed_overflow: c * 2 ≤ 2147483647; */ /* <[---], [---]> */ /* <[---], [---]> */ int y = c * 2; /* <[---], [---]> */ if (c == 0) { /* <[---], [---]> */ int tmp; /* invisible call */ /* <[---], [---]> */ tmp = f(x); /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = tmp; /* <[---], [---]> */ goto return_label; } } else { /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = y; /* <[---], [---]> */ goto return_label; } } /* <[---], [---]> */ return_label: /* <[---], [---]> */ return __retres; } Print slice = h_slice_1: /**/int h(void) { /* invisible call */ /* <[---], [---]> */ /* <[---], [---]> */ int a = f(1); /* invisible call */ /* <[---], [---]> */ /* <[---], [---]> */ int b = f(2); /* invisible call */ /* <[---], [---]> */ /* <[---], [---]> */ int c = f(3); /* invisible call */ /* <[---], [---]> */ G = f(4); /* <[---], [---]> */ if (G > 0) { /* invisible call */ /* <[---], [---]> */ G = g(c); } /* <[---], [---]> */ return G; } Slicing project worklist [default] = [h_slice_1 = change_call for call 13 -> (src:f)][h_slice_1 = change_call for call 12 -> (src:f)][h_slice_1 = change_call for call 11 -> (src:f)][h_slice_1 = change_call for call 10 -> (src:f)][h_slice_1 = change_call for call 16 -> g_slice_1][g_slice_1 = change_call for call 5 -> (src:f)] [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 6 actions... [slicing] applying actions: 1/6... [slicing] applying actions: 2/6... [slicing] applying actions: 3/6... [slicing] applying actions: 4/6... [slicing] applying actions: 5/6... [slicing] applying actions: 6/6... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int G; int f(int a); void g_slice_1(int c) { int x = c + 1; if (c == 0) { int tmp; tmp = f(x); } return; } void h(void) { int a = f(1); int b = f(2); int c = f(3); G = f(4); if (G > 0) g_slice_1(c); return; } [slicing] reinitializing slicing ... [slicing] applying all slicing requests... [slicing] applying 6 actions... [slicing] applying actions: 1/6... [slicing] applying actions: 2/6... [slicing] applying actions: 3/6... [slicing] applying actions: 4/6... [slicing] applying actions: 5/6... [slicing] applying actions: 6/6... int G; /*@ assigns \result; assigns \result \from a; */ int f(int a); Print slice = g_slice_1: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) /**/int g(/* <[---], [ S ]> */ int c) { /* <[---], [---]> */ int __retres; /*@ assert Eva: signed_overflow: c + 1 ≤ 2147483647; */ /* <[---], [ S ]> */ /* <[---], [ S ]> */ int x = c + 1; /*@ assert Eva: signed_overflow: -2147483648 ≤ c * 2; */ /*@ assert Eva: signed_overflow: c * 2 ≤ 2147483647; */ /* <[---], [---]> */ /* <[---], [---]> */ int y = c * 2; /* <[---], [ S ]> */ if (c == 0) { /* <[---], [ S ]> */ int tmp; /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ tmp = f(x); /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = tmp; /* <[---], [---]> */ goto return_label; } } else { /* <[---], [ S ]> */ { /* <[---], [---]> */ __retres = y; /* <[---], [---]> */ goto return_label; } } /* <[---], [---]> */ return_label: /* <[---], [---]> */ return __retres; } Print slice = h_slice_1: (InCtrl: <[---], [ S ]>) /**/int h(void) { /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ /* <[---], [ S ]> */ int a = f(1); /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ /* <[---], [ S ]> */ int b = f(2); /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ /* <[---], [ S ]> */ int c = f(3); /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) (OutRet: <[---], [ S ]>) */ /* call to source function */ /* <[---], [ S ]> */ G = f(4); /* <[---], [ S ]> */ if (G > 0) { /* sig call: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) */ /* call to g_slice_1: (InCtrl: <[---], [ S ]>) (In1: <[---], [ S ]>) */ /* <[---], [ S ]> */ G = g(c); } /* <[---], [---]> */ return G; } Slicing project worklist [default] = [slicing] exporting project to 'Sliced code'... [slicing] applying all slicing requests... [slicing] applying 0 actions... [sparecode] remove unused global declarations from project 'Sliced code tmp' [sparecode] removed unused global declarations in new project 'Sliced code' /* Generated by Frama-C */ int G; int f(int a); void g_slice_1(int c) { int x = c + 1; if (c == 0) { int tmp; tmp = f(x); } return; } void h(void) { int a = f(1); int b = f(2); int c = f(3); G = f(4); if (G > 0) g_slice_1(c); return; }