X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fbinaries%2Fprobe%2Foptions.ml;h=0b9487d6bf68d6d15ed8f4faba317b4ae76fa54c;hb=076439def28e649ec384fae038ed021dadd5f75c;hp=981483e29b196ce8fbbae3a593f7f004913bfb12;hpb=2f19651bcec24abfb1bf15ff7e1387daad1f6638;p=helm.git diff --git a/matita/components/binaries/probe/options.ml b/matita/components/binaries/probe/options.ml index 981483e29..0b9487d6b 100644 --- a/matita/components/binaries/probe/options.ml +++ b/matita/components/binaries/probe/options.ml @@ -1,12 +1,12 @@ (* - ||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. + ||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 A = Array @@ -16,7 +16,25 @@ module C = NCic module R = Helm_registry module U = NUri module US = NUri.UriSet -module UH = NUri.UriHash + +module UriPair = struct + + type t = U.uri * U.uri + + let equal (u1l,u1r) (u2l,u2r) = + U.eq u1l u2l && U.eq u1r u2r + + let compare (u1l,u1r) (u2l,u2r) = + match U.compare u1l u2l with + | 0 -> U.compare u1r u2r + | c -> c + + let hash (ul,ur) = + Hashtbl.hash (U.hash ul, U.hash ur) + +end + +module UPS = Set.Make(UriPair) type def_xflavour = [ C.def_flavour | `Inductive @@ -26,6 +44,8 @@ let default_objs = US.empty let default_srcs = US.empty +let default_names = US.empty + let default_remove = [] let default_exclude = [] @@ -48,6 +68,8 @@ let objs = ref default_objs let srcs = ref default_srcs +let names = ref default_names + let remove = ref default_remove let exclude = ref default_exclude @@ -62,7 +84,7 @@ let no_devel = ref default_no_devel let no_init = ref default_no_init -let deps = UH.create 11 +let deps = ref UPS.empty let index_of_xflavour = function | `Inductive -> 0 @@ -83,20 +105,20 @@ let clear_slot i _ = slot.(i) <- 0 let iter_xflavours map = A.iteri (fun _ -> map) slot let add_dep c u = - UH.add deps c u + deps := UPS.add (c,u) !deps let out_deps file = let och = open_out file in - let map a b = + let map (a,b) = P.fprintf och "\"%s\": \"%s\"\n" (U.string_of_uri a) (U.string_of_uri b) in - UH.iter map deps; + UPS.iter map !deps; close_out och let clear () = R.clear (); A.iteri clear_slot slot; - objs := default_objs; srcs := default_srcs; remove := default_remove; - exclude := default_exclude; net := default_net; + objs := default_objs; srcs := default_srcs; names := default_names; + remove := default_remove; exclude := default_exclude; net := default_net; chars := default_chars; debug_lexer := default_debug_lexer; no_devel := default_no_devel; no_init := default_no_init; - UH.reset deps + deps := UPS.empty