# HG changeset patch # User Cezary Kaliszyk # Date 1324450062 -32400 # Node ID 5e74bd87bcda558bc9b23daf1151a0d3cb685bbd # Parent c95afd0dc594878bc586be265f2bc3406a2c5e62 SFT/LambdaTerms: rename 'var' to 'name' to match Lambda. diff -r c95afd0dc594 -r 5e74bd87bcda Nominal/Ex/SFT/Consts.thy --- a/Nominal/Ex/SFT/Consts.thy Wed Dec 21 15:43:58 2011 +0900 +++ b/Nominal/Ex/SFT/Consts.thy Wed Dec 21 15:47:42 2011 +0900 @@ -84,7 +84,7 @@ by (rule_tac y="x" and c="0 :: perm" in lam.strong_exhaust) (auto simp add: Abs1_eq_iff fresh_star_def)[3] next - fix x :: var and M and xa :: var and Ma + fix x :: name and M and xa :: name and Ma assume "[[atom x]]lst. M = [[atom xa]]lst. Ma" "eqvt_at Numeral_sumC M" then show "[[atom x]]lst. Numeral_sumC M = [[atom xa]]lst. Numeral_sumC Ma" @@ -110,7 +110,7 @@ "x \ \y\ = x \ y" unfolding fresh_def by simp -fun app_lst :: "var \ lam list \ lam" where +fun app_lst :: "name \ lam list \ lam" where "app_lst n [] = Var n" | "app_lst n (h # t) = (app_lst n t) \ h" @@ -134,7 +134,7 @@ [simp del]: "atom x \ l \ \l\ = \x. (app_lst x (rev l))" unfolding eqvt_def Ltgt_graph_def apply (rule, perm_simp, rule, rule) - apply (rule_tac x="x" and ?'a="var" in obtain_fresh) + apply (rule_tac x="x" and ?'a="name" in obtain_fresh) apply (simp_all add: Abs1_eq_iff lam.fresh swap_fresh_fresh fresh_at_base) apply (simp add: eqvts swap_fresh_fresh) apply (case_tac "x = xa") @@ -149,14 +149,14 @@ lemma ltgt_eq_iff[simp]: "\M\ = \N\ \ M = N" proof auto - obtain x :: var where "atom x \ (M, N)" using obtain_fresh by auto + obtain x :: name where "atom x \ (M, N)" using obtain_fresh by auto then have *: "atom x \ M" "atom x \ N" using fresh_Pair by simp_all then show "(\M\ = \N\) \ (M = N)" by (simp add: Abs1_eq_iff app_lst_rev_eq_iff Ltgt.simps) qed lemma Ltgt1_app: "\[M]\ \ N \ N \ M" proof - - obtain x :: var where "atom x \ (M, N)" using obtain_fresh by auto + obtain x :: name where "atom x \ (M, N)" using obtain_fresh by auto then have "atom x \ M" "atom x \ N" using fresh_Pair by simp_all then show ?thesis apply (subst Ltgt.simps) @@ -167,7 +167,7 @@ lemma Ltgt3_app: "\[M,N,P]\ \ R \ R \ M \ N \ P" proof - - obtain x :: var where "atom x \ (M, N, P, R)" using obtain_fresh by auto + obtain x :: name where "atom x \ (M, N, P, R)" using obtain_fresh by auto then have *: "atom x \ (M,N,P)" "atom x \ R" using fresh_Pair by simp_all then have s: "Var x \ M \ N \ P [x ::= R] \ R \ M \ N \ P" using b1 by simp show ?thesis using * @@ -181,7 +181,7 @@ lemma supp_ltgt[simp]: "supp \t\ = supp t" proof - - obtain x :: var where *:"atom x \ t" using obtain_fresh by auto + obtain x :: name where *:"atom x \ t" using obtain_fresh by auto show ?thesis using * by (simp_all add: Ltgt.simps lam.supp supp_at_base supp_Nil supp_app_lst supp_rev fresh_def) qed @@ -194,7 +194,7 @@ lemma Ltgt1_subst[simp]: "\[M]\ [y ::= A] = \[M [y ::= A]]\" proof - - obtain x :: var where a: "atom x \ (M, A, y, M [y ::= A])" using obtain_fresh by blast + obtain x :: name where a: "atom x \ (M, A, y, M [y ::= A])" using obtain_fresh by blast have "x \ y" using a[simplified fresh_Pair fresh_at_base] by simp then show ?thesis apply (subst Ltgt.simps) @@ -242,8 +242,8 @@ assumes f: "atom x \ A" "atom x \ B" (* or A and B have empty support *) shows "F3 \ A \ B \ APP \ \Abs\ \ (Abs \ (\x. (B \ (A \ Var x))))" proof - - obtain y :: var where b: "atom y \ (x, A, B)" using obtain_fresh by blast - obtain z :: var where c: "atom z \ (x, y, A, B)" using obtain_fresh by blast + obtain y :: name where b: "atom y \ (x, A, B)" using obtain_fresh by blast + obtain z :: name where c: "atom z \ (x, y, A, B)" using obtain_fresh by blast have *: "x \ z" "x \ y" "y \ z" using b c by (simp_all add: fresh_Pair fresh_at_base) blast+ have **: diff -r c95afd0dc594 -r 5e74bd87bcda Nominal/Ex/SFT/LambdaTerms.thy --- a/Nominal/Ex/SFT/LambdaTerms.thy Wed Dec 21 15:43:58 2011 +0900 +++ b/Nominal/Ex/SFT/LambdaTerms.thy Wed Dec 21 15:47:42 2011 +0900 @@ -5,25 +5,25 @@ lemma [simp]: "supp x = {} \ y \ x" unfolding fresh_def by blast -atom_decl var +atom_decl name nominal_datatype lam = - Var "var" + Var "name" | App "lam" "lam" -| Lam x::"var" l::"lam" binds x in l ("Lam [_]. _" [100, 100] 100) +| Lam x::"name" l::"lam" binds x in l ("Lam [_]. _" [100, 100] 100) notation App (infixl "\" 98) and Lam ("\ _. _" [97, 97] 99) nominal_primrec - subst :: "lam \ var \ lam \ lam" ("_ [_ ::= _]" [90, 90, 90] 90) + subst :: "lam \ name \ lam \ lam" ("_ [_ ::= _]" [90, 90, 90] 90) where "(Var x)[y ::= s] = (if x = y then s else (Var x))" | "(t1 \ t2)[y ::= s] = (t1[y ::= s]) \ (t2[y ::= s])" | "atom x \ (y, s) \ (\x. t)[y ::= s] = \x.(t[y ::= s])" proof auto - fix a b :: lam and aa :: var and P + fix a b :: lam and aa :: name and P assume "\x y s. a = Var x \ aa = y \ b = s \ P" "\t1 t2 y s. a = t1 \ t2 \ aa = y \ b = s \ P" "\x y s t. \atom x \ (y, s); a = \ x. t \ aa = y \ b = s\ \ P" @@ -31,7 +31,7 @@ by (rule_tac y="a" and c="(aa, b)" in lam.strong_exhaust) (blast, blast, simp add: fresh_star_def) next - fix x :: var and t and xa :: var and ya sa ta + fix x :: name and t and xa :: name and ya sa ta assume *: "eqvt_at subst_sumC (t, ya, sa)" "atom x \ (ya, sa)" "atom xa \ (ya, sa)" "[[atom x]]lst. t = [[atom xa]]lst. ta" diff -r c95afd0dc594 -r 5e74bd87bcda Nominal/Ex/SFT/Theorem.thy --- a/Nominal/Ex/SFT/Theorem.thy Wed Dec 21 15:43:58 2011 +0900 +++ b/Nominal/Ex/SFT/Theorem.thy Wed Dec 21 15:47:42 2011 +0900 @@ -55,7 +55,7 @@ fixes F :: lam shows "\X. X \ F \ \X\" proof - - obtain x :: var where [simp]:"atom x \ F" using obtain_fresh by blast + obtain x :: name where [simp]:"atom x \ F" using obtain_fresh by blast def W \ "\x. (F \ (APP \ Var x \ (Num \ Var x)))" def X \ "W \ \W\" have a: "X = W \ \W\" unfolding X_def .. diff -r c95afd0dc594 -r 5e74bd87bcda Nominal/Ex/SFT/Utils.thy --- a/Nominal/Ex/SFT/Utils.thy Wed Dec 21 15:43:58 2011 +0900 +++ b/Nominal/Ex/SFT/Utils.thy Wed Dec 21 15:47:42 2011 +0900 @@ -12,7 +12,7 @@ and su: "\x. atom x \ A \ F (V x) [x ::= A] = F A" shows "L \ A \ F A" proof - - obtain x :: var where a: "atom x \ A" using obtain_fresh by blast + obtain x :: name where a: "atom x \ A" using obtain_fresh by blast show ?thesis by (simp add: leq[of x], rule b3, rule bI, simp add: su b1 a) qed @@ -23,9 +23,9 @@ x \ y \ F (V x) (V y) [x ::= A] [y ::= B] = F A B" shows "L \ A \ B \ F A B" proof - - obtain x :: var where a: "atom x \ (A, B)" using obtain_fresh by blast - obtain y :: var where b: "atom y \ (x, A, B)" using obtain_fresh by blast - obtain z :: var where c: "atom z \ (x, y, A, B)" using obtain_fresh by blast + obtain x :: name where a: "atom x \ (A, B)" using obtain_fresh by blast + obtain y :: name where b: "atom y \ (x, A, B)" using obtain_fresh by blast + obtain z :: name where c: "atom z \ (x, y, A, B)" using obtain_fresh by blast have *: "x \ y" "x \ z" "y \ z" using a b c by (simp_all add: fresh_Pair fresh_at_base) blast+ have ** : "atom y \ z" "atom x \ z" "atom y \ x" @@ -51,9 +51,9 @@ ((F (V x) (V y) (V z))[x ::= A] [y ::= B] [z ::= C] = F A B C)" shows "L \ A \ B \ C \ F A B C" proof - - obtain x :: var where a: "atom x \ (A, B, C)" using obtain_fresh by blast - obtain y :: var where b: "atom y \ (x, A, B, C)" using obtain_fresh by blast - obtain z :: var where c: "atom z \ (x, y, A, B, C)" using obtain_fresh by blast + obtain x :: name where a: "atom x \ (A, B, C)" using obtain_fresh by blast + obtain y :: name where b: "atom y \ (x, A, B, C)" using obtain_fresh by blast + obtain z :: name where c: "atom z \ (x, y, A, B, C)" using obtain_fresh by blast have *: "x \ y" "y \ z" "z \ x" using a b c by (simp_all add: fresh_Pair fresh_at_base) blast+ have ** : "atom y \ z" "atom x \ z" "atom y \ x" @@ -72,14 +72,14 @@ done qed -definition cn :: "nat \ var" where "cn n \ Abs_var (Atom (Sort ''LambdaTerms.var'' []) n)" +definition cn :: "nat \ name" where "cn n \ Abs_name (Atom (Sort ''LambdaTerms.name'' []) n)" lemma cnd[simp]: "m \ n \ cn m \ cn n" - unfolding cn_def using Abs_var_inject by simp + unfolding cn_def using Abs_name_inject by simp -definition cx :: var where "cx \ cn 0" -definition cy :: var where "cy \ cn 1" -definition cz :: var where "cz \ cn 2" +definition cx :: name where "cx \ cn 0" +definition cy :: name where "cy \ cn 1" +definition cz :: name where "cz \ cn 2" lemma cx_cy_cz[simp]: "cx \ cy" "cx \ cz" "cz \ cy"