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_ui_sub'vc (mpz : mpz_memo) (w : mpz_ptr) (v : mpz_ptr) (uval : bv 64%N) (fact0 : 1%Z ≤ alloc mpz w) (fact1 : 1%Z ≤ alloc mpz v) (fact2 : readers mpz w = 0%Z) (fact3 : readers mpz v = 0%Z) (fact4 : abs_size mpz v < 2147483647%Z) : - 2%Z < readers mpz v ∧ (∀(o1 : bv 32%N), bv_signed o1 = sgn mpz v * abs_size mpz v -> mpz_eq v w = (v = w) -> (if decide (1%Z < bv_signed o1) then (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 (mpz_eq v w) then (valid wp (bv_signed o1) ∧ 0%Z < bv_signed o1 ∧ 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 o1) - Z.pow (18446744073709551615%Z + 1%Z) (bv_signed o1) * bv_unsigned x_b = value wp (bv_signed o1) - bv_unsigned uval ∧ (0%Z ≤ bv_unsigned x_b ∧ bv_unsigned x_b ≤ 1%Z) ∧ (∀(j : Z), j < offset wp1 ∨ offset wp1 + bv_signed o1 ≤ j -> pelts wp1 j = pelts wp j) -> int'32_in_bounds (bv_signed o1 - 1%Z) ∧ (∀(o2 : bv 32%N), bv_signed o2 = bv_signed o1 - 1%Z -> (min wp1 ≤ offset wp1 + bv_signed o2 ∧ offset wp1 + bv_signed o2 < C.max wp1) ∧ (let o3 : bv 64%N := pelts wp1 (offset wp1 + bv_signed o2) in ∀(o4 : bool), (bv_unsigned o3 = bv_unsigned (0%bv : bv 64%N) -> o4 = true) ∧ (o4 = true -> o3 = (0%bv : bv 64%N)) -> (∀(o5 : bv 32%N), (if decide (o4 = true) then o5 = (1%bv : bv 32%N) else o5 = (0%bv : bv 32%N)) -> int'32_in_bounds (bv_signed o1 - bv_signed o5) ∧ (∀(o6 : bv 32%N), bv_signed o6 = bv_signed o1 - bv_signed o5 -> int'32_in_bounds (- bv_signed o6) ∧ (∀(o7 : bv 32%N), bv_signed o7 = - bv_signed o6 -> (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 o7) ≤ plength wp1 ∧ plength wp1 = alloc mpz1 w ∧ (¬ 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)))) ∧ (∀(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 o7) ∧ (sgn mpz2 w = - 1%Z) = (bv_signed o7 < 0%Z) ∧ abs_size mpz2 w = Z.abs (bv_signed o7) ∧ abs_value_of mpz2 w = value wp1 (Z.abs (bv_signed o7)) -> (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 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz) ∧ readers mpz3 w = 0%Z ∧ readers mpz3 v = 0%Z))))))))) else mpz_unchanged v mpz1 mpz ∧ (readers mpz1 v = readers mpz v ∧ (- 2%Z < readers mpz1 v -> abs_value_of mpz1 v = abs_value_of mpz v ∧ alloc mpz1 v = alloc mpz v ∧ abs_size mpz1 v = abs_size mpz v ∧ sgn mpz1 v = sgn mpz v ∧ readers mpz1 v = readers mpz v ∧ zones mpz1 v = zones mpz v) -> 0%Z ≤ readers mpz1 v ∧ (∀(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 -> (∀(vp : C.ptr (bv 64%N)), readers mpz2 v = readers mpz1 v + 1%Z ∧ (∀(y : mpz_ptr), ¬ v = y -> readers mpz2 y = readers mpz1 y) ∧ value vp (abs_size mpz2 v) = abs_value_of mpz2 v ∧ plength vp = alloc mpz2 v ∧ offset vp = 0%Z ∧ min vp = 0%Z ∧ C.max vp = plength vp ∧ zone1 vp = zones mpz2 v -> (valid vp (bv_signed o1) ∧ valid wp (bv_signed o1) ∧ 0%Z < bv_signed o1 ∧ 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 o1) - Z.pow (18446744073709551615%Z + 1%Z) (bv_signed o1) * bv_unsigned x_b = value vp (bv_signed o1) - bv_unsigned uval ∧ (∀(j : Z), j < offset wp1 ∨ offset wp1 + bv_signed o1 ≤ j -> pelts wp1 j = pelts wp j) ∧ 0%Z ≤ bv_unsigned x_b ∧ bv_unsigned x_b ≤ 1%Z -> (zones mpz2 v = zone1 vp ∧ 1%Z ≤ readers mpz2 v ∧ min vp = 0%Z ∧ C.max vp = plength vp) ∧ (∀(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 v = readers mpz2 v - 1%Z ∧ (∀(y : mpz_ptr), ¬ y = v -> readers mpz3 y = readers mpz2 y) -> int'32_in_bounds (bv_signed o1 - 1%Z) ∧ (∀(o2 : bv 32%N), bv_signed o2 = bv_signed o1 - 1%Z -> (min wp1 ≤ offset wp1 + bv_signed o2 ∧ offset wp1 + bv_signed o2 < C.max wp1) ∧ (let o3 : bv 64%N := pelts wp1 (offset wp1 + bv_signed o2) in ∀(o4 : bool), (bv_unsigned o3 = bv_unsigned (0%bv : bv 64%N) -> o4 = true) ∧ (o4 = true -> o3 = (0%bv : bv 64%N)) -> (∀(o5 : bv 32%N), (if decide (o4 = true) then o5 = (1%bv : bv 32%N) else o5 = (0%bv : bv 32%N)) -> int'32_in_bounds (bv_signed o1 - bv_signed o5) ∧ (∀(o6 : bv 32%N), bv_signed o6 = bv_signed o1 - bv_signed o5 -> int'32_in_bounds (- bv_signed o6) ∧ (∀(o7 : bv 32%N), bv_signed o7 = - bv_signed o6 -> (zones mpz3 w = zone1 wp1 ∧ readers mpz3 w = - 1%Z ∧ offset wp1 = 0%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ Z.abs (bv_signed o7) ≤ plength wp1 ∧ plength wp1 = alloc mpz3 w ∧ (¬ 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)))) ∧ (∀(mpz4 : mpz_memo), alloc mpz4 = alloc mpz3 ∧ readers mpz4 = readers mpz3 ∧ zones mpz4 = zones mpz3 -> (∀(y : mpz_ptr), ¬ y = w -> mpz_unchanged y mpz4 mpz3) ∧ (sgn mpz4 w = 1%Z) = (0%Z ≤ bv_signed o7) ∧ (sgn mpz4 w = - 1%Z) = (bv_signed o7 < 0%Z) ∧ abs_size mpz4 w = Z.abs (bv_signed o7) ∧ abs_value_of mpz4 w = value wp1 (Z.abs (bv_signed o7)) -> (zones mpz4 w = zone1 wp1 ∧ readers mpz4 w = - 1%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ abs_value_of mpz4 w = value wp1 (abs_size mpz4 w)) ∧ (∀(mpz5 : mpz_memo), abs_value_of mpz5 = abs_value_of mpz4 ∧ alloc mpz5 = alloc mpz4 ∧ abs_size mpz5 = abs_size mpz4 ∧ sgn mpz5 = sgn mpz4 ∧ zones mpz5 = zones mpz4 -> readers mpz5 w = 0%Z ∧ (∀(y : mpz_ptr), ¬ y = w -> readers mpz5 y = readers mpz4 y) -> value_of w mpz5 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz5 mpz) ∧ readers mpz5 w = 0%Z ∧ readers mpz5 v = 0%Z)))))))))))))))) else ∀(o2 : bool), (bv_signed o1 = bv_signed (1%bv : bv 32%N) -> o2 = true) ∧ (o2 = true -> o1 = (1%bv : bv 32%N)) -> (if decide (o2 = true) 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 -> (if decide (mpz_eq v w) then (min wp ≤ offset wp ∧ offset wp < C.max wp) ∧ (if decide (bv_unsigned (pelts wp (offset wp)) ≤ bv_unsigned uval) 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 uval - bv_unsigned o3) ∧ (∀(o4 : bv 64%N), bv_unsigned o4 = bv_unsigned uval - 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 -> (min wp1 ≤ offset wp1 ∧ offset wp1 < C.max wp1) ∧ (let o5 : bv 64%N := pelts wp1 (offset wp1) in ∀(o6 : bool), (bv_unsigned o5 = bv_unsigned (0%bv : bv 64%N) -> o6 = true) ∧ (o6 = true -> o5 = (0%bv : bv 64%N)) -> (∀(o7 : bv 32%N), (if decide (¬ o6 = true) then o7 = (1%bv : bv 32%N) else o7 = (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 o7) ≤ plength wp1 ∧ plength wp1 = alloc mpz1 w ∧ (¬ 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)))) ∧ (∀(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 o7) ∧ (sgn mpz2 w = - 1%Z) = (bv_signed o7 < 0%Z) ∧ abs_size mpz2 w = Z.abs (bv_signed o7) ∧ abs_value_of mpz2 w = value wp1 (Z.abs (bv_signed o7)) -> (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 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz) ∧ readers mpz3 w = 0%Z ∧ readers mpz3 v = 0%Z))))))) else (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 o3 - bv_unsigned uval) ∧ (∀(o4 : bv 64%N), bv_unsigned o4 = bv_unsigned o3 - bv_unsigned uval -> ((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 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 ((-1)%bv : bv 32%N)) ≤ plength wp1 ∧ plength wp1 = alloc mpz1 w ∧ (¬ 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))))) ∧ (∀(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 ((-1)%bv : bv 32%N)) ∧ (sgn mpz2 w = - 1%Z) = (bv_signed ((-1)%bv : bv 32%N) < 0%Z) ∧ abs_size mpz2 w = Z.abs (bv_signed ((-1)%bv : bv 32%N)) ∧ abs_value_of mpz2 w = value wp1 (Z.abs (bv_signed ((-1)%bv : bv 32%N))) -> (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 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz) ∧ readers mpz3 w = 0%Z ∧ readers mpz3 v = 0%Z)))))) else 0%Z ≤ readers mpz1 v ∧ (∀(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 -> (∀(vp : C.ptr (bv 64%N)), readers mpz2 v = readers mpz1 v + 1%Z ∧ (∀(y : mpz_ptr), ¬ v = y -> readers mpz2 y = readers mpz1 y) ∧ value vp (abs_size mpz2 v) = abs_value_of mpz2 v ∧ plength vp = alloc mpz2 v ∧ offset vp = 0%Z ∧ min vp = 0%Z ∧ C.max vp = plength vp ∧ zone1 vp = zones mpz2 v -> (min vp ≤ offset vp ∧ offset vp < C.max vp) ∧ (if decide (bv_unsigned (pelts vp (offset vp)) ≤ bv_unsigned uval) then (min vp ≤ offset vp ∧ offset vp < C.max vp) ∧ (let o3 : bv 64%N := pelts vp (offset vp) in uint'64_in_bounds (bv_unsigned uval - bv_unsigned o3) ∧ (∀(o4 : bv 64%N), bv_unsigned o4 = bv_unsigned uval - 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 -> (min wp1 ≤ offset wp1 ∧ offset wp1 < C.max wp1) ∧ (let o5 : bv 64%N := pelts wp1 (offset wp1) in ∀(o6 : bool), (bv_unsigned o5 = bv_unsigned (0%bv : bv 64%N) -> o6 = true) ∧ (o6 = true -> o5 = (0%bv : bv 64%N)) -> (∀(o7 : bv 32%N), (if decide (¬ o6 = true) then o7 = (1%bv : bv 32%N) else o7 = (0%bv : bv 32%N)) -> (zones mpz2 v = zone1 vp ∧ 1%Z ≤ readers mpz2 v ∧ min vp = 0%Z ∧ C.max vp = plength vp) ∧ (∀(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 v = readers mpz2 v - 1%Z ∧ (∀(y : mpz_ptr), ¬ y = v -> readers mpz3 y = readers mpz2 y) -> (zones mpz3 w = zone1 wp1 ∧ readers mpz3 w = - 1%Z ∧ offset wp1 = 0%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ Z.abs (bv_signed o7) ≤ plength wp1 ∧ plength wp1 = alloc mpz3 w ∧ (¬ 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)))) ∧ (∀(mpz4 : mpz_memo), alloc mpz4 = alloc mpz3 ∧ readers mpz4 = readers mpz3 ∧ zones mpz4 = zones mpz3 -> (∀(y : mpz_ptr), ¬ y = w -> mpz_unchanged y mpz4 mpz3) ∧ (sgn mpz4 w = 1%Z) = (0%Z ≤ bv_signed o7) ∧ (sgn mpz4 w = - 1%Z) = (bv_signed o7 < 0%Z) ∧ abs_size mpz4 w = Z.abs (bv_signed o7) ∧ abs_value_of mpz4 w = value wp1 (Z.abs (bv_signed o7)) -> (zones mpz4 w = zone1 wp1 ∧ readers mpz4 w = - 1%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ abs_value_of mpz4 w = value wp1 (abs_size mpz4 w)) ∧ (∀(mpz5 : mpz_memo), abs_value_of mpz5 = abs_value_of mpz4 ∧ alloc mpz5 = alloc mpz4 ∧ abs_size mpz5 = abs_size mpz4 ∧ sgn mpz5 = sgn mpz4 ∧ zones mpz5 = zones mpz4 -> readers mpz5 w = 0%Z ∧ (∀(y : mpz_ptr), ¬ y = w -> readers mpz5 y = readers mpz4 y) -> value_of w mpz5 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz5 mpz) ∧ readers mpz5 w = 0%Z ∧ readers mpz5 v = 0%Z)))))))) else (min vp ≤ offset vp ∧ offset vp < C.max vp) ∧ (let o3 : bv 64%N := pelts vp (offset vp) in uint'64_in_bounds (bv_unsigned o3 - bv_unsigned uval) ∧ (∀(o4 : bv 64%N), bv_unsigned o4 = bv_unsigned o3 - bv_unsigned uval -> ((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 v = zone1 vp ∧ 1%Z ≤ readers mpz2 v ∧ min vp = 0%Z ∧ C.max vp = plength vp) ∧ (∀(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 v = readers mpz2 v - 1%Z ∧ (∀(y : mpz_ptr), ¬ y = v -> readers mpz3 y = readers mpz2 y) -> (zones mpz3 w = zone1 wp1 ∧ readers mpz3 w = - 1%Z ∧ offset wp1 = 0%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ Z.abs (bv_signed ((-1)%bv : bv 32%N)) ≤ plength wp1 ∧ plength wp1 = alloc mpz3 w ∧ (¬ 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))))) ∧ (∀(mpz4 : mpz_memo), alloc mpz4 = alloc mpz3 ∧ readers mpz4 = readers mpz3 ∧ zones mpz4 = zones mpz3 -> (∀(y : mpz_ptr), ¬ y = w -> mpz_unchanged y mpz4 mpz3) ∧ (sgn mpz4 w = 1%Z) = (0%Z ≤ bv_signed ((-1)%bv : bv 32%N)) ∧ (sgn mpz4 w = - 1%Z) = (bv_signed ((-1)%bv : bv 32%N) < 0%Z) ∧ abs_size mpz4 w = Z.abs (bv_signed ((-1)%bv : bv 32%N)) ∧ abs_value_of mpz4 w = value wp1 (Z.abs (bv_signed ((-1)%bv : bv 32%N))) -> (zones mpz4 w = zone1 wp1 ∧ readers mpz4 w = - 1%Z ∧ min wp1 = 0%Z ∧ C.max wp1 = plength wp1 ∧ abs_value_of mpz4 w = value wp1 (abs_size mpz4 w)) ∧ (∀(mpz5 : mpz_memo), abs_value_of mpz5 = abs_value_of mpz4 ∧ alloc mpz5 = alloc mpz4 ∧ abs_size mpz5 = abs_size mpz4 ∧ sgn mpz5 = sgn mpz4 ∧ zones mpz5 = zones mpz4 -> readers mpz5 w = 0%Z ∧ (∀(y : mpz_ptr), ¬ y = w -> readers mpz5 y = readers mpz4 y) -> value_of w mpz5 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz5 mpz) ∧ readers mpz5 w = 0%Z ∧ readers mpz5 v = 0%Z)))))))))))) else ∀(o3 : bool), (bv_signed o1 = bv_signed (0%bv : bv 32%N) -> o3 = true) ∧ (o3 = true -> o1 = (0%bv : bv 32%N)) -> (if decide (o3 = true) 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) uval -> (∀(o4 : bool), (bv_unsigned uval = bv_unsigned (0%bv : bv 64%N) -> o4 = true) ∧ (o4 = true -> uval = (0%bv : bv 64%N)) -> (∀(o5 : bv 32%N), (if decide (¬ o4 = true) then o5 = (1%bv : bv 32%N) else o5 = (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 o5) ≤ plength wp1 ∧ plength wp1 = alloc mpz1 w ∧ (¬ bv_signed o5 = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed o5) - 1%Z) ≤ value wp1 (Z.abs (bv_signed o5)))) ∧ (∀(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 o5) ∧ (sgn mpz2 w = - 1%Z) = (bv_signed o5 < 0%Z) ∧ abs_size mpz2 w = Z.abs (bv_signed o5) ∧ abs_value_of mpz2 w = value wp1 (Z.abs (bv_signed o5)) -> (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 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz) ∧ readers mpz3 w = 0%Z ∧ readers mpz3 v = 0%Z))))))) else int'32_in_bounds (- bv_signed o1) ∧ (∀(o4 : bv 32%N), bv_signed o4 = - bv_signed o1 -> int'32_in_bounds (bv_signed o4 + 1%Z) ∧ (∀(o5 : bv 32%N), bv_signed o5 = bv_signed o4 + 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 o5) then alloc mpz1 w = bv_signed o5 else alloc mpz1 w = alloc mpz w) -> (if decide (mpz_eq v w) then (valid wp (bv_signed o4) ∧ 0%Z < bv_signed o4 ∧ 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 -> (∀(cy : bv 64%N), value wp1 (bv_signed o4) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed o4) * bv_unsigned cy = value wp (bv_signed o4) + bv_unsigned uval ∧ (0%Z ≤ bv_unsigned cy ∧ bv_unsigned cy ≤ 1%Z) ∧ (∀(j : Z), j < offset wp1 ∨ offset wp1 + bv_signed o4 ≤ j -> pelts wp1 j = pelts wp j) -> ((min wp1 ≤ offset wp1 + bv_signed o4 ∧ offset wp1 + bv_signed o4 < 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 o4) cy ∧ pelts wp2 (offset wp2 + bv_signed o4) = cy -> (∀(o6 : bool), (bv_unsigned cy = bv_unsigned (0%bv : bv 64%N) -> o6 = true) ∧ (o6 = true -> cy = (0%bv : bv 64%N)) -> (∀(o7 : bv 32%N), (if decide (¬ o6 = true) then o7 = (1%bv : bv 32%N) else o7 = (0%bv : bv 32%N)) -> int'32_in_bounds (bv_signed o4 + bv_signed o7) ∧ (∀(o8 : bv 32%N), bv_signed o8 = bv_signed o4 + bv_signed o7 -> (zones mpz1 w = zone1 wp2 ∧ readers mpz1 w = - 1%Z ∧ offset wp2 = 0%Z ∧ min wp2 = 0%Z ∧ C.max wp2 = plength wp2 ∧ Z.abs (bv_signed o8) ≤ plength wp2 ∧ plength wp2 = alloc mpz1 w ∧ (¬ bv_signed o8 = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed o8) - 1%Z) ≤ value wp2 (Z.abs (bv_signed o8)))) ∧ (∀(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 o8) ∧ (sgn mpz2 w = - 1%Z) = (bv_signed o8 < 0%Z) ∧ abs_size mpz2 w = Z.abs (bv_signed o8) ∧ abs_value_of mpz2 w = value wp2 (Z.abs (bv_signed o8)) -> (zones mpz2 w = zone1 wp2 ∧ readers mpz2 w = - 1%Z ∧ min wp2 = 0%Z ∧ C.max wp2 = plength wp2 ∧ abs_value_of mpz2 w = value wp2 (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 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz3 mpz) ∧ readers mpz3 w = 0%Z ∧ readers mpz3 v = 0%Z)))))))) else mpz_unchanged v mpz1 mpz ∧ (readers mpz1 v = readers mpz v ∧ (- 2%Z < readers mpz1 v -> abs_value_of mpz1 v = abs_value_of mpz v ∧ alloc mpz1 v = alloc mpz v ∧ abs_size mpz1 v = abs_size mpz v ∧ sgn mpz1 v = sgn mpz v ∧ readers mpz1 v = readers mpz v ∧ zones mpz1 v = zones mpz v) -> 0%Z ≤ readers mpz1 v ∧ (∀(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 -> (∀(vp : C.ptr (bv 64%N)), readers mpz2 v = readers mpz1 v + 1%Z ∧ (∀(y : mpz_ptr), ¬ v = y -> readers mpz2 y = readers mpz1 y) ∧ value vp (abs_size mpz2 v) = abs_value_of mpz2 v ∧ plength vp = alloc mpz2 v ∧ offset vp = 0%Z ∧ min vp = 0%Z ∧ C.max vp = plength vp ∧ zone1 vp = zones mpz2 v -> (valid vp (bv_signed o4) ∧ valid wp (bv_signed o4) ∧ 0%Z < bv_signed o4 ∧ 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 -> (∀(cy : bv 64%N), value wp1 (bv_signed o4) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed o4) * bv_unsigned cy = value vp (bv_signed o4) + bv_unsigned uval ∧ (0%Z ≤ bv_unsigned cy ∧ bv_unsigned cy ≤ 1%Z) ∧ (∀(j : Z), j < offset wp1 ∨ offset wp1 + bv_signed o4 ≤ j -> pelts wp1 j = pelts wp j) -> ((min wp1 ≤ offset wp1 + bv_signed o4 ∧ offset wp1 + bv_signed o4 < 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 o4) cy ∧ pelts wp2 (offset wp2 + bv_signed o4) = cy -> (∀(o6 : bool), (bv_unsigned cy = bv_unsigned (0%bv : bv 64%N) -> o6 = true) ∧ (o6 = true -> cy = (0%bv : bv 64%N)) -> (∀(o7 : bv 32%N), (if decide (¬ o6 = true) then o7 = (1%bv : bv 32%N) else o7 = (0%bv : bv 32%N)) -> int'32_in_bounds (bv_signed o4 + bv_signed o7) ∧ (∀(o8 : bv 32%N), bv_signed o8 = bv_signed o4 + bv_signed o7 -> (zones mpz2 v = zone1 vp ∧ 1%Z ≤ readers mpz2 v ∧ min vp = 0%Z ∧ C.max vp = plength vp) ∧ (∀(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 v = readers mpz2 v - 1%Z ∧ (∀(y : mpz_ptr), ¬ y = v -> readers mpz3 y = readers mpz2 y) -> (zones mpz3 w = zone1 wp2 ∧ readers mpz3 w = - 1%Z ∧ offset wp2 = 0%Z ∧ min wp2 = 0%Z ∧ C.max wp2 = plength wp2 ∧ Z.abs (bv_signed o8) ≤ plength wp2 ∧ plength wp2 = alloc mpz3 w ∧ (¬ bv_signed o8 = 0%Z -> Z.pow (18446744073709551615%Z + 1%Z) (Z.abs (bv_signed o8) - 1%Z) ≤ value wp2 (Z.abs (bv_signed o8)))) ∧ (∀(mpz4 : mpz_memo), alloc mpz4 = alloc mpz3 ∧ readers mpz4 = readers mpz3 ∧ zones mpz4 = zones mpz3 -> (∀(y : mpz_ptr), ¬ y = w -> mpz_unchanged y mpz4 mpz3) ∧ (sgn mpz4 w = 1%Z) = (0%Z ≤ bv_signed o8) ∧ (sgn mpz4 w = - 1%Z) = (bv_signed o8 < 0%Z) ∧ abs_size mpz4 w = Z.abs (bv_signed o8) ∧ abs_value_of mpz4 w = value wp2 (Z.abs (bv_signed o8)) -> (zones mpz4 w = zone1 wp2 ∧ readers mpz4 w = - 1%Z ∧ min wp2 = 0%Z ∧ C.max wp2 = plength wp2 ∧ abs_value_of mpz4 w = value wp2 (abs_size mpz4 w)) ∧ (∀(mpz5 : mpz_memo), abs_value_of mpz5 = abs_value_of mpz4 ∧ alloc mpz5 = alloc mpz4 ∧ abs_size mpz5 = abs_size mpz4 ∧ sgn mpz5 = sgn mpz4 ∧ zones mpz5 = zones mpz4 -> readers mpz5 w = 0%Z ∧ (∀(y : mpz_ptr), ¬ y = w -> readers mpz5 y = readers mpz4 y) -> value_of w mpz5 = bv_unsigned uval - value_of v mpz ∧ (∀(x : mpz_ptr), ¬ x = w -> mpz_unchanged x mpz5 mpz) ∧ readers mpz5 w = 0%Z ∧ readers mpz5 v = 0%Z))))))))))))))))))))).
Admitted.
