src/HOL/Tools/inductive.ML
changeset 53995 1d457fc83f5c
parent 53994 4237859c186d
child 54742 7a86358a3c0b
equal deleted inserted replaced
53994:4237859c186d 53995:1d457fc83f5c
    33   val mk_cases_tac: Proof.context -> tactic
    33   val mk_cases_tac: Proof.context -> tactic
    34   val mk_cases: Proof.context -> term -> thm
    34   val mk_cases: Proof.context -> term -> thm
    35   val inductive_forall_def: thm
    35   val inductive_forall_def: thm
    36   val rulify: Proof.context -> thm -> thm
    36   val rulify: Proof.context -> thm -> thm
    37   val inductive_cases: (Attrib.binding * string list) list -> local_theory ->
    37   val inductive_cases: (Attrib.binding * string list) list -> local_theory ->
    38     thm list list * local_theory
    38     (string * thm list) list * local_theory
    39   val inductive_cases_i: (Attrib.binding * term list) list -> local_theory ->
    39   val inductive_cases_i: (Attrib.binding * term list) list -> local_theory ->
    40     thm list list * local_theory
    40     (string * thm list) list * local_theory
       
    41   val inductive_simps: (Attrib.binding * string list) list -> local_theory ->
       
    42     (string * thm list) list * local_theory
       
    43   val inductive_simps_i: (Attrib.binding * term list) list -> local_theory ->
       
    44     (string * thm list) list * local_theory
    41   type inductive_flags =
    45   type inductive_flags =
    42     {quiet_mode: bool, verbose: bool, alt_name: binding, coind: bool,
    46     {quiet_mode: bool, verbose: bool, alt_name: binding, coind: bool,
    43       no_elim: bool, no_ind: bool, skip_mono: bool}
    47       no_elim: bool, no_ind: bool, skip_mono: bool}
    44   val add_inductive_i:
    48   val add_inductive_i:
    45     inductive_flags -> ((binding * typ) * mixfix) list ->
    49     inductive_flags -> ((binding * typ) * mixfix) list ->
   576       map snd args
   580       map snd args
   577       |> burrow (grouped 10 Par_List.map (mk_cases lthy o prep_prop lthy));
   581       |> burrow (grouped 10 Par_List.map (mk_cases lthy o prep_prop lthy));
   578     val facts =
   582     val facts =
   579       map2 (fn ((a, atts), _) => fn thms => ((a, map (prep_att thy) atts), [(thms, [])]))
   583       map2 (fn ((a, atts), _) => fn thms => ((a, map (prep_att thy) atts), [(thms, [])]))
   580         args thmss;
   584         args thmss;
   581   in lthy |> Local_Theory.notes facts |>> map snd end;
   585   in lthy |> Local_Theory.notes facts end;
   582 
   586 
   583 val inductive_cases = gen_inductive_cases Attrib.intern_src Syntax.read_prop;
   587 val inductive_cases = gen_inductive_cases Attrib.intern_src Syntax.read_prop;
   584 val inductive_cases_i = gen_inductive_cases (K I) Syntax.check_prop;
   588 val inductive_cases_i = gen_inductive_cases (K I) Syntax.check_prop;
   585 
   589 
   586 
   590 
   632   let
   636   let
   633     val thy = Proof_Context.theory_of lthy;
   637     val thy = Proof_Context.theory_of lthy;
   634     val facts = args |> map (fn ((a, atts), props) =>
   638     val facts = args |> map (fn ((a, atts), props) =>
   635       ((a, map (prep_att thy) atts),
   639       ((a, map (prep_att thy) atts),
   636         map (Thm.no_attributes o single o mk_simp_eq lthy o prep_prop lthy) props));
   640         map (Thm.no_attributes o single o mk_simp_eq lthy o prep_prop lthy) props));
   637   in lthy |> Local_Theory.notes facts |>> map snd end;
   641   in lthy |> Local_Theory.notes facts end;
   638 
   642 
   639 val inductive_simps = gen_inductive_simps Attrib.intern_src Syntax.read_prop;
   643 val inductive_simps = gen_inductive_simps Attrib.intern_src Syntax.read_prop;
   640 val inductive_simps_i = gen_inductive_simps (K I) Syntax.check_prop;
   644 val inductive_simps_i = gen_inductive_simps (K I) Syntax.check_prop;
   641 
   645 
   642 
   646