binary_search_safety_why.why 34.3 KB
Newer Older
François Bobot's avatar
François Bobot committed
1
theory Why2
2
use array.Array as A
3
  use unit_inf.Unit
François Bobot's avatar
François Bobot committed
4 5 6
  use int.Int
  use int.ComputerDivision
  use real.Real
7
  use bool_inf.Bool
Andrei Paskevich's avatar
Andrei Paskevich committed
8
  predicate eq_unit Unit.unit Unit.unit
François Bobot's avatar
François Bobot committed
9

Andrei Paskevich's avatar
Andrei Paskevich committed
10
  predicate neq_unit Unit.unit Unit.unit
François Bobot's avatar
François Bobot committed
11

Andrei Paskevich's avatar
Andrei Paskevich committed
12
  predicate eq_bool Bool.bool Bool.bool
François Bobot's avatar
François Bobot committed
13

Andrei Paskevich's avatar
Andrei Paskevich committed
14
  predicate neq_bool Bool.bool Bool.bool
François Bobot's avatar
François Bobot committed
15

Andrei Paskevich's avatar
Andrei Paskevich committed
16
  predicate lt_int int int
François Bobot's avatar
François Bobot committed
17

Andrei Paskevich's avatar
Andrei Paskevich committed
18
  predicate le_int int int
François Bobot's avatar
François Bobot committed
19

Andrei Paskevich's avatar
Andrei Paskevich committed
20
  predicate gt_int int int
François Bobot's avatar
François Bobot committed
21

Andrei Paskevich's avatar
Andrei Paskevich committed
22
  predicate ge_int int int
François Bobot's avatar
François Bobot committed
23

Andrei Paskevich's avatar
Andrei Paskevich committed
24
  predicate eq_int int int
François Bobot's avatar
François Bobot committed
25

Andrei Paskevich's avatar
Andrei Paskevich committed
26
  predicate neq_int int int
François Bobot's avatar
François Bobot committed
27

Andrei Paskevich's avatar
Andrei Paskevich committed
28
  function add_int int int : int
François Bobot's avatar
François Bobot committed
29

Andrei Paskevich's avatar
Andrei Paskevich committed
30
  function sub_int int int : int
François Bobot's avatar
François Bobot committed
31

Andrei Paskevich's avatar
Andrei Paskevich committed
32
  function mul_int int int : int
François Bobot's avatar
François Bobot committed
33

Andrei Paskevich's avatar
Andrei Paskevich committed
34
  function div_int int int : int
François Bobot's avatar
François Bobot committed
35

Andrei Paskevich's avatar
Andrei Paskevich committed
36
  function mod_int int int : int
François Bobot's avatar
François Bobot committed
37

Andrei Paskevich's avatar
Andrei Paskevich committed
38
  function neg_int int : int
François Bobot's avatar
François Bobot committed
39

Andrei Paskevich's avatar
Andrei Paskevich committed
40
  predicate zwf_zero (a : int) (b : int) = ((Int.(<=) 0 b) /\ (Int.(<) a b))
François Bobot's avatar
François Bobot committed
41

Andrei Paskevich's avatar
Andrei Paskevich committed
42
  function bw_compl int : int
François Bobot's avatar
François Bobot committed
43

Andrei Paskevich's avatar
Andrei Paskevich committed
44
  function bw_and int int : int
François Bobot's avatar
François Bobot committed
45

Andrei Paskevich's avatar
Andrei Paskevich committed
46
  function bw_xor int int : int
François Bobot's avatar
François Bobot committed
47

Andrei Paskevich's avatar
Andrei Paskevich committed
48
  function bw_or int int : int
François Bobot's avatar
François Bobot committed
49

Andrei Paskevich's avatar
Andrei Paskevich committed
50
  function lsl int int : int
François Bobot's avatar
François Bobot committed
51

Andrei Paskevich's avatar
Andrei Paskevich committed
52
  function lsr int int : int
François Bobot's avatar
François Bobot committed
53 54 55 56 57 58 59

  type pointer 'z

  type addr 'z

  type alloc_table

Andrei Paskevich's avatar
Andrei Paskevich committed
60
  function block_length alloc_table (pointer 'a1) : int
François Bobot's avatar
François Bobot committed
61

Andrei Paskevich's avatar
Andrei Paskevich committed
62
  function base_addr (pointer 'a1) : (addr 'a1)
François Bobot's avatar
François Bobot committed
63

Andrei Paskevich's avatar
Andrei Paskevich committed
64
  function offset (pointer 'a1) : int
François Bobot's avatar
François Bobot committed
65

Andrei Paskevich's avatar
Andrei Paskevich committed
66
  function shift (pointer 'a1) int : (pointer 'a1)
François Bobot's avatar
François Bobot committed
67

Andrei Paskevich's avatar
Andrei Paskevich committed
68
  function sub_pointer (pointer 'a1) (pointer 'a1) : int
François Bobot's avatar
François Bobot committed
69

Andrei Paskevich's avatar
Andrei Paskevich committed
70 71
  predicate lt_pointer (p1 : (pointer 'a1)) (p2 : (pointer 'a1)) =
    (((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) /\
François Bobot's avatar
François Bobot committed
72 73
     (Int.(<) (offset p1 : int) (offset p2 : int)))

Andrei Paskevich's avatar
Andrei Paskevich committed
74 75
  predicate le_pointer (p1 : (pointer 'a1)) (p2 : (pointer 'a1)) =
    (((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) /\
François Bobot's avatar
François Bobot committed
76 77
     (Int.(<=) (offset p1 : int) (offset p2 : int)))

Andrei Paskevich's avatar
Andrei Paskevich committed
78 79
  predicate gt_pointer (p1 : (pointer 'a1)) (p2 : (pointer 'a1)) =
    (((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) /\
François Bobot's avatar
François Bobot committed
80 81
     (Int.(>) (offset p1 : int) (offset p2 : int)))

Andrei Paskevich's avatar
Andrei Paskevich committed
82 83
  predicate ge_pointer (p1 : (pointer 'a1)) (p2 : (pointer 'a1)) =
    (((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) /\
François Bobot's avatar
François Bobot committed
84 85
     (Int.(>=) (offset p1 : int) (offset p2 : int)))

Andrei Paskevich's avatar
Andrei Paskevich committed
86 87
  predicate valid (a : alloc_table) (p : (pointer 'a1)) =
    ((Int.(<=) 0 (offset p : int)) /\
François Bobot's avatar
François Bobot committed
88 89
     (Int.(<) (offset p : int) (block_length a p : int)))

Andrei Paskevich's avatar
Andrei Paskevich committed
90 91
  predicate valid_index (a : alloc_table) (p : (pointer 'a1)) (i : int) =
    ((Int.(<=) 0 (Int.(+) (offset p : int) i : int)) /\
François Bobot's avatar
François Bobot committed
92 93
     (Int.(<) (Int.(+) (offset p : int) i : int) (block_length a p : int)))

Andrei Paskevich's avatar
Andrei Paskevich committed
94 95
  predicate valid_range (a : alloc_table) (p : (pointer 'a1)) (i : int) (j : int) =
    ((Int.(<=) 0 (Int.(+) (offset p : int) i : int)) /\
François Bobot's avatar
François Bobot committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
     (Int.(<) (Int.(+) (offset p : int) j : int) (block_length a p : int)))

  axiom Offset_shift:
    (forall p:(pointer 'a1).
      (forall i:int [(offset (shift p i : (pointer 'a1)) : int)].
        ((offset (shift p i : (pointer 'a1)) : int) = (Int.(+) (offset p : int) i : int))))

  axiom Shift_zero:
    (forall p:(pointer 'a1) [(shift p 0 : (pointer 'a1))].
      ((shift p 0 : (pointer 'a1)) = p))

  axiom Shift_shift:
    (forall p:(pointer 'a1).
      (forall i:int.
        (forall j:int [(shift (shift p i : (pointer 'a1)) j : (pointer 'a1))].
          ((shift (shift p i : (pointer 'a1)) j : (pointer 'a1)) = (shift p (Int.(+) i j : int) : (pointer 'a1))))))

  axiom Base_addr_shift:
    (forall p:(pointer 'a1).
      (forall i:int [(base_addr (shift p i : (pointer 'a1)) : (addr 'a1))].
        ((base_addr (shift p i : (pointer 'a1)) : (addr 'a1)) = (base_addr p : (addr 'a1)))))

  axiom Block_length_shift:
    (forall a:alloc_table.
      (forall p:(pointer 'a1).
        (forall i:int [(block_length a (shift p i : (pointer 'a1)) : int)].
          ((block_length a (shift p i : (pointer 'a1)) : int) = (block_length a p : int)))))

  axiom Base_addr_block_length:
    (forall a:alloc_table.
      (forall p1:(pointer 'a1).
        (forall p2:(pointer 'a1).
          (((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) ->
           ((block_length a p1 : int) = (block_length a p2 : int))))))

  axiom Pointer_pair_1:
    (forall p1:(pointer 'a1).
      (forall p2:(pointer 'a1).
Andrei Paskevich's avatar
Andrei Paskevich committed
134
        ((((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) /\
François Bobot's avatar
François Bobot committed
135 136 137 138 139 140 141
          ((offset p1 : int) = (offset p2 : int))) ->
         (p1 = p2))))

  axiom Pointer_pair_2:
    (forall p1:(pointer 'a1).
      (forall p2:(pointer 'a1).
        ((p1 = p2) ->
Andrei Paskevich's avatar
Andrei Paskevich committed
142
         (((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) /\
François Bobot's avatar
François Bobot committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
          ((offset p1 : int) = (offset p2 : int))))))

  axiom Neq_base_addr_neq_shift:
    (forall p1:(pointer 'a1).
      (forall p2:(pointer 'a1).
        (forall i:int.
          (forall j:int.
            (((base_addr p1 : (addr 'a1)) <> (base_addr p2 : (addr 'a1))) ->
             ((shift p1 i : (pointer 'a1)) <> (shift p2 j : (pointer 'a1))))))))

  axiom Neq_offset_neq_shift:
    (forall p1:(pointer 'a1).
      (forall p2:(pointer 'a1).
        (forall i:int.
          (forall j:int.
            (((Int.(+) (offset p1 : int) i : int) <> (Int.(+) (offset p2 : int) j : int)) ->
             ((shift p1 i : (pointer 'a1)) <> (shift p2 j : (pointer 'a1))))))))

  axiom Eq_offset_eq_shift:
    (forall p1:(pointer 'a1).
      (forall p2:(pointer 'a1).
        (forall i:int.
          (forall j:int.
            (((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) ->
             (((Int.(+) (offset p1 : int) i : int) = (Int.(+) (offset p2 : int) j : int)) ->
              ((shift p1 i : (pointer 'a1)) = (shift p2 j : (pointer 'a1)))))))))

  axiom Valid_index_valid_shift:
    (forall a:alloc_table.
      (forall p:(pointer 'a1).
        (forall i:int.
          ((valid_index a p i) -> (valid a (shift p i : (pointer 'a1)))))))

  axiom Valid_range_valid_shift:
    (forall a:alloc_table.
      (forall p:(pointer 'a1).
        (forall i:int.
          (forall j:int.
            (forall k:int.
              ((valid_range a p i j) ->
Andrei Paskevich's avatar
Andrei Paskevich committed
183
               (((Int.(<=) i k) /\ (Int.(<=) k j)) ->
François Bobot's avatar
François Bobot committed
184 185 186 187 188 189 190 191
                (valid a (shift p k : (pointer 'a1))))))))))

  axiom Valid_range_valid:
    (forall a:alloc_table.
      (forall p:(pointer 'a1).
        (forall i:int.
          (forall j:int.
            ((valid_range a p i j) ->
Andrei Paskevich's avatar
Andrei Paskevich committed
192
             (((Int.(<=) i 0) /\ (Int.(<=) 0 j)) -> (valid a p)))))))
François Bobot's avatar
François Bobot committed
193 194 195 196 197 198 199 200

  axiom Valid_range_valid_index:
    (forall a:alloc_table.
      (forall p:(pointer 'a1).
        (forall i:int.
          (forall j:int.
            (forall k:int.
              ((valid_range a p i j) ->
Andrei Paskevich's avatar
Andrei Paskevich committed
201
               (((Int.(<=) i k) /\ (Int.(<=) k j)) -> (valid_index a p k))))))))
François Bobot's avatar
François Bobot committed
202 203 204 205 206 207 208

  axiom Sub_pointer_def:
    (forall p1:(pointer 'a1).
      (forall p2:(pointer 'a1).
        (((base_addr p1 : (addr 'a1)) = (base_addr p2 : (addr 'a1))) ->
         ((sub_pointer p1 p2 : int) = (Int.(-) (offset p1 : int) (offset p2 : int) : int)))))

209
  type memory 'a 'z = A.t (pointer 'z) 'a
François Bobot's avatar
François Bobot committed
210

Andrei Paskevich's avatar
Andrei Paskevich committed
211
  function acc (m:memory 'a1 'a2) (k:pointer 'a2) : 'a1 = A.get m k
François Bobot's avatar
François Bobot committed
212

Andrei Paskevich's avatar
Andrei Paskevich committed
213
  function upd (m:memory 'a1 'a2) (k:pointer 'a2) (v:'a1) : (memory 'a1 'a2) = A.set m k v
François Bobot's avatar
François Bobot committed
214 215 216



217

François Bobot's avatar
François Bobot committed
218 219 220

  type pset 'z

Andrei Paskevich's avatar
Andrei Paskevich committed
221
  function pset_empty  : (pset 'a1)
François Bobot's avatar
François Bobot committed
222

Andrei Paskevich's avatar
Andrei Paskevich committed
223
  function pset_singleton (pointer 'a1) : (pset 'a1)
François Bobot's avatar
François Bobot committed
224

Andrei Paskevich's avatar
Andrei Paskevich committed
225
  function pset_star (pset 'a2) (memory (pointer 'a1) 'a2) : (pset 'a1)
François Bobot's avatar
François Bobot committed
226

Andrei Paskevich's avatar
Andrei Paskevich committed
227
  function pset_all (pset 'a1) : (pset 'a1)
François Bobot's avatar
François Bobot committed
228

Andrei Paskevich's avatar
Andrei Paskevich committed
229
  function pset_range (pset 'a1) int int : (pset 'a1)
François Bobot's avatar
François Bobot committed
230

Andrei Paskevich's avatar
Andrei Paskevich committed
231
  function pset_range_left (pset 'a1) int : (pset 'a1)
François Bobot's avatar
François Bobot committed
232

Andrei Paskevich's avatar
Andrei Paskevich committed
233
  function pset_range_right (pset 'a1) int : (pset 'a1)
François Bobot's avatar
François Bobot committed
234

Andrei Paskevich's avatar
Andrei Paskevich committed
235
  function pset_acc_all (pset 'a2) (memory (pointer 'a1) 'a2) : (pset 'a1)
François Bobot's avatar
François Bobot committed
236

Andrei Paskevich's avatar
Andrei Paskevich committed
237
  function pset_acc_range (pset 'a2) (memory (pointer 'a1) 'a2) int int : (pset 'a1)
François Bobot's avatar
François Bobot committed
238

Andrei Paskevich's avatar
Andrei Paskevich committed
239
  function pset_acc_range_left (pset 'a2) (memory (pointer 'a1) 'a2) int : (pset 'a1)
François Bobot's avatar
François Bobot committed
240

Andrei Paskevich's avatar
Andrei Paskevich committed
241
  function pset_acc_range_right (pset 'a2) (memory (pointer 'a1) 'a2) int : (pset 'a1)
François Bobot's avatar
François Bobot committed
242

Andrei Paskevich's avatar
Andrei Paskevich committed
243
  function pset_union (pset 'a1) (pset 'a1) : (pset 'a1)
François Bobot's avatar
François Bobot committed
244

Andrei Paskevich's avatar
Andrei Paskevich committed
245
  predicate not_in_pset (pointer 'a1) (pset 'a1)
François Bobot's avatar
François Bobot committed
246

Andrei Paskevich's avatar
Andrei Paskevich committed
247
  predicate not_assigns (a : alloc_table) (m1 : (memory 'a1 'a2)) (m2 : (memory 'a1 'a2)) (l : (pset 'a2)) =
François Bobot's avatar
François Bobot committed
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
    (forall p:(pointer 'a2).
      ((valid a p) ->
       ((not_in_pset p l) -> ((acc m2 p : 'a1) = (acc m1 p : 'a1)))))

  axiom Pset_empty_intro:
    (forall p:(pointer 'a1). (not_in_pset p (pset_empty : (pset 'a1))))

  axiom Pset_singleton_intro:
    (forall p1:(pointer 'a1).
      (forall p2:(pointer 'a1) [(not_in_pset p1 (pset_singleton p2 : (pset 'a1)))].
        ((p1 <> p2) -> (not_in_pset p1 (pset_singleton p2 : (pset 'a1))))))

  axiom Pset_singleton_elim:
    (forall p1:(pointer 'a1).
      (forall p2:(pointer 'a1) [(not_in_pset p1 (pset_singleton p2 : (pset 'a1)))].
        ((not_in_pset p1 (pset_singleton p2 : (pset 'a1))) -> (p1 <> p2))))

  axiom Not_not_in_singleton:
    (forall p:(pointer 'a1).
      (not (not_in_pset p (pset_singleton p : (pset 'a1)))))

  axiom Pset_union_intro:
    (forall l1:(pset 'a1).
      (forall l2:(pset 'a1).
        (forall p:(pointer 'a1) [(not_in_pset p (pset_union l1 l2 : (pset 'a1)))].
Andrei Paskevich's avatar
Andrei Paskevich committed
273
          (((not_in_pset p l1) /\ (not_in_pset p l2)) ->
François Bobot's avatar
François Bobot committed
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
           (not_in_pset p (pset_union l1 l2 : (pset 'a1)))))))

  axiom Pset_union_elim1:
    (forall l1:(pset 'a1).
      (forall l2:(pset 'a1).
        (forall p:(pointer 'a1) [(not_in_pset p (pset_union l1 l2 : (pset 'a1)))].
          ((not_in_pset p (pset_union l1 l2 : (pset 'a1))) ->
           (not_in_pset p l1)))))

  axiom Pset_union_elim2:
    (forall l1:(pset 'a1).
      (forall l2:(pset 'a1).
        (forall p:(pointer 'a1) [(not_in_pset p (pset_union l1 l2 : (pset 'a1)))].
          ((not_in_pset p (pset_union l1 l2 : (pset 'a1))) ->
           (not_in_pset p l2)))))

  axiom Pset_star_intro:
    (forall l:(pset 'a1).
      (forall m:(memory (pointer 'a2) 'a1).
        (forall p:(pointer 'a2) [(not_in_pset p (pset_star l m : (pset 'a2)))].
          ((forall p1:(pointer 'a1).
             ((p = (acc m p1 : (pointer 'a2))) -> (not_in_pset p1 l))) ->
           (not_in_pset p (pset_star l m : (pset 'a2)))))))

  axiom Pset_star_elim:
    (forall l:(pset 'a1).
      (forall m:(memory (pointer 'a2) 'a1).
        (forall p:(pointer 'a2) [(not_in_pset p (pset_star l m : (pset 'a2)))].
          ((not_in_pset p (pset_star l m : (pset 'a2))) ->
           (forall p1:(pointer 'a1).
             ((p = (acc m p1 : (pointer 'a2))) -> (not_in_pset p1 l)))))))

  axiom Pset_all_intro:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a1) [(not_in_pset p (pset_all l : (pset 'a1)))].
        ((forall p1:(pointer 'a1).
           ((not (not_in_pset p1 l)) ->
            ((base_addr p : (addr 'a1)) <> (base_addr p1 : (addr 'a1))))) ->
         (not_in_pset p (pset_all l : (pset 'a1))))))

  axiom Pset_all_elim:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a1) [(not_in_pset p (pset_all l : (pset 'a1)))].
        ((not_in_pset p (pset_all l : (pset 'a1))) ->
         (forall p1:(pointer 'a1).
           ((not (not_in_pset p1 l)) ->
            ((base_addr p : (addr 'a1)) <> (base_addr p1 : (addr 'a1))))))))

  axiom Pset_range_intro:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a1).
        (forall a:int.
          (forall b:int [(not_in_pset p (pset_range l a b : (pset 'a1)))].
            ((forall p1:(pointer 'a1).
Andrei Paskevich's avatar
Andrei Paskevich committed
328
               ((not_in_pset p1 l) \/
François Bobot's avatar
François Bobot committed
329
                (forall i:int.
Andrei Paskevich's avatar
Andrei Paskevich committed
330
                  (((Int.(<=) a i) /\ (Int.(<=) i b)) ->
François Bobot's avatar
François Bobot committed
331 332 333 334 335 336 337 338 339 340 341 342
                   (p <> (shift p1 i : (pointer 'a1))))))) ->
             (not_in_pset p (pset_range l a b : (pset 'a1))))))))

  axiom Pset_range_elim:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a1).
        (forall a:int.
          (forall b:int [(not_in_pset p (pset_range l a b : (pset 'a1)))].
            ((not_in_pset p (pset_range l a b : (pset 'a1))) ->
             (forall p1:(pointer 'a1).
               ((not (not_in_pset p1 l)) ->
                (forall i:int.
Andrei Paskevich's avatar
Andrei Paskevich committed
343
                  (((Int.(<=) a i) /\ (Int.(<=) i b)) ->
François Bobot's avatar
François Bobot committed
344 345 346 347 348 349 350
                   ((shift p1 i : (pointer 'a1)) <> p))))))))))

  axiom Pset_range_left_intro:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a1).
        (forall a:int [(not_in_pset p (pset_range_left l a : (pset 'a1)))].
          ((forall p1:(pointer 'a1).
Andrei Paskevich's avatar
Andrei Paskevich committed
351
             ((not_in_pset p1 l) \/
François Bobot's avatar
François Bobot committed
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
              (forall i:int.
                ((Int.(<=) i a) -> (p <> (shift p1 i : (pointer 'a1))))))) ->
           (not_in_pset p (pset_range_left l a : (pset 'a1)))))))

  axiom Pset_range_left_elim:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a1).
        (forall a:int [(not_in_pset p (pset_range_left l a : (pset 'a1)))].
          ((not_in_pset p (pset_range_left l a : (pset 'a1))) ->
           (forall p1:(pointer 'a1).
             ((not (not_in_pset p1 l)) ->
              (forall i:int.
                ((Int.(<=) i a) -> ((shift p1 i : (pointer 'a1)) <> p)))))))))

  axiom Pset_range_right_intro:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a1).
        (forall a:int [(not_in_pset p (pset_range_right l a : (pset 'a1)))].
          ((forall p1:(pointer 'a1).
Andrei Paskevich's avatar
Andrei Paskevich committed
371
             ((not_in_pset p1 l) \/
François Bobot's avatar
François Bobot committed
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
              (forall i:int.
                ((Int.(<=) a i) -> (p <> (shift p1 i : (pointer 'a1))))))) ->
           (not_in_pset p (pset_range_right l a : (pset 'a1)))))))

  axiom Pset_range_right_elim:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a1).
        (forall a:int [(not_in_pset p (pset_range_right l a : (pset 'a1)))].
          ((not_in_pset p (pset_range_right l a : (pset 'a1))) ->
           (forall p1:(pointer 'a1).
             ((not (not_in_pset p1 l)) ->
              (forall i:int.
                ((Int.(<=) a i) -> ((shift p1 i : (pointer 'a1)) <> p)))))))))

  axiom Pset_acc_all_intro:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a2).
        (forall m:(memory (pointer 'a1) 'a2) [(not_in_pset p (pset_acc_all l m : (pset 'a1)))].
          ((forall p1:(pointer 'a2).
             ((not (not_in_pset p1 l)) ->
              (forall i:int.
                (p <> (acc m (shift p1 i : (pointer 'a2)) : (pointer 'a1)))))) ->
           (not_in_pset p (pset_acc_all l m : (pset 'a1)))))))

  axiom Pset_acc_all_elim:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a2).
        (forall m:(memory (pointer 'a1) 'a2) [(not_in_pset p (pset_acc_all l m : (pset 'a1)))].
          ((not_in_pset p (pset_acc_all l m : (pset 'a1))) ->
           (forall p1:(pointer 'a2).
             ((not (not_in_pset p1 l)) ->
              (forall i:int.
                ((acc m (shift p1 i : (pointer 'a2)) : (pointer 'a1)) <> p))))))))

  axiom Pset_acc_range_intro:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a2).
        (forall m:(memory (pointer 'a1) 'a2).
          (forall a:int.
            (forall b:int [(not_in_pset p (pset_acc_range l m a b : (pset 'a1)))].
              ((forall p1:(pointer 'a2).
                 ((not (not_in_pset p1 l)) ->
                  (forall i:int.
Andrei Paskevich's avatar
Andrei Paskevich committed
415
                    (((Int.(<=) a i) /\ (Int.(<=) i b)) ->
François Bobot's avatar
François Bobot committed
416 417 418 419 420 421 422 423 424 425 426 427 428
                     (p <> (acc m (shift p1 i : (pointer 'a2)) : (pointer 'a1))))))) ->
               (not_in_pset p (pset_acc_range l m a b : (pset 'a1)))))))))

  axiom Pset_acc_range_elim:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a2).
        (forall m:(memory (pointer 'a1) 'a2).
          (forall a:int.
            (forall b:int.
              ((not_in_pset p (pset_acc_range l m a b : (pset 'a1))) ->
               (forall p1:(pointer 'a2).
                 ((not (not_in_pset p1 l)) ->
                  (forall i:int.
Andrei Paskevich's avatar
Andrei Paskevich committed
429
                    (((Int.(<=) a i) /\ (Int.(<=) i b)) ->
François Bobot's avatar
François Bobot committed
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493
                     ((acc m (shift p1 i : (pointer 'a2)) : (pointer 'a1)) <> p)))))))))))

  axiom Pset_acc_range_left_intro:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a2).
        (forall m:(memory (pointer 'a1) 'a2).
          (forall a:int [(not_in_pset p (pset_acc_range_left l m a : (pset 'a1)))].
            ((forall p1:(pointer 'a2).
               ((not (not_in_pset p1 l)) ->
                (forall i:int.
                  ((Int.(<=) i a) ->
                   (p <> (acc m (shift p1 i : (pointer 'a2)) : (pointer 'a1))))))) ->
             (not_in_pset p (pset_acc_range_left l m a : (pset 'a1))))))))

  axiom Pset_acc_range_left_elim:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a2).
        (forall m:(memory (pointer 'a1) 'a2).
          (forall a:int [(not_in_pset p (pset_acc_range_left l m a : (pset 'a1)))].
            ((not_in_pset p (pset_acc_range_left l m a : (pset 'a1))) ->
             (forall p1:(pointer 'a2).
               ((not (not_in_pset p1 l)) ->
                (forall i:int.
                  ((Int.(<=) i a) ->
                   ((acc m (shift p1 i : (pointer 'a2)) : (pointer 'a1)) <> p))))))))))

  axiom Pset_acc_range_right_intro:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a2).
        (forall m:(memory (pointer 'a1) 'a2).
          (forall a:int [(not_in_pset p (pset_acc_range_right l m a : (pset 'a1)))].
            ((forall p1:(pointer 'a2).
               ((not (not_in_pset p1 l)) ->
                (forall i:int.
                  ((Int.(<=) a i) ->
                   (p <> (acc m (shift p1 i : (pointer 'a2)) : (pointer 'a1))))))) ->
             (not_in_pset p (pset_acc_range_right l m a : (pset 'a1))))))))

  axiom Pset_acc_range_right_elim:
    (forall p:(pointer 'a1).
      (forall l:(pset 'a2).
        (forall m:(memory (pointer 'a1) 'a2).
          (forall a:int [(not_in_pset p (pset_acc_range_right l m a : (pset 'a1)))].
            ((not_in_pset p (pset_acc_range_right l m a : (pset 'a1))) ->
             (forall p1:(pointer 'a2).
               ((not (not_in_pset p1 l)) ->
                (forall i:int.
                  ((Int.(<=) a i) ->
                   ((acc m (shift p1 i : (pointer 'a2)) : (pointer 'a1)) <> p))))))))))

  axiom Not_assigns_trans:
    (forall a:alloc_table.
      (forall l:(pset 'a1).
        (forall m1:(memory 'a2 'a1).
          (forall m2:(memory 'a2 'a1).
            (forall m3:(memory 'a2 'a1).
              ((not_assigns a m1 m2 l) ->
               ((not_assigns a m2 m3 l) -> (not_assigns a m1 m3 l))))))))

  axiom Not_assigns_refl:
    (forall a:alloc_table.
      (forall l:(pset 'a1).
        (forall m:(memory 'a2 'a1). (not_assigns a m m l))))

Andrei Paskevich's avatar
Andrei Paskevich committed
494
  predicate valid_acc (m1 : (memory (pointer 'a1) 'a2)) =
François Bobot's avatar
François Bobot committed
495 496 497 498
    (forall p:(pointer 'a2).
      (forall a:alloc_table.
        ((valid a p) -> (valid a (acc m1 p : (pointer 'a1))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
499
  predicate valid_acc_range (m1 : (memory (pointer 'a1) 'a2)) (size : int) =
François Bobot's avatar
François Bobot committed
500 501 502 503 504 505 506 507 508 509 510 511 512
    (forall p:(pointer 'a2).
      (forall a:alloc_table.
        ((valid a p) ->
         (valid_range a (acc m1 p : (pointer 'a1)) 0 (Int.(-) size 1 : int)))))

  axiom Valid_acc_range_valid:
    (forall m1:(memory (pointer 'a1) 'a2).
      (forall size:int.
        (forall p:(pointer 'a2).
          (forall a:alloc_table.
            ((valid_acc_range m1 size) ->
             ((valid a p) -> (valid a (acc m1 p : (pointer 'a1)))))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
513
  predicate separation1 (m1 : (memory (pointer 'a1) 'a2)) (m2 : (memory (pointer 'a1) 'a2)) =
François Bobot's avatar
François Bobot committed
514 515 516 517 518
    (forall p:(pointer 'a2).
      (forall a:alloc_table.
        ((valid a p) ->
         ((base_addr (acc m1 p : (pointer 'a1)) : (addr 'a1)) <> (base_addr (acc m2 p : (pointer 'a1)) : (addr 'a1))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
519
  predicate separation1_range1 (m1 : (memory (pointer 'a1) 'a2)) (m2 : (memory (pointer 'a1) 'a2)) (size : int) =
François Bobot's avatar
François Bobot committed
520 521 522 523 524
    (forall p:(pointer 'a2).
      (forall a:alloc_table.
        ((valid a p) ->
         (forall i1:int.
           (forall i2:int.
Andrei Paskevich's avatar
Andrei Paskevich committed
525 526
             (((Int.(<=) 0 i1) /\ (Int.(<) i1 size)) ->
              (((Int.(<=) 0 i2) /\ (Int.(<) i2 size)) ->
François Bobot's avatar
François Bobot committed
527 528
               ((base_addr (acc m1 (shift p i1 : (pointer 'a2)) : (pointer 'a1)) : (addr 'a1)) <> (base_addr (acc m2 (shift p i2 : (pointer 'a2)) : (pointer 'a1)) : (addr 'a1))))))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
529
  predicate separation1_range (m : (memory (pointer 'a1) 'a2)) (size : int) =
François Bobot's avatar
François Bobot committed
530 531 532 533
    (forall p:(pointer 'a2).
      (forall a:alloc_table.
        ((valid a p) ->
         (forall i1:int.
Andrei Paskevich's avatar
Andrei Paskevich committed
534
           (((Int.(<=) 0 i1) /\ (Int.(<) i1 size)) ->
François Bobot's avatar
François Bobot committed
535 536
            ((base_addr (acc m (shift p i1 : (pointer 'a2)) : (pointer 'a1)) : (addr 'a1)) <> (base_addr (acc m p : (pointer 'a1)) : (addr 'a1))))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
537
  predicate separation2 (m1 : (memory (pointer 'a1) 'a2)) (m2 : (memory (pointer 'a1) 'a2)) =
François Bobot's avatar
François Bobot committed
538 539 540 541 542
    (forall p1:(pointer 'a2).
      (forall p2:(pointer 'a2).
        ((p1 <> p2) ->
         ((base_addr (acc m1 p1 : (pointer 'a1)) : (addr 'a1)) <> (base_addr (acc m2 p2 : (pointer 'a1)) : (addr 'a1))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
543
  predicate separation2_range1 (m1 : (memory (pointer 'a1) 'a2)) (m2 : (memory (pointer 'a1) 'a2)) (size : int) =
François Bobot's avatar
François Bobot committed
544 545 546 547
    (forall p:(pointer 'a2).
      (forall q:(pointer 'a2).
        (forall a:alloc_table.
          (forall i:int.
Andrei Paskevich's avatar
Andrei Paskevich committed
548
            (((Int.(<=) 0 i) /\ (Int.(<) i size)) ->
François Bobot's avatar
François Bobot committed
549 550
             ((base_addr (acc m1 (shift p i : (pointer 'a2)) : (pointer 'a1)) : (addr 'a1)) <> (base_addr (acc m2 q : (pointer 'a1)) : (addr 'a1))))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
551
  predicate on_heap alloc_table (pointer 'a1)
François Bobot's avatar
François Bobot committed
552

Andrei Paskevich's avatar
Andrei Paskevich committed
553
  predicate on_stack alloc_table (pointer 'a1)
François Bobot's avatar
François Bobot committed
554

Andrei Paskevich's avatar
Andrei Paskevich committed
555
  predicate fresh alloc_table (pointer 'a1)
François Bobot's avatar
François Bobot committed
556 557 558 559 560 561 562 563 564 565 566

  axiom Fresh_not_valid:
    (forall a:alloc_table.
      (forall p:(pointer 'a1). ((fresh a p) -> (not (valid a p)))))

  axiom Fresh_not_valid_shift:
    (forall a:alloc_table.
      (forall p:(pointer 'a1).
        ((fresh a p) ->
         (forall i:int. (not (valid a (shift p i : (pointer 'a1))))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
567
  predicate alloc_extends alloc_table alloc_table
François Bobot's avatar
François Bobot committed
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600

  axiom Alloc_extends_valid:
    (forall a1:alloc_table.
      (forall a2:alloc_table.
        ((alloc_extends a1 a2) ->
         (forall q:(pointer 'a1). ((valid a1 q) -> (valid a2 q))))))

  axiom Alloc_extends_valid_index:
    (forall a1:alloc_table.
      (forall a2:alloc_table.
        ((alloc_extends a1 a2) ->
         (forall q:(pointer 'a1).
           (forall i:int. ((valid_index a1 q i) -> (valid_index a2 q i)))))))

  axiom Alloc_extends_valid_range:
    (forall a1:alloc_table.
      (forall a2:alloc_table.
        ((alloc_extends a1 a2) ->
         (forall q:(pointer 'a1).
           (forall i:int.
             (forall j:int.
               ((valid_range a1 q i j) -> (valid_range a2 q i j))))))))

  axiom Alloc_extends_refl: (forall a:alloc_table. (alloc_extends a a))

  axiom Alloc_extends_trans:
    (forall a1:alloc_table.
      (forall a2:alloc_table.
        (forall a3:alloc_table [(alloc_extends a1 a2),
          (alloc_extends a2 a3)].
          ((alloc_extends a1 a2) ->
           ((alloc_extends a2 a3) -> (alloc_extends a1 a3))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
601
  predicate free_stack alloc_table alloc_table alloc_table
François Bobot's avatar
François Bobot committed
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618

  axiom Free_stack_heap:
    (forall a1:alloc_table.
      (forall a2:alloc_table.
        (forall a3:alloc_table.
          ((free_stack a1 a2 a3) ->
           (forall p:(pointer 'a1).
             ((valid a2 p) -> ((on_heap a2 p) -> (valid a3 p))))))))

  axiom Free_stack_stack:
    (forall a1:alloc_table.
      (forall a2:alloc_table.
        (forall a3:alloc_table.
          ((free_stack a1 a2 a3) ->
           (forall p:(pointer 'a1).
             ((valid a1 p) -> ((on_stack a1 p) -> (valid a3 p))))))))

Andrei Paskevich's avatar
Andrei Paskevich committed
619
  function null  : (pointer 'a1)
François Bobot's avatar
François Bobot committed
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634

  axiom Null_not_valid:
    (forall a:alloc_table. (not (valid a (null : (pointer 'a1)))))

  type t_0

  type t_1

  type t_2

  axiom Mean_1:
    ("CADUCEUS_1"
    (forall x:int.
      (forall y:int.
        ((Int.(<=) x y) ->
Andrei Paskevich's avatar
Andrei Paskevich committed
635
         ((Int.(<=) x (ComputerDivision.div (Int.(+) x y : int) 2 : int)) /\
François Bobot's avatar
François Bobot committed
636 637 638 639 640 641 642
          (Int.(<=) (ComputerDivision.div (Int.(+) x y : int) 2 : int) y))))))

  goal Binary_search1_impl_po_1:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall alloc:alloc_table.
          (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
643
           ((Int.(>=) n 0) /\ (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
644 645 646 647 648 649 650
           ("CADUCEUS_3" (Int.(<=) (Int.(-) n 1 : int) (Int.(-) n 1 : int)))))))

  goal Binary_search1_impl_po_2:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall alloc:alloc_table.
          (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
651
           ((Int.(>=) n 0) /\ (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
652 653 654
           (forall l:int.
             (forall u:int.
               (("CADUCEUS_3"
Andrei Paskevich's avatar
Andrei Paskevich committed
655
                ((Int.(<=) 0 l) /\ (Int.(<=) u (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
                ((Int.(<=) l u) ->
                 ((2 <> 0) ->
                  (forall result:int.
                    ((result = (ComputerDivision.div (Int.(+) l u : int) 2 : int)) ->
                     (forall result0:(pointer 'a1).
                       ((result0 = (shift t result : (pointer 'a1))) ->
                        (valid alloc result0))))))))))))))

  goal Binary_search1_impl_po_3:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall v:int.
          (forall alloc:alloc_table.
            (forall intM_t_2:(memory int 'a1).
              (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
671
               ((Int.(>=) n 0) /\
François Bobot's avatar
François Bobot committed
672 673 674 675
                (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
               (forall l:int.
                 (forall u:int.
                   (("CADUCEUS_3"
Andrei Paskevich's avatar
Andrei Paskevich committed
676
                    ((Int.(<=) 0 l) /\ (Int.(<=) u (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697
                    ((Int.(<=) l u) ->
                     ((2 <> 0) ->
                      (forall result:int.
                        ((result = (ComputerDivision.div (Int.(+) l u : int) 2 : int)) ->
                         (forall result0:(pointer 'a1).
                           ((result0 = (shift t result : (pointer 'a1))) ->
                            ((valid alloc result0) ->
                             (forall result1:int.
                               ((result1 = (acc intM_t_2 result0 : int)) ->
                                ((Int.(<) result1 v) ->
                                 (forall l0:int.
                                   ((l0 = (Int.(+) result 1 : int)) ->
                                    ("CADUCEUS_3" (Int.(<=) 0 l0)))))))))))))))))))))))

  goal Binary_search1_impl_po_4:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall v:int.
          (forall alloc:alloc_table.
            (forall intM_t_2:(memory int 'a1).
              (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
698
               ((Int.(>=) n 0) /\
François Bobot's avatar
François Bobot committed
699 700 701 702
                (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
               (forall l:int.
                 (forall u:int.
                   (("CADUCEUS_3"
Andrei Paskevich's avatar
Andrei Paskevich committed
703
                    ((Int.(<=) 0 l) /\ (Int.(<=) u (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725
                    ((Int.(<=) l u) ->
                     ((2 <> 0) ->
                      (forall result:int.
                        ((result = (ComputerDivision.div (Int.(+) l u : int) 2 : int)) ->
                         (forall result0:(pointer 'a1).
                           ((result0 = (shift t result : (pointer 'a1))) ->
                            ((valid alloc result0) ->
                             (forall result1:int.
                               ((result1 = (acc intM_t_2 result0 : int)) ->
                                ((Int.(<) result1 v) ->
                                 (forall l0:int.
                                   ((l0 = (Int.(+) result 1 : int)) ->
                                    (Int.(<=) 0 ("CADUCEUS_4"
                                                (Int.(-) u l : int))))))))))))))))))))))))

  goal Binary_search1_impl_po_5:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall v:int.
          (forall alloc:alloc_table.
            (forall intM_t_2:(memory int 'a1).
              (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
726
               ((Int.(>=) n 0) /\
François Bobot's avatar
François Bobot committed
727 728 729 730
                (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
               (forall l:int.
                 (forall u:int.
                   (("CADUCEUS_3"
Andrei Paskevich's avatar
Andrei Paskevich committed
731
                    ((Int.(<=) 0 l) /\ (Int.(<=) u (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754
                    ((Int.(<=) l u) ->
                     ((2 <> 0) ->
                      (forall result:int.
                        ((result = (ComputerDivision.div (Int.(+) l u : int) 2 : int)) ->
                         (forall result0:(pointer 'a1).
                           ((result0 = (shift t result : (pointer 'a1))) ->
                            ((valid alloc result0) ->
                             (forall result1:int.
                               ((result1 = (acc intM_t_2 result0 : int)) ->
                                ((Int.(<) result1 v) ->
                                 (forall l0:int.
                                   ((l0 = (Int.(+) result 1 : int)) ->
                                    (Int.(<) ("CADUCEUS_4"
                                             (Int.(-) u l0 : int)) ("CADUCEUS_4"
                                                                   (Int.(-) u l : int))))))))))))))))))))))))

  goal Binary_search1_impl_po_6:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall v:int.
          (forall alloc:alloc_table.
            (forall intM_t_2:(memory int 'a1).
              (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
755
               ((Int.(>=) n 0) /\
François Bobot's avatar
François Bobot committed
756 757 758 759
                (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
               (forall l:int.
                 (forall u:int.
                   (("CADUCEUS_3"
Andrei Paskevich's avatar
Andrei Paskevich committed
760
                    ((Int.(<=) 0 l) /\ (Int.(<=) u (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781
                    ((Int.(<=) l u) ->
                     ((2 <> 0) ->
                      (forall result:int.
                        ((result = (ComputerDivision.div (Int.(+) l u : int) 2 : int)) ->
                         (forall result0:(pointer 'a1).
                           ((result0 = (shift t result : (pointer 'a1))) ->
                            ((valid alloc result0) ->
                             (forall result1:int.
                               ((result1 = (acc intM_t_2 result0 : int)) ->
                                ((Int.(>=) result1 v) ->
                                 (forall result2:(pointer 'a1).
                                   ((result2 = (shift t result : (pointer 'a1))) ->
                                    (valid alloc result2))))))))))))))))))))))

  goal Binary_search1_impl_po_7:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall v:int.
          (forall alloc:alloc_table.
            (forall intM_t_2:(memory int 'a1).
              (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
782
               ((Int.(>=) n 0) /\
François Bobot's avatar
François Bobot committed
783 784 785 786
                (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
               (forall l:int.
                 (forall u:int.
                   (("CADUCEUS_3"
Andrei Paskevich's avatar
Andrei Paskevich committed
787
                    ((Int.(<=) 0 l) /\ (Int.(<=) u (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815
                    ((Int.(<=) l u) ->
                     ((2 <> 0) ->
                      (forall result:int.
                        ((result = (ComputerDivision.div (Int.(+) l u : int) 2 : int)) ->
                         (forall result0:(pointer 'a1).
                           ((result0 = (shift t result : (pointer 'a1))) ->
                            ((valid alloc result0) ->
                             (forall result1:int.
                               ((result1 = (acc intM_t_2 result0 : int)) ->
                                ((Int.(>=) result1 v) ->
                                 (forall result2:(pointer 'a1).
                                   ((result2 = (shift t result : (pointer 'a1))) ->
                                    ((valid alloc result2) ->
                                     (forall result3:int.
                                       ((result3 = (acc intM_t_2 result2 : int)) ->
                                        ((Int.(>) result3 v) ->
                                         (forall u0:int.
                                           ((u0 = (Int.(-) result 1 : int)) ->
                                            ("CADUCEUS_3"
                                            (Int.(<=) u0 (Int.(-) n 1 : int))))))))))))))))))))))))))))))

  goal Binary_search1_impl_po_8:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall v:int.
          (forall alloc:alloc_table.
            (forall intM_t_2:(memory int 'a1).
              (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
816
               ((Int.(>=) n 0) /\
François Bobot's avatar
François Bobot committed
817 818 819 820
                (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
               (forall l:int.
                 (forall u:int.
                   (("CADUCEUS_3"
Andrei Paskevich's avatar
Andrei Paskevich committed
821
                    ((Int.(<=) 0 l) /\ (Int.(<=) u (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849
                    ((Int.(<=) l u) ->
                     ((2 <> 0) ->
                      (forall result:int.
                        ((result = (ComputerDivision.div (Int.(+) l u : int) 2 : int)) ->
                         (forall result0:(pointer 'a1).
                           ((result0 = (shift t result : (pointer 'a1))) ->
                            ((valid alloc result0) ->
                             (forall result1:int.
                               ((result1 = (acc intM_t_2 result0 : int)) ->
                                ((Int.(>=) result1 v) ->
                                 (forall result2:(pointer 'a1).
                                   ((result2 = (shift t result : (pointer 'a1))) ->
                                    ((valid alloc result2) ->
                                     (forall result3:int.
                                       ((result3 = (acc intM_t_2 result2 : int)) ->
                                        ((Int.(>) result3 v) ->
                                         (forall u0:int.
                                           ((u0 = (Int.(-) result 1 : int)) ->
                                            (Int.(<=) 0 ("CADUCEUS_4"
                                                        (Int.(-) u l : int))))))))))))))))))))))))))))))

  goal Binary_search1_impl_po_9:
    (forall t:(pointer 'a1).
      (forall n:int.
        (forall v:int.
          (forall alloc:alloc_table.
            (forall intM_t_2:(memory int 'a1).
              (("CADUCEUS_2"
Andrei Paskevich's avatar
Andrei Paskevich committed
850
               ((Int.(>=) n 0) /\
François Bobot's avatar
François Bobot committed
851 852 853 854
                (valid_range alloc t 0 (Int.(-) n 1 : int)))) ->
               (forall l:int.
                 (forall u:int.
                   (("CADUCEUS_3"
Andrei Paskevich's avatar
Andrei Paskevich committed
855
                    ((Int.(<=) 0 l) /\ (Int.(<=) u (Int.(-) n 1 : int)))) ->
François Bobot's avatar
François Bobot committed
856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880
                    ((Int.(<=) l u) ->
                     ((2 <> 0) ->
                      (forall result:int.
                        ((result = (ComputerDivision.div (Int.(+) l u : int) 2 : int)) ->
                         (forall result0:(pointer 'a1).
                           ((result0 = (shift t result : (pointer 'a1))) ->
                            ((valid alloc result0) ->
                             (forall result1:int.
                               ((result1 = (acc intM_t_2 result0 : int)) ->
                                ((Int.(>=) result1 v) ->
                                 (forall result2:(pointer 'a1).
                                   ((result2 = (shift t result : (pointer 'a1))) ->
                                    ((valid alloc result2) ->
                                     (forall result3:int.
                                       ((result3 = (acc intM_t_2 result2 : int)) ->
                                        ((Int.(>) result3 v) ->
                                         (forall u0:int.
                                           ((u0 = (Int.(-) result 1 : int)) ->
                                            (Int.(<) ("CADUCEUS_4"
                                                     (Int.(-) u0 l : int))
                                            ("CADUCEUS_4"
                                            (Int.(-) u l : int))))))))))))))))))))))))))))))


end