src/HOL/Tools/Predicate_Compile/predicate_compile.ML
changeset 36023 d606ca1674a7
parent 36022 c0fa8499e366
child 36027 29a15da9c63d
equal deleted inserted replaced
36022:c0fa8499e366 36023:d606ca1674a7
     7 signature PREDICATE_COMPILE =
     7 signature PREDICATE_COMPILE =
     8 sig
     8 sig
     9   val setup : theory -> theory
     9   val setup : theory -> theory
    10   val preprocess : Predicate_Compile_Aux.options -> string -> theory -> theory
    10   val preprocess : Predicate_Compile_Aux.options -> string -> theory -> theory
    11   val present_graph : bool Unsynchronized.ref
    11   val present_graph : bool Unsynchronized.ref
       
    12   val intro_hook : (theory -> thm -> unit) option Unsynchronized.ref
    12 end;
    13 end;
    13 
    14 
    14 structure Predicate_Compile (*: PREDICATE_COMPILE*) =
    15 structure Predicate_Compile (*: PREDICATE_COMPILE*) =
    15 struct
    16 struct
    16 
    17 
    17 val present_graph = Unsynchronized.ref false
    18 val present_graph = Unsynchronized.ref false
       
    19 
       
    20 val intro_hook = Unsynchronized.ref NONE : (theory -> thm -> unit) option Unsynchronized.ref
       
    21   
    18 
    22 
    19 open Predicate_Compile_Aux;
    23 open Predicate_Compile_Aux;
    20 
    24 
    21 (* Some last processing *)
    25 (* Some last processing *)
    22 
    26 
   112       val _ = print_intross options thy''' "After removing equality premises:" intross5
   116       val _ = print_intross options thy''' "After removing equality premises:" intross5
   113       val intross6 =
   117       val intross6 =
   114         map (fn (s, ths) => (overload_const thy''' s, map (AxClass.overload thy''') ths)) intross5
   118         map (fn (s, ths) => (overload_const thy''' s, map (AxClass.overload thy''') ths)) intross5
   115       val intross7 = map_specs (map (expand_tuples thy''')) intross6
   119       val intross7 = map_specs (map (expand_tuples thy''')) intross6
   116       val intross8 = map_specs (map (eta_contract_ho_arguments thy''')) intross7
   120       val intross8 = map_specs (map (eta_contract_ho_arguments thy''')) intross7
       
   121       val _ = case !intro_hook of NONE => () | SOME f => (map_specs (map (f thy''')) intross8; ())
   117       val _ = print_intross options thy''' "introduction rules before registering: " intross8
   122       val _ = print_intross options thy''' "introduction rules before registering: " intross8
   118       val _ = print_step options "Registering introduction rules..."
   123       val _ = print_step options "Registering introduction rules..."
   119       val thy'''' = fold Predicate_Compile_Core.register_intros intross8 thy'''
   124       val thy'''' = fold Predicate_Compile_Core.register_intros intross8 thy'''
   120     in
   125     in
   121       thy''''
   126       thy''''