[kernel] Parsing updater.c (with preprocessing) /* Generated by Frama-C */ struct S { int v ; int a[5] ; int b ; }; struct SS { struct S a[5] ; struct S b ; }; struct S x = {.v = 1, .a = {0, 0, 0, 0, 0}, .b = 2}; struct SS y; /*@ logic struct S foo(struct S x) = {{x \with .b = (int)(x.b + 1)} \with .v = (int)3}; */ /*@ lemma foo2{L}: x ≡ {foo(x) \with .b = (int)(x.a[0] + 1)}; */ /*@ lemma bar{L}: (\let tmp = foo(x); {tmp \with .a = {{tmp.a \with [..] = (int)0} \with [3] = (int)3}}) ≡ (\let tmp = \let tmp = foo(x); {tmp \with .a = {tmp.a \with [..] = (int)0}}; {tmp \with .a = {tmp.a \with [3] = (int)3}}); */ /*@ lemma bar2{L}: x ≡ {x \with .a = {x.a \with [4] = (int)0}}; */ /*@ lemma bar3{L}: y ≡ {y \with .a = \let idx = 3 + 1; {y.a \with [idx] = {y.a[idx] \with .b = (int)(x.b + 1)}}}; */ /*@ lemma bar4{L}: y ≡ {y \with .a = {y.a \with [4] = {y.a[4] \with .a = {y.a[4].a \with [ ..] = (int)(x.b + 1)}}}}; */ /*@ lemma bar5{L}: y ≡ (\let tmp = {y \with .a = {y.a \with [4] = {{y.a[4] \with .a = {y.a[4].a \with [ ..] = (int)(x.b + 1)}} \with .v = (int)3}}}; {tmp \with .b = {tmp.b \with .v = (int)4}}); */ /*@ lemma cast{L}: y.a[0].v ≡ (\let tmp = (struct S)y; tmp.v); */ int *f(void) { int *__retres; if (y.a[0].v == y.b.v) { __retres = (int *)y.a[0].v; goto return_label; } __retres = (int *)x.b; return_label: return __retres; }