Nominal/Ex/CPS/CPS3_DanvyFilinski_FCB2.thy
changeset 2998 f0fab367453a
parent 2965 d8a6b424f80a
child 3186 425b4c406d80
equal deleted inserted replaced
2997:132575f5bd26 2998:f0fab367453a
     5   CPS1 :: "lt \<Rightarrow> (lt \<Rightarrow> lt) \<Rightarrow> lt" ("_*_"  [100,100] 100)
     5   CPS1 :: "lt \<Rightarrow> (lt \<Rightarrow> lt) \<Rightarrow> lt" ("_*_"  [100,100] 100)
     6 and
     6 and
     7   CPS2 :: "lt \<Rightarrow> lt \<Rightarrow> lt" ("_^_" [100,100] 100)
     7   CPS2 :: "lt \<Rightarrow> lt \<Rightarrow> lt" ("_^_" [100,100] 100)
     8 where
     8 where
     9   "eqvt k \<Longrightarrow> (x~)*k = k (x~)"
     9   "eqvt k \<Longrightarrow> (x~)*k = k (x~)"
    10 | "eqvt k \<Longrightarrow> (M$N)*k = M*(%m. (N*(%n.((m $ n) $ (Abs c (k (c~)))))))"
    10 | "eqvt k \<Longrightarrow> (M$N)*k = M*(%m. (N*(%n.((m $ n) $ (Lam c (k (c~)))))))"
    11 | "eqvt k \<Longrightarrow> atom c \<sharp> (x, M) \<Longrightarrow> (Abs x M)*k = k (Abs x (Abs c (M^(c~))))"
    11 | "eqvt k \<Longrightarrow> atom c \<sharp> (x, M) \<Longrightarrow> (Lam x M)*k = k (Lam x (Lam c (M^(c~))))"
    12 | "\<not>eqvt k \<Longrightarrow> (CPS1 t k) = t"
    12 | "\<not>eqvt k \<Longrightarrow> (CPS1 t k) = t"
    13 | "(x~)^l = l $ (x~)"
    13 | "(x~)^l = l $ (x~)"
    14 | "(M$N)^l = M*(%m. (N*(%n.((m $ n) $ l))))"
    14 | "(M$N)^l = M*(%m. (N*(%n.((m $ n) $ l))))"
    15 | "atom c \<sharp> (x, M) \<Longrightarrow> (Abs x M)^l = l $ (Abs x (Abs c (M^(c~))))"
    15 | "atom c \<sharp> (x, M) \<Longrightarrow> (Lam x M)^l = l $ (Lam x (Lam c (M^(c~))))"
    16   apply (simp only: eqvt_def CPS1_CPS2_graph_def)
    16   apply (simp only: eqvt_def CPS1_CPS2_graph_def)
    17   apply (rule, perm_simp, rule)
    17   apply (rule, perm_simp, rule)
    18   apply auto
    18   apply auto
    19   apply (case_tac x)
    19   apply (case_tac x)
    20   apply (case_tac a)
    20   apply (case_tac a)
    29   apply blast
    29   apply blast
    30   apply (rule_tac x="(name, lt)" and ?'a="name" in obtain_fresh) 
    30   apply (rule_tac x="(name, lt)" and ?'a="name" in obtain_fresh) 
    31   apply (simp add: fresh_at_base Abs1_eq_iff)
    31   apply (simp add: fresh_at_base Abs1_eq_iff)
    32   apply blast
    32   apply blast
    33 --"-"
    33 --"-"
    34   apply (subgoal_tac "Abs c (ka (c~)) = Abs ca (ka (ca~))")
    34   apply (subgoal_tac "Lam c (ka (c~)) = Lam ca (ka (ca~))")
    35   apply (simp only:)
    35   apply (simp only:)
    36   apply (simp add: Abs1_eq_iff)
    36   apply (simp add: Abs1_eq_iff)
    37   apply (case_tac "c=ca")
    37   apply (case_tac "c=ca")
    38   apply simp_all[2]
    38   apply simp_all[2]
    39   apply rule
    39   apply rule
    46 --"-"
    46 --"-"
    47   apply (rule arg_cong)
    47   apply (rule arg_cong)
    48   back
    48   back
    49   apply (thin_tac "eqvt ka")
    49   apply (thin_tac "eqvt ka")
    50   apply (rule_tac x="(c, ca, x, xa, M, Ma)" and ?'a="name" in obtain_fresh)
    50   apply (rule_tac x="(c, ca, x, xa, M, Ma)" and ?'a="name" in obtain_fresh)
    51   apply (subgoal_tac "Abs c (CPS1_CPS2_sumC (Inr (M, c~))) = Abs a (CPS1_CPS2_sumC (Inr (M, a~)))")
    51   apply (subgoal_tac "Lam c (CPS1_CPS2_sumC (Inr (M, c~))) = Lam a (CPS1_CPS2_sumC (Inr (M, a~)))")
    52   prefer 2
    52   prefer 2
    53   apply (simp add: Abs1_eq_iff')
    53   apply (simp add: Abs1_eq_iff')
    54   apply (case_tac "c = a")
    54   apply (case_tac "c = a")
    55   apply simp_all[2]
    55   apply simp_all[2]
    56   apply rule
    56   apply rule
    57   apply (simp add: eqvt_at_def)
    57   apply (simp add: eqvt_at_def)
    58   apply (simp add: swap_fresh_fresh fresh_Pair_elim)
    58   apply (simp add: swap_fresh_fresh fresh_Pair_elim)
    59   apply (erule fresh_eqvt_at)
    59   apply (erule fresh_eqvt_at)
    60   apply (simp add: supp_Inr finite_supp)
    60   apply (simp add: supp_Inr finite_supp)
    61   apply (simp add: fresh_Inr fresh_Pair lt.fresh fresh_at_base)
    61   apply (simp add: fresh_Inr fresh_Pair lt.fresh fresh_at_base)
    62   apply (subgoal_tac "Abs ca (CPS1_CPS2_sumC (Inr (Ma, ca~))) = Abs a (CPS1_CPS2_sumC (Inr (Ma, a~)))")
    62   apply (subgoal_tac "Lam ca (CPS1_CPS2_sumC (Inr (Ma, ca~))) = Lam a (CPS1_CPS2_sumC (Inr (Ma, a~)))")
    63   prefer 2
    63   prefer 2
    64   apply (simp add: Abs1_eq_iff')
    64   apply (simp add: Abs1_eq_iff')
    65   apply (case_tac "ca = a")
    65   apply (case_tac "ca = a")
    66   apply simp_all[2]
    66   apply simp_all[2]
    67   apply rule
    67   apply rule