X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fcommon%2Fhierarchy.ml;h=f8a58dc0f37bf180d4ec6c07eeb74e0ad743f910;hb=0920a5755553774f5b41d7603318ea997ecbdca5;hp=abe23e10a04e4a195bd1e6592e2747deac003818;hpb=de66af7241ad8ab71d5857d14570e4662f2488dc;p=helm.git diff --git a/helm/software/lambda-delta/common/hierarchy.ml b/helm/software/lambda-delta/common/hierarchy.ml index abe23e10a..f8a58dc0f 100644 --- a/helm/software/lambda-delta/common/hierarchy.ml +++ b/helm/software/lambda-delta/common/hierarchy.ml @@ -16,26 +16,24 @@ module C = Cps type graph = string * (int -> int) let sorts = 2 -let sort = H.create sorts -let index = ref 0 +let sort = H.create sorts (* Internal functions *******************************************************) -let set_sort f (h:int) (s:string) = - H.add sort h s; f (succ h) +let set_sort h s = + H.add sort h s; succ h (* Interface functions ******************************************************) -let set_new_sorts f ss = - let f i = index := i; f i in - C.list_fold_left f set_sort !index ss +let set_sorts ss i = + List.fold_left set_sort i ss let get_sort err f h = try f (H.find sort h) with Not_found -> err () -let string_of_graph f (s, _) = f s +let string_of_graph (s, _) = s -let apply f (_, g) h = f (g h) +let apply (_, g) h = (g h) let graph_of_string err f s = try