src/HOL/Tools/Function/fun.ML
changeset 67149 e61557884799
parent 63352 4eaf35781b23
equal deleted inserted replaced
67148:d24dcac5eb4c 67149:e61557884799
    68           |> apsnd (fn Ts => Ts ---> body_type fT)
    68           |> apsnd (fn Ts => Ts ---> body_type fT)
    69 
    69 
    70         val qs = map Free (Name.invent Name.context "a" n ~~ argTs)
    70         val qs = map Free (Name.invent Name.context "a" n ~~ argTs)
    71       in
    71       in
    72         HOLogic.mk_eq(list_comb (Free (fname, fT), qs),
    72         HOLogic.mk_eq(list_comb (Free (fname, fT), qs),
    73           Const (@{const_name undefined}, rT))
    73           Const (\<^const_name>\<open>undefined\<close>, rT))
    74         |> HOLogic.mk_Trueprop
    74         |> HOLogic.mk_Trueprop
    75         |> fold_rev Logic.all qs
    75         |> fold_rev Logic.all qs
    76       end
    76       end
    77   in
    77   in
    78     map mk_eqn fixes
    78     map mk_eqn fixes
   169 fun add_fun_cmd a b c int = gen_add_fun (fn tac => Function.add_function_cmd a b c tac int)
   169 fun add_fun_cmd a b c int = gen_add_fun (fn tac => Function.add_function_cmd a b c tac int)
   170 
   170 
   171 
   171 
   172 
   172 
   173 val _ =
   173 val _ =
   174   Outer_Syntax.local_theory' @{command_keyword fun}
   174   Outer_Syntax.local_theory' \<^command_keyword>\<open>fun\<close>
   175     "define general recursive functions (short version)"
   175     "define general recursive functions (short version)"
   176     (function_parser fun_config
   176     (function_parser fun_config
   177       >> (fn (config, (fixes, specs)) => add_fun_cmd fixes specs config))
   177       >> (fn (config, (fixes, specs)) => add_fun_cmd fixes specs config))
   178 
   178 
   179 end
   179 end