src/HOL/Tools/function_package/fundef_core.ML
changeset 23189 4574ab8f3b21
parent 22769 6f5068e26b89
child 23766 77e796fe89eb
equal deleted inserted replaced
23188:595a0e24bd8e 23189:4574ab8f3b21
     8 
     8 
     9 signature FUNDEF_CORE =
     9 signature FUNDEF_CORE =
    10 sig
    10 sig
    11     val prepare_fundef : FundefCommon.fundef_config
    11     val prepare_fundef : FundefCommon.fundef_config
    12                          -> string (* defname *)
    12                          -> string (* defname *)
    13                          -> (string * typ * mixfix) (* defined symbol *)
    13                          -> ((string * typ) * mixfix) list (* defined symbol *)
    14                          -> ((string * typ) list * term list * term * term) list (* specification *)
    14                          -> ((string * typ) list * term list * term * term) list (* specification *)
    15                          -> string (* default_value, not parsed yet *)
       
    16                          -> local_theory
    15                          -> local_theory
    17 
    16 
    18                          -> (term   (* f *)
    17                          -> (term   (* f *)
    19                              * thm  (* goalstate *)
    18                              * thm  (* goalstate *)
    20                              * (thm -> FundefCommon.fundef_result) (* continuation *)
    19                              * (thm -> FundefCommon.fundef_result) (* continuation *)
   856     in
   855     in
   857       map2 mk_trsimp clauses psimps
   856       map2 mk_trsimp clauses psimps
   858     end
   857     end
   859 
   858 
   860 
   859 
   861 fun prepare_fundef config defname (fname, fT, mixfix) abstract_qglrs default_str lthy =
   860 fun prepare_fundef config defname [((fname, fT), mixfix)] abstract_qglrs lthy =
   862     let
   861     let
   863       val FundefConfig {domintros, tailrec, ...} = config 
   862       val FundefConfig {domintros, tailrec, default=default_str, ...} = config 
   864                                                          
   863                                                          
   865       val fvar = Free (fname, fT)
   864       val fvar = Free (fname, fT)
   866       val domT = domain_type fT
   865       val domT = domain_type fT
   867       val ranT = range_type fT
   866       val ranT = range_type fT
   868                             
   867