src/HOL/Tools/Metis/metis_reconstruct.ML
changeset 40665 1a65f0c74827
parent 40264 b91e2e16d994
child 40724 d01a1b3ab23d
equal deleted inserted replaced
40664:e023788a91a1 40665:1a65f0c74827
    11 sig
    11 sig
    12   type mode = Metis_Translate.mode
    12   type mode = Metis_Translate.mode
    13 
    13 
    14   val trace : bool Config.T
    14   val trace : bool Config.T
    15   val trace_msg : Proof.context -> (unit -> string) -> unit
    15   val trace_msg : Proof.context -> (unit -> string) -> unit
       
    16   val verbose : bool Config.T
       
    17   val verbose_warning : Proof.context -> string -> unit
    16   val lookth : (Metis_Thm.thm * 'a) list -> Metis_Thm.thm -> 'a
    18   val lookth : (Metis_Thm.thm * 'a) list -> Metis_Thm.thm -> 'a
    17   val untyped_aconv : term -> term -> bool
    19   val untyped_aconv : term -> term -> bool
    18   val replay_one_inference :
    20   val replay_one_inference :
    19     Proof.context -> mode -> (string * term) list * int Unsynchronized.ref
    21     Proof.context -> mode -> (string * term) list * int Unsynchronized.ref
    20     -> Metis_Thm.thm * Metis_Proof.inference -> (Metis_Thm.thm * thm) list
    22     -> Metis_Thm.thm * Metis_Proof.inference -> (Metis_Thm.thm * thm) list
    28 struct
    30 struct
    29 
    31 
    30 open Metis_Translate
    32 open Metis_Translate
    31 
    33 
    32 val (trace, trace_setup) = Attrib.config_bool "trace_metis" (K false)
    34 val (trace, trace_setup) = Attrib.config_bool "trace_metis" (K false)
       
    35 val (verbose, verbose_setup) = Attrib.config_bool "verbose_metis" (K true)
    33 
    36 
    34 fun trace_msg ctxt msg = if Config.get ctxt trace then tracing (msg ()) else ()
    37 fun trace_msg ctxt msg = if Config.get ctxt trace then tracing (msg ()) else ()
       
    38 fun verbose_warning ctxt msg =
       
    39   if Config.get ctxt verbose then warning msg else ()
    35 
    40 
    36 datatype term_or_type = SomeTerm of term | SomeType of typ
    41 datatype term_or_type = SomeTerm of term | SomeType of typ
    37 
    42 
    38 fun terms_of [] = []
    43 fun terms_of [] = []
    39   | terms_of (SomeTerm t :: tts) = t :: terms_of tts
    44   | terms_of (SomeTerm t :: tts) = t :: terms_of tts
   819       handle ERROR _ =>
   824       handle ERROR _ =>
   820              error ("Cannot replay Metis proof in Isabelle:\n\
   825              error ("Cannot replay Metis proof in Isabelle:\n\
   821                     \Error when discharging Skolem assumptions.")
   826                     \Error when discharging Skolem assumptions.")
   822     end
   827     end
   823 
   828 
   824 val setup = trace_setup
   829 val setup = trace_setup #> verbose_setup
   825 
   830 
   826 end;
   831 end;