--- a/src/Pure/library.ML Tue Jul 27 17:19:31 1999 +0200
+++ b/src/Pure/library.ML Tue Jul 27 17:30:25 1999 +0200
@@ -153,6 +153,7 @@
val union_int: int list * int list -> int list
val union_string: string list * string list -> string list
val gen_union: ('a * 'a -> bool) -> 'a list * 'a list -> 'a list
+ val gen_inter: ('a * 'b -> bool) -> 'a list * 'b list -> 'a list
val inter: ''a list * ''a list -> ''a list
val inter_int: int list * int list -> int list
val inter_string: string list * string list -> string list
@@ -792,6 +793,12 @@
| (x :: xs) inter_string ys =
if x mem_string ys then x :: (xs inter_string ys) else xs inter_string ys;
+(*generalized intersection*)
+fun gen_inter eq ([], ys) = []
+ | gen_inter eq (x::xs, ys) =
+ if gen_mem eq (x,ys) then x :: gen_inter eq (xs, ys)
+ else gen_inter eq (xs, ys);
+
(*subset*)
fun [] subset ys = true