# HG changeset patch # User berghofe # Date 1184145394 -7200 # Node ID b07cff284683589712db4857f8e82bd3b445b0cd # Parent a455e69c31cc8a44cd983a03e6ae623239f2acfc Renamed inductive2 to inductive. diff -r a455e69c31cc -r b07cff284683 src/HOL/Bali/AxSem.thy --- a/src/HOL/Bali/AxSem.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Bali/AxSem.thy Wed Jul 11 11:16:34 2007 +0200 @@ -476,7 +476,7 @@ change_claset (fn cs => cs delSWrapper "split_all_tac"); *} -inductive2 +inductive ax_derivs :: "prog \ 'a triples \ 'a triples \ bool" ("_,_|\_" [61,58,58] 57) and ax_deriv :: "prog \ 'a triples \ 'a triple \ bool" ("_,_\_" [61,58,58] 57) for G :: prog diff -r a455e69c31cc -r b07cff284683 src/HOL/Bali/DeclConcepts.thy --- a/src/HOL/Bali/DeclConcepts.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Bali/DeclConcepts.thy Wed Jul 11 11:16:34 2007 +0200 @@ -541,7 +541,7 @@ below *) -inductive2 +inductive members :: "prog \ (qtname \ memberdecl) \ qtname \ bool" ("_ \ _ member'_of _" [61,61,61] 60) for G :: prog @@ -634,7 +634,7 @@ text {* Static overriding (used during the typecheck of the compiler) *} -inductive2 +inductive stat_overridesR :: "prog \ (qtname \ mdecl) \ (qtname \ mdecl) \ bool" ("_ \ _ overrides\<^sub>S _" [61,61,61] 60) for G :: prog @@ -653,7 +653,7 @@ text {* Dynamic overriding (used during the typecheck of the compiler) *} -inductive2 +inductive overridesR :: "prog \ (qtname \ mdecl) \ (qtname \ mdecl) \ bool" ("_ \ _ overrides _" [61,61,61] 60) for G :: prog @@ -784,7 +784,7 @@ \end{itemize} *} -inductive2 +inductive accessible_fromR :: "prog \ qtname \ (qtname \ memberdecl) \ qtname \ bool" and accessible_from :: "prog \ (qtname \ memberdecl) \ qtname \ qtname \ bool" ("_ \ _ of _ accessible'_from _" [61,61,61,61] 60) @@ -828,7 +828,7 @@ "G\Field fn f of C accessible_from accclass" \ "G\(fieldm fn f) of C accessible_from accclass" -inductive2 +inductive dyn_accessible_fromR :: "prog \ qtname \ (qtname \ memberdecl) \ qtname \ bool" and dyn_accessible_from' :: "prog \ (qtname \ memberdecl) \ qtname \ qtname \ bool" ("_ \ _ in _ dyn'_accessible'_from _" [61,61,61,61] 60) diff -r a455e69c31cc -r b07cff284683 src/HOL/Bali/DefiniteAssignment.thy --- a/src/HOL/Bali/DefiniteAssignment.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Bali/DefiniteAssignment.thy Wed Jul 11 11:16:34 2007 +0200 @@ -533,7 +533,7 @@ distinguish boolean and other expressions. *} -inductive2 +inductive da :: "env \ lname set \ term \ assigned \ bool" ("_\ _ \_\ _" [65,65,65,65] 71) where Skip: "Env\ B \\Skip\\ \nrm=B,brk=\ l. UNIV\" @@ -823,7 +823,7 @@ ML_setup {* change_simpset (fn ss => ss delloop "split_all_tac"); *} -inductive_cases2 da_elim_cases [cases set]: +inductive_cases da_elim_cases [cases set]: "Env\ B \\Skip\\ A" "Env\ B \In1r Skip\ A" "Env\ B \\Expr e\\ A" diff -r a455e69c31cc -r b07cff284683 src/HOL/Bali/Eval.thy --- a/src/HOL/Bali/Eval.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Bali/Eval.thy Wed Jul 11 11:16:34 2007 +0200 @@ -474,7 +474,7 @@ section "evaluation judgments" -inductive2 +inductive halloc :: "[prog,state,obj_tag,loc,state]\bool" ("_\_ \halloc _\_\ _"[61,61,61,61,61]60) for G::prog where --{* allocating objects on the heap, cf. 12.5 *} @@ -487,7 +487,7 @@ \ G\Norm s \halloc oi\a\ (x,init_obj G oi' (Heap a) s)" -inductive2 sxalloc :: "[prog,state,state]\bool" ("_\_ \sxalloc\ _"[61,61,61]60) for G::prog +inductive sxalloc :: "[prog,state,state]\bool" ("_\_ \sxalloc\ _"[61,61,61]60) for G::prog where --{* allocating exception objects for standard exceptions (other than OutOfMemory) *} @@ -503,7 +503,7 @@ G\(Some (Xcpt (Std xn)),s0) \sxalloc\ (Some (Xcpt (Loc a)),s1)" -inductive2 +inductive eval :: "[prog,state,term,vals,state]\bool" ("_\_ \_\\ '(_, _')" [61,61,80,0,0]60) and exec ::"[prog,state,stmt ,state]\bool"("_\_ \_\ _" [61,61,65, 61]60) and evar ::"[prog,state,var ,vvar,state]\bool"("_\_ \_=\_\ _"[61,61,90,61,61]60) @@ -765,17 +765,17 @@ declare split_if [split del] split_if_asm [split del] option.split [split del] option.split_asm [split del] -inductive_cases2 halloc_elim_cases: +inductive_cases halloc_elim_cases: "G\(Some xc,s) \halloc oi\a\ s'" "G\(Norm s) \halloc oi\a\ s'" -inductive_cases2 sxalloc_elim_cases: +inductive_cases sxalloc_elim_cases: "G\ Norm s \sxalloc\ s'" "G\(Some (Jump j),s) \sxalloc\ s'" "G\(Some (Error e),s) \sxalloc\ s'" "G\(Some (Xcpt (Loc a )),s) \sxalloc\ s'" "G\(Some (Xcpt (Std xn)),s) \sxalloc\ s'" -inductive_cases2 sxalloc_cases: "G\s \sxalloc\ s'" +inductive_cases sxalloc_cases: "G\s \sxalloc\ s'" lemma sxalloc_elim_cases2: "\G\s \sxalloc\ s'; \s. \s' = Norm s\ \ P; @@ -793,9 +793,9 @@ ML_setup {* change_simpset (fn ss => ss delloop "split_all_tac"); *} -inductive_cases2 eval_cases: "G\s \t\\ (v, s')" +inductive_cases eval_cases: "G\s \t\\ (v, s')" -inductive_cases2 eval_elim_cases [cases set]: +inductive_cases eval_elim_cases [cases set]: "G\(Some xc,s) \t \\ (v, s')" "G\Norm s \In1r Skip \\ (x, s')" "G\Norm s \In1r (Jmp j) \\ (x, s')" diff -r a455e69c31cc -r b07cff284683 src/HOL/Bali/Evaln.thy --- a/src/HOL/Bali/Evaln.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Bali/Evaln.thy Wed Jul 11 11:16:34 2007 +0200 @@ -28,7 +28,7 @@ for welltyped, and definitely assigned terms. *} -inductive2 +inductive evaln :: "[prog, state, term, nat, vals, state] \ bool" ("_\_ \_\\_\ '(_, _')" [61,61,80,61,0,0] 60) and evarn :: "[prog, state, var, vvar, nat, state] \ bool" @@ -201,9 +201,9 @@ ML_setup {* change_simpset (fn ss => ss delloop "split_all_tac"); *} -inductive_cases2 evaln_cases: "G\s \t\\n\ (v, s')" +inductive_cases evaln_cases: "G\s \t\\n\ (v, s')" -inductive_cases2 evaln_elim_cases: +inductive_cases evaln_elim_cases: "G\(Some xc, s) \t \\n\ (v, s')" "G\Norm s \In1r Skip \\n\ (x, s')" "G\Norm s \In1r (Jmp j) \\n\ (x, s')" diff -r a455e69c31cc -r b07cff284683 src/HOL/Bali/Trans.thy --- a/src/HOL/Bali/Trans.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Bali/Trans.thy Wed Jul 11 11:16:34 2007 +0200 @@ -68,7 +68,7 @@ "Ref a" == "Lit (Addr a)" "SKIP" == "Lit Unit" -inductive2 +inductive step :: "[prog,term \ state,term \ state] \ bool" ("_\_ \1 _"[61,82,82] 81) for G :: prog where diff -r a455e69c31cc -r b07cff284683 src/HOL/Bali/TypeRel.thy --- a/src/HOL/Bali/TypeRel.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Bali/TypeRel.thy Wed Jul 11 11:16:34 2007 +0200 @@ -351,7 +351,7 @@ done -inductive2 --{* implementation, cf. 8.1.4 *} +inductive --{* implementation, cf. 8.1.4 *} implmt :: "prog \ qtname \ qtname \ bool" ("_\_\_" [71,71,71] 70) for G :: prog where @@ -385,7 +385,7 @@ section "widening relation" -inductive2 +inductive --{*widening, viz. method invocation conversion, cf. 5.3 i.e. kind of syntactic subtyping *} widen :: "prog \ ty \ ty \ bool" ("_\_\_" [71,71,71] 70) @@ -407,14 +407,14 @@ lemma widen_PrimT: "G\PrimT x\T \ T = PrimT x" *) lemma widen_PrimT: "G\PrimT x\T \ (\y. T = PrimT y)" -apply (ind_cases2 "G\PrimT x\T") +apply (ind_cases "G\PrimT x\T") by auto (* too strong in general: lemma widen_PrimT2: "G\S\PrimT x \ S = PrimT x" *) lemma widen_PrimT2: "G\S\PrimT x \ \y. S = PrimT y" -apply (ind_cases2 "G\S\PrimT x") +apply (ind_cases "G\S\PrimT x") by auto text {* @@ -424,37 +424,37 @@ *} lemma widen_PrimT_strong: "G\PrimT x\T \ T = PrimT x" -by (ind_cases2 "G\PrimT x\T") simp_all +by (ind_cases "G\PrimT x\T") simp_all lemma widen_PrimT2_strong: "G\S\PrimT x \ S = PrimT x" -by (ind_cases2 "G\S\PrimT x") simp_all +by (ind_cases "G\S\PrimT x") simp_all text {* Specialized versions for booleans also would work for real Java *} lemma widen_Boolean: "G\PrimT Boolean\T \ T = PrimT Boolean" -by (ind_cases2 "G\PrimT Boolean\T") simp_all +by (ind_cases "G\PrimT Boolean\T") simp_all lemma widen_Boolean2: "G\S\PrimT Boolean \ S = PrimT Boolean" -by (ind_cases2 "G\S\PrimT Boolean") simp_all +by (ind_cases "G\S\PrimT Boolean") simp_all lemma widen_RefT: "G\RefT R\T \ \t. T=RefT t" -apply (ind_cases2 "G\RefT R\T") +apply (ind_cases "G\RefT R\T") by auto lemma widen_RefT2: "G\S\RefT R \ \t. S=RefT t" -apply (ind_cases2 "G\S\RefT R") +apply (ind_cases "G\S\RefT R") by auto lemma widen_Iface: "G\Iface I\T \ T=Class Object \ (\J. T=Iface J)" -apply (ind_cases2 "G\Iface I\T") +apply (ind_cases "G\Iface I\T") by auto lemma widen_Iface2: "G\S\ Iface J \ S = NT \ (\I. S = Iface I) \ (\D. S = Class D)" -apply (ind_cases2 "G\S\ Iface J") +apply (ind_cases "G\S\ Iface J") by auto lemma widen_Iface_Iface: "G\Iface I\ Iface J \ G\I\I J" -apply (ind_cases2 "G\Iface I\ Iface J") +apply (ind_cases "G\Iface I\ Iface J") by auto lemma widen_Iface_Iface_eq [simp]: "G\Iface I\ Iface J = G\I\I J" @@ -464,15 +464,15 @@ done lemma widen_Class: "G\Class C\T \ (\D. T=Class D) \ (\I. T=Iface I)" -apply (ind_cases2 "G\Class C\T") +apply (ind_cases "G\Class C\T") by auto lemma widen_Class2: "G\S\ Class C \ C = Object \ S = NT \ (\D. S = Class D)" -apply (ind_cases2 "G\S\ Class C") +apply (ind_cases "G\S\ Class C") by auto lemma widen_Class_Class: "G\Class C\ Class cm \ G\C\\<^sub>C cm" -apply (ind_cases2 "G\Class C\ Class cm") +apply (ind_cases "G\Class C\ Class cm") by auto lemma widen_Class_Class_eq [simp]: "G\Class C\ Class cm = G\C\\<^sub>C cm" @@ -482,7 +482,7 @@ done lemma widen_Class_Iface: "G\Class C\ Iface I \ G\C\I" -apply (ind_cases2 "G\Class C\ Iface I") +apply (ind_cases "G\Class C\ Iface I") by auto lemma widen_Class_Iface_eq [simp]: "G\Class C\ Iface I = G\C\I" @@ -492,21 +492,21 @@ done lemma widen_Array: "G\S.[]\T \ T=Class Object \ (\T'. T=T'.[] \ G\S\T')" -apply (ind_cases2 "G\S.[]\T") +apply (ind_cases "G\S.[]\T") by auto lemma widen_Array2: "G\S\T.[] \ S = NT \ (\S'. S=S'.[] \ G\S'\T)" -apply (ind_cases2 "G\S\T.[]") +apply (ind_cases "G\S\T.[]") by auto lemma widen_ArrayPrimT: "G\PrimT t.[]\T \ T=Class Object \ T=PrimT t.[]" -apply (ind_cases2 "G\PrimT t.[]\T") +apply (ind_cases "G\PrimT t.[]\T") by auto lemma widen_ArrayRefT: "G\RefT t.[]\T \ T=Class Object \ (\s. T=RefT s.[] \ G\RefT t\RefT s)" -apply (ind_cases2 "G\RefT t.[]\T") +apply (ind_cases "G\RefT t.[]\T") by auto lemma widen_ArrayRefT_ArrayRefT_eq [simp]: @@ -527,7 +527,7 @@ lemma widen_NT2: "G\S\NT \ S = NT" -apply (ind_cases2 "G\S\NT") +apply (ind_cases "G\S\NT") by auto lemma widen_Object:"\isrtype G T;ws_prog G\ \ G\RefT T \ Class Object" @@ -610,7 +610,7 @@ *) (* more detailed than necessary for type-safety, see above rules. *) -inductive2 --{* narrowing reference conversion, cf. 5.1.5 *} +inductive --{* narrowing reference conversion, cf. 5.1.5 *} narrow :: "prog \ ty \ ty \ bool" ("_\_\_" [71,71,71] 70) for G :: prog where @@ -625,20 +625,20 @@ (*unused*) lemma narrow_RefT: "G\RefT R\T \ \t. T=RefT t" -apply (ind_cases2 "G\RefT R\T") +apply (ind_cases "G\RefT R\T") by auto lemma narrow_RefT2: "G\S\RefT R \ \t. S=RefT t" -apply (ind_cases2 "G\S\RefT R") +apply (ind_cases "G\S\RefT R") by auto (*unused*) lemma narrow_PrimT: "G\PrimT pt\T \ \t. T=PrimT t" -by (ind_cases2 "G\PrimT pt\T") +by (ind_cases "G\PrimT pt\T") lemma narrow_PrimT2: "G\S\PrimT pt \ \t. S=PrimT t \ G\PrimT t\PrimT pt" -by (ind_cases2 "G\S\PrimT pt") +by (ind_cases "G\S\PrimT pt") text {* These narrowing lemmata hold in Bali but are to strong for ordinary @@ -646,22 +646,22 @@ long, int. These lemmata are just for documentation and are not used. *} lemma narrow_PrimT_strong: "G\PrimT pt\T \ T=PrimT pt" -by (ind_cases2 "G\PrimT pt\T") +by (ind_cases "G\PrimT pt\T") lemma narrow_PrimT2_strong: "G\S\PrimT pt \ S=PrimT pt" -by (ind_cases2 "G\S\PrimT pt") +by (ind_cases "G\S\PrimT pt") text {* Specialized versions for booleans also would work for real Java *} lemma narrow_Boolean: "G\PrimT Boolean\T \ T=PrimT Boolean" -by (ind_cases2 "G\PrimT Boolean\T") +by (ind_cases "G\PrimT Boolean\T") lemma narrow_Boolean2: "G\S\PrimT Boolean \ S=PrimT Boolean" -by (ind_cases2 "G\S\PrimT Boolean") +by (ind_cases "G\S\PrimT Boolean") section "casting relation" -inductive2 --{* casting conversion, cf. 5.5 *} +inductive --{* casting conversion, cf. 5.5 *} cast :: "prog \ ty \ ty \ bool" ("_\_\? _" [71,71,71] 70) for G :: prog where @@ -670,20 +670,20 @@ (*unused*) lemma cast_RefT: "G\RefT R\? T \ \t. T=RefT t" -apply (ind_cases2 "G\RefT R\? T") +apply (ind_cases "G\RefT R\? T") by (auto dest: widen_RefT narrow_RefT) lemma cast_RefT2: "G\S\? RefT R \ \t. S=RefT t" -apply (ind_cases2 "G\S\? RefT R") +apply (ind_cases "G\S\? RefT R") by (auto dest: widen_RefT2 narrow_RefT2) (*unused*) lemma cast_PrimT: "G\PrimT pt\? T \ \t. T=PrimT t" -apply (ind_cases2 "G\PrimT pt\? T") +apply (ind_cases "G\PrimT pt\? T") by (auto dest: widen_PrimT narrow_PrimT) lemma cast_PrimT2: "G\S\? PrimT pt \ \t. S=PrimT t \ G\PrimT t\PrimT pt" -apply (ind_cases2 "G\S\? PrimT pt") +apply (ind_cases "G\S\? PrimT pt") by (auto dest: widen_PrimT2 narrow_PrimT2) lemma cast_Boolean: diff -r a455e69c31cc -r b07cff284683 src/HOL/Bali/WellType.thy --- a/src/HOL/Bali/WellType.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Bali/WellType.thy Wed Jul 11 11:16:34 2007 +0200 @@ -246,7 +246,7 @@ "tys" <= (type) "ty + ty list" -inductive2 +inductive wt :: "env \ dyn_ty \ [term,tys] \ bool" ("_,_\_\_" [51,51,51,51] 50) and wt_stmt :: "env \ dyn_ty \ stmt \ bool" ("_,_\_\\" [51,51,51 ] 50) and ty_expr :: "env \ dyn_ty \ [expr ,ty ] \ bool" ("_,_\_\-_" [51,51,51,51] 50) @@ -456,7 +456,7 @@ change_simpset (fn ss => ss delloop "split_all_tac") *} -inductive_cases2 wt_elim_cases [cases set]: +inductive_cases wt_elim_cases [cases set]: "E,dt\In2 (LVar vn) \T" "E,dt\In2 ({accC,statDeclC,s}e..fn)\T" "E,dt\In2 (e.[i]) \T" diff -r a455e69c31cc -r b07cff284683 src/HOL/Extraction/Higman.thy --- a/src/HOL/Extraction/Higman.thy Wed Jul 11 11:14:51 2007 +0200 +++ b/src/HOL/Extraction/Higman.thy Wed Jul 11 11:16:34 2007 +0200 @@ -15,37 +15,37 @@ datatype letter = A | B -inductive2 emb :: "letter list \ letter list \ bool" +inductive emb :: "letter list \ letter list \ bool" where emb0 [Pure.intro]: "emb [] bs" | emb1 [Pure.intro]: "emb as bs \ emb as (b # bs)" | emb2 [Pure.intro]: "emb as bs \ emb (a # as) (a # bs)" -inductive2 L :: "letter list \ letter list list \ bool" +inductive L :: "letter list \ letter list list \ bool" for v :: "letter list" where L0 [Pure.intro]: "emb w v \ L v (w # ws)" | L1 [Pure.intro]: "L v ws \ L v (w # ws)" -inductive2 good :: "letter list list \ bool" +inductive good :: "letter list list \ bool" where good0 [Pure.intro]: "L w ws \ good (w # ws)" | good1 [Pure.intro]: "good ws \ good (w # ws)" -inductive2 R :: "letter \ letter list list \ letter list list \ bool" +inductive R :: "letter \ letter list list \ letter list list \ bool" for a :: letter where R0 [Pure.intro]: "R a [] []" | R1 [Pure.intro]: "R a vs ws \ R a (w # vs) ((a # w) # ws)" -inductive2 T :: "letter \ letter list list \ letter list list \ bool" +inductive T :: "letter \ letter list list \ letter list list \ bool" for a :: letter where T0 [Pure.intro]: "a \ b \ R b ws zs \ T a (w # zs) ((a # w) # zs)" | T1 [Pure.intro]: "T a ws zs \ T a (w # ws) ((a # w) # zs)" | T2 [Pure.intro]: "a \ b \ T a ws zs \ T a ws ((b # w) # zs)" -inductive2 bar :: "letter list list \ bool" +inductive bar :: "letter list list \ bool" where bar1 [Pure.intro]: "good ws \ bar ws" | bar2 [Pure.intro]: "(\w. bar (w # ws)) \ bar ws"