# HG changeset patch # User Christian Urban # Date 1283554094 -28800 # Node ID 4a6e78bd9de98462933b0464a4656b01a145c20a # Parent 7b1470b559365effbf9bc0f1c8b99f1bcdf2080a renamed alpha_gen -> alpha_set and Abs -> Abs_set etc diff -r 7b1470b55936 -r 4a6e78bd9de9 Nominal/Abs.thy --- a/Nominal/Abs.thy Sat Sep 04 06:23:31 2010 +0800 +++ b/Nominal/Abs.thy Sat Sep 04 06:48:14 2010 +0800 @@ -8,10 +8,10 @@ begin fun - alpha_gen + alpha_set where - alpha_gen[simp del]: - "alpha_gen (bs, x) R f pi (cs, y) \ + alpha_set[simp del]: + "alpha_set (bs, x) R f pi (cs, y) \ f x - bs = f y - cs \ (f x - bs) \* pi \ R (pi \ x) y \ @@ -36,17 +36,17 @@ R (pi \ x) y \ pi \ bs = cs" -lemmas alphas = alpha_gen.simps alpha_res.simps alpha_lst.simps +lemmas alphas = alpha_set.simps alpha_res.simps alpha_lst.simps notation - alpha_gen ("_ \gen _ _ _ _" [100, 100, 100, 100, 100] 100) and + alpha_set ("_ \set _ _ _ _" [100, 100, 100, 100, 100] 100) and alpha_res ("_ \res _ _ _ _" [100, 100, 100, 100, 100] 100) and alpha_lst ("_ \lst _ _ _ _" [100, 100, 100, 100, 100] 100) section {* Mono *} lemma [mono]: - shows "R1 \ R2 \ alpha_gen bs R1 \ alpha_gen bs R2" + shows "R1 \ R2 \ alpha_set bs R1 \ alpha_set bs R2" and "R1 \ R2 \ alpha_res bs R1 \ alpha_res bs R2" and "R1 \ R2 \ alpha_lst cs R1 \ alpha_lst cs R2" by (case_tac [!] bs, case_tac [!] cs) @@ -55,7 +55,7 @@ section {* Equivariance *} lemma alpha_eqvt[eqvt]: - shows "(bs, x) \gen R f q (cs, y) \ (p \ bs, p \ x) \gen (p \ R) (p \ f) (p \ q) (p \ cs, p \ y)" + shows "(bs, x) \set R f q (cs, y) \ (p \ bs, p \ x) \set (p \ R) (p \ f) (p \ q) (p \ cs, p \ y)" and "(bs, x) \res R f q (cs, y) \ (p \ bs, p \ x) \res (p \ R) (p \ f) (p \ q) (p \ cs, p \ y)" and "(ds, x) \lst R f q (es, y) \ (p \ ds, p \ x) \lst (p \ R) (p \ f) (p \ q) (p \ es, p \ y)" unfolding alphas @@ -70,7 +70,7 @@ lemma alpha_refl: assumes a: "R x x" - shows "(bs, x) \gen R f 0 (bs, x)" + shows "(bs, x) \set R f 0 (bs, x)" and "(bs, x) \res R f 0 (bs, x)" and "(cs, x) \lst R f 0 (cs, x)" using a @@ -80,7 +80,7 @@ lemma alpha_sym: assumes a: "R (p \ x) y \ R (- p \ y) x" - shows "(bs, x) \gen R f p (cs, y) \ (cs, y) \gen R f (- p) (bs, x)" + shows "(bs, x) \set R f p (cs, y) \ (cs, y) \set R f (- p) (bs, x)" and "(bs, x) \res R f p (cs, y) \ (cs, y) \res R f (- p) (bs, x)" and "(ds, x) \lst R f p (es, y) \ (es, y) \lst R f (- p) (ds, x)" unfolding alphas fresh_star_def @@ -89,7 +89,7 @@ lemma alpha_trans: assumes a: "\R (p \ x) y; R (q \ y) z\ \ R ((q + p) \ x) z" - shows "\(bs, x) \gen R f p (cs, y); (cs, y) \gen R f q (ds, z)\ \ (bs, x) \gen R f (q + p) (ds, z)" + shows "\(bs, x) \set R f p (cs, y); (cs, y) \set R f q (ds, z)\ \ (bs, x) \set R f (q + p) (ds, z)" and "\(bs, x) \res R f p (cs, y); (cs, y) \res R f q (ds, z)\ \ (bs, x) \res R f (q + p) (ds, z)" and "\(es, x) \lst R f p (gs, y); (gs, y) \lst R f q (hs, z)\ \ (es, x) \lst R f (q + p) (hs, z)" using a @@ -99,7 +99,7 @@ lemma alpha_sym_eqvt: assumes a: "R (p \ x) y \ R y (p \ x)" and b: "p \ R = R" - shows "(bs, x) \gen R f p (cs, y) \ (cs, y) \gen R f (- p) (bs, x)" + shows "(bs, x) \set R f p (cs, y) \ (cs, y) \set R f (- p) (bs, x)" and "(bs, x) \res R f p (cs, y) \ (cs, y) \res R f (- p) (bs, x)" and "(ds, x) \lst R f p (es, y) \ (es, y) \lst R f (- p) (ds, x)" apply(auto intro!: alpha_sym) @@ -113,12 +113,12 @@ apply(assumption) done -lemma alpha_gen_trans_eqvt: - assumes b: "(cs, y) \gen R f q (ds, z)" - and a: "(bs, x) \gen R f p (cs, y)" +lemma alpha_set_trans_eqvt: + assumes b: "(cs, y) \set R f q (ds, z)" + and a: "(bs, x) \set R f p (cs, y)" and d: "q \ R = R" and c: "\R (p \ x) y; R y (- q \ z)\ \ R (p \ x) (- q \ z)" - shows "(bs, x) \gen R f (q + p) (ds, z)" + shows "(bs, x) \set R f (q + p) (ds, z)" apply(rule alpha_trans) defer apply(rule a) @@ -173,16 +173,16 @@ apply(simp add: permute_eqvt[symmetric]) done -lemmas alpha_trans_eqvt = alpha_gen_trans_eqvt alpha_res_trans_eqvt alpha_lst_trans_eqvt +lemmas alpha_trans_eqvt = alpha_set_trans_eqvt alpha_res_trans_eqvt alpha_lst_trans_eqvt section {* General Abstractions *} fun - alpha_abs + alpha_abs_set where [simp del]: - "alpha_abs (bs, x) (cs, y) \ (\p. (bs, x) \gen (op=) supp p (cs, y))" + "alpha_abs_set (bs, x) (cs, y) \ (\p. (bs, x) \set (op=) supp p (cs, y))" fun alpha_abs_lst @@ -197,15 +197,15 @@ "alpha_abs_res (bs, x) (cs, y) \ (\p. (bs, x) \res (op=) supp p (cs, y))" notation - alpha_abs (infix "\abs" 50) and + alpha_abs_set (infix "\abs'_set" 50) and alpha_abs_lst (infix "\abs'_lst" 50) and alpha_abs_res (infix "\abs'_res" 50) -lemmas alphas_abs = alpha_abs.simps alpha_abs_res.simps alpha_abs_lst.simps +lemmas alphas_abs = alpha_abs_set.simps alpha_abs_res.simps alpha_abs_lst.simps lemma alphas_abs_refl: - shows "(bs, x) \abs (bs, x)" + shows "(bs, x) \abs_set (bs, x)" and "(bs, x) \abs_res (bs, x)" and "(cs, x) \abs_lst (cs, x)" unfolding alphas_abs @@ -215,7 +215,7 @@ (simp_all add: fresh_zero_perm) lemma alphas_abs_sym: - shows "(bs, x) \abs (cs, y) \ (cs, y) \abs (bs, x)" + shows "(bs, x) \abs_set (cs, y) \ (cs, y) \abs_set (bs, x)" and "(bs, x) \abs_res (cs, y) \ (cs, y) \abs_res (bs, x)" and "(ds, x) \abs_lst (es, y) \ (es, y) \abs_lst (ds, x)" unfolding alphas_abs @@ -225,7 +225,7 @@ (auto simp add: fresh_minus_perm) lemma alphas_abs_trans: - shows "\(bs, x) \abs (cs, y); (cs, y) \abs (ds, z)\ \ (bs, x) \abs (ds, z)" + shows "\(bs, x) \abs_set (cs, y); (cs, y) \abs_set (ds, z)\ \ (bs, x) \abs_set (ds, z)" and "\(bs, x) \abs_res (cs, y); (cs, y) \abs_res (ds, z)\ \ (bs, x) \abs_res (ds, z)" and "\(es, x) \abs_lst (gs, y); (gs, y) \abs_lst (hs, z)\ \ (es, x) \abs_lst (hs, z)" unfolding alphas_abs @@ -236,7 +236,7 @@ by (simp_all add: fresh_plus_perm) lemma alphas_abs_eqvt: - shows "(bs, x) \abs (cs, y) \ (p \ bs, p \ x) \abs (p \ cs, p \ y)" + shows "(bs, x) \abs_set (cs, y) \ (p \ bs, p \ x) \abs_set (p \ cs, p \ y)" and "(bs, x) \abs_res (cs, y) \ (p \ bs, p \ x) \abs_res (p \ cs, p \ y)" and "(ds, x) \abs_lst (es, y) \ (p \ ds, p \ x) \abs_lst (p \ es, p \ y)" unfolding alphas_abs @@ -249,7 +249,7 @@ by (auto simp add: fresh_star_permute_iff permute_eqvt[symmetric]) quotient_type - 'a abs_gen = "(atom set \ 'a::pt)" / "alpha_abs" + 'a abs_set = "(atom set \ 'a::pt)" / "alpha_abs_set" and 'b abs_res = "(atom set \ 'b::pt)" / "alpha_abs_res" and 'c abs_lst = "(atom list \ 'c::pt)" / "alpha_abs_lst" apply(rule_tac [!] equivpI) @@ -257,9 +257,9 @@ by (auto intro: alphas_abs_sym alphas_abs_refl alphas_abs_trans simp only:) quotient_definition - Abs ("[_]set. _" [60, 60] 60) + Abs_set ("[_]set. _" [60, 60] 60) where - "Abs::atom set \ ('a::pt) \ 'a abs_gen" + "Abs_set::atom set \ ('a::pt) \ 'a abs_set" is "Pair::atom set \ ('a::pt) \ (atom set \ 'a)" @@ -278,21 +278,21 @@ "Pair::atom list \ ('a::pt) \ (atom list \ 'a)" lemma [quot_respect]: - shows "(op= ===> op= ===> alpha_abs) Pair Pair" + shows "(op= ===> op= ===> alpha_abs_set) Pair Pair" and "(op= ===> op= ===> alpha_abs_res) Pair Pair" and "(op= ===> op= ===> alpha_abs_lst) Pair Pair" unfolding fun_rel_def by (auto intro: alphas_abs_refl) lemma [quot_respect]: - shows "(op= ===> alpha_abs ===> alpha_abs) permute permute" + shows "(op= ===> alpha_abs_set ===> alpha_abs_set) permute permute" and "(op= ===> alpha_abs_res ===> alpha_abs_res) permute permute" and "(op= ===> alpha_abs_lst ===> alpha_abs_lst) permute permute" unfolding fun_rel_def by (auto intro: alphas_abs_eqvt simp only: Pair_eqvt) lemma abs_exhausts: - shows "(\as (x::'a::pt). y1 = Abs as x \ P1) \ P1" + shows "(\as (x::'a::pt). y1 = Abs_set as x \ P1) \ P1" and "(\as (x::'a::pt). y2 = Abs_res as x \ P2) \ P2" and "(\as (x::'a::pt). y3 = Abs_lst as x \ P3) \ P3" by (lifting prod.exhaust[where 'a="atom set" and 'b="'a"] @@ -300,22 +300,22 @@ prod.exhaust[where 'a="atom list" and 'b="'a"]) lemma abs_eq_iff: - shows "Abs bs x = Abs cs y \ (bs, x) \abs (cs, y)" + shows "Abs_set bs x = Abs_set cs y \ (bs, x) \abs_set (cs, y)" and "Abs_res bs x = Abs_res cs y \ (bs, x) \abs_res (cs, y)" and "Abs_lst ds x = Abs_lst hs y \ (ds, x) \abs_lst (hs, y)" unfolding alphas_abs by (lifting alphas_abs) -instantiation abs_gen :: (pt) pt +instantiation abs_set :: (pt) pt begin quotient_definition - "permute_abs_gen::perm \ ('a::pt abs_gen) \ 'a abs_gen" + "permute_abs_set::perm \ ('a::pt abs_set) \ 'a abs_set" is "permute:: perm \ (atom set \ 'a::pt) \ (atom set \ 'a::pt)" lemma permute_Abs[simp]: fixes x::"'a::pt" - shows "(p \ (Abs as x)) = Abs (p \ as) (p \ x)" + shows "(p \ (Abs_set as x)) = Abs_set (p \ as) (p \ x)" by (lifting permute_prod.simps[where 'a="atom set" and 'b="'a"]) instance @@ -374,7 +374,7 @@ lemma abs_swap1: assumes a1: "a \ (supp x) - bs" and a2: "b \ (supp x) - bs" - shows "Abs bs x = Abs ((a \ b) \ bs) ((a \ b) \ x)" + shows "Abs_set bs x = Abs_set ((a \ b) \ bs) ((a \ b) \ x)" and "Abs_res bs x = Abs_res ((a \ b) \ bs) ((a \ b) \ x)" unfolding abs_eq_iff unfolding alphas_abs @@ -401,7 +401,7 @@ (auto simp add: supp_perm swap_atom) lemma abs_supports: - shows "((supp x) - as) supports (Abs as x)" + shows "((supp x) - as) supports (Abs_set as x)" and "((supp x) - as) supports (Abs_res as x)" and "((supp x) - set bs) supports (Abs_lst bs x)" unfolding supports_def @@ -409,15 +409,15 @@ by (simp_all add: abs_swap1[symmetric] abs_swap2[symmetric]) function - supp_gen :: "('a::pt) abs_gen \ atom set" + supp_set :: "('a::pt) abs_set \ atom set" where - "supp_gen (Abs as x) = supp x - as" + "supp_set (Abs_set as x) = supp x - as" apply(case_tac x rule: abs_exhausts(1)) apply(simp) apply(simp add: abs_eq_iff alphas_abs alphas) done -termination supp_gen +termination supp_set by (auto intro!: local.termination) function @@ -445,7 +445,7 @@ by (auto intro!: local.termination) lemma [eqvt]: - shows "(p \ supp_gen x) = supp_gen (p \ x)" + shows "(p \ supp_set x) = supp_set (p \ x)" and "(p \ supp_res y) = supp_res (p \ y)" and "(p \ supp_lst z) = supp_lst (p \ z)" apply(case_tac x rule: abs_exhausts(1)) @@ -457,7 +457,7 @@ done lemma aux_fresh: - shows "a \ Abs bs x \ a \ supp_gen (Abs bs x)" + shows "a \ Abs bs x \ a \ supp_set (Abs bs x)" and "a \ Abs_res bs x \ a \ supp_res (Abs_res bs x)" and "a \ Abs_lst cs x \ a \ supp_lst (Abs_lst cs x)" by (rule_tac [!] fresh_fun_eqvt_app) @@ -465,7 +465,7 @@ lemma supp_abs_subset1: assumes a: "finite (supp x)" - shows "(supp x) - as \ supp (Abs as x)" + shows "(supp x) - as \ supp (Abs_set as x)" and "(supp x) - as \ supp (Abs_res as x)" and "(supp x) - (set bs) \ supp (Abs_lst bs x)" unfolding supp_conv_fresh @@ -474,7 +474,7 @@ lemma supp_abs_subset2: assumes a: "finite (supp x)" - shows "supp (Abs as x) \ (supp x) - as" + shows "supp (Abs_set as x) \ (supp x) - as" and "supp (Abs_res as x) \ (supp x) - as" and "supp (Abs_lst bs x) \ (supp x) - (set bs)" by (rule_tac [!] supp_is_subset) @@ -482,7 +482,7 @@ lemma abs_finite_supp: assumes a: "finite (supp x)" - shows "supp (Abs as x) = (supp x) - as" + shows "supp (Abs_set as x) = (supp x) - as" and "supp (Abs_res as x) = (supp x) - as" and "supp (Abs_lst bs x) = (supp x) - (set bs)" by (rule_tac [!] subset_antisym) @@ -490,13 +490,13 @@ lemma supp_abs: fixes x::"'a::fs" - shows "supp (Abs as x) = (supp x) - as" + shows "supp (Abs_set as x) = (supp x) - as" and "supp (Abs_res as x) = (supp x) - as" and "supp (Abs_lst bs x) = (supp x) - (set bs)" by (rule_tac [!] abs_finite_supp) (simp_all add: finite_supp) -instance abs_gen :: (fs) fs +instance abs_set :: (fs) fs apply(default) apply(case_tac x rule: abs_exhausts(1)) apply(simp add: supp_abs finite_supp) @@ -516,7 +516,7 @@ lemma abs_fresh_iff: fixes x::"'a::fs" - shows "a \ Abs bs x \ a \ bs \ (a \ bs \ a \ x)" + shows "a \ Abs_set bs x \ a \ bs \ (a \ bs \ a \ x)" and "a \ Abs_res bs x \ a \ bs \ (a \ bs \ a \ x)" and "a \ Abs_lst cs x \ a \ (set cs) \ (a \ (set cs) \ a \ x)" unfolding fresh_def @@ -524,7 +524,7 @@ by auto lemma Abs_eq_iff: - shows "Abs bs x = Abs cs y \ (\p. (bs, x) \gen (op =) supp p (cs, y))" + shows "Abs_set bs x = Abs_set cs y \ (\p. (bs, x) \set (op =) supp p (cs, y))" and "Abs_res bs x = Abs_res cs y \ (\p. (bs, x) \res (op =) supp p (cs, y))" and "Abs_lst bsl x = Abs_lst csl y \ (\p. (bsl, x) \lst (op =) supp p (csl, y))" by (lifting alphas_abs) diff -r 7b1470b55936 -r 4a6e78bd9de9 Nominal/nominal_dt_alpha.ML --- a/Nominal/nominal_dt_alpha.ML Sat Sep 04 06:23:31 2010 +0800 +++ b/Nominal/nominal_dt_alpha.ML Sat Sep 04 06:48:14 2010 +0800 @@ -88,7 +88,7 @@ val (alpha_name, binder_ty) = case bmode of Lst => (@{const_name "alpha_lst"}, @{typ "atom list"}) - | Set => (@{const_name "alpha_gen"}, @{typ "atom set"}) + | Set => (@{const_name "alpha_set"}, @{typ "atom set"}) | Res => (@{const_name "alpha_res"}, @{typ "atom set"}) val ty = fastype_of args val pair_ty = HOLogic.mk_prodT (binder_ty, ty)