# HG changeset patch # User Cezary Kaliszyk # Date 1269515078 -3600 # Node ID 733bac87d5bffd5281f99d60dd16ae8ec56b7949 # Parent bde8da26093edbd199b4887c463979efef3c7008 Solved all boring subgoals, and looking at properly defning permute_bv diff -r bde8da26093e -r 733bac87d5bf Nominal/ExCoreHaskell.thy --- a/Nominal/ExCoreHaskell.thy Thu Mar 25 11:29:54 2010 +0100 +++ b/Nominal/ExCoreHaskell.thy Thu Mar 25 12:04:38 2010 +0100 @@ -95,6 +95,27 @@ unfolding fresh_star_def Ball_def by auto (simp_all add: fresh_minus_perm) +(*primrec + permute_bv_raw +where + "permute_bv_raw p (K c l1 l2 l3) = K c (permute_.. l1) ... + +(permute_bv p (K (q \ char) (q \ tvtk_lst) (q \ tvck_lst) (q \ vt_lst) +*) + +consts + permute_bv :: "perm \ pat \ pat" + +lemma ACons_subst: + "supp (Abs (bv pat) trm) \* q \ (ACons pat trm al) = ACons (permute_bv q pat) (q \ trm) al" +sorry + +lemma perm_bv: + "p \ bv l = bv (permute_bv p l)" + sorry + + + lemma fv_alpha1: "fv_bv_tvtk x \* pa \ alpha_bv_tvtk (pa \ x) x" apply (induct x rule: inducts(11)) apply (tactic {* ALLGOALS (TRY o rtac @{thm TrueI}) *}) @@ -249,7 +270,7 @@ P11 (k :: 'k :: pt) tvtk_lst \ P12 (l :: 'l :: pt) tvck_lst" proof - - have a: "(\p a. P1 a (p \ tkind)) \ (\p b. P2 b (p \ ckind)) \ (\p c. P3 c (p \ ty)) \ (\p d. P4 d (p \ ty_lst)) \ (\p e. P5 e (p \ co)) \ (\p f. P6 f (p \ co_lst)) \ (\p g. P7 g (p \ trm)) \ (\p h. P8 h (p \ assoc_lst)) \ (\p i. P9 i (p \ pat)) \ (\p j. P10 j (p \ vt_lst)) \ (\p k. P11 k (p \ tvtk_lst)) \ (\p l. P12 l (p \ tvck_lst))" + have a: "(\p a. P1 a (p \ tkind)) \ (\p b. P2 b (p \ ckind)) \ (\p c. P3 c (p \ ty)) \ (\p d. P4 d (p \ ty_lst)) \ (\p e. P5 e (p \ co)) \ (\p f. P6 f (p \ co_lst)) \ (\p g. P7 g (p \ trm)) \ (\p h. P8 h (p \ assoc_lst)) \ (\p q i. P9 i (permute_bv p (q \ pat))) \ (\p j. P10 j (p \ vt_lst)) \ (\p k. P11 k (p \ tvtk_lst)) \ (\p l. P12 l (p \ tvck_lst))" apply (rule tkind_ckind_ty_ty_lst_co_co_lst_trm_assoc_lst_pat_vt_lst_tvtk_lst_tvck_lst.induct) apply (tactic {* ALLGOALS (REPEAT o rtac allI) *}) apply (tactic {* ALLGOALS (TRY o SOLVED' (simp_tac @{simpset} THEN_ALL_NEW resolve_tac @{thms assms} THEN_ALL_NEW asm_full_simp_tac @{simpset})) *}) @@ -375,29 +396,62 @@ apply (simp only: supp_Abs eqvts) apply blast -prefer 5 -(* using a38*) - apply(subgoal_tac "\pa. ((pa \ (bv (p \ pat))) \* h \ - supp (Abs (p \ (bv pat)) (p \ trm), fv_bv (p \ pat)) \* pa)") +(* GOAL4 a copy-and-paste *) + apply(subgoal_tac "\pa. ((pa \ (atom (p \ tvar))) \ g \ + supp (Abs (p \ {atom tvar}) (p \ trm)) \* pa)") apply clarify apply (simp only: perm) - apply(rule_tac t="ACons (p \ pat) (p \ trm) (p \ assoc_lst)" - and s="ACons (pa \ p \ pat) (pa \ p \ trm) (p \ assoc_lst)" in subst) - apply (simp only: eq_iff supp_Pair fresh_star_union) - apply (erule conjE) + apply(rule_tac t="LAMC (p \ tvar) (p \ ckind) (p \ trm)" + and s="LAMC (pa \ p \ tvar) (p \ ckind) (pa \ p \ trm)" in subst) + apply (simp only: eq_iff) apply (rule_tac x="-pa" in exI) apply (simp add: alphas eqvts eqvts_raw supp_Abs fv_supp) - apply (rule_tac t="supp (pa \ p \ trm) - bv (pa \ p \ pat)" - and s="pa \ (supp (p \ trm) - bv (p \ pat))" in subst) + apply (rule_tac t="supp (pa \ p \ trm) - {atom (pa \ p \ tvar)}" + and s="pa \ (p \ supp trm - {p \ atom tvar})" in subst) apply (simp add: eqvts) + apply (simp add: eqvts[symmetric]) apply (rule conjI) - apply (rule fv_alpha) - apply (rule_tac s="supp (fv_bv (p \ pat))" - and t="fv_bv (p \ pat)" in subst) - apply (rule supp_finite_atom_set[OF fin_fv_bv]) - apply (assumption) + apply (rule supp_perm_eq) + apply (simp add: eqvts) + apply (subst supp_finite_atom_set) + apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp) + apply (simp add: eqvts) + apply (simp add: eqvts) + apply (subst supp_perm_eq) + apply (subst supp_finite_atom_set) + apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp) + apply (simp add: eqvts) + apply assumption + apply (simp add: fresh_star_minus_perm) + apply (rule a30) + apply simp + apply(rotate_tac 1) + apply(erule_tac x="(pa + p)" in allE) + apply simp + apply (simp add: eqvts eqvts_raw) + apply (rule at_set_avoiding2_atom) + apply (simp add: finite_supp) + apply (simp add: finite_supp) + apply (simp add: fresh_def) + apply (simp only: supp_Abs eqvts) + apply blast + + +(* GOAL5 a copy-and-paste *) + apply(subgoal_tac "\pa. ((pa \ (atom (p \ var))) \ g \ + supp (Abs (p \ {atom var}) (p \ trm)) \* pa)") + apply clarify + apply (simp only: perm) + apply(rule_tac t="Lam (p \ var) (p \ ty) (p \ trm)" + and s="Lam (pa \ p \ var) (p \ ty) (pa \ p \ trm)" in subst) + apply (simp only: eq_iff) + apply (rule_tac x="-pa" in exI) + apply (simp add: alphas eqvts eqvts_raw supp_Abs fv_supp) + apply (rule_tac t="supp (pa \ p \ trm) - {atom (pa \ p \ var)}" + and s="pa \ (p \ supp trm - {p \ atom var})" in subst) + apply (simp add: eqvts) + apply (simp add: eqvts[symmetric]) apply (rule conjI) - apply (simp add: eqvts[symmetric]) apply (rule supp_perm_eq) apply (simp add: eqvts) apply (subst supp_finite_atom_set) @@ -410,25 +464,85 @@ apply (simp add: eqvts) apply assumption apply (simp add: fresh_star_minus_perm) + apply (rule a32) + apply simp + apply(rotate_tac 1) + apply(erule_tac x="(pa + p)" in allE) + apply simp + apply (simp add: eqvts eqvts_raw) + apply (rule at_set_avoiding2_atom) + apply (simp add: finite_supp) + apply (simp add: finite_supp) + apply (simp add: fresh_def) + apply (simp only: supp_Abs eqvts) + apply blast + + +(* GOAL6 a copy-and-paste *) + apply(subgoal_tac "\pa. ((pa \ (atom (p \ var))) \ g \ + supp (Abs (p \ {atom var}) (p \ trm2)) \* pa)") + apply clarify + apply (simp only: perm) + apply(rule_tac t="Let (p \ var) (p \ ty) (p \ trm1) (p \ trm2)" + and s="Let (pa \ p \ var) (p \ ty) (p \ trm1) (pa \ p \ trm2)" in subst) + apply (simp only: eq_iff) + apply (rule_tac x="-pa" in exI) + apply (simp add: alphas eqvts eqvts_raw supp_Abs fv_supp) + apply (rule_tac t="supp (pa \ p \ trm2) - {atom (pa \ p \ var)}" + and s="pa \ (p \ supp trm2 - {p \ atom var})" in subst) + apply (simp add: eqvts) + apply (simp add: eqvts[symmetric]) + apply (rule conjI) + apply (rule supp_perm_eq) + apply (simp add: eqvts) + apply (subst supp_finite_atom_set) + apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp) + apply (simp add: eqvts) + apply (simp add: eqvts) + apply (subst supp_perm_eq) + apply (subst supp_finite_atom_set) + apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp) + apply (simp add: eqvts) + apply assumption + apply (simp add: fresh_star_minus_perm) + apply (rule a34) + apply simp + apply simp + apply(rotate_tac 2) + apply(erule_tac x="(pa + p)" in allE) + apply simp + apply (simp add: eqvts eqvts_raw) + apply (rule at_set_avoiding2_atom) + apply (simp add: finite_supp) + apply (simp add: finite_supp) + apply (simp add: fresh_def) + apply (simp only: supp_Abs eqvts) + apply blast + +(* MAIN ACons Goal *) + apply(subgoal_tac "\pa. ((pa \ (bv (p \ pat))) \* h \ + supp (Abs (p \ (bv pat)) (p \ trm)) \* pa)") + apply clarify + apply (simp only: perm eqvts) + apply (subst ACons_subst) + apply assumption apply (rule a38) - apply(erule_tac x="(pa + p)" in allE) apply simp apply(rotate_tac 1) apply(erule_tac x="(pa + p)" in allE) apply simp apply simp + apply (simp add: perm_bv[symmetric]) apply (simp add: eqvts eqvts_raw) apply (rule at_set_avoiding2) apply (simp add: fin_bv) apply (simp add: finite_supp) - apply (simp add: supp_Pair supp_Abs supp_finite_atom_set[OF fin_fv_bv] fin_fv_bv) + apply (simp add: supp_Abs) apply (rule finite_Diff) - apply (simp add: eqvts[symmetric] finite_eqvt[symmetric] finite_supp) - apply (simp add: True_eqvt) - apply (simp add: fresh_star_prod eqvts[symmetric]) - apply (rule conjI) - apply (simp add: fresh_star_def fresh_def supp_Abs) - apply (simp add: fresh_star_permute_iff) + apply (simp add: finite_supp) + apply (simp add: fresh_star_def fresh_def supp_Abs eqvts) +(* Goal for K *) + apply (simp) sorry have g1: "P1 a (0 \ tkind)" using a[THEN conjunct1] by blast have g2: "P2 b (0 \ ckind)" using a[THEN conjunct2,THEN conjunct1] by blast