src/HOL/Tools/Function/function_common.ML
changeset 52384 80c00a851de5
parent 52383 71df93ff010d
child 53603 59ef06cda7b9
equal deleted inserted replaced
52383:71df93ff010d 52384:80c00a851de5
    14   add_simps : (binding -> binding) -> string -> (binding -> binding) ->
    14   add_simps : (binding -> binding) -> string -> (binding -> binding) ->
    15     Attrib.src list -> thm list -> local_theory -> thm list * local_theory,
    15     Attrib.src list -> thm list -> local_theory -> thm list * local_theory,
    16   case_names : string list,
    16   case_names : string list,
    17   fs : term list,
    17   fs : term list,
    18   R : term,
    18   R : term,
       
    19   dom: term,
    19   psimps: thm list,
    20   psimps: thm list,
    20   pinducts: thm list,
    21   pinducts: thm list,
    21   simps : thm list option,
    22   simps : thm list option,
    22   inducts : thm list option,
    23   inducts : thm list option,
    23   termination : thm,
    24   termination : thm,
    35   add_simps : (binding -> binding) -> string -> (binding -> binding) ->
    36   add_simps : (binding -> binding) -> string -> (binding -> binding) ->
    36     Attrib.src list -> thm list -> local_theory -> thm list * local_theory,
    37     Attrib.src list -> thm list -> local_theory -> thm list * local_theory,
    37   case_names : string list,
    38   case_names : string list,
    38   fs : term list,
    39   fs : term list,
    39   R : term,
    40   R : term,
       
    41   dom: term,
    40   psimps: thm list,
    42   psimps: thm list,
    41   pinducts: thm list,
    43   pinducts: thm list,
    42   simps : thm list option,
    44   simps : thm list option,
    43   inducts : thm list option,
    45   inducts : thm list option,
    44   termination : thm,
    46   termination : thm,
    59   val apply_termination_rule : Proof.context -> int -> tactic
    61   val apply_termination_rule : Proof.context -> int -> tactic
    60   datatype function_result = FunctionResult of
    62   datatype function_result = FunctionResult of
    61    {fs: term list,
    63    {fs: term list,
    62     G: term,
    64     G: term,
    63     R: term,
    65     R: term,
       
    66     dom: term,
    64     psimps : thm list,
    67     psimps : thm list,
    65     simple_pinducts : thm list,
    68     simple_pinducts : thm list,
    66     cases : thm,
    69     cases : thm,
    67     termination : thm,
    70     termination : thm,
    68     domintros : thm list option}
    71     domintros : thm list option}
   138 
   141 
   139 datatype function_result = FunctionResult of
   142 datatype function_result = FunctionResult of
   140  {fs: term list,
   143  {fs: term list,
   141   G: term,
   144   G: term,
   142   R: term,
   145   R: term,
       
   146   dom: term,
   143   psimps : thm list,
   147   psimps : thm list,
   144   simple_pinducts : thm list,
   148   simple_pinducts : thm list,
   145   cases : thm,
   149   cases : thm,
   146   termination : thm,
   150   termination : thm,
   147   domintros : thm list option}
   151   domintros : thm list option}
   148 
   152 
   149 fun transform_function_data ({add_simps, case_names, fs, R, psimps, pinducts,
   153 fun transform_function_data ({add_simps, case_names, fs, R, dom, psimps, pinducts,
   150   simps, inducts, termination, defname, is_partial, cases} : info) phi =
   154   simps, inducts, termination, defname, is_partial, cases} : info) phi =
   151     let
   155     let
   152       val term = Morphism.term phi
   156       val term = Morphism.term phi
   153       val thm = Morphism.thm phi
   157       val thm = Morphism.thm phi
   154       val fact = Morphism.fact phi
   158       val fact = Morphism.fact phi
   155       val name = Binding.name_of o Morphism.binding phi o Binding.name
   159       val name = Binding.name_of o Morphism.binding phi o Binding.name
   156     in
   160     in
   157       { add_simps = add_simps, case_names = case_names,
   161       { add_simps = add_simps, case_names = case_names,
   158         fs = map term fs, R = term R, psimps = fact psimps,
   162         fs = map term fs, R = term R, dom = term dom, psimps = fact psimps,
   159         pinducts = fact pinducts, simps = Option.map fact simps,
   163         pinducts = fact pinducts, simps = Option.map fact simps,
   160         inducts = Option.map fact inducts, termination = thm termination,
   164         inducts = Option.map fact inducts, termination = thm termination,
   161         defname = name defname, is_partial=is_partial, cases = thm cases }
   165         defname = name defname, is_partial=is_partial, cases = thm cases }
   162     end
   166     end
   163 
   167