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 multiprecision.logical.LogicalUtil.
Require Import Why3.mach.int.Unsigned.
Require Import Why3.mach.c.C.
Require Import multiprecision.types.Config.
Require Import multiprecision.types.Types.
Require Import multiprecision.types.Int32Eq.
Require Import multiprecision.types.UInt64Eq.
Require Import multiprecision.lemmas.Lemmas.
Open Scope Z_scope.
Lemma wmpn_lshift'vc (cnt : bv 64%N) (r : ptr (bv 64%N)) (sz : bv 32%N) (x : ptr (bv 64%N)) (fact0 : 0%Z < bv_unsigned cnt) (fact1 : bv_unsigned cnt < 64%Z) (fact2 : valid r (bv_signed sz)) (fact3 : valid x (bv_signed sz)) (fact4 : writable r = true) (fact5 : 0%Z < bv_signed sz) : int'32_in_bounds (bv_signed sz - 1%Z) ∧ (∀(msb : bv 32%N), bv_signed msb = bv_signed sz - 1%Z -> (min x ≤ offset x + bv_signed msb ∧ offset x + bv_signed msb ≤ C.max x) ∧ (∀(o1 : ptr (bv 64%N)), offset o1 = offset x + bv_signed msb ∧ plength o1 = plength x ∧ pelts o1 = pelts x ∧ data o1 = data x ∧ min o1 = min x ∧ C.max o1 = C.max x ∧ zone1 o1 = zone1 x ∧ writable o1 = writable x -> (min r ≤ offset r + bv_signed msb ∧ offset r + bv_signed msb ≤ C.max r) ∧ (∀(o2 : ptr (bv 64%N)), offset o2 = offset r + bv_signed msb ∧ plength o2 = plength r ∧ pelts o2 = pelts r ∧ data o2 = data r ∧ min o2 = min r ∧ C.max o2 = C.max r ∧ zone1 o2 = zone1 r ∧ writable o2 = writable r -> (min o1 ≤ offset o1 ∧ offset o1 < C.max o1) ∧ (0%Z < bv_unsigned cnt ∧ bv_unsigned cnt < 64%Z) ∧ (∀(l : bv 64%N) (retval : bv 64%N), bv_unsigned l + (18446744073709551615%Z + 1%Z) * bv_unsigned retval = Z.pow 2%Z (bv_unsigned cnt) * bv_unsigned (pelts o1 (offset o1)) ∧ ZEuclid.modulo (bv_unsigned l) (Z.pow 2%Z (bv_unsigned cnt)) = 0%Z ∧ bv_unsigned l ≤ 18446744073709551615%Z + 1%Z - Z.pow 2%Z (bv_unsigned cnt) ∧ bv_unsigned retval < Z.pow 2%Z (bv_unsigned cnt) -> ((0%Z ≤ bv_signed msb ∧ bv_signed msb < bv_signed sz) ∧ (18446744073709551615%Z + 1%Z) * value_sub (pelts r) (offset r + 1%Z + bv_signed msb) (offset r + bv_signed sz) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed sz - bv_signed msb) * bv_unsigned retval + bv_unsigned l = value o1 (bv_signed sz - bv_signed msb) * Z.pow 2%Z (bv_unsigned cnt) ∧ offset o2 = offset r + bv_signed msb ∧ offset o1 = offset x + bv_signed msb ∧ plength o2 = plength r ∧ min o2 = min r ∧ C.max o2 = C.max r ∧ writable o2 = true ∧ pelts o2 = pelts r ∧ plength o1 = plength x ∧ min o1 = min x ∧ C.max o1 = C.max x ∧ pelts o1 = pelts x ∧ bv_unsigned l ≤ 18446744073709551615%Z + 1%Z - Z.pow 2%Z (bv_unsigned cnt)) ∧ (∀(i : bv 32%N) (high : bv 64%N) (rp : ptr (bv 64%N)) (xp : ptr (bv 64%N)) (r1 : ptr (bv 64%N)), length (data r1) = length (data r) ∧ offset r1 = offset r ∧ min r1 = min r ∧ C.max r1 = C.max r ∧ writable r1 = writable r ∧ zone1 r1 = zone1 r -> (0%Z ≤ bv_signed i ∧ bv_signed i < bv_signed sz) ∧ (18446744073709551615%Z + 1%Z) * value_sub (pelts r1) (offset r1 + 1%Z + bv_signed i) (offset r1 + bv_signed sz) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed sz - bv_signed i) * bv_unsigned retval + bv_unsigned high = value xp (bv_signed sz - bv_signed i) * Z.pow 2%Z (bv_unsigned cnt) ∧ offset rp = offset r1 + bv_signed i ∧ offset xp = offset x + bv_signed i ∧ plength rp = plength r1 ∧ min rp = min r1 ∧ C.max rp = C.max r1 ∧ writable rp = true ∧ pelts rp = pelts r1 ∧ plength xp = plength x ∧ min xp = min x ∧ C.max xp = C.max x ∧ pelts xp = pelts x ∧ bv_unsigned high ≤ 18446744073709551615%Z + 1%Z - Z.pow 2%Z (bv_unsigned cnt) -> (if decide (0%Z < bv_signed i) then (min xp ≤ offset xp + - 1%Z ∧ offset xp + - 1%Z ≤ C.max xp) ∧ (∀(o3 : ptr (bv 64%N)), offset o3 = offset xp + - 1%Z ∧ plength o3 = plength xp ∧ pelts o3 = pelts xp ∧ data o3 = data xp ∧ min o3 = min xp ∧ C.max o3 = C.max xp ∧ zone1 o3 = zone1 xp ∧ writable o3 = writable xp -> (min o3 ≤ offset o3 ∧ offset o3 < C.max o3) ∧ (0%Z < bv_unsigned cnt ∧ bv_unsigned cnt < 64%Z) ∧ (∀(l1 : bv 64%N) (h : bv 64%N), bv_unsigned l1 + (18446744073709551615%Z + 1%Z) * bv_unsigned h = Z.pow 2%Z (bv_unsigned cnt) * bv_unsigned (pelts o3 (offset o3)) ∧ ZEuclid.modulo (bv_unsigned l1) (Z.pow 2%Z (bv_unsigned cnt)) = 0%Z ∧ bv_unsigned l1 ≤ 18446744073709551615%Z + 1%Z - Z.pow 2%Z (bv_unsigned cnt) ∧ bv_unsigned h < Z.pow 2%Z (bv_unsigned cnt) -> uint'64_in_bounds (bv_unsigned high + bv_unsigned h) ∧ (∀(v : bv 64%N), bv_unsigned v = bv_unsigned high + bv_unsigned h -> uint'64_in_bounds (bv_unsigned high + bv_unsigned h) ∧ (∀(o4 : bv 64%N), bv_unsigned o4 = bv_unsigned high + bv_unsigned h -> ((min rp ≤ offset rp ∧ offset rp < C.max rp) ∧ writable rp = true) ∧ (∀(rp1 : ptr (bv 64%N)) (r2 : ptr (bv 64%N)), data rp1 = data r2 ∧ length (data r2) = length (data rp) ∧ offset rp1 = offset rp ∧ min rp1 = min rp ∧ C.max rp1 = C.max rp ∧ writable rp1 = writable rp ∧ zone1 rp1 = zone1 rp -> data rp1 = data r2 ∧ length (data r2) = length (data rp) ∧ offset rp1 = offset rp ∧ min rp1 = min rp ∧ C.max rp1 = C.max rp ∧ writable rp1 = writable rp ∧ zone1 rp1 = zone1 rp -> length (data r2) = length (data r1) ∧ offset r2 = offset r1 ∧ min r2 = min r1 ∧ C.max r2 = C.max r1 ∧ writable r2 = writable r1 ∧ zone1 r2 = zone1 r1 -> pelts rp1 = fun_updt (pelts rp) (offset rp1) o4 -> (min rp1 ≤ offset rp1 + - 1%Z ∧ offset rp1 + - 1%Z ≤ C.max rp1) ∧ (∀(o5 : ptr (bv 64%N)), offset o5 = offset rp1 + - 1%Z ∧ plength o5 = plength rp1 ∧ pelts o5 = pelts rp1 ∧ data o5 = data rp1 ∧ min o5 = min rp1 ∧ C.max o5 = C.max rp1 ∧ zone1 o5 = zone1 rp1 ∧ writable o5 = writable rp1 -> int'32_in_bounds (bv_signed i - 1%Z) ∧ (∀(o6 : bv 32%N), bv_signed o6 = bv_signed i - 1%Z -> bv_signed o6 < bv_signed i ∧ (0%Z ≤ bv_signed o6 ∧ bv_signed o6 < bv_signed sz) ∧ (18446744073709551615%Z + 1%Z) * value_sub (pelts r2) (offset r2 + 1%Z + bv_signed o6) (offset r2 + bv_signed sz) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed sz - bv_signed o6) * bv_unsigned retval + bv_unsigned l1 = value o3 (bv_signed sz - bv_signed o6) * Z.pow 2%Z (bv_unsigned cnt) ∧ offset o5 = offset r2 + bv_signed o6 ∧ offset o3 = offset x + bv_signed o6 ∧ plength o5 = plength r2 ∧ min o5 = min r2 ∧ C.max o5 = C.max r2 ∧ writable o5 = true ∧ pelts o5 = pelts r2 ∧ plength o3 = plength x ∧ min o3 = min x ∧ C.max o3 = C.max x ∧ pelts o3 = pelts x ∧ bv_unsigned l1 ≤ 18446744073709551615%Z + 1%Z - Z.pow 2%Z (bv_unsigned cnt)))))))) else ((min r1 ≤ offset r1 ∧ offset r1 < C.max r1) ∧ writable r1 = true) ∧ (∀(r2 : ptr (bv 64%N)), length (data r2) = length (data r1) ∧ offset r2 = offset r1 ∧ min r2 = min r1 ∧ C.max r2 = C.max r1 ∧ writable r2 = writable r1 ∧ zone1 r2 = zone1 r1 -> pelts r2 = fun_updt (pelts r1) (offset r2) high -> value r2 (bv_signed sz) + Z.pow (18446744073709551615%Z + 1%Z) (bv_signed sz) * bv_unsigned retval = value x (bv_signed sz) * Z.pow 2%Z (bv_unsigned cnt)))))))).
Admitted.
