diff -r 132575f5bd26 -r f0fab367453a Nominal/Ex/CPS/CPS2_DanvyNielsen.thy --- a/Nominal/Ex/CPS/CPS2_DanvyNielsen.thy Fri Aug 19 11:07:17 2011 +0900 +++ b/Nominal/Ex/CPS/CPS2_DanvyNielsen.thy Fri Aug 19 12:49:38 2011 +0900 @@ -7,7 +7,7 @@ Hole | CFun cpsctxt lt | CArg lt cpsctxt -| CAbs x::name c::cpsctxt bind x in c +| CAbs x::name c::cpsctxt binds x in c nominal_primrec fill :: "cpsctxt \ lt \ lt" ("_<_>" [200, 200] 100) @@ -15,7 +15,7 @@ fill_hole : "Hole = M" | fill_fun : "(CFun C N) = (C) $ N" | fill_arg : "(CArg N C) = N $ (C)" -| fill_abs : "atom x \ M \ (CAbs x C) = Abs x (C)" +| fill_abs : "atom x \ M \ (CAbs x C) = Lam x (C)" unfolding eqvt_def fill_graph_def apply perm_simp apply auto @@ -29,11 +29,7 @@ apply (simp add: eqvt_at_def swap_fresh_fresh) done -termination - by (relation "measure (\(x, _). size x)") (auto simp add: cpsctxt.size) - -lemma [eqvt]: "p \ fill c t = fill (p \ c) (p \ t)" - by (nominal_induct c avoiding: t rule: cpsctxt.strong_induct) simp_all +termination (eqvt) by lexicographic_order nominal_primrec ccomp :: "cpsctxt => cpsctxt => cpsctxt" @@ -56,20 +52,16 @@ apply (simp add: eqvt_at_def swap_fresh_fresh) done -termination - by (relation "measure (\(x, _). size x)") (auto simp add: cpsctxt.size) - -lemma [eqvt]: "p \ ccomp c c' = ccomp (p \ c) (p \ c')" - by (nominal_induct c avoiding: c' rule: cpsctxt.strong_induct) simp_all +termination (eqvt) by lexicographic_order nominal_primrec CPSv :: "lt => lt" and CPS :: "lt => cpsctxt" where "CPSv (Var x) = x~" | "CPS (Var x) = CFun Hole (x~)" -| "atom b \ M \ CPSv (Abs y M) = Abs y (Abs b ((CPS M)))" -| "atom b \ M \ CPS (Abs y M) = CFun Hole (Abs y (Abs b ((CPS M))))" -| "CPSv (M $ N) = Abs x (Var x)" +| "atom b \ M \ CPSv (Lam y M) = Lam y (Lam b ((CPS M)))" +| "atom b \ M \ CPS (Lam y M) = CFun Hole (Lam y (Lam b ((CPS M))))" +| "CPSv (M $ N) = Lam x (Var x)" | "isValue M \ isValue N \ CPS (M $ N) = CArg (CPSv M $ CPSv N) Hole" | "isValue M \ ~isValue N \ atom a \ M \ CPS (M $ N) = ccomp (CPS N) (CAbs a (CArg (CPSv M $ Var a) Hole))" @@ -97,8 +89,8 @@ apply (simp_all add: fresh_Pair)[4] --"" apply (rule_tac x="(y, ya, b, ba, M, Ma)" and ?'a="name" in obtain_fresh) - apply (subgoal_tac "Abs b (Sum_Type.Projr (CPSv_CPS_sumC (Inr M))<(b~)>) = Abs a (Sum_Type.Projr (CPSv_CPS_sumC (Inr M))<(a~)>)") - apply (subgoal_tac "Abs ba (Sum_Type.Projr (CPSv_CPS_sumC (Inr Ma))<(ba~)>) = Abs a (Sum_Type.Projr (CPSv_CPS_sumC (Inr Ma))<(a~)>)") + apply (subgoal_tac "Lam b (Sum_Type.Projr (CPSv_CPS_sumC (Inr M))<(b~)>) = Lam a (Sum_Type.Projr (CPSv_CPS_sumC (Inr M))<(a~)>)") + apply (subgoal_tac "Lam ba (Sum_Type.Projr (CPSv_CPS_sumC (Inr Ma))<(ba~)>) = Lam a (Sum_Type.Projr (CPSv_CPS_sumC (Inr Ma))<(a~)>)") apply (simp only:) apply (erule Abs_lst1_fcb) apply (simp add: Abs_fresh_iff)