aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/util.ml
diff options
context:
space:
mode:
authorGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>1999-11-19 14:22:39 +0000
committerGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>1999-11-19 14:22:39 +0000
commitb0382a9829f08282351244839526bd2ffbe6283f (patch)
treea5b6ef413fb056288326d76ac10cb30847af847f /lib/util.ml
parent6f600fd1c528c97f7d2e1016af1650ab62b2b4c1 (diff)
modules Bij, Gmapl, Stock
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@125 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r--lib/util.ml13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 30f1cbeb6..bb5023886 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -91,10 +91,6 @@ let list_assign l n e =
in
assrec [] (l,n)
-let rec list_distinct = function
- | h::t -> (not (List.mem h t)) && list_distinct t
- | [] -> true
-
let list_map_i f =
let rec map_i_rec i = function
| [] -> []
@@ -154,6 +150,15 @@ let rec list_distinct = function
| h::t -> (not (List.mem h t)) && list_distinct t
| _ -> true
+let list_subset l1 l2 =
+ let t2 = Hashtbl.create 151 in
+ List.iter (fun x -> Hashtbl.add t2 x ()) l2;
+ let rec look = function
+ | [] -> true
+ | x::ll -> try Hashtbl.find t2 x; look ll with Not_found -> false
+ in
+ look l1
+
(* Arrays *)
let array_exists f v =