From Stdlib Require Import Strings.String.
From Stdlib Require Import String Ascii.
From Stdlib Require Arith.
From stdpp Require Import base.
From stdpp Require Import fin_maps.
From stdpp Require Import gmap.
From stdpp Require Import base gmultiset.
From Stdlib Require Classical.
From Stdlib Require Import ZArith.
From stdpp.bitvector Require Import definitions tactics.
From Stdlib Require Import Sorting.Sorted.
From Stdlib Require Import Reals.Rbasic_fun.
From Stdlib Require Import Reals.Abstract.ConstructiveAbs.
From Stdlib Require Import Reals.Rdefinitions.
From stdpp Require Import list_relations.
From stdpp Require Import list_numbers.
From stdpp Require Import functions.
From Stdlib Require Import ClassicalEpsilon.
From stdpp Require Import base decidable.
From Stdlib Require Import ZArith.Zeuclid.
From Stdlib Require Import ZArith.Znumtheory.
From stdpp Require Import propset.
From Stdlib Require Import Reals.
Require Import Why3.Base.
Require Import Why3.why3.Ref.Ref.
Require Import Why3.map.Const.
Require Import Why3.map.MapEq.
Require Import Why3.mach.int.Unsigned.
Require Import Why3.mach.c.C.
Require Import multiprecision.lemmas.Lemmas.
Require Import multiprecision.types.Config.
Require Import multiprecision.types.Types.
Require Import multiprecision.types.Int32Eq.
Require Import multiprecision.types.UInt64Eq.
Require Import multiprecision.util.Util.
Require Import multiprecision.ptralias.Alias.
Require Import multiprecision.compare.Compare.
Require Import multiprecision.add.Add.
Require Import multiprecision.sub.Sub.
Require Import multiprecision.mpz.Z.
Require Import multiprecision.mpz.Zutil.
Require Import multiprecision.add_1.Add_1.
Require Import multiprecision.sub_1.Sub_1.
Open Scope Z_scope.
Lemma wmpz_add_ui'vc (mpz : mpz_memo) (w : mpz_ptr) (u : mpz_ptr) (v : bv 64%N) (fact0 : 1%Z ≤ alloc mpz w) (fact1 : 1%Z ≤ alloc mpz u) (fact2 : readers mpz w = 0%Z) (fact3 : readers mpz u = 0%Z) (fact4 : abs_size mpz u < 2147483647%Z) : - 2%Z < readers mpz u ∧ (∀(usize : bv 32%N), bv_signed usize = sgn mpz u * abs_size mpz u -> (bv_signed usize = 0%Z -> usize = (0%bv : bv 32%N)) -> (if decide (usize = (0%bv : bv 32%N)) then readers mpz w = 0%Z ∧ (∀(mpz1 : mpz_memo), abs_value_of mpz1 = abs_value_of mpz ∧ alloc mpz1 = alloc mpz ∧ abs_size mpz1 = abs_size mpz ∧ sgn mpz1 = sgn mpz ∧ zones mpz1 = zones mpz -> (∀(wp : C.ptr (bv 64%N)), readers mpz1 w = - 1%Z ∧ (∀(y : mpz_ptr), ¬ w = y -> readers mpz1 y = readers mpz y) ∧ value wp (abs_size mpz1 w) = abs_value_of mpz1 w ∧ plength wp = alloc mpz1 w ∧ offset wp = 0%Z ∧ min wp = 0%Z ∧ C.max wp = plength wp ∧ writable wp = true ∧ zone1 wp = zones mpz1 w -> ((min wp ≤ offset wp ∧ offset wp < C.max wp) ∧ writable wp = true) ∧ (∀(wp1 : C.ptr (bv 64%N)), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> pelts wp1 = fun_updt (pelts wp) (offset wp1) v -> (bv_unsigned v = 0%Z -> v = (0%bv : bv 64%N)) -> (∀(o1 : bv 32%N), (if decide (¬ v = (0%bv : bv 64%N)) then o1 = (1%bv : bv 32%N) else o1 = (0%bv : bv 32%N)) -> (zones mpz1 w = zone1 wp1 ∧ readers mpz1 w = - 1%Z ∧ offset wp1 = 0%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ Z.abs (bv_signed o1) ≤ plength wp1 ∧ plength wp1 = alloc mpz1 w ∧ (¬ bv_signed o1 = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed o1) - 1%Z) ≤ value wp1 (Z.abs (bv_signed o1)))) ∧ (∀(mpz2 : mpz_memo), alloc mpz2 = alloc mpz1 ∧ readers mpz2 = readers mpz1 ∧ zones mpz2 = zones mpz1 -> (∀(y : mpz_ptr), ¬ y = w -> mpz_unchanged y mpz2 mpz1) ∧ (sgn mpz2 w = 1%Z) = (0%Z ≤ bv_signed o1) ∧ (sgn mpz2 w = - 1%Z) = (bv_signed o1 < 0%Z) ∧ abs_size mpz2 w = Z.abs (bv_signed o1) ∧ abs_value_of mpz2 w = value wp1 (Z.abs (bv_signed o1)) -> (zones mpz2 w = zone1 wp1 ∧ readers mpz2 w = - 1%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ abs_value_of mpz2 w = value wp1 (abs_size mpz2 w)) ∧ (∀(mpz3 : mpz_memo), abs_value_of mpz3 = abs_value_of mpz2 ∧ alloc mpz3 = alloc mpz2 ∧ abs_size mpz3 = abs_size mpz2 ∧ sgn mpz3 = sgn mpz2 ∧ zones mpz3 = zones mpz2 -> readers mpz3 w = 0%Z ∧ (∀(y : mpz_ptr), ¬ y = w -> readers mpz3 y = readers mpz2 y) -> value_of w mpz3 = value_of u mpz + bv_unsigned v ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz) ∧ readers mpz3 w = 0%Z ∧ readers mpz3 u = 0%Z)))))) else - 2147483648%Z < bv_signed usize ∧ (∀(abs_usize : bv 32%N), bv_signed abs_usize = Z.abs (bv_signed usize) -> mpz_eq u w = (u = w) -> int'32_in_bounds (bv_signed abs_usize + 1%Z) ∧ (∀(o1 : bv 32%N), bv_signed o1 = bv_signed abs_usize + 1%Z -> (readers mpz w = 0%Z ∧ 1%Z ≤ alloc mpz w) ∧ (∀(mpz1 : mpz_memo), sgn mpz1 = sgn mpz -> (∀(wp : C.ptr (bv 64%N)), (∀(y : mpz_ptr), ¬ y = w -> mpz_unchanged y mpz1 mpz) ∧ readers mpz1 w = - 1%Z ∧ abs_value_of mpz1 w = value wp (abs_size mpz1 w) ∧ zones mpz1 w = zone1 wp ∧ offset wp = 0%Z ∧ plength wp = alloc mpz1 w ∧ min wp = 0%Z ∧ C.max wp = plength wp ∧ writable wp = true ∧ abs_size mpz1 w = abs_size mpz w ∧ value wp (abs_size mpz w) = abs_value_of mpz w ∧ (if decide (alloc mpz w < bv_signed o1) then alloc mpz1 w = bv_signed o1 else alloc mpz1 w = alloc mpz w) -> (if decide (0%Z ≤ bv_signed usize) then (if decide (mpz_eq u w) then (valid wp (bv_signed abs_usize) ∧ 0%Z < bv_signed abs_usize ∧ writable wp = true) ∧ (∀(wp1 : C.ptr (bv 64%N)), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> (∀(o2 : bv 64%N), value wp1 (bv_signed abs_usize) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed abs_usize) * bv_unsigned o2 = value wp (bv_signed abs_usize) + bv_unsigned v ∧ (0%Z ≤ bv_unsigned o2 ∧ bv_unsigned o2 ≤ 1%Z) ∧ (∀(j : Z), j < offset wp1 ∨ offset wp1 + bv_signed abs_usize ≤ j -> pelts wp1 j = pelts wp j) -> value wp1 (bv_signed abs_usize) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed abs_usize) * bv_unsigned o2 = value_of u mpz1 + bv_unsigned v ∧ (0%Z ≤ bv_unsigned o2 ∧ bv_unsigned o2 ≤ 1%Z) ∧ (mpz_eq u w ∨ readers mpz1 u = 0%Z) ∧ readers mpz1 w = - 1%Z ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz1 mpz))) else 0%Z ≤ readers mpz1 u ∧ (∀(mpz2 : mpz_memo), abs_value_of mpz2 = abs_value_of mpz1 ∧ alloc mpz2 = alloc mpz1 ∧ abs_size mpz2 = abs_size mpz1 ∧ sgn mpz2 = sgn mpz1 ∧ zones mpz2 = zones mpz1 -> (∀(up : C.ptr (bv 64%N)), readers mpz2 u = readers mpz1 u + 1%Z ∧ (∀(y : mpz_ptr), ¬ u = y -> readers mpz2 y = readers mpz1 y) ∧ value up (abs_size mpz2 u) = abs_value_of mpz2 u ∧ plength up = alloc mpz2 u ∧ offset up = 0%Z ∧ min up = 0%Z ∧ C.max up = plength up ∧ zone1 up = zones mpz2 u -> (valid up (bv_signed abs_usize) ∧ valid wp (bv_signed abs_usize) ∧ 0%Z < bv_signed abs_usize ∧ writable wp = true) ∧ (∀(wp1 : C.ptr (bv 64%N)), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> (∀(o2 : bv 64%N), value wp1 (bv_signed abs_usize) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed abs_usize) * bv_unsigned o2 = value up (bv_signed abs_usize) + bv_unsigned v ∧ (0%Z ≤ bv_unsigned o2 ∧ bv_unsigned o2 ≤ 1%Z) ∧ (∀(j : Z), j < offset wp1 ∨ offset wp1 + bv_signed abs_usize ≤ j -> pelts wp1 j = pelts wp j) -> (zones mpz2 u = zone1 up ∧ 1%Z ≤ readers mpz2 u ∧ min up = 0%Z ∧ C.max up = plength up) ∧ (∀(mpz3 : mpz_memo), abs_value_of mpz3 = abs_value_of mpz2 ∧ alloc mpz3 = alloc mpz2 ∧ abs_size mpz3 = abs_size mpz2 ∧ sgn mpz3 = sgn mpz2 ∧ zones mpz3 = zones mpz2 -> readers mpz3 u = readers mpz2 u - 1%Z ∧ (∀(y : mpz_ptr), ¬ y = u -> readers mpz3 y = readers mpz2 y) -> value wp1 (bv_signed abs_usize) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed abs_usize) * bv_unsigned o2 = value_of u mpz1 + bv_unsigned v ∧ (0%Z ≤ bv_unsigned o2 ∧ bv_unsigned o2 ≤ 1%Z) ∧ (mpz_eq u w ∨ readers mpz3 u = 0%Z) ∧ readers mpz3 w = - 1%Z ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz))))))) ∧ (∀(cy : bv 64%N) (wp1 : C.ptr (bv 64%N)) (mpz2 : mpz_memo), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> abs_value_of mpz2 = abs_value_of mpz1 ∧ alloc mpz2 = alloc mpz1 ∧ abs_size mpz2 = abs_size mpz1 ∧ sgn mpz2 = sgn mpz1 ∧ zones mpz2 = zones mpz1 -> value wp1 (bv_signed abs_usize) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed abs_usize) * bv_unsigned cy = value_of u mpz1 + bv_unsigned v ∧ (0%Z ≤ bv_unsigned cy ∧ bv_unsigned cy ≤ 1%Z) ∧ (mpz_eq u w ∨ readers mpz2 u = 0%Z) ∧ readers mpz2 w = - 1%Z ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz2 mpz) -> ((min wp1 ≤ offset wp1 + bv_signed abs_usize ∧ offset wp1 + bv_signed abs_usize < C.max wp1) ∧ writable wp1 = true) ∧ (∀(wp2 : C.ptr (bv 64%N)), length (data wp2) = length (data wp1) ∧ offset wp2 = offset wp1 ∧ min wp2 = min wp1 ∧ C.max wp2 = C.max wp1 ∧ writable wp2 = writable wp1 ∧ zone1 wp2 = zone1 wp1 -> pelts wp2 = fun_updt (pelts wp1) (offset wp2 + bv_signed abs_usize) cy ∧ pelts wp2 (offset wp2 + bv_signed abs_usize) = cy -> bv_unsigned cy ≤ 2147483647%Z ∧ (∀(o2 : bv 32%N), bv_signed o2 = bv_unsigned cy -> int'32_in_bounds (bv_signed abs_usize + bv_signed o2) ∧ (∀(o3 : bv 32%N), bv_signed o3 = bv_signed abs_usize + bv_signed o2 -> (zones mpz2 w = zone1 wp2 ∧ readers mpz2 w = - 1%Z ∧ offset wp2 = 0%Z ∧ min wp2 = 0%Z ∧ C.max wp2 = plength wp2 ∧ Z.abs (bv_signed o3) ≤ plength wp2 ∧ plength wp2 = alloc mpz2 w ∧ (¬ bv_signed o3 = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed o3) - 1%Z) ≤ value wp2 (Z.abs (bv_signed o3)))) ∧ (∀(mpz3 : mpz_memo), alloc mpz3 = alloc mpz2 ∧ readers mpz3 = readers mpz2 ∧ zones mpz3 = zones mpz2 -> (∀(y : mpz_ptr), ¬ y = w -> mpz_unchanged y mpz3 mpz2) ∧ (sgn mpz3 w = 1%Z) = (0%Z ≤ bv_signed o3) ∧ (sgn mpz3 w = - 1%Z) = (bv_signed o3 < 0%Z) ∧ abs_size mpz3 w = Z.abs (bv_signed o3) ∧ abs_value_of mpz3 w = value wp2 (Z.abs (bv_signed o3)) -> (zones mpz3 w = zone1 wp2 ∧ readers mpz3 w = - 1%Z ∧ min wp2 = 0%Z ∧ C.max wp2 = plength wp2 ∧ abs_value_of mpz3 w = value wp2 (abs_size mpz3 w)) ∧ (∀(mpz4 : mpz_memo), abs_value_of mpz4 = abs_value_of mpz3 ∧ alloc mpz4 = alloc mpz3 ∧ abs_size mpz4 = abs_size mpz3 ∧ sgn mpz4 = sgn mpz3 ∧ zones mpz4 = zones mpz3 -> readers mpz4 w = 0%Z ∧ (∀(y : mpz_ptr), ¬ y = w -> readers mpz4 y = readers mpz3 y) -> value_of w mpz4 = value_of u mpz + bv_unsigned v ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz4 mpz) ∧ readers mpz4 w = 0%Z ∧ readers mpz4 u = 0%Z)))))) else (if decide (mpz_eq u w) then (bv_signed abs_usize = 1%Z -> abs_usize = (1%bv : bv 32%N)) -> (abs_usize = (1%bv : bv 32%N) -> min wp ≤ offset wp ∧ offset wp < C.max wp) ∧ (∀(o2 : bool), (if decide (abs_usize = (1%bv : bv 32%N)) then o2 = (if decide (bv_unsigned (pelts wp (offset wp)) < bv_unsigned v) then true else false) else o2 = false) -> (if decide (o2 = true) then (min wp ≤ offset wp ∧ offset wp < C.max wp) ∧ (let o3 : bv 64%N := pelts wp (offset wp) in uint'64_in_bounds (bv_unsigned v - bv_unsigned o3) ∧ (∀(o4 : bv 64%N), bv_unsigned o4 = bv_unsigned v - bv_unsigned o3 -> ((min wp ≤ offset wp ∧ offset wp < C.max wp) ∧ writable wp = true) ∧ (∀(wp1 : C.ptr (bv 64%N)), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> pelts wp1 = fun_updt (pelts wp) (offset wp1) o4 -> sgn_value wp1 (1%bv : bv 32%N) = value_of u mpz1 + bv_unsigned v ∧ Z.abs (bv_signed (1%bv : bv 32%N)) ≤ bv_signed abs_usize + 1%Z ∧ (¬ bv_signed (1%bv : bv 32%N) = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed (1%bv : bv 32%N)) - 1%Z) ≤ value wp1 (Z.abs (bv_signed (1%bv : bv 32%N)))) ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz1 mpz) ∧ (mpz_eq u w ∨ readers mpz1 u = 0%Z) ∧ readers mpz1 w = - 1%Z))) else (valid wp (bv_signed abs_usize) ∧ 0%Z < bv_signed abs_usize ∧ writable wp = true) ∧ (∀(wp1 : C.ptr (bv 64%N)), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> (∀(x_b : bv 64%N), value wp1 (bv_signed abs_usize) - Z.pow (18446744073709551615%Z + 1%Z) (bv_signed abs_usize) * bv_unsigned x_b = value wp (bv_signed abs_usize) - bv_unsigned v ∧ (0%Z ≤ bv_unsigned x_b ∧ bv_unsigned x_b ≤ 1%Z) ∧ (∀(j : Z), j < offset wp1 ∨ offset wp1 + bv_signed abs_usize ≤ j -> pelts wp1 j = pelts wp j) -> int'32_in_bounds (bv_signed abs_usize - 1%Z) ∧ (∀(o3 : bv 32%N), bv_signed o3 = bv_signed abs_usize - 1%Z -> (min wp1 ≤ offset wp1 + bv_signed o3 ∧ offset wp1 + bv_signed o3 < C.max wp1) ∧ (let o4 : bv 64%N := pelts wp1 (offset wp1 + bv_signed o3) in (bv_unsigned o4 = 0%Z -> o4 = (0%bv : bv 64%N)) -> (∀(o5 : bv 32%N), (if decide (o4 = (0%bv : bv 64%N)) then o5 = (1%bv : bv 32%N) else o5 = (0%bv : bv 32%N)) -> int'32_in_bounds (bv_signed abs_usize - bv_signed o5) ∧ (∀(o6 : bv 32%N), bv_signed o6 = bv_signed abs_usize - bv_signed o5 -> int'32_in_bounds (- bv_signed o6) ∧ (∀(o7 : bv 32%N), bv_signed o7 = - bv_signed o6 -> sgn_value wp1 o7 = value_of u mpz1 + bv_unsigned v ∧ Z.abs (bv_signed o7) ≤ bv_signed abs_usize + 1%Z ∧ (¬ bv_signed o7 = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed o7) - 1%Z) ≤ value wp1 (Z.abs (bv_signed o7))) ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz1 mpz) ∧ (mpz_eq u w ∨ readers mpz1 u = 0%Z) ∧ readers mpz1 w = - 1%Z))))))))) else 0%Z ≤ readers mpz1 u ∧ (∀(mpz2 : mpz_memo), abs_value_of mpz2 = abs_value_of mpz1 ∧ alloc mpz2 = alloc mpz1 ∧ abs_size mpz2 = abs_size mpz1 ∧ sgn mpz2 = sgn mpz1 ∧ zones mpz2 = zones mpz1 -> (∀(up : C.ptr (bv 64%N)), readers mpz2 u = readers mpz1 u + 1%Z ∧ (∀(y : mpz_ptr), ¬ u = y -> readers mpz2 y = readers mpz1 y) ∧ value up (abs_size mpz2 u) = abs_value_of mpz2 u ∧ plength up = alloc mpz2 u ∧ offset up = 0%Z ∧ min up = 0%Z ∧ C.max up = plength up ∧ zone1 up = zones mpz2 u -> (bv_signed abs_usize = 1%Z -> abs_usize = (1%bv : bv 32%N)) -> (abs_usize = (1%bv : bv 32%N) -> min up ≤ offset up ∧ offset up < C.max up) ∧ (∀(o2 : bool), (if decide (abs_usize = (1%bv : bv 32%N)) then o2 = (if decide (bv_unsigned (pelts up (offset up)) < bv_unsigned v) then true else false) else o2 = false) -> (if decide (o2 = true) then (min up ≤ offset up ∧ offset up < C.max up) ∧ (let o3 : bv 64%N := pelts up (offset up) in uint'64_in_bounds (bv_unsigned v - bv_unsigned o3) ∧ (∀(o4 : bv 64%N), bv_unsigned o4 = bv_unsigned v - bv_unsigned o3 -> ((min wp ≤ offset wp ∧ offset wp < C.max wp) ∧ writable wp = true) ∧ (∀(wp1 : C.ptr (bv 64%N)), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> pelts wp1 = fun_updt (pelts wp) (offset wp1) o4 -> (zones mpz2 u = zone1 up ∧ 1%Z ≤ readers mpz2 u ∧ min up = 0%Z ∧ C.max up = plength up) ∧ (∀(mpz3 : mpz_memo), abs_value_of mpz3 = abs_value_of mpz2 ∧ alloc mpz3 = alloc mpz2 ∧ abs_size mpz3 = abs_size mpz2 ∧ sgn mpz3 = sgn mpz2 ∧ zones mpz3 = zones mpz2 -> readers mpz3 u = readers mpz2 u - 1%Z ∧ (∀(y : mpz_ptr), ¬ y = u -> readers mpz3 y = readers mpz2 y) -> sgn_value wp1 (1%bv : bv 32%N) = value_of u mpz1 + bv_unsigned v ∧ Z.abs (bv_signed (1%bv : bv 32%N)) ≤ bv_signed abs_usize + 1%Z ∧ (¬ bv_signed (1%bv : bv 32%N) = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed (1%bv : bv 32%N)) - 1%Z) ≤ value wp1 (Z.abs (bv_signed (1%bv : bv 32%N)))) ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz) ∧ (mpz_eq u w ∨ readers mpz3 u = 0%Z) ∧ readers mpz3 w = - 1%Z)))) else (valid up (bv_signed abs_usize) ∧ valid wp (bv_signed abs_usize) ∧ 0%Z < bv_signed abs_usize ∧ writable wp = true) ∧ (∀(wp1 : C.ptr (bv 64%N)), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> (∀(x_b : bv 64%N), value wp1 (bv_signed abs_usize) - Z.pow (18446744073709551615%Z + 1%Z) (bv_signed abs_usize) * bv_unsigned x_b = value up (bv_signed abs_usize) - bv_unsigned v ∧ (∀(j : Z), j < offset wp1 ∨ offset wp1 + bv_signed abs_usize ≤ j -> pelts wp1 j = pelts wp j) ∧ 0%Z ≤ bv_unsigned x_b ∧ bv_unsigned x_b ≤ 1%Z -> int'32_in_bounds (bv_signed abs_usize - 1%Z) ∧ (∀(o3 : bv 32%N), bv_signed o3 = bv_signed abs_usize - 1%Z -> (min wp1 ≤ offset wp1 + bv_signed o3 ∧ offset wp1 + bv_signed o3 < C.max wp1) ∧ (let o4 : bv 64%N := pelts wp1 (offset wp1 + bv_signed o3) in (bv_unsigned o4 = 0%Z -> o4 = (0%bv : bv 64%N)) -> (∀(o5 : bv 32%N), (if decide (o4 = (0%bv : bv 64%N)) then o5 = (1%bv : bv 32%N) else o5 = (0%bv : bv 32%N)) -> int'32_in_bounds (bv_signed abs_usize - bv_signed o5) ∧ (∀(o6 : bv 32%N), bv_signed o6 = bv_signed abs_usize - bv_signed o5 -> int'32_in_bounds (- bv_signed o6) ∧ (∀(o7 : bv 32%N), bv_signed o7 = - bv_signed o6 -> (zones mpz2 u = zone1 up ∧ 1%Z ≤ readers mpz2 u ∧ min up = 0%Z ∧ C.max up = plength up) ∧ (∀(mpz3 : mpz_memo), abs_value_of mpz3 = abs_value_of mpz2 ∧ alloc mpz3 = alloc mpz2 ∧ abs_size mpz3 = abs_size mpz2 ∧ sgn mpz3 = sgn mpz2 ∧ zones mpz3 = zones mpz2 -> readers mpz3 u = readers mpz2 u - 1%Z ∧ (∀(y : mpz_ptr), ¬ y = u -> readers mpz3 y = readers mpz2 y) -> sgn_value wp1 o7 = value_of u mpz1 + bv_unsigned v ∧ Z.abs (bv_signed o7) ≤ bv_signed abs_usize + 1%Z ∧ (¬ bv_signed o7 = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed o7) - 1%Z) ≤ value wp1 (Z.abs (bv_signed o7))) ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz) ∧ (mpz_eq u w ∨ readers mpz3 u = 0%Z) ∧ readers mpz3 w = - 1%Z))))))))))))) ∧ (∀(wp1 : C.ptr (bv 64%N)) (wsize : bv 32%N) (mpz2 : mpz_memo), length (data wp1) = length (data wp) ∧ offset wp1 = offset wp ∧ min wp1 = min wp ∧ C.max wp1 = C.max wp ∧ writable wp1 = writable wp ∧ zone1 wp1 = zone1 wp -> abs_value_of mpz2 = abs_value_of mpz1 ∧ alloc mpz2 = alloc mpz1 ∧ abs_size mpz2 = abs_size mpz1 ∧ sgn mpz2 = sgn mpz1 ∧ zones mpz2 = zones mpz1 -> sgn_value wp1 wsize = value_of u mpz1 + bv_unsigned v ∧ Z.abs (bv_signed wsize) ≤ bv_signed abs_usize + 1%Z ∧ (¬ bv_signed wsize = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed wsize) - 1%Z) ≤ value wp1 (Z.abs (bv_signed wsize))) ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz2 mpz) ∧ (mpz_eq u w ∨ readers mpz2 u = 0%Z) ∧ readers mpz2 w = - 1%Z -> (zones mpz2 w = zone1 wp1 ∧ readers mpz2 w = - 1%Z ∧ offset wp1 = 0%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ Z.abs (bv_signed wsize) ≤ plength wp1 ∧ plength wp1 = alloc mpz2 w ∧ (¬ bv_signed wsize = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed wsize) - 1%Z) ≤ value wp1 (Z.abs (bv_signed wsize)))) ∧ (∀(mpz3 : mpz_memo), alloc mpz3 = alloc mpz2 ∧ readers mpz3 = readers mpz2 ∧ zones mpz3 = zones mpz2 -> (∀(y : mpz_ptr), ¬ y = w -> mpz_unchanged y mpz3 mpz2) ∧ (sgn mpz3 w = 1%Z) = (0%Z ≤ bv_signed wsize) ∧ (sgn mpz3 w = - 1%Z) = (bv_signed wsize < 0%Z) ∧ abs_size mpz3 w = Z.abs (bv_signed wsize) ∧ abs_value_of mpz3 w = value wp1 (Z.abs (bv_signed wsize)) -> (zones mpz3 w = zone1 wp1 ∧ readers mpz3 w = - 1%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ abs_value_of mpz3 w = value wp1 (abs_size mpz3 w)) ∧ (∀(mpz4 : mpz_memo), abs_value_of mpz4 = abs_value_of mpz3 ∧ alloc mpz4 = alloc mpz3 ∧ abs_size mpz4 = abs_size mpz3 ∧ sgn mpz4 = sgn mpz3 ∧ zones mpz4 = zones mpz3 -> readers mpz4 w = 0%Z ∧ (∀(y : mpz_ptr), ¬ y = w -> readers mpz4 y = readers mpz3 y) -> value_of w mpz4 = value_of u mpz + bv_unsigned v ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz4 mpz) ∧ readers mpz4 w = 0%Z ∧ readers mpz4 u = 0%Z)))))))))).
Admitted.
