src/ZF/Tools/ind_cases.ML
changeset 12876 a70df1e5bf10
parent 12716 fa4ea2856a31
child 14981 e73f8140af78
equal deleted inserted replaced
12875:bda60442bf02 12876:a70df1e5bf10
    53 fun inductive_cases args thy =
    53 fun inductive_cases args thy =
    54   let
    54   let
    55     val read_prop = ProofContext.read_prop (ProofContext.init thy);
    55     val read_prop = ProofContext.read_prop (ProofContext.init thy);
    56     val mk_cases = smart_cases thy (Simplifier.simpset_of thy) read_prop;
    56     val mk_cases = smart_cases thy (Simplifier.simpset_of thy) read_prop;
    57     val facts = args |> map (fn ((name, srcs), props) =>
    57     val facts = args |> map (fn ((name, srcs), props) =>
    58       (((name, map (Attrib.global_attribute thy) srcs),
    58       ((name, map (Attrib.global_attribute thy) srcs),
    59         map (Thm.no_attributes o single o mk_cases) props), Comment.none));
    59         map (Thm.no_attributes o single o mk_cases) props));
    60   in thy |> IsarThy.theorems_i Drule.lemmaK facts |> #1 end;
    60   in thy |> IsarThy.theorems_i Drule.lemmaK facts |> #1 end;
    61 
    61 
    62 
    62 
    63 (* ind_cases method *)
    63 (* ind_cases method *)
    64 
    64 
    82 (* outer syntax *)
    82 (* outer syntax *)
    83 
    83 
    84 local structure P = OuterParse and K = OuterSyntax.Keyword in
    84 local structure P = OuterParse and K = OuterSyntax.Keyword in
    85 
    85 
    86 val ind_cases =
    86 val ind_cases =
    87   P.and_list1 (P.opt_thm_name ":" -- Scan.repeat1 P.prop --| P.marg_comment)
    87   P.and_list1 (P.opt_thm_name ":" -- Scan.repeat1 P.prop)
    88   >> (Toplevel.theory o inductive_cases);
    88   >> (Toplevel.theory o inductive_cases);
    89 
    89 
    90 val inductive_casesP =
    90 val inductive_casesP =
    91   OuterSyntax.command "inductive_cases"
    91   OuterSyntax.command "inductive_cases"
    92     "create simplified instances of elimination rules (improper)" K.thy_script ind_cases;
    92     "create simplified instances of elimination rules (improper)" K.thy_script ind_cases;