36 thm list list * local_theory |
36 thm list list * local_theory |
37 val inductive_cases_i: (Attrib.binding * term list) list -> local_theory -> |
37 val inductive_cases_i: (Attrib.binding * term list) list -> local_theory -> |
38 thm list list * local_theory |
38 thm list list * local_theory |
39 type inductive_flags |
39 type inductive_flags |
40 val add_inductive_i: |
40 val add_inductive_i: |
41 inductive_flags -> ((Binding.T * typ) * mixfix) list -> |
41 inductive_flags -> ((binding * typ) * mixfix) list -> |
42 (string * typ) list -> (Attrib.binding * term) list -> thm list -> local_theory -> |
42 (string * typ) list -> (Attrib.binding * term) list -> thm list -> local_theory -> |
43 inductive_result * local_theory |
43 inductive_result * local_theory |
44 val add_inductive: bool -> bool -> |
44 val add_inductive: bool -> bool -> |
45 (Binding.T * string option * mixfix) list -> |
45 (binding * string option * mixfix) list -> |
46 (Binding.T * string option * mixfix) list -> |
46 (binding * string option * mixfix) list -> |
47 (Attrib.binding * string) list -> |
47 (Attrib.binding * string) list -> |
48 (Facts.ref * Attrib.src list) list -> |
48 (Facts.ref * Attrib.src list) list -> |
49 bool -> local_theory -> inductive_result * local_theory |
49 bool -> local_theory -> inductive_result * local_theory |
50 val add_inductive_global: string -> inductive_flags -> |
50 val add_inductive_global: string -> inductive_flags -> |
51 ((Binding.T * typ) * mixfix) list -> (string * typ) list -> (Attrib.binding * term) list -> |
51 ((binding * typ) * mixfix) list -> (string * typ) list -> (Attrib.binding * term) list -> |
52 thm list -> theory -> inductive_result * theory |
52 thm list -> theory -> inductive_result * theory |
53 val arities_of: thm -> (string * int) list |
53 val arities_of: thm -> (string * int) list |
54 val params_of: thm -> term list |
54 val params_of: thm -> term list |
55 val partition_rules: thm -> thm list -> (string * thm list) list |
55 val partition_rules: thm -> thm list -> (string * thm list) list |
56 val partition_rules': thm -> (thm * 'a) list -> (string * (thm * 'a) list) list |
56 val partition_rules': thm -> (thm * 'a) list -> (string * (thm * 'a) list) list |
61 |
61 |
62 signature INDUCTIVE_PACKAGE = |
62 signature INDUCTIVE_PACKAGE = |
63 sig |
63 sig |
64 include BASIC_INDUCTIVE_PACKAGE |
64 include BASIC_INDUCTIVE_PACKAGE |
65 type add_ind_def |
65 type add_ind_def |
66 val declare_rules: string -> Binding.T -> bool -> bool -> string list -> |
66 val declare_rules: string -> binding -> bool -> bool -> string list -> |
67 thm list -> Binding.T list -> Attrib.src list list -> (thm * string list) list -> |
67 thm list -> binding list -> Attrib.src list list -> (thm * string list) list -> |
68 thm -> local_theory -> thm list * thm list * thm * local_theory |
68 thm -> local_theory -> thm list * thm list * thm * local_theory |
69 val add_ind_def: add_ind_def |
69 val add_ind_def: add_ind_def |
70 val gen_add_inductive_i: add_ind_def -> inductive_flags -> |
70 val gen_add_inductive_i: add_ind_def -> inductive_flags -> |
71 ((Binding.T * typ) * mixfix) list -> (string * typ) list -> (Attrib.binding * term) list -> |
71 ((binding * typ) * mixfix) list -> (string * typ) list -> (Attrib.binding * term) list -> |
72 thm list -> local_theory -> inductive_result * local_theory |
72 thm list -> local_theory -> inductive_result * local_theory |
73 val gen_add_inductive: add_ind_def -> bool -> bool -> |
73 val gen_add_inductive: add_ind_def -> bool -> bool -> |
74 (Binding.T * string option * mixfix) list -> |
74 (binding * string option * mixfix) list -> |
75 (Binding.T * string option * mixfix) list -> |
75 (binding * string option * mixfix) list -> |
76 (Attrib.binding * string) list -> (Facts.ref * Attrib.src list) list -> |
76 (Attrib.binding * string) list -> (Facts.ref * Attrib.src list) list -> |
77 bool -> local_theory -> inductive_result * local_theory |
77 bool -> local_theory -> inductive_result * local_theory |
78 val gen_ind_decl: add_ind_def -> bool -> |
78 val gen_ind_decl: add_ind_def -> bool -> |
79 OuterParse.token list -> (bool -> local_theory -> local_theory) * OuterParse.token list |
79 OuterParse.token list -> (bool -> local_theory -> local_theory) * OuterParse.token list |
80 end; |
80 end; |
718 Attrib.internal (K (Induct.induct_pred name))])))] |> snd |
718 Attrib.internal (K (Induct.induct_pred name))])))] |> snd |
719 end |
719 end |
720 in (intrs', elims', induct', ctxt3) end; |
720 in (intrs', elims', induct', ctxt3) end; |
721 |
721 |
722 type inductive_flags = |
722 type inductive_flags = |
723 {quiet_mode: bool, verbose: bool, kind: string, alt_name: Binding.T, |
723 {quiet_mode: bool, verbose: bool, kind: string, alt_name: binding, |
724 coind: bool, no_elim: bool, no_ind: bool, skip_mono: bool, fork_mono: bool} |
724 coind: bool, no_elim: bool, no_ind: bool, skip_mono: bool, fork_mono: bool} |
725 |
725 |
726 type add_ind_def = |
726 type add_ind_def = |
727 inductive_flags -> |
727 inductive_flags -> |
728 term list -> (Attrib.binding * term) list -> thm list -> |
728 term list -> (Attrib.binding * term) list -> thm list -> |
729 term list -> (Binding.T * mixfix) list -> |
729 term list -> (binding * mixfix) list -> |
730 local_theory -> inductive_result * local_theory |
730 local_theory -> inductive_result * local_theory |
731 |
731 |
732 fun add_ind_def {quiet_mode, verbose, kind, alt_name, coind, no_elim, no_ind, skip_mono, fork_mono} |
732 fun add_ind_def {quiet_mode, verbose, kind, alt_name, coind, no_elim, no_ind, skip_mono, fork_mono} |
733 cs intros monos params cnames_syn ctxt = |
733 cs intros monos params cnames_syn ctxt = |
734 let |
734 let |