X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Flambda-delta%2Fsrc%2Fcommon%2Fhierarchy.ml;fp=helm%2Fsoftware%2Flambda-delta%2Fsrc%2Fcommon%2Fhierarchy.ml;h=0000000000000000000000000000000000000000;hb=95872555aaa040a22ad2d93cb1278f79e20da70c;hp=28d95cc82cba6f14904971999362969a98df0aad;hpb=4025c3f5b36025380dcad84bb7a97045d08652f6;p=helm.git diff --git a/helm/software/lambda-delta/src/common/hierarchy.ml b/helm/software/lambda-delta/src/common/hierarchy.ml deleted file mode 100644 index 28d95cc82..000000000 --- a/helm/software/lambda-delta/src/common/hierarchy.ml +++ /dev/null @@ -1,64 +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_______________________________________________________________ *) - -module K = Hashtbl -module P = Scanf -module C = Cps - -type graph = string * (int -> int) - -let sorts = 3 -let sort = K.create sorts - -let default_graph = "Z1" - -(* Internal functions *******************************************************) - -let set_sort h s = - K.add sort h s; succ h - -let graph_of_string err f s = - try - let x = P.sscanf s "Z%u" C.start in - if x > 0 then f (s, fun h -> x + h) else err () - with - P.Scan_failure _ | Failure _ | End_of_file -> err () - -let graph = ref (graph_of_string C.err C.start default_graph) - -(* Interface functions ******************************************************) - -let set_sorts i ss = - List.fold_left set_sort i ss - -let string_of_sort err f h = - try f (K.find sort h) with Not_found -> err () - -let sort_of_string err f s = - let map h n = function - | None when n = s -> Some h - | xh -> xh - in - match K.fold map sort None with - | None -> err () - | Some h -> f h - -let string_of_graph () = fst !graph - -let apply h = snd !graph h - -let set_graph s = - let err () = false in - let f g = graph := g; true in - graph_of_string err f s - -let clear () = - K.clear sort; graph := graph_of_string C.err C.start default_graph