src/HOL/Tools/Function/function_common.ML
changeset 46042 ab32a87ba01a
parent 45294 3c5d3d286055
child 46496 b8920f3fd259
equal deleted inserted replaced
46035:313be214e40a 46042:ab32a87ba01a
    66 val rel_name = suffix "_rel"
    66 val rel_name = suffix "_rel"
    67 val dom_name = suffix "_dom"
    67 val dom_name = suffix "_dom"
    68 
    68 
    69 (* Termination rules *)
    69 (* Termination rules *)
    70 
    70 
       
    71 (* FIXME just one data slot (record) per program unit *)
    71 structure TerminationRule = Generic_Data
    72 structure TerminationRule = Generic_Data
    72 (
    73 (
    73   type T = thm list
    74   type T = thm list
    74   val empty = []
    75   val empty = []
    75   val extend = I
    76   val extend = I
   106         pinducts = fact pinducts, simps = Option.map fact simps,
   107         pinducts = fact pinducts, simps = Option.map fact simps,
   107         inducts = Option.map fact inducts, termination = thm termination,
   108         inducts = Option.map fact inducts, termination = thm termination,
   108         defname = name defname, is_partial=is_partial }
   109         defname = name defname, is_partial=is_partial }
   109     end
   110     end
   110 
   111 
       
   112 (* FIXME just one data slot (record) per program unit *)
   111 structure FunctionData = Generic_Data
   113 structure FunctionData = Generic_Data
   112 (
   114 (
   113   type T = (term * info) Item_Net.T;
   115   type T = (term * info) Item_Net.T;
   114   val empty : T = Item_Net.init (op aconv o pairself fst) (single o fst);
   116   val empty : T = Item_Net.init (op aconv o pairself fst) (single o fst);
   115   val extend = I;
   117   val extend = I;
   166 )
   168 )
   167 
   169 
   168 
   170 
   169 (* Default Termination Prover *)
   171 (* Default Termination Prover *)
   170 
   172 
       
   173 (* FIXME just one data slot (record) per program unit *)
   171 structure TerminationProver = Generic_Data
   174 structure TerminationProver = Generic_Data
   172 (
   175 (
   173   type T = Proof.context -> tactic
   176   type T = Proof.context -> tactic
   174   val empty = (fn _ => error "Termination prover not configured")
   177   val empty = (fn _ => error "Termination prover not configured")
   175   val extend = I
   178   val extend = I
   319     val cnames = map_index (fn (i, _) => mk_case_names i "" 1) bnds |> flat
   322     val cnames = map_index (fn (i, _) => mk_case_names i "" 1) bnds |> flat
   320   in
   323   in
   321     (ts, curry op ~~ bnds o Library.unflat tss, sort, cnames)
   324     (ts, curry op ~~ bnds o Library.unflat tss, sort, cnames)
   322   end
   325   end
   323 
   326 
       
   327 (* FIXME just one data slot (record) per program unit *)
   324 structure Preprocessor = Generic_Data
   328 structure Preprocessor = Generic_Data
   325 (
   329 (
   326   type T = preproc
   330   type T = preproc
   327   val empty : T = empty_preproc check_defs
   331   val empty : T = empty_preproc check_defs
   328   val extend = I
   332   val extend = I