--- a/src/Pure/library.ML Sun Nov 05 21:44:34 2006 +0100
+++ b/src/Pure/library.ML Sun Nov 05 21:44:35 2006 +0100
@@ -220,7 +220,6 @@
val distinct: ('a * 'a -> bool) -> 'a list -> 'a list
val duplicates: ('a * 'a -> bool) -> 'a list -> 'a list
val has_duplicates: ('a * 'a -> bool) -> 'a list -> bool
- val first_duplicate: ('a * 'a -> bool) -> 'a list -> 'a option
(*lists as tables -- see also Pure/General/alist.ML*)
val gen_merge_lists: ('a * 'a -> bool) -> 'a list -> 'a list -> 'a list
@@ -1051,11 +1050,6 @@
| dups (x :: xs) = member eq xs x orelse dups xs;
in dups end;
-fun first_duplicate eq =
- let
- fun dup [] = NONE
- | dup (x :: xs) = if member eq xs x then SOME x else dup xs;
- in dup end;
(** association lists -- legacy operations **)
--- a/src/Pure/thm.ML Sun Nov 05 21:44:34 2006 +0100
+++ b/src/Pure/thm.ML Sun Nov 05 21:44:35 2006 +0100
@@ -1376,9 +1376,9 @@
val freenames = Term.fold_aterms (fn Free (x, _) => insert (op =) x | _ => I) Bi [];
val newBi = Logic.list_rename_params (newnames, Bi);
in
- case first_duplicate (op =) cs of
- SOME c => (warning ("Can't rename. Bound variables not distinct: " ^ c); state)
- | NONE =>
+ (case duplicates (op =) cs of
+ a :: _ => (warning ("Can't rename. Bound variables not distinct: " ^ a); state)
+ | [] =>
(case cs inter_string freenames of
a :: _ => (warning ("Can't rename. Bound/Free variable clash: " ^ a); state)
| [] =>
@@ -1388,7 +1388,7 @@
shyps = shyps,
hyps = hyps,
tpairs = tpairs,
- prop = Logic.list_implies (Bs @ [newBi], C)})
+ prop = Logic.list_implies (Bs @ [newBi], C)}))
end;