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 imp.imp.Syntax.
Require Import imp.imp.ConcreteSemantics.
Require Import imp.imp.Svar.
Require Import imp.imp.Constraint.
Require Import imp.imp.SymState.
Require Import imp.imp.FreshSvar.
Require Import imp.imp.SymStateSet.
Open Scope Z_scope.
Axiom compose : (svar -> Z) -> t -> program_var -> option Z.
Axiom compose'def : forall  (rho : svar -> Z) (sigma : t) (x : program_var), compose rho sigma x = (match get sigma x with | Some v => Some (rho v) | None => None end).
Definition state_extends (s : sym_state) (s' : sym_state) := Svar.to_fset (vars s) ⊆ Svar.to_fset (vars s') ∧ (∀(v : svar), v ∈ Svar.to_fset (vars s) -> SymState.rho s v = SymState.rho s' v).
Axiom svar_set_add : svar -> Svar.set -> Svar.set.
Axiom svar_set_add'def : forall  (v : svar) (vs : Svar.set), Svar.to_fset (svar_set_add v vs) = insert_set v (Svar.to_fset vs) ∧ (if decide (v ∈ Svar.to_fset vs) then size (Svar.to_fset (svar_set_add v vs)) = size (Svar.to_fset vs) else Z.of_nat (size (Svar.to_fset (svar_set_add v vs))) = Z.of_nat (size (Svar.to_fset vs)) + 1%Z).
Definition results_extend (s : sym_state) (normals : gset sym_state) (unbounds : gset sym_state) (limits : gset sym_state) := ∀(s' : sym_state), s' ∈ normals ∨ s' ∈ unbounds ∨ s' ∈ limits -> state_extends s s'.
Theorem symbolic_interp_cmd'vc (n : Z) (c : cmd) (s : sym_state) (fact0 : 0%Z ≤ n) : (match c with | Cskip => True | Cassign x e => (∀(se : symbolic_expr), eval_expr (compose (SymState.rho s) (sigma s)) e (Enormal (interp_symbolic_expr (SymState.rho s) se)) ∧ (∀(v : svar), v ∈ vars_in_symbolic_expr se -> (∃(x1 : program_var), get (sigma s) x1 = Some v)) -> (∀(v' : svar), is_fresh v' (Svar.to_fset (vars s)) -> (let o1 : t := sigma s in let sigma' : t := Constraint.set o1 x v' in get sigma' x = Some v' ∧ (∀(k' : program_var), ¬ k' = x -> get sigma' k' = get o1 k') -> (∀(constr' : Constraint.constr), (let constr : Constraint.constr := Cconj (SymState.constr s) (Ceq (Svar v') se) in (∃(v : svar), (match get (sigma s) x with | None => False | Some v1 => v = v1 end) ∧ (∀(rho : svar -> Z), is_solution rho constr' = is_solution rho (Cexists v constr)) ∧ vars_in_constraint constr' ⊆ vars_in_constraint (Cexists v constr)) ∨ get (sigma s) x = None ∧ constr' = constr) -> (let o2 : Svar.set := vars s in ∀(vars' : Svar.set), Svar.to_fset vars' = insert_set v' (Svar.to_fset o2) ∧ (if decide (v' ∈ Svar.to_fset o2) then size (Svar.to_fset vars') = size (Svar.to_fset o2) else Z.of_nat (size (Svar.to_fset vars')) = Z.of_nat (size (Svar.to_fset o2)) + 1%Z) -> vars_in_constraint constr' ⊆ Svar.to_fset vars' ∧ (∀(x1 : program_var) (v : svar), get sigma' x1 = Some v -> v ∈ Svar.to_fset vars')))))) | Cseq c1 c2 => ((match c with | Cskip => False | Cassign _ _ => False | Cseq f f1 => f = c1 ∨ f1 = c1 | Cif _ f f1 => f = c1 ∨ f1 = c1 | Cwhile _ f => f = c1 end) ∧ 0%Z ≤ n) ∧ (∀(normals1 : SymStateSet.set) (unbounds1 : SymStateSet.set) (limits1 : SymStateSet.set), results_extend s (SymStateSet.to_fset normals1) (SymStateSet.to_fset unbounds1) (SymStateSet.to_fset limits1) ∧ (is_solution (SymState.rho s) (SymState.constr s) -> (∀(gamma' : program_var -> option Z) (bhv : behavior), exec_cmd (mk_loop_cnf n) (compose (SymState.rho s) (sigma s)) c1 gamma' bhv -> (∃(s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals1 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds1 | Cloop_limit => s' ∈ SymStateSet.to_fset limits1 end) ∧ is_solution (SymState.rho s') (SymState.constr s') ∧ gamma' = compose (SymState.rho s') (sigma s')))) ∧ (∀(bhv : behavior) (s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals1 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds1 | Cloop_limit => s' ∈ SymStateSet.to_fset limits1 end) -> is_solution (SymState.rho s') (SymState.constr s') -> is_solution (SymState.rho s) (SymState.constr s) ∧ exec_cmd (mk_loop_cnf n) (compose (SymState.rho s) (sigma s)) c1 (compose (SymState.rho s') (sigma s')) bhv) -> (let o1 : list sym_state := to_list normals1 in (∀(e : sym_state), (e ∈ SymStateSet.to_fset normals1) = (e ∈ o1)) -> ((match c with | Cskip => False | Cassign _ _ => False | Cseq f f1 => f = c2 ∨ f1 = c2 | Cif _ f f1 => f = c2 ∨ f1 = c2 | Cwhile _ f => f = c2 end) ∨ c = c2 ∧ 0%Z ≤ 0%Z ∧ Z.of_nat (length o1) < 0%Z) ∧ 0%Z ≤ n)) | Cif e c1 c2 => (∀(se : symbolic_expr), eval_expr (compose (SymState.rho s) (sigma s)) e (Enormal (interp_symbolic_expr (SymState.rho s) se)) ∧ (∀(v : svar), v ∈ vars_in_symbolic_expr se -> (∃(x : program_var), get (sigma s) x = Some v)) -> (let o1 : Svar.set := vars s in let o2 : Constraint.constr := Cconj (SymState.constr s) (Cneq se (Slit 0%Z)) in let o3 : t := sigma s in (vars_in_constraint o2 ⊆ Svar.to_fset o1 ∧ (∀(x : program_var) (v : svar), get o3 x = Some v -> v ∈ Svar.to_fset o1)) ∧ (∀(s1 : sym_state), sigma s1 = o3 ∧ SymState.constr s1 = o2 ∧ SymState.rho s1 = SymState.rho s ∧ vars s1 = o1 -> (let o4 : Svar.set := vars s in let o5 : Constraint.constr := Cconj (SymState.constr s) (Ceq se (Slit 0%Z)) in let o6 : t := sigma s in (vars_in_constraint o5 ⊆ Svar.to_fset o4 ∧ (∀(x : program_var) (v : svar), get o6 x = Some v -> v ∈ Svar.to_fset o4)) ∧ (∀(s2 : sym_state), sigma s2 = o6 ∧ SymState.constr s2 = o5 ∧ SymState.rho s2 = SymState.rho s ∧ vars s2 = o4 -> ((true = false -> (∀(rho : svar -> Z), ¬ is_solution rho (SymState.constr s1))) -> (match c with | Cskip => False | Cassign _ _ => False | Cseq f f1 => f = c1 ∨ f1 = c1 | Cif _ f f1 => f = c1 ∨ f1 = c1 | Cwhile _ f => f = c1 end) ∧ 0%Z ≤ n) ∧ (∀(normals1 : SymStateSet.set) (unbounds1 : SymStateSet.set) (limits1 : SymStateSet.set), (∃(o7 : bool), (o7 = false -> (∀(rho : svar -> Z), ¬ is_solution rho (SymState.constr s1))) ∧ (if decide (o7 = true) then results_extend s1 (SymStateSet.to_fset normals1) (SymStateSet.to_fset unbounds1) (SymStateSet.to_fset limits1) ∧ (is_solution (SymState.rho s1) (SymState.constr s1) -> (∀(gamma' : program_var -> option Z) (bhv : behavior), exec_cmd (mk_loop_cnf n) (compose (SymState.rho s1) (sigma s1)) c1 gamma' bhv -> (∃(s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals1 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds1 | Cloop_limit => s' ∈ SymStateSet.to_fset limits1 end) ∧ is_solution (SymState.rho s') (SymState.constr s') ∧ gamma' = compose (SymState.rho s') (sigma s')))) ∧ (∀(bhv : behavior) (s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals1 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds1 | Cloop_limit => s' ∈ SymStateSet.to_fset limits1 end) -> is_solution (SymState.rho s') (SymState.constr s') -> is_solution (SymState.rho s1) (SymState.constr s1) ∧ exec_cmd (mk_loop_cnf n) (compose (SymState.rho s1) (sigma s1)) c1 (compose (SymState.rho s') (sigma s')) bhv) else (SymStateSet.to_fset limits1 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset limits1)) = 0%Z) ∧ (SymStateSet.to_fset unbounds1 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset unbounds1)) = 0%Z) ∧ SymStateSet.to_fset normals1 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset normals1)) = 0%Z)) -> (true = false -> (∀(rho : svar -> Z), ¬ is_solution rho (SymState.constr s2))) -> (match c with | Cskip => False | Cassign _ _ => False | Cseq f f1 => f = c2 ∨ f1 = c2 | Cif _ f f1 => f = c2 ∨ f1 = c2 | Cwhile _ f => f = c2 end) ∧ 0%Z ≤ n)))))) | Cwhile e c1 => ((match c with | Cskip => False | Cassign _ _ => False | Cseq f f1 => f = Cwhile e c1 ∨ f1 = Cwhile e c1 | Cif _ f f1 => f = Cwhile e c1 ∨ f1 = Cwhile e c1 | Cwhile _ f => f = Cwhile e c1 end) ∨ c = Cwhile e c1 ∧ 0%Z ≤ n + 1%Z ∧ n - 0%Z < n + 1%Z) ∧ 0%Z ≤ 0%Z ∧ 0%Z ≤ n end) ∧ (∀(normals : SymStateSet.set) (unbounds : SymStateSet.set) (limits : SymStateSet.set), (match c with | Cskip => (SymStateSet.to_fset limits = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset limits)) = 0%Z) ∧ (SymStateSet.to_fset unbounds = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset unbounds)) = 0%Z) ∧ SymStateSet.to_fset normals = ({[s]} : gset _) ∧ Z.of_nat (size (SymStateSet.to_fset normals)) = 1%Z | Cassign x e => (∃(se : symbolic_expr), (eval_expr (compose (SymState.rho s) (sigma s)) e (Enormal (interp_symbolic_expr (SymState.rho s) se)) ∧ (∀(v : svar), v ∈ vars_in_symbolic_expr se -> (∃(x1 : program_var), get (sigma s) x1 = Some v))) ∧ (∃(v' : svar), is_fresh v' (Svar.to_fset (vars s)) ∧ (let o1 : t := sigma s in let sigma' : t := Constraint.set o1 x v' in (get sigma' x = Some v' ∧ (∀(k' : program_var), ¬ k' = x -> get sigma' k' = get o1 k')) ∧ (∃(constr' : Constraint.constr), (let constr : Constraint.constr := Cconj (SymState.constr s) (Ceq (Svar v') se) in (∃(v : svar), (match get (sigma s) x with | None => False | Some v1 => v = v1 end) ∧ (∀(rho : svar -> Z), is_solution rho constr' = is_solution rho (Cexists v constr)) ∧ vars_in_constraint constr' ⊆ vars_in_constraint (Cexists v constr)) ∨ get (sigma s) x = None ∧ constr' = constr) ∧ (let o2 : Svar.set := vars s in ∃(vars' : Svar.set), (Svar.to_fset vars' = insert_set v' (Svar.to_fset o2) ∧ (if decide (v' ∈ Svar.to_fset o2) then size (Svar.to_fset vars') = size (Svar.to_fset o2) else Z.of_nat (size (Svar.to_fset vars')) = Z.of_nat (size (Svar.to_fset o2)) + 1%Z)) ∧ (∃(s' : sym_state), (sigma s' = sigma' ∧ SymState.constr s' = constr' ∧ SymState.rho s' = fun_updt (SymState.rho s) v' (interp_symbolic_expr (SymState.rho s) se) ∧ vars s' = vars') ∧ (SymStateSet.to_fset limits = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset limits)) = 0%Z) ∧ (SymStateSet.to_fset unbounds = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset unbounds)) = 0%Z) ∧ SymStateSet.to_fset normals = ({[s']} : gset _) ∧ Z.of_nat (size (SymStateSet.to_fset normals)) = 1%Z)))))) ∨ eval_expr (compose (SymState.rho s) (sigma s)) e Eunbound_var ∧ (SymStateSet.to_fset limits = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset limits)) = 0%Z) ∧ (SymStateSet.to_fset unbounds = ({[s]} : gset _) ∧ Z.of_nat (size (SymStateSet.to_fset unbounds)) = 1%Z) ∧ SymStateSet.to_fset normals = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset normals)) = 0%Z | Cseq c1 c2 => (∃(normals1 : SymStateSet.set) (unbounds1 : SymStateSet.set) (limits1 : SymStateSet.set), (results_extend s (SymStateSet.to_fset normals1) (SymStateSet.to_fset unbounds1) (SymStateSet.to_fset limits1) ∧ (is_solution (SymState.rho s) (SymState.constr s) -> (∀(gamma' : program_var -> option Z) (bhv : behavior), exec_cmd (mk_loop_cnf n) (compose (SymState.rho s) (sigma s)) c1 gamma' bhv -> (∃(s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals1 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds1 | Cloop_limit => s' ∈ SymStateSet.to_fset limits1 end) ∧ is_solution (SymState.rho s') (SymState.constr s') ∧ gamma' = compose (SymState.rho s') (sigma s')))) ∧ (∀(bhv : behavior) (s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals1 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds1 | Cloop_limit => s' ∈ SymStateSet.to_fset limits1 end) -> is_solution (SymState.rho s') (SymState.constr s') -> is_solution (SymState.rho s) (SymState.constr s) ∧ exec_cmd (mk_loop_cnf n) (compose (SymState.rho s) (sigma s)) c1 (compose (SymState.rho s') (sigma s')) bhv)) ∧ (let o1 : list sym_state := to_list normals1 in (∀(e : sym_state), (e ∈ SymStateSet.to_fset normals1) = (e ∈ o1)) ∧ (∃(unbounds2 : SymStateSet.set) (limits2 : SymStateSet.set), ((∀(s' : sym_state), s' ∈ SymStateSet.to_fset normals ∨ s' ∈ SymStateSet.to_fset unbounds2 ∨ s' ∈ SymStateSet.to_fset limits2 -> (∃(s1 : sym_state), s1 ∈ SymStateSet.to_fset (of_list o1) ∧ state_extends s1 s')) ∧ (∀(s1 : sym_state), s1 ∈ SymStateSet.to_fset (of_list o1) -> is_solution (SymState.rho s1) (SymState.constr s1) -> (∀(gamma' : program_var -> option Z) (bhv : behavior), exec_cmd (mk_loop_cnf n) (compose (SymState.rho s1) (sigma s1)) c2 gamma' bhv -> (∃(s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds2 | Cloop_limit => s' ∈ SymStateSet.to_fset limits2 end) ∧ is_solution (SymState.rho s') (SymState.constr s') ∧ gamma' = compose (SymState.rho s') (sigma s')))) ∧ (∀(bhv : behavior) (s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds2 | Cloop_limit => s' ∈ SymStateSet.to_fset limits2 end) -> is_solution (SymState.rho s') (SymState.constr s') -> (∃(s1 : sym_state), s1 ∈ SymStateSet.to_fset (of_list o1) ∧ is_solution (SymState.rho s1) (SymState.constr s1) ∧ exec_cmd (mk_loop_cnf n) (compose (SymState.rho s1) (sigma s1)) c2 (compose (SymState.rho s') (sigma s')) bhv))) ∧ SymStateSet.to_fset limits = SymStateSet.to_fset limits1 ∪ SymStateSet.to_fset limits2 ∧ SymStateSet.to_fset unbounds = SymStateSet.to_fset unbounds1 ∪ SymStateSet.to_fset unbounds2))) | Cif e c1 c2 => (∃(se : symbolic_expr), (eval_expr (compose (SymState.rho s) (sigma s)) e (Enormal (interp_symbolic_expr (SymState.rho s) se)) ∧ (∀(v : svar), v ∈ vars_in_symbolic_expr se -> (∃(x : program_var), get (sigma s) x = Some v))) ∧ (∃(s1 : sym_state), (sigma s1 = sigma s ∧ SymState.constr s1 = Cconj (SymState.constr s) (Cneq se (Slit 0%Z)) ∧ SymState.rho s1 = SymState.rho s ∧ vars s1 = vars s) ∧ (∃(s2 : sym_state), (sigma s2 = sigma s ∧ SymState.constr s2 = Cconj (SymState.constr s) (Ceq se (Slit 0%Z)) ∧ SymState.rho s2 = SymState.rho s ∧ vars s2 = vars s) ∧ (∃(normals1 : SymStateSet.set) (unbounds1 : SymStateSet.set) (limits1 : SymStateSet.set), (∃(o1 : bool), (o1 = false -> (∀(rho : svar -> Z), ¬ is_solution rho (SymState.constr s1))) ∧ (if decide (o1 = true) then results_extend s1 (SymStateSet.to_fset normals1) (SymStateSet.to_fset unbounds1) (SymStateSet.to_fset limits1) ∧ (is_solution (SymState.rho s1) (SymState.constr s1) -> (∀(gamma' : program_var -> option Z) (bhv : behavior), exec_cmd (mk_loop_cnf n) (compose (SymState.rho s1) (sigma s1)) c1 gamma' bhv -> (∃(s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals1 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds1 | Cloop_limit => s' ∈ SymStateSet.to_fset limits1 end) ∧ is_solution (SymState.rho s') (SymState.constr s') ∧ gamma' = compose (SymState.rho s') (sigma s')))) ∧ (∀(bhv : behavior) (s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals1 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds1 | Cloop_limit => s' ∈ SymStateSet.to_fset limits1 end) -> is_solution (SymState.rho s') (SymState.constr s') -> is_solution (SymState.rho s1) (SymState.constr s1) ∧ exec_cmd (mk_loop_cnf n) (compose (SymState.rho s1) (sigma s1)) c1 (compose (SymState.rho s') (sigma s')) bhv) else (SymStateSet.to_fset limits1 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset limits1)) = 0%Z) ∧ (SymStateSet.to_fset unbounds1 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset unbounds1)) = 0%Z) ∧ SymStateSet.to_fset normals1 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset normals1)) = 0%Z)) ∧ (∃(normals2 : SymStateSet.set) (unbounds2 : SymStateSet.set) (limits2 : SymStateSet.set), (∃(o1 : bool), (o1 = false -> (∀(rho : svar -> Z), ¬ is_solution rho (SymState.constr s2))) ∧ (if decide (o1 = true) then results_extend s2 (SymStateSet.to_fset normals2) (SymStateSet.to_fset unbounds2) (SymStateSet.to_fset limits2) ∧ (is_solution (SymState.rho s2) (SymState.constr s2) -> (∀(gamma' : program_var -> option Z) (bhv : behavior), exec_cmd (mk_loop_cnf n) (compose (SymState.rho s2) (sigma s2)) c2 gamma' bhv -> (∃(s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals2 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds2 | Cloop_limit => s' ∈ SymStateSet.to_fset limits2 end) ∧ is_solution (SymState.rho s') (SymState.constr s') ∧ gamma' = compose (SymState.rho s') (sigma s')))) ∧ (∀(bhv : behavior) (s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals2 | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds2 | Cloop_limit => s' ∈ SymStateSet.to_fset limits2 end) -> is_solution (SymState.rho s') (SymState.constr s') -> is_solution (SymState.rho s2) (SymState.constr s2) ∧ exec_cmd (mk_loop_cnf n) (compose (SymState.rho s2) (sigma s2)) c2 (compose (SymState.rho s') (sigma s')) bhv) else (SymStateSet.to_fset limits2 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset limits2)) = 0%Z) ∧ (SymStateSet.to_fset unbounds2 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset unbounds2)) = 0%Z) ∧ SymStateSet.to_fset normals2 = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset normals2)) = 0%Z)) ∧ SymStateSet.to_fset limits = SymStateSet.to_fset limits1 ∪ SymStateSet.to_fset limits2 ∧ SymStateSet.to_fset unbounds = SymStateSet.to_fset unbounds1 ∪ SymStateSet.to_fset unbounds2 ∧ SymStateSet.to_fset normals = SymStateSet.to_fset normals1 ∪ SymStateSet.to_fset normals2))))) ∨ eval_expr (compose (SymState.rho s) (sigma s)) e Eunbound_var ∧ (SymStateSet.to_fset limits = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset limits)) = 0%Z) ∧ (SymStateSet.to_fset unbounds = ({[s]} : gset _) ∧ Z.of_nat (size (SymStateSet.to_fset unbounds)) = 1%Z) ∧ SymStateSet.to_fset normals = (∅ : gset sym_state) ∧ Z.of_nat (size (SymStateSet.to_fset normals)) = 0%Z | Cwhile e c1 => results_extend s (SymStateSet.to_fset normals) (SymStateSet.to_fset unbounds) (SymStateSet.to_fset limits) ∧ (is_solution (SymState.rho s) (SymState.constr s) -> (∀(gamma' : program_var -> option Z) (bhv : behavior), exec_while (mk_loop_cnf n) 0%Z (compose (SymState.rho s) (sigma s)) e c1 gamma' bhv -> (∃(s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds | Cloop_limit => s' ∈ SymStateSet.to_fset limits end) ∧ is_solution (SymState.rho s') (SymState.constr s') ∧ gamma' = compose (SymState.rho s') (sigma s')))) ∧ (∀(bhv : behavior) (s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds | Cloop_limit => s' ∈ SymStateSet.to_fset limits end) -> is_solution (SymState.rho s') (SymState.constr s') -> is_solution (SymState.rho s) (SymState.constr s) ∧ exec_while (mk_loop_cnf n) 0%Z (compose (SymState.rho s) (sigma s)) e c1 (compose (SymState.rho s') (sigma s')) bhv) end) -> results_extend s (SymStateSet.to_fset normals) (SymStateSet.to_fset unbounds) (SymStateSet.to_fset limits) ∧ (is_solution (SymState.rho s) (SymState.constr s) -> (∀(gamma' : program_var -> option Z) (bhv : behavior), exec_cmd (mk_loop_cnf n) (compose (SymState.rho s) (sigma s)) c gamma' bhv -> (∃(s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds | Cloop_limit => s' ∈ SymStateSet.to_fset limits end) ∧ is_solution (SymState.rho s') (SymState.constr s') ∧ gamma' = compose (SymState.rho s') (sigma s')))) ∧ (∀(bhv : behavior) (s' : sym_state), (match bhv with | Cnormal => s' ∈ SymStateSet.to_fset normals | Cunbound_var => s' ∈ SymStateSet.to_fset unbounds | Cloop_limit => s' ∈ SymStateSet.to_fset limits end) -> is_solution (SymState.rho s') (SymState.constr s') -> is_solution (SymState.rho s) (SymState.constr s) ∧ exec_cmd (mk_loop_cnf n) (compose (SymState.rho s) (sigma s)) c (compose (SymState.rho s') (sigma s')) bhv)).
Admitted.
