]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/lib/cps.ml
rewritten instantiate code
[helm.git] / helm / software / lambda-delta / lib / cps.ml
index b61fccfa47f148553394d83fb26a5bb369002efc..e42faba498aa4b0806e4264f0b0099d67f9f6e30 100644 (file)
@@ -9,6 +9,8 @@
      \ /   This software is distributed as is, NO WARRANTY.              
       V_______________________________________________________________ *)
 
+let err _ = assert false
+
 let start x = x
 
 let id f x = f x
@@ -60,6 +62,15 @@ let list_iter f map l =
 let rec list_fold_left2 f map a l1 l2 = match l1, l2 with
    | [], []                 -> f a
    | hd1 :: tl1, hd2 :: tl2 -> 
-      let f a = if a = None then f a else list_fold_left2 f map a tl1 tl2 in
+      let f a = list_fold_left2 f map a tl1 tl2 in
       map f a hd1 hd2
-   | _                      -> f None
+   | _                      -> assert false
+
+let list_iter2 f map l1 l2 =
+   let map f () x1 x2 = map f x1 x2 in
+   list_fold_left2 f map () l1 l2
+
+let rec list_mem ?(eq=(=)) a = function
+   | []                   -> false
+   | hd :: _ when eq a hd -> true
+   | _ :: tl              -> list_mem ~eq a tl