| 1 |
# frama-c -wp -wp-rte [...] |
| 2 |
[kernel] Parsing opaque_struct.i (no preprocessing) |
| 3 |
[wp] Running WP plugin... |
| 4 |
[rte:annot] annotating function assigned_via_pointer |
| 5 |
[rte:annot] annotating function assigns |
| 6 |
[rte:annot] annotating function assigns_effect |
| 7 |
[rte:annot] annotating function chunk_typing |
| 8 |
[rte:annot] annotating function initialized_assigns |
| 9 |
[rte:annot] annotating function uninitialized_assigns |
| 10 |
[kernel:annot:missing-spec] opaque_struct.i:79: Warning: |
| 11 |
Neither code nor specification for function use, generating default assigns from the prototype |
| 12 |
------------------------------------------------------------ |
| 13 |
Axiomatic 'test' |
| 14 |
------------------------------------------------------------ |
| 15 |
|
| 16 |
Lemma fail: |
| 17 |
Prove: (EqS1_S S1_0 S2_0) |
| 18 |
|
| 19 |
------------------------------------------------------------ |
| 20 |
|
| 21 |
Lemma succeed_L1: |
| 22 |
Prove: true |
| 23 |
|
| 24 |
------------------------------------------------------------ |
| 25 |
|
| 26 |
Lemma succeed_L2: |
| 27 |
Prove: 0<=BytesLength_of_S1_S |
| 28 |
|
| 29 |
------------------------------------------------------------ |
| 30 |
------------------------------------------------------------ |
| 31 |
Function assigned_via_pointer |
| 32 |
------------------------------------------------------------ |
| 33 |
|
| 34 |
Goal Check 'fail' (file opaque_struct.i, line 60): |
| 35 |
Let a = havoc(Mint_undef_0, Mint_0, p, Length_of_S1_S). |
| 36 |
Let a_1 = havoc(Mint_undef_3, Mint_3, p, Length_of_S1_S). |
| 37 |
Let a_2 = havoc(Mint_undef_5, Mint_5, p, Length_of_S1_S). |
| 38 |
Let a_3 = havoc(Mint_undef_7, Mint_7, p, Length_of_S1_S). |
| 39 |
Let a_4 = havoc(Mchar_undef_0, Mchar_0, p, Length_of_S1_S). |
| 40 |
Let a_5 = havoc(Mint_undef_2, Mint_2, p, Length_of_S1_S). |
| 41 |
Let a_6 = havoc(Mint_undef_4, Mint_4, p, Length_of_S1_S). |
| 42 |
Let a_7 = havoc(Mint_undef_6, Mint_6, p, Length_of_S1_S). |
| 43 |
Let a_8 = havoc(Mint_undef_1, Mint_1, p, Length_of_S1_S). |
| 44 |
Assume { |
| 45 |
Type: is_bool_chunk(Mint_0) /\ is_sint16_chunk(Mint_3) /\ |
| 46 |
is_sint32_chunk(Mint_5) /\ is_sint64_chunk(Mint_7) /\ |
| 47 |
is_sint8_chunk(Mchar_0) /\ is_uint16_chunk(Mint_2) /\ |
| 48 |
is_uint32_chunk(Mint_4) /\ is_uint64_chunk(Mint_6) /\ |
| 49 |
is_uint8_chunk(Mint_1) /\ is_bool_chunk(a) /\ is_sint16_chunk(a_1) /\ |
| 50 |
is_sint32_chunk(a_2) /\ is_sint64_chunk(a_3) /\ is_sint8_chunk(a_4) /\ |
| 51 |
is_uint16_chunk(a_5) /\ is_uint32_chunk(a_6) /\ is_uint64_chunk(a_7) /\ |
| 52 |
is_uint8_chunk(a_8). |
| 53 |
(* Heap *) |
| 54 |
Type: (region(p.base) <= 0) /\ framed(Mptr_0) /\ sconst(Mchar_0). |
| 55 |
} |
| 56 |
Prove: EqS1_S(Load_S1_S(p, a, a_8, a_4, a_5, a_1, a_6, a_2, a_7, a_3, |
| 57 |
havoc(Mf32_undef_0, Mf32_0, p, Length_of_S1_S), |
| 58 |
havoc(Mf64_undef_0, Mf64_0, p, Length_of_S1_S), |
| 59 |
havoc(Mptr_undef_0, Mptr_0, p, Length_of_S1_S)), |
| 60 |
Load_S1_S(p, Mint_0, Mint_1, Mchar_0, Mint_2, Mint_3, Mint_4, |
| 61 |
Mint_5, Mint_6, Mint_7, Mf32_0, Mf64_0, Mptr_0)). |
| 62 |
|
| 63 |
------------------------------------------------------------ |
| 64 |
------------------------------------------------------------ |
| 65 |
Function assigns |
| 66 |
------------------------------------------------------------ |
| 67 |
|
| 68 |
Goal Check 'fail' (file opaque_struct.i, line 24): |
| 69 |
Prove: EqS1_S(S1_0, S1_1). |
| 70 |
|
| 71 |
------------------------------------------------------------ |
| 72 |
|
| 73 |
Goal Check 'succeed' (file opaque_struct.i, line 25): |
| 74 |
Prove: true. |
| 75 |
|
| 76 |
------------------------------------------------------------ |
| 77 |
------------------------------------------------------------ |
| 78 |
Function assigns_effect |
| 79 |
------------------------------------------------------------ |
| 80 |
|
| 81 |
Goal Check 'fail' (file opaque_struct.i, line 69): |
| 82 |
Let x = Mint_0[p]. |
| 83 |
Let a_1 = havoc(Mint_undef_0, Mint_0, a, Length_of_S1_S). |
| 84 |
Let a_2 = a_1[p]. |
| 85 |
Assume { |
| 86 |
Type: is_sint32_chunk(Mint_0) /\ is_sint32(x) /\ is_sint32_chunk(a_1) /\ |
| 87 |
is_sint32(a_2). |
| 88 |
(* Heap *) |
| 89 |
Type: (region(a.base) <= 0) /\ (region(c.base) <= 0) /\ |
| 90 |
(region(p.base) <= 0). |
| 91 |
(* Pre-condition *) |
| 92 |
Have: separated(a, Length_of_S1_S, c, 1). |
| 93 |
} |
| 94 |
Prove: a_2 = x. |
| 95 |
|
| 96 |
------------------------------------------------------------ |
| 97 |
|
| 98 |
Goal Check 'fail' (file opaque_struct.i, line 70): |
| 99 |
Assume { |
| 100 |
(* Heap *) |
| 101 |
Type: (region(a.base) <= 0) /\ (region(c.base) <= 0) /\ |
| 102 |
(region(q.base) <= 0). |
| 103 |
(* Pre-condition *) |
| 104 |
Have: separated(a, Length_of_S1_S, c, 1). |
| 105 |
} |
| 106 |
Prove: of_f32(havoc(Mf32_undef_0, Mf32_0, a, Length_of_S1_S)[q]) |
| 107 |
= of_f32(Mf32_0[q]). |
| 108 |
|
| 109 |
------------------------------------------------------------ |
| 110 |
|
| 111 |
Goal Check 'succeed' (file opaque_struct.i, line 71): |
| 112 |
Let x = Mchar_0[c]. |
| 113 |
Let a_1 = havoc(Mchar_undef_0, Mchar_0, a, Length_of_S1_S). |
| 114 |
Let a_2 = a_1[c]. |
| 115 |
Assume { |
| 116 |
Type: is_sint8_chunk(Mchar_0) /\ is_sint8(x) /\ is_sint8_chunk(a_1) /\ |
| 117 |
is_sint8(a_2). |
| 118 |
(* Heap *) |
| 119 |
Type: (region(a.base) <= 0) /\ (region(c.base) <= 0) /\ sconst(Mchar_0). |
| 120 |
(* Pre-condition *) |
| 121 |
Have: separated(a, Length_of_S1_S, c, 1). |
| 122 |
} |
| 123 |
Prove: a_2 = x. |
| 124 |
|
| 125 |
------------------------------------------------------------ |
| 126 |
------------------------------------------------------------ |
| 127 |
Function chunk_typing |
| 128 |
------------------------------------------------------------ |
| 129 |
|
| 130 |
Goal Assertion 'rte,mem_access' (file opaque_struct.i, line 81): |
| 131 |
Prove: true. |
| 132 |
|
| 133 |
------------------------------------------------------------ |
| 134 |
|
| 135 |
Goal Assertion 'rte,mem_access' (file opaque_struct.i, line 81): |
| 136 |
Prove: true. |
| 137 |
|
| 138 |
------------------------------------------------------------ |
| 139 |
------------------------------------------------------------ |
| 140 |
Function initialized_assigns |
| 141 |
------------------------------------------------------------ |
| 142 |
|
| 143 |
Goal Check 'fails' (file opaque_struct.i, line 38): |
| 144 |
Let a = havoc(Init_undef_0, Init_0, p, Length_of_S1_S). |
| 145 |
Assume { |
| 146 |
(* Heap *) |
| 147 |
Type: (region(p.base) <= 0) /\ linked(Malloc_0) /\ cinits(Init_0). |
| 148 |
(* Pre-condition *) |
| 149 |
Have: IsInit_S1_S(p, Init_0). |
| 150 |
(* Pre-condition *) |
| 151 |
Have: valid_rw(Malloc_0, p, Length_of_S1_S). |
| 152 |
(* Call Effects *) |
| 153 |
Have: cinits(a). |
| 154 |
} |
| 155 |
Prove: IsInit_S1_S(p, a). |
| 156 |
|
| 157 |
------------------------------------------------------------ |
| 158 |
|
| 159 |
Goal Check 'succeed' (file opaque_struct.i, line 39): |
| 160 |
Let x = p.base. |
| 161 |
Assume { |
| 162 |
(* Heap *) |
| 163 |
Type: (region(x) <= 0) /\ linked(Malloc_0). |
| 164 |
(* Pre-condition *) |
| 165 |
Have: valid_rw(Malloc_0, p, Length_of_S1_S). |
| 166 |
} |
| 167 |
Prove: 0 <= (BytesLength_of_S1_S * (Malloc_0[x] / Length_of_S1_S)). |
| 168 |
|
| 169 |
------------------------------------------------------------ |
| 170 |
------------------------------------------------------------ |
| 171 |
Function uninitialized_assigns |
| 172 |
------------------------------------------------------------ |
| 173 |
|
| 174 |
Goal Check 'fail' (file opaque_struct.i, line 54): |
| 175 |
Let a = havoc(Init_undef_0, Init_0, p, Length_of_S1_S). |
| 176 |
Assume { |
| 177 |
(* Heap *) |
| 178 |
Type: (region(p.base) <= 0) /\ cinits(Init_0). |
| 179 |
(* Pre-condition *) |
| 180 |
Have: !IsInit_S1_S(p, Init_0). |
| 181 |
(* Call Effects *) |
| 182 |
Have: cinits(a). |
| 183 |
} |
| 184 |
Prove: !IsInit_S1_S(p, a). |
| 185 |
|
| 186 |
------------------------------------------------------------ |
| 187 |
|
| 188 |
Goal Check 'fail' (file opaque_struct.i, line 55): |
| 189 |
Let a = havoc(Init_undef_0, Init_0, p, Length_of_S1_S). |
| 190 |
Assume { |
| 191 |
(* Heap *) |
| 192 |
Type: (region(p.base) <= 0) /\ cinits(Init_0). |
| 193 |
(* Pre-condition *) |
| 194 |
Have: !IsInit_S1_S(p, Init_0). |
| 195 |
(* Call Effects *) |
| 196 |
Have: cinits(a). |
| 197 |
} |
| 198 |
Prove: IsInit_S1_S(p, a). |
| 199 |
|
| 200 |
------------------------------------------------------------ |
| 201 |
[wp] opaque_struct.i:31: Warning: |
| 202 |
Memory model hypotheses for function 'g': |
| 203 |
/*@ behavior wp_typed: |
| 204 |
requires \separated(p, &S1, &S2, &p); */ |
| 205 |
void g(void); |
| 206 |
[wp] opaque_struct.i:64: Warning: |
| 207 |
Memory model hypotheses for function 'assign': |
| 208 |
/*@ behavior wp_typed: |
| 209 |
requires \separated(a, &S1, &S2); */ |
| 210 |
void assign(struct S *a); |
| 211 |
[wp] opaque_struct.i:67: Warning: |
| 212 |
Memory model hypotheses for function 'assigns_effect': |
| 213 |
/*@ |
| 214 |
behavior wp_typed: |
| 215 |
requires \separated(a, &S1, &S2); |
| 216 |
requires \separated(c, &S1, &S2); |
| 217 |
requires \separated(p_0, &S1, &S2); |
| 218 |
requires \separated(q, &S1, &S2); |
| 219 |
*/ |
| 220 |
void assigns_effect(int *p_0, float *q, char *c, struct S *a); |
| 221 |
[wp] opaque_struct.i:76: Warning: |
| 222 |
Memory model hypotheses for function 'use': |
| 223 |
/*@ behavior wp_typed: |
| 224 |
requires \separated(s, &S1, &S2); */ |
| 225 |
void use(struct S *s); |
| 226 |
[wp] opaque_struct.i:79: Warning: |
| 227 |
Memory model hypotheses for function 'chunk_typing': |
| 228 |
/*@ |
| 229 |
behavior wp_typed: |
| 230 |
requires \separated(sc, &S1, &S2); |
| 231 |
requires \separated(uc, &S1, &S2); |
| 232 |
*/ |
| 233 |
void chunk_typing(unsigned char *uc, signed char *sc); |