src/HOL/Tools/Sledgehammer/sledgehammer_util.ML
changeset 51007 4f694d52bf62
parent 50735 6b232d76cbc9
child 51010 afd0213a3dab
equal deleted inserted replaced
51006:0ecffccf9359 51007:4f694d52bf62
     9   val sledgehammerN : string
     9   val sledgehammerN : string
    10   val log2 : real -> real
    10   val log2 : real -> real
    11   val plural_s : int -> string
    11   val plural_s : int -> string
    12   val serial_commas : string -> string list -> string list
    12   val serial_commas : string -> string list -> string list
    13   val simplify_spaces : string -> string
    13   val simplify_spaces : string -> string
       
    14   val triple_self : ('a -> 'b) -> 'a * 'a * 'a -> 'b * 'b * 'b
    14   val with_cleanup : ('a -> unit) -> ('a -> 'b) -> 'a -> 'b
    15   val with_cleanup : ('a -> unit) -> ('a -> 'b) -> 'a -> 'b
    15   val infinite_timeout : Time.time
    16   val infinite_timeout : Time.time
    16   val time_mult : real -> Time.time -> Time.time
    17   val time_mult : real -> Time.time -> Time.time
    17   val parse_bool_option : bool -> string -> string -> bool option
    18   val parse_bool_option : bool -> string -> string -> bool option
    18   val parse_time_option : string -> string -> Time.time option
    19   val parse_time_option : string -> string -> Time.time option
    40 
    41 
    41 fun plural_s n = if n = 1 then "" else "s"
    42 fun plural_s n = if n = 1 then "" else "s"
    42 
    43 
    43 val serial_commas = Try.serial_commas
    44 val serial_commas = Try.serial_commas
    44 val simplify_spaces = strip_spaces false (K true)
    45 val simplify_spaces = strip_spaces false (K true)
       
    46 
       
    47 fun triple_self f (x, y, z) = (f x, f y, f z)
    45 
    48 
    46 fun with_cleanup clean_up f x =
    49 fun with_cleanup clean_up f x =
    47   Exn.capture f x
    50   Exn.capture f x
    48   |> tap (fn _ => clean_up x)
    51   |> tap (fn _ => clean_up x)
    49   |> Exn.release
    52   |> Exn.release