X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fsrc%2Flib%2Fcps.ml;fp=helm%2Fsoftware%2Flambda-delta%2Fsrc%2Flib%2Fcps.ml;h=0000000000000000000000000000000000000000;hb=95872555aaa040a22ad2d93cb1278f79e20da70c;hp=f993ffb049cef6f3930a8da3a60822b2935bd517;hpb=4025c3f5b36025380dcad84bb7a97045d08652f6;p=helm.git diff --git a/helm/software/lambda-delta/src/lib/cps.ml b/helm/software/lambda-delta/src/lib/cps.ml deleted file mode 100644 index f993ffb04..000000000 --- a/helm/software/lambda-delta/src/lib/cps.ml +++ /dev/null @@ -1,88 +0,0 @@ -(* - ||M|| This file is part of HELM, an Hypertextual, Electronic - ||A|| Library of Mathematics, developed at the Computer Science - ||T|| Department, University of Bologna, Italy. - ||I|| - ||T|| HELM is free software; you can redistribute it and/or - ||A|| modify it under the terms of the GNU General Public License - \ / version 2 or (at your option) any later version. - \ / This software is distributed as is, NO WARRANTY. - V_______________________________________________________________ *) - -let err _ = assert false - -let start x = x - -let id f x = f x - -let rec list_sub_strict f l1 l2 = match l1, l2 with - | _, [] -> f l1 - | _ :: tl1, _ :: tl2 -> list_sub_strict f tl1 tl2 - | _ -> assert false - -(* this is not tail recursive *) -let rec list_fold_left f map a = function - | [] -> f a - | hd :: tl -> - let f a = list_fold_left f map a tl in - map f a hd - -(* this is not tail recursive *) -let rec list_rev_map_append f map ~tail = function - | [] -> f tail - | hd :: tl -> - let f hd = list_rev_map_append f map ~tail:(hd :: tail) tl in - map f hd - -(* this is not tail recursive *) -let rec list_forall2 f map l1 l2 = match l1, l2 with - | [], [] -> f true - | hd1 :: tl1, hd2 :: tl2 -> - let f b = if b then list_forall2 f map tl1 tl2 else f false in - map f hd1 hd2 - | _ -> f false - -let list_rev_append f = - list_rev_map_append f (fun f t -> f t) - -let list_rev_map = - list_rev_map_append ~tail:[] - -let list_rev = - list_rev_append ~tail:[] - -let list_iter f map l = - let map f () x = map f x in - list_fold_left f map () l - -(* this is not tail recursive *) -let rec list_fold_left2 f map a l1 l2 = match l1, l2 with - | [], [] -> f a - | hd1 :: tl1, hd2 :: tl2 -> - let f a = list_fold_left2 f map a tl1 tl2 in - map f a hd1 hd2 - | _ -> 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_fold_right f map l a = match l with - | [] -> f a - | hd :: tl -> list_fold_right (map f hd) map tl a - -let rec list_fold_right2 f map l1 l2 a = match l1, l2 with - | [], [] -> f a - | hd1 :: tl1, hd2 :: tl2 -> list_fold_right2 (map f hd1 hd2) map tl1 tl2 a - | _ -> failwith "Cps.list_fold_right2" - -let list_map f map l = - let map f hd a = - let f hd = f (hd :: a) in map f hd - in - list_fold_right f map l [] - -let rec list_mem ?(eq=(=)) a = function - | [] -> false - | hd :: _ when eq a hd -> true - | _ :: tl -> list_mem ~eq a tl