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.Qed.Qed.
Require Import Why3.Memory.Memory.
Require Import Why3.Cint.Cint.
Require Import contiki_list.Compound.Compound.
Require Import contiki_list.S1_list.S1_list.
Require Import contiki_list.Axiomatic.Axiomatic.
Require Import contiki_list.A_Index_of_item.A_Index_of_item.
Require Import contiki_list.Axiomatic1.Axiomatic1.
Open Scope Z_scope.
Theorem goal3 (i_1 : Z) (i_2 : Z) (t_3 : addr -> addr) (a_3 : addr) (a_4 : addr) (a_2 : addr) (t_2 : addr -> addr) (a : addr) (a_1 : addr) (i_3 : Z) (t : Z -> Z) (i : Z) (t_1 : addr -> R) : let x : Z := i_1 + i_2 in let x_1 : Z := l_index_of t_3 a_3 a_4 i_2 x in let a_5 : addr := shift a_4 0%Z in let a_6 : addr := t_3 a_2 in let x_2 : Z := x_1 - 1%Z in let a_7 : addr := shift a_4 x_2 in let a_8 : addr := t_3 a_7 in let a_9 : addr -> addr := havoc t_2 (fun_updt (fun_updt t_3 a_2 a) (shift a_8 0%Z) a_1) (shift a_4 x_1) (i_1 + i_2 - x_1) in let a_10 : addr := a_9 a_2 in let a_11 : addr := t_3 (shift a_4 i_3) in let x_3 : Z := l_index_of t_3 a_11 a_4 i_2 x in ¬ Mk_addr 0%Z 0%Z = a_3 -> 0%Z ≤ i_1 -> 0%Z ≤ i_2 -> region (base a_2) ≤ 0%Z -> region (base a_3) ≤ 0%Z -> region (base a_4) ≤ 0%Z -> i_2 ≤ x_1 -> x_1 ≤ x -> i_1 ≤ 2147483645%Z -> - 2147483648%Z ≤ x -> x ≤ 2147483645%Z -> x ≤ 2147483647%Z -> framed t_3 -> linked t -> is_sint32 i -> is_sint32 i_1 -> is_sint32 i_2 -> valid_rw t a_2 1%Z -> valid_rw t a_3 4%Z -> separated a_2 1%Z a_3 4%Z -> valid_rw t a_5 2147483646%Z -> valid_rw t (shift a_4 i_2) i_1 -> separated a_2 1%Z a_5 2147483646%Z -> separated a_3 4%Z a_5 2147483646%Z -> separated a_6 4%Z a_5 2147483646%Z -> p_linked_n t t_3 a_6 a_4 i_2 i_1 (Mk_addr 0%Z 0%Z) -> is_sint32 x_1 -> separated a_10 4%Z a_5 2147483646%Z -> eqs1_list (load_s1_list a_3 t_1 a_9) (load_s1_list a_3 t_1 t_3) -> (if decide (x = x_1) then i_1 = i else 1%Z + i = i_1 ∧ - 2147483648%Z ≤ i) -> (if decide (i_1 = i) then x = x_1 ∧ (∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> is_sint32 i_4 -> ¬ t_3 (shift a_4 i_4) = a_3) else a_11 = a_3 ∧ i_2 ≤ i_3 ∧ i_3 < x ∧ i_2 ≤ x_3 ∧ x_3 < x) -> (i_2 < x_1 -> (∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> a_9 a_7 = a_8) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> p_array_swipe_left a_9 t_3 a_4 x_1 (i_1 + i_2 - 1%Z)) -> ((∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ t_3 (shift a_4 i_4) = a_3) -> (∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ a_9 (shift a_4 i_4) = a_3)) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> (∀(i_4 : Z), i_2 ≤ i_4 -> 2%Z + i_4 ≤ x -> ¬ a_9 (shift a_4 i_4) = a_3)) -> ((∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ t_3 (shift a_4 i_4) = a_3) -> p_linked_n t a_9 a_10 a_4 i_2 i_1 (Mk_addr 0%Z 0%Z)) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> p_linked_n t a_9 a_10 a_4 i_2 (i_1 - 1%Z) (Mk_addr 0%Z 0%Z)) -> ((∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ t_3 (shift a_4 i_4) = a_3) -> p_unchanged t a_9 t_1 t t_3 t_1 a_4 i_2 x) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> p_unchanged t a_9 t_1 t t_3 t_1 a_4 i_2 x_2) -> ((∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ t_3 (shift a_4 i_4) = a_3) -> (∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> separated a_2 1%Z (a_9 (shift a_4 i_4)) 4%Z)) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> (∀(i_4 : Z), i_2 ≤ i_4 -> 2%Z + i_4 ≤ x -> separated a_2 1%Z (a_9 (shift a_4 i_4)) 4%Z)) -> ((∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ t_3 (shift a_4 i_4) = a_3) -> (∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> separated a_3 4%Z (a_9 (shift a_4 i_4)) 4%Z)) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> (∀(i_4 : Z), i_2 ≤ i_4 -> 2%Z + i_4 ≤ x -> separated a_3 4%Z (a_9 (shift a_4 i_4)) 4%Z)) -> ((∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ t_3 (shift a_4 i_4) = a_3) -> (∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> separated (a_9 (shift a_4 i_4)) 4%Z a_5 2147483646%Z)) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> (∀(i_4 : Z), i_2 ≤ i_4 -> 2%Z + i_4 ≤ x -> separated (a_9 (shift a_4 i_4)) 4%Z a_5 2147483646%Z)) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> (∀(i_4 : Z), x_1 ≤ i_4 -> 2%Z + i_4 ≤ x -> eqs1_list (load_s1_list (a_9 (shift a_4 i_4)) t_1 a_9) (load_s1_list (t_3 (shift a_4 (1%Z + i_4))) t_1 t_3))) -> ((∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ t_3 (shift a_4 i_4) = a_3) -> (∀(i_5 : Z) (i_4 : Z), ¬ i_5 = i_4 -> i_2 ≤ i_4 -> i_2 ≤ i_5 -> i_4 < x -> i_5 < x -> ¬ a_9 (shift a_4 i_5) = a_9 (shift a_4 i_4))) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> (∀(i_5 : Z) (i_4 : Z), ¬ i_5 = i_4 -> i_2 ≤ i_4 -> i_2 ≤ i_5 -> 2%Z + i_4 ≤ x -> 2%Z + i_5 ≤ x -> ¬ a_9 (shift a_4 i_5) = a_9 (shift a_4 i_4))) -> ((∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> ¬ t_3 (shift a_4 i_4) = a_3) -> (∀(i_5 : Z) (i_4 : Z), ¬ i_5 = i_4 -> i_2 ≤ i_4 -> i_2 ≤ i_5 -> i_4 < x -> i_5 < x -> separated (a_9 (shift a_4 i_5)) 4%Z (a_9 (shift a_4 i_4)) 4%Z)) -> ((∃(i_4 : Z), t_3 (shift a_4 i_4) = a_3 ∧ i_2 ≤ i_4 ∧ i_4 < x) -> (∀(i_5 : Z) (i_4 : Z), ¬ i_5 = i_4 -> i_2 ≤ i_4 -> i_2 ≤ i_5 -> 2%Z + i_4 ≤ x -> 2%Z + i_5 ≤ x -> separated (a_9 (shift a_4 i_5)) 4%Z (a_9 (shift a_4 i_4)) 4%Z)) -> (∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> separated a_2 1%Z (t_3 (shift a_4 i_4)) 4%Z) -> (∀(i_4 : Z), i_2 ≤ i_4 -> i_4 < x -> separated (t_3 (shift a_4 i_4)) 4%Z a_5 2147483646%Z) -> (∀(i_4 : Z), let a_12 : addr := t_3 (shift a_4 i_4) in ¬ a_12 = a_3 -> i_2 ≤ i_4 -> i_4 < x -> separated a_3 4%Z a_12 4%Z) -> (∀(i_5 : Z) (i_4 : Z), ¬ i_5 = i_4 -> i_2 ≤ i_4 -> i_2 ≤ i_5 -> i_4 < x -> i_5 < x -> ¬ t_3 (shift a_4 i_5) = t_3 (shift a_4 i_4)) -> (∀(i_5 : Z) (i_4 : Z), ¬ i_5 = i_4 -> i_2 ≤ i_4 -> i_2 ≤ i_5 -> i_4 < x -> i_5 < x -> separated (t_3 (shift a_4 i_5)) 4%Z (t_3 (shift a_4 i_4)) 4%Z) -> i_2 ≤ 2147483646%Z.
Admitted.
