src/HOL/Tools/Sledgehammer/sledgehammer_util.ML
changeset 48318 325c8fd0d762
parent 48316 252f45c04042
child 48383 df75b2d7e26a
equal deleted inserted replaced
48317:e5420161d11d 48318:325c8fd0d762
     7 signature SLEDGEHAMMER_UTIL =
     7 signature SLEDGEHAMMER_UTIL =
     8 sig
     8 sig
     9   val plural_s : int -> string
     9   val plural_s : int -> string
    10   val serial_commas : string -> string list -> string list
    10   val serial_commas : string -> string list -> string list
    11   val simplify_spaces : string -> string
    11   val simplify_spaces : string -> string
       
    12   val time_mult : real -> Time.time -> Time.time
    12   val parse_bool_option : bool -> string -> string -> bool option
    13   val parse_bool_option : bool -> string -> string -> bool option
    13   val parse_time_option : string -> string -> Time.time option
    14   val parse_time_option : string -> string -> Time.time option
    14   val subgoal_count : Proof.state -> int
    15   val subgoal_count : Proof.state -> int
    15   val reserved_isar_keyword_table : unit -> unit Symtab.table
    16   val reserved_isar_keyword_table : unit -> unit Symtab.table
    16   val thms_in_proof : unit Symtab.table option -> thm -> string list
    17   val thms_in_proof : unit Symtab.table option -> thm -> string list
    23 
    24 
    24 fun plural_s n = if n = 1 then "" else "s"
    25 fun plural_s n = if n = 1 then "" else "s"
    25 
    26 
    26 val serial_commas = Try.serial_commas
    27 val serial_commas = Try.serial_commas
    27 val simplify_spaces = strip_spaces false (K true)
    28 val simplify_spaces = strip_spaces false (K true)
       
    29 
       
    30 fun time_mult k t =
       
    31   Time.fromMilliseconds (Real.ceil (k * Real.fromInt (Time.toMilliseconds t)))
    28 
    32 
    29 fun parse_bool_option option name s =
    33 fun parse_bool_option option name s =
    30   (case s of
    34   (case s of
    31      "smart" => if option then NONE else raise Option
    35      "smart" => if option then NONE else raise Option
    32    | "false" => SOME false
    36    | "false" => SOME false