# HG changeset patch # User berghofe # Date 1184146566 -7200 # Node ID aca2c7f80e2fbcea34e41c629cb10c44c92a9e80 # Parent 90bccef650049c1c4be39588a0d1969fc206032e Renamed inductive2 to inductive. diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/CR.thy --- a/src/HOL/Nominal/Examples/CR.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/CR.thy Wed Jul 11 11:36:06 2007 +0200 @@ -147,7 +147,7 @@ section {* Beta Reduction *} -inductive2 +inductive "Beta" :: "lam\lam\bool" (" _ \\<^isub>\ _" [80,80] 80) where b1[intro]: "s1\\<^isub>\s2 \ (App s1 t)\\<^isub>\(App s2 t)" @@ -160,7 +160,7 @@ nominal_inductive Beta by (simp_all add: abs_fresh fresh_fact') -inductive2 +inductive "Beta_star" :: "lam\lam\bool" (" _ \\<^isub>\\<^sup>* _" [80,80] 80) where bs1[intro, simp]: "M \\<^isub>\\<^sup>* M" @@ -177,7 +177,7 @@ section {* One-Reduction *} -inductive2 +inductive One :: "lam\lam\bool" (" _ \\<^isub>1 _" [80,80] 80) where o1[intro!]: "M\\<^isub>1M" @@ -190,7 +190,7 @@ nominal_inductive One by (simp_all add: abs_fresh fresh_fact') -inductive2 +inductive "One_star" :: "lam\lam\bool" (" _ \\<^isub>1\<^sup>* _" [80,80] 80) where os1[intro, simp]: "M \\<^isub>1\<^sup>* M" @@ -272,7 +272,7 @@ shows "\t''. t'=Lam [a].t'' \ t\\<^isub>1t''" using a apply - - apply(ind_cases2 "(Lam [a].t)\\<^isub>1t'") + apply(ind_cases "(Lam [a].t)\\<^isub>1t'") apply(auto simp add: lam.inject alpha) apply(rule_tac x="[(a,aa)]\s2" in exI) apply(rule conjI) @@ -289,7 +289,7 @@ (\a s s1 s2. t1 = Lam [a].s \ a\(t2,s2) \ t' = s1[a::=s2] \ s \\<^isub>1 s1 \ t2 \\<^isub>1 s2)" using a apply - - apply(ind_cases2 "App t1 t2 \\<^isub>1 t'") + apply(ind_cases "App t1 t2 \\<^isub>1 t'") apply(auto simp add: lam.distinct lam.inject) done @@ -299,7 +299,7 @@ (\s1 s2. M = s1[a::=s2] \ t1 \\<^isub>1 s1 \ t2 \\<^isub>1 s2)" using a apply - - apply(ind_cases2 "App (Lam [a].t1) t2 \\<^isub>1 M") + apply(ind_cases "App (Lam [a].t1) t2 \\<^isub>1 M") apply(simp_all add: lam.inject) apply(force) apply(erule conjE) diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/CR_Takahashi.thy --- a/src/HOL/Nominal/Examples/CR_Takahashi.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/CR_Takahashi.thy Wed Jul 11 11:36:06 2007 +0200 @@ -71,7 +71,7 @@ section {* Beta-Reduction *} -inductive2 +inductive "Beta" :: "lam\lam\bool" (" _ \\<^isub>\ _" [80,80] 80) where b1[intro]: "t1 \\<^isub>\ t2 \ App t1 s \\<^isub>\ App t2 s" @@ -81,7 +81,7 @@ section {* Transitive Closure of Beta *} -inductive2 +inductive "Beta_star" :: "lam\lam\bool" (" _ \\<^isub>\\<^sup>* _" [80,80] 80) where bs1[intro]: "t \\<^isub>\\<^sup>* t" @@ -90,7 +90,7 @@ section {* One-Reduction *} -inductive2 +inductive One :: "lam\lam\bool" (" _ \\<^isub>1 _" [80,80] 80) where o1[intro]: "Var x\\<^isub>1 Var x" @@ -169,7 +169,7 @@ section {* Transitive Closure of One *} -inductive2 +inductive "One_star" :: "lam\lam\bool" (" _ \\<^isub>1\<^sup>* _" [80,80] 80) where os1[intro]: "t \\<^isub>1\<^sup>* t" @@ -178,7 +178,7 @@ section {* Complete Development Reduction *} -inductive2 +inductive Dev :: "lam \ lam \ bool" (" _ \\<^isub>d _" [80,80]80) where d1[intro]: "Var x \\<^isub>d Var x" diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/Compile.thy --- a/src/HOL/Nominal/Examples/Compile.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/Compile.thy Wed Jul 11 11:36:06 2007 +0200 @@ -50,7 +50,7 @@ text {* valid contexts *} -inductive2 +inductive valid :: "(name\'a::pt_name) list \ bool" where v1[intro]: "valid []" @@ -58,7 +58,7 @@ text {* typing judgements for trms *} -inductive2 +inductive typing :: "(name\ty) list\trm\ty\bool" (" _ \ _ : _ " [80,80,80] 80) where t0[intro]: "\valid \; (x,\)\set \\\ \ \ Var x : \" @@ -76,7 +76,7 @@ text {* typing judgements for Itrms *} -inductive2 +inductive Ityping :: "(name\tyI) list\trmI\tyI\bool" (" _ I\ _ : _ " [80,80,80] 80) where t0[intro]: "\valid \; (x,\)\set \\\ \ I\ IVar x : \" @@ -167,7 +167,7 @@ text {* big-step evaluation for trms *} -inductive2 +inductive big :: "trm\trm\bool" ("_ \ _" [80,80] 80) where b0[intro]: "Lam [x].e \ Lam [x].e" @@ -181,7 +181,7 @@ | b8[intro]: "\e\InL e'; e1[x::=e']\e''\ \ Case e of inl x1 \ e1 | inr x2 \ e2 \ e''" | b9[intro]: "\e\InR e'; e2[x::=e']\e''\ \ Case e of inl x1 \ e1 | inr x2 \ e2 \ e''" -inductive2 +inductive Ibig :: "((nat\nat)\trmI)\((nat\nat)\trmI)\bool" ("_ I\ _" [80,80] 80) where m0[intro]: "(m,ILam [x].e) I\ (m,ILam [x].e)" diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/Crary.thy --- a/src/HOL/Nominal/Examples/Crary.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/Crary.thy Wed Jul 11 11:36:06 2007 +0200 @@ -257,7 +257,7 @@ section {* Typing *} -inductive2 +inductive valid :: "Ctxt \ bool" where v_nil[intro]: "valid []" @@ -265,7 +265,7 @@ equivariance valid -inductive_cases2 +inductive_cases valid_cons_elim_auto[elim]:"valid ((x,T)#\)" abbreviation @@ -297,7 +297,7 @@ by (induct \) (auto dest!: fresh_context) -inductive2 +inductive typing :: "Ctxt\trm\ty\bool" (" _ \ _ : _ " [60,60,60] 60) where t_Var[intro]: "\valid \; (x,T)\set \\ \ \ \ Var x : T" @@ -319,7 +319,7 @@ declare trm.inject [simp add] declare ty.inject [simp add] -inductive_cases2 t_inv_auto[elim]: +inductive_cases t_inv_auto[elim]: "\ \ Lam [x].t : T" "\ \ Var x : T" "\ \ App x y : T" @@ -332,7 +332,7 @@ section {* Definitional Equivalence *} -inductive2 +inductive def_equiv :: "Ctxt\trm\trm\ty\bool" ("_ \ _ \ _ : _" [60,60] 60) where Q_Refl[intro]: "\ \ t : T \ \ \ t \ t : T" @@ -358,7 +358,7 @@ section {* Weak Head Reduction *} -inductive2 +inductive whr_def :: "trm\trm\bool" ("_ \ _" [80,80] 80) where QAR_Beta[intro]: "App (Lam [x]. t\<^isub>1) t\<^isub>2 \ t\<^isub>1[x::=t\<^isub>2]" @@ -367,7 +367,7 @@ declare trm.inject [simp add] declare ty.inject [simp add] -inductive_cases2 whr_inv_auto[elim]: +inductive_cases whr_inv_auto[elim]: "t \ t'" "Lam [x].t \ t'" "App (Lam [x].t12) t2 \ t" @@ -390,7 +390,7 @@ where "t\| \ \(\ u. t \ u)" -inductive2 +inductive whn_def :: "trm\trm\bool" ("_ \ _" [80,80] 80) where QAN_Reduce[intro]: "\s \ t; t \ u\ \ s \ u" @@ -398,7 +398,7 @@ declare trm.inject[simp] -inductive_cases2 whn_inv_auto[elim]: "t \ t'" +inductive_cases whn_inv_auto[elim]: "t \ t'" declare trm.inject[simp del] @@ -448,7 +448,7 @@ section {* Algorithmic Term Equivalence and Algorithmic Path Equivalence *} -inductive2 +inductive alg_equiv :: "Ctxt\trm\trm\ty\bool" ("_ \ _ \ _ : _" [60,60,60,60] 60) and alg_path_equiv :: "Ctxt\trm\trm\ty\bool" ("_ \ _ \ _ : _" [60,60,60,60] 60) @@ -470,11 +470,11 @@ declare trm.inject [simp add] declare ty.inject [simp add] -inductive_cases2 alg_equiv_inv_auto[elim]: +inductive_cases alg_equiv_inv_auto[elim]: "\ \ s\t : TBase" "\ \ s\t : T\<^isub>1 \ T\<^isub>2" -inductive_cases2 alg_path_equiv_inv_auto[elim]: +inductive_cases alg_path_equiv_inv_auto[elim]: "\ \ s\t : TBase" "\ \ s\t : TUnit" "\ \ s\t : T\<^isub>1 \ T\<^isub>2" diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/Fsub.thy --- a/src/HOL/Nominal/Examples/Fsub.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/Fsub.thy Wed Jul 11 11:36:06 2007 +0200 @@ -177,7 +177,7 @@ text {* Now validity of a context is a straightforward inductive definition. *} -inductive2 +inductive valid_rel :: "ty_context \ bool" ("\ _ ok" [100] 100) where valid_nil[simp]: "\ [] ok" @@ -279,7 +279,7 @@ does \emph{not} make the subtyping-relation ``partial"\ldots because we work over $\alpha$-equivalence classes.) *} -inductive2 +inductive subtype_of :: "ty_context \ ty \ ty \ bool" ("_\_<:_" [100,100,100] 100) where S_Top[intro]: "\\ \ ok; S closed_in \\ \ \ \ S <: Top" @@ -509,7 +509,7 @@ shows "\\ \ \[X<:S\<^isub>1].S\<^isub>2 <: T; X\\; X\S\<^isub>1\ \ T = Top \ (\T\<^isub>1 T\<^isub>2. T = \[X<:T\<^isub>1].T\<^isub>2 \ \ \ T\<^isub>1 <: S\<^isub>1 \ ((X,T\<^isub>1)#\) \ S\<^isub>2 <: T\<^isub>2)" apply(frule subtype_implies_ok) - apply(ind_cases2 "\ \ \[X<:S\<^isub>1].S\<^isub>2 <: T") + apply(ind_cases "\ \ \[X<:S\<^isub>1].S\<^isub>2 <: T") apply(auto simp add: ty.inject alpha) apply(rule_tac x="[(X,Xa)]\T\<^isub>2" in exI) apply(rule conjI) diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/LocalWeakening.thy --- a/src/HOL/Nominal/Examples/LocalWeakening.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/LocalWeakening.thy Wed Jul 11 11:36:06 2007 +0200 @@ -96,7 +96,7 @@ types cxt = "(name\ty) list" -inductive2 +inductive valid :: "cxt \ bool" where v1[intro]: "valid []" @@ -112,7 +112,7 @@ text {* "weak" typing relation *} -inductive2 +inductive typing :: "cxt\llam\ty\bool" (" _ \ _ : _ " [60,60,60] 60) where t_lPar[intro]: "\valid \; (x,T)\set \\\ \ \ lPar x : T" diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/SN.thy --- a/src/HOL/Nominal/Examples/SN.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/SN.thy Wed Jul 11 11:36:06 2007 +0200 @@ -59,7 +59,7 @@ by (nominal_induct t avoiding: \ c s rule: lam.induct) (auto simp add: fresh_list_cons fresh_atm forget lookup_fresh lookup_fresh') -inductive2 +inductive Beta :: "lam\lam\bool" (" _ \\<^isub>\ _" [80,80] 80) where b1[intro!]: "s1\\<^isub>\s2 \ (App s1 t)\\<^isub>\(App s2 t)" @@ -85,7 +85,7 @@ (auto intro!: simp add: abs_supp lam.supp subst_supp) lemma beta_abs: "Lam [a].t\\<^isub>\ t'\\t''. t'=Lam [a].t'' \ t\\<^isub>\ t''" -apply(ind_cases2 "Lam [a].t \\<^isub>\ t'") +apply(ind_cases "Lam [a].t \\<^isub>\ t'") apply(auto simp add: lam.distinct lam.inject) apply(auto simp add: alpha) apply(rule_tac x="[(a,aa)]\s2" in exI) @@ -138,7 +138,7 @@ (* valid contexts *) -inductive2 +inductive valid :: "(name\ty) list \ bool" where v1[intro]: "valid []" @@ -146,7 +146,7 @@ equivariance valid -inductive_cases2 valid_elim[elim]: "valid ((a,\)#\)" +inductive_cases valid_elim[elim]: "valid ((a,\)#\)" (* typing judgements *) @@ -160,7 +160,7 @@ apply(auto simp add: fresh_prod fresh_list_cons fresh_atm) done -inductive2 +inductive typing :: "(name\ty) list\lam\ty\bool" ("_ \ _ : _" [60,60,60] 60) where t1[intro]: "\valid \; (a,\)\set \\ \ \ \ Var a : \" @@ -195,17 +195,17 @@ constdefs "SN" :: "lam \ bool" - "SN t \ termi Beta t" + "SN t \ termip Beta t" lemma SN_preserved: "\SN(t1);t1\\<^isub>\ t2\\SN(t2)" apply(simp add: SN_def) -apply(drule_tac a="t2" in acc_downward) +apply(drule_tac a="t2" in accp_downward) apply(auto) done lemma SN_intro: "(\t2. t1\\<^isub>\t2 \ SN(t2))\SN(t1)" apply(simp add: SN_def) -apply(rule accI) +apply(rule accp.accI) apply(auto) done @@ -225,27 +225,27 @@ "NEUT t \ (\a. t=Var a)\(\t1 t2. t=App t1 t2)" (* a slight hack to get the first element of applications *) -inductive2 +inductive FST :: "lam\lam\bool" (" _ \ _" [80,80] 80) where fst[intro!]: "(App t s) \ t" lemma fst_elim[elim!]: shows "(App t s) \ t' \ t=t'" -apply(ind_cases2 "App t s \ t'") +apply(ind_cases "App t s \ t'") apply(simp add: lam.inject) done lemma qq3: "SN(App t s)\SN(t)" apply(simp add: SN_def) -apply(subgoal_tac "\z. (App t s \ z) \ termi Beta z")(*A*) +apply(subgoal_tac "\z. (App t s \ z) \ termip Beta z")(*A*) apply(force) (*A*) -apply(erule acc_induct) +apply(erule accp_induct) apply(clarify) -apply(ind_cases2 "x \ z" for x z) +apply(ind_cases "x \ z" for x z) apply(clarify) -apply(rule accI) +apply(rule accp.accI) apply(auto intro: b1) done @@ -275,7 +275,7 @@ lemma sub_ind: "SN(u)\(u\RED \\(\t. (NEUT t\CR2 \\CR3 \\CR3_RED t (\\\))\(App t u)\RED \))" apply(simp add: SN_def) -apply(erule acc_induct) +apply(erule accp_induct) apply(auto) apply(simp add: CR3_def) apply(rotate_tac 5) @@ -285,7 +285,7 @@ apply(force simp only: NEUT_def) apply(simp (no_asm) add: CR3_RED_def) apply(clarify) -apply(ind_cases2 "App t x \\<^isub>\ t'" for x t t') +apply(ind_cases "App t x \\<^isub>\ t'" for x t t') apply(simp_all add: lam.inject) apply(simp only: CR3_RED_def) apply(drule_tac x="s2" in spec) @@ -360,29 +360,29 @@ qed lemma double_acc_aux: - assumes a_acc: "acc r a" - and b_acc: "acc r b" + assumes a_acc: "accp r a" + and b_acc: "accp r b" and hyp: "\x z. - (\y. r y x \ acc r y) \ + (\y. r y x \ accp r y) \ (\y. r y x \ P y z) \ - (\u. r u z \ acc r u) \ + (\u. r u z \ accp r u) \ (\u. r u z \ P x u) \ P x z" shows "P a b" proof - from a_acc - have r: "\b. acc r b \ P a b" - proof (induct a rule: acc.induct) + have r: "\b. accp r b \ P a b" + proof (induct a rule: accp.induct) case (accI x) note accI' = accI - have "acc r b" by fact + have "accp r b" by fact thus ?case - proof (induct b rule: acc.induct) + proof (induct b rule: accp.induct) case (accI y) show ?case apply (rule hyp) apply (erule accI') apply (erule accI') - apply (rule acc.accI) + apply (rule accp.accI) apply (erule accI) apply (erule accI) apply (erule accI) @@ -393,7 +393,7 @@ qed lemma double_acc: - "\acc r a; acc r b; \x z. ((\y. r y x \ P y z) \ (\u. r u z \ P x u)) \ P x z\ \ P a b" + "\accp r a; accp r b; \x z. ((\y. r y x \ P y z) \ (\u. r u z \ P x u)) \ P x z\ \ P a b" apply(rule_tac r="r" in double_acc_aux) apply(assumption)+ apply(blast) @@ -402,7 +402,7 @@ lemma abs_RED: "(\s\RED \. t[x::=s]\RED \)\Lam [x].t\RED (\\\)" apply(simp) apply(clarify) -apply(subgoal_tac "termi Beta t")(*1*) +apply(subgoal_tac "termip Beta t")(*1*) apply(erule rev_mp) apply(subgoal_tac "u \ RED \")(*A*) apply(erule rev_mp) @@ -423,7 +423,7 @@ apply(force simp add: NEUT_def) apply(simp add: CR3_RED_def) apply(clarify) -apply(ind_cases2 "App(Lam[x].xa) z \\<^isub>\ t'" for xa z t') +apply(ind_cases "App(Lam[x].xa) z \\<^isub>\ t'" for xa z t') apply(auto simp add: lam.inject lam.distinct) apply(drule beta_abs) apply(auto) @@ -472,7 +472,7 @@ apply(force simp add: NEUT_def) apply(simp add: NORMAL_def) apply(clarify) -apply(ind_cases2 "Var x \\<^isub>\ t'" for t') +apply(ind_cases "Var x \\<^isub>\ t'" for t') apply(auto simp add: lam.inject lam.distinct) apply(force simp add: RED_props) apply(simp add: id_subs) diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/SOS.thy --- a/src/HOL/Nominal/Examples/SOS.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/SOS.thy Wed Jul 11 11:36:06 2007 +0200 @@ -207,7 +207,7 @@ text {* Typing-Judgements *} -inductive2 +inductive valid :: "(name \ 'a::pt_name) list \ bool" where v_nil[intro]: "valid []" @@ -215,7 +215,7 @@ equivariance valid -inductive_cases2 +inductive_cases valid_cons_inv_auto[elim]:"valid ((x,T)#\)" abbreviation @@ -253,7 +253,7 @@ ultimately show ?thesis by auto qed -inductive2 +inductive typing :: "(name\ty) list\trm\ty\bool" ("_ \ _ : _" [60,60,60] 60) where t_Var[intro]: "\valid \; (x,T)\set \\\ \ \ Var x : T" @@ -287,7 +287,7 @@ declare data.inject [simp add] -inductive_cases2 typing_inv_auto[elim]: +inductive_cases typing_inv_auto[elim]: "\ \ Lam [x].t : T" "\ \ Var x : T" "\ \ App x y : T" @@ -487,7 +487,7 @@ text {* Big-Step Evaluation *} -inductive2 +inductive big :: "trm\trm\bool" ("_ \ _" [80,80] 80) where b_Lam[intro]: "Lam [x].e \ Lam [x].e" @@ -530,7 +530,7 @@ declare ty.inject [simp add] declare data.inject [simp add] -inductive_cases2 b_inv_auto[elim]: +inductive_cases b_inv_auto[elim]: "App e\<^isub>1 e\<^isub>2 \ t" "Case e of inl x\<^isub>1 \ e\<^isub>1 | inr x\<^isub>2 \ e\<^isub>2 \ t" "Lam[x].t \ t" @@ -615,7 +615,7 @@ apply(assumption) done -inductive2 +inductive val :: "trm\bool" where v_Lam[intro]: "val (Lam [x].e)" @@ -628,7 +628,7 @@ declare ty.inject [simp add] declare data.inject [simp add] -inductive_cases2 v_inv_auto[elim]: +inductive_cases v_inv_auto[elim]: "val (Const n)" "val (Pr e\<^isub>1 e\<^isub>2)" "val (InL e)" diff -r 90bccef65004 -r aca2c7f80e2f src/HOL/Nominal/Examples/Weakening.thy --- a/src/HOL/Nominal/Examples/Weakening.thy Wed Jul 11 11:35:17 2007 +0200 +++ b/src/HOL/Nominal/Examples/Weakening.thy Wed Jul 11 11:36:06 2007 +0200 @@ -27,7 +27,7 @@ text {* valid contexts *} -inductive2 +inductive valid :: "(name\ty) list \ bool" where v1[intro]: "valid []" @@ -36,7 +36,7 @@ equivariance valid text{* typing judgements *} -inductive2 +inductive typing :: "(name\ty) list\lam\ty\bool" ("_ \ _ : _" [60,60,60] 60) where t_Var[intro]: "\valid \; (x,T)\set \\ \ \ \ Var x : T"