src/HOL/Tools/Sledgehammer/sledgehammer_util.ML
changeset 36378 f32c567dbcaa
parent 36183 f723348b2231
child 36402 1b20805974c7
     1.1 --- a/src/HOL/Tools/Sledgehammer/sledgehammer_util.ML	Fri Apr 23 18:11:41 2010 +0200
     1.2 +++ b/src/HOL/Tools/Sledgehammer/sledgehammer_util.ML	Fri Apr 23 19:12:49 2010 +0200
     1.3 @@ -6,6 +6,7 @@
     1.4  
     1.5  signature SLEDGEHAMMER_UTIL =
     1.6  sig
     1.7 +  val pairf : ('a -> 'b) -> ('a -> 'c) -> 'a -> 'b * 'c
     1.8    val plural_s : int -> string
     1.9    val serial_commas : string -> string list -> string list
    1.10    val replace_all : string -> string -> string -> string
    1.11 @@ -13,14 +14,13 @@
    1.12    val timestamp : unit -> string
    1.13    val parse_bool_option : bool -> string -> string -> bool option
    1.14    val parse_time_option : string -> string -> Time.time option
    1.15 -  val hashw : word * word -> word
    1.16 -  val hashw_char : Char.char * word -> word
    1.17 -  val hashw_string : string * word -> word
    1.18  end;
    1.19   
    1.20  structure Sledgehammer_Util : SLEDGEHAMMER_UTIL =
    1.21  struct
    1.22  
    1.23 +fun pairf f g x = (f x, g x)
    1.24 +
    1.25  fun plural_s n = if n = 1 then "" else "s"
    1.26  
    1.27  fun serial_commas _ [] = ["??"]
    1.28 @@ -73,11 +73,4 @@
    1.29          SOME (Time.fromMilliseconds msecs)
    1.30      end
    1.31  
    1.32 -(* This hash function is recommended in Compilers: Principles, Techniques, and
    1.33 -   Tools, by Aho, Sethi and Ullman. The hashpjw function, which they
    1.34 -   particularly recommend, triggers a bug in versions of Poly/ML up to 4.2.0. *)
    1.35 -fun hashw (u, w) = Word.+ (u, Word.* (0w65599, w))
    1.36 -fun hashw_char (c, w) = hashw (Word.fromInt (Char.ord c), w)
    1.37 -fun hashw_string (s:string, w) = CharVector.foldl hashw_char w s
    1.38 -
    1.39  end;