| 1 |
# frama-c -wp [...] |
| 2 |
[kernel] Parsing div_mod.i (no preprocessing) |
| 3 |
[wp] Running WP plugin... |
| 4 |
[wp] Warning: Missing RTE guards |
| 5 |
------------------------------------------------------------ |
| 6 |
Function f |
| 7 |
------------------------------------------------------------ |
| 8 |
|
| 9 |
Goal Post-condition 'd0,div_pos_pos' in 'f': |
| 10 |
Prove: P_Peq(1, 1). |
| 11 |
|
| 12 |
------------------------------------------------------------ |
| 13 |
|
| 14 |
Goal Post-condition 'd1,div_neg_pos' in 'f': |
| 15 |
Prove: P_Peq(-1, -1). |
| 16 |
|
| 17 |
------------------------------------------------------------ |
| 18 |
|
| 19 |
Goal Post-condition 'd2,div_pos_neg' in 'f': |
| 20 |
Prove: P_Peq(-1, -1). |
| 21 |
|
| 22 |
------------------------------------------------------------ |
| 23 |
|
| 24 |
Goal Post-condition 'd3,div_neg_neg' in 'f': |
| 25 |
Prove: P_Peq(1, 1). |
| 26 |
|
| 27 |
------------------------------------------------------------ |
| 28 |
|
| 29 |
Goal Post-condition 'd4,div_x_1' in 'f': |
| 30 |
Assume { Type: is_sint32(x). } |
| 31 |
Prove: P_Peq(x, x). |
| 32 |
|
| 33 |
------------------------------------------------------------ |
| 34 |
|
| 35 |
Goal Post-condition 'd5,div_x_minus1' in 'f': |
| 36 |
Let x_1 = -x. Assume { Type: is_sint32(x). } |
| 37 |
Prove: P_Peq(x_1, x_1). |
| 38 |
|
| 39 |
------------------------------------------------------------ |
| 40 |
|
| 41 |
Goal Post-condition 'd6,div_0_x' in 'f': |
| 42 |
Assume { Type: is_sint32(x). (* Goal *) When: x != 0. } |
| 43 |
Prove: P_Peq(0 / x, 0). |
| 44 |
|
| 45 |
------------------------------------------------------------ |
| 46 |
|
| 47 |
Goal Post-condition 'd7,div_0_x,ko' in 'f': |
| 48 |
Assume { Type: is_sint32(x). } |
| 49 |
Prove: P_Peq(0 / x, 0). |
| 50 |
|
| 51 |
------------------------------------------------------------ |
| 52 |
|
| 53 |
Goal Post-condition 'sd0,div_pos_pos' in 'f': |
| 54 |
Assume { |
| 55 |
Type: is_sint32(x) /\ is_sint32(y). |
| 56 |
(* Goal *) |
| 57 |
When: (0 < y) /\ (0 <= x). |
| 58 |
} |
| 59 |
Prove: 0 <= (x / y). |
| 60 |
|
| 61 |
------------------------------------------------------------ |
| 62 |
|
| 63 |
Goal Post-condition 'sd1,div_neg_pos' in 'f': |
| 64 |
Assume { |
| 65 |
Type: is_sint32(x) /\ is_sint32(y). |
| 66 |
(* Goal *) |
| 67 |
When: (x <= 0) /\ (0 < y). |
| 68 |
} |
| 69 |
Prove: (x / y) <= 0. |
| 70 |
|
| 71 |
------------------------------------------------------------ |
| 72 |
|
| 73 |
Goal Post-condition 'sd2,div_pos_neg' in 'f': |
| 74 |
Assume { |
| 75 |
Type: is_sint32(x) /\ is_sint32(y). |
| 76 |
(* Goal *) |
| 77 |
When: (0 <= x) /\ (y < 0). |
| 78 |
} |
| 79 |
Prove: (x / y) <= 0. |
| 80 |
|
| 81 |
------------------------------------------------------------ |
| 82 |
|
| 83 |
Goal Post-condition 'sd3,div_neg_neg' in 'f': |
| 84 |
Assume { |
| 85 |
Type: is_sint32(x) /\ is_sint32(y). |
| 86 |
(* Goal *) |
| 87 |
When: (x <= 0) /\ (y < 0). |
| 88 |
} |
| 89 |
Prove: 0 <= (x / y). |
| 90 |
|
| 91 |
------------------------------------------------------------ |
| 92 |
|
| 93 |
Goal Post-condition 'm0,mod_pos_pos' in 'f': |
| 94 |
Prove: P_Peq(2, 2). |
| 95 |
|
| 96 |
------------------------------------------------------------ |
| 97 |
|
| 98 |
Goal Post-condition 'm1,mod_neg_pos' in 'f': |
| 99 |
Prove: P_Peq(-2, -2). |
| 100 |
|
| 101 |
------------------------------------------------------------ |
| 102 |
|
| 103 |
Goal Post-condition 'm2,mod_pos_neg' in 'f': |
| 104 |
Prove: P_Peq(2, 2). |
| 105 |
|
| 106 |
------------------------------------------------------------ |
| 107 |
|
| 108 |
Goal Post-condition 'm3,mod_neg_neg' in 'f': |
| 109 |
Prove: P_Peq(-2, -2). |
| 110 |
|
| 111 |
------------------------------------------------------------ |
| 112 |
|
| 113 |
Goal Post-condition 'm4,mod_x_1' in 'f': |
| 114 |
Prove: P_Peq(0, 0). |
| 115 |
|
| 116 |
------------------------------------------------------------ |
| 117 |
|
| 118 |
Goal Post-condition 'm5,mod_x_minus1' in 'f': |
| 119 |
Assume { Type: is_sint32(x). } |
| 120 |
Prove: P_Peq(x % (-1), 0). |
| 121 |
|
| 122 |
------------------------------------------------------------ |
| 123 |
|
| 124 |
Goal Post-condition 'm6,mod_0_x' in 'f': |
| 125 |
Assume { Type: is_sint32(x). (* Goal *) When: x != 0. } |
| 126 |
Prove: P_Peq(0 % x, 0). |
| 127 |
|
| 128 |
------------------------------------------------------------ |
| 129 |
|
| 130 |
Goal Post-condition 'm7,mod_0_x,ko' in 'f': |
| 131 |
Assume { Type: is_sint32(x). } |
| 132 |
Prove: P_Peq(0 % x, 0). |
| 133 |
|
| 134 |
------------------------------------------------------------ |
| 135 |
|
| 136 |
Goal Post-condition 'sm0,mod_pos_pos' in 'f': |
| 137 |
Assume { |
| 138 |
Type: is_sint32(x) /\ is_sint32(y). |
| 139 |
(* Goal *) |
| 140 |
When: (0 < y) /\ (0 <= x). |
| 141 |
} |
| 142 |
Prove: 0 <= (x % y). |
| 143 |
|
| 144 |
------------------------------------------------------------ |
| 145 |
|
| 146 |
Goal Post-condition 'sm1,mod_neg_pos' in 'f': |
| 147 |
Assume { |
| 148 |
Type: is_sint32(x) /\ is_sint32(y). |
| 149 |
(* Goal *) |
| 150 |
When: (x <= 0) /\ (0 < y). |
| 151 |
} |
| 152 |
Prove: (x % y) <= 0. |
| 153 |
|
| 154 |
------------------------------------------------------------ |
| 155 |
|
| 156 |
Goal Post-condition 'sm2,mod_pos_neg' in 'f': |
| 157 |
Assume { |
| 158 |
Type: is_sint32(x) /\ is_sint32(y). |
| 159 |
(* Goal *) |
| 160 |
When: (0 <= x) /\ (y < 0). |
| 161 |
} |
| 162 |
Prove: 0 <= (x % y). |
| 163 |
|
| 164 |
------------------------------------------------------------ |
| 165 |
|
| 166 |
Goal Post-condition 'sm3,mod_neg_neg' in 'f': |
| 167 |
Assume { |
| 168 |
Type: is_sint32(x) /\ is_sint32(y). |
| 169 |
(* Goal *) |
| 170 |
When: (x <= 0) /\ (y < 0). |
| 171 |
} |
| 172 |
Prove: (x % y) <= 0. |
| 173 |
|
| 174 |
------------------------------------------------------------ |