X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fparamodulation%2Fpath_indexing.ml;h=72120c7f7cabbabc686c78ed1d0d704d82533c0a;hb=33a02e0b639217093eb63f30169aaa6ac8c78907;hp=bc9bc01f1608fa42d36c369a57808496364a6b08;hpb=bdc855b1b6c9552a49a01769cb906a438ca60cc4;p=helm.git diff --git a/helm/ocaml/paramodulation/path_indexing.ml b/helm/ocaml/paramodulation/path_indexing.ml index bc9bc01f1..72120c7f7 100644 --- a/helm/ocaml/paramodulation/path_indexing.ml +++ b/helm/ocaml/paramodulation/path_indexing.ml @@ -49,8 +49,6 @@ end module PSMap = Map.Make(OrderedPathStringElement);; -(* module PSTrie = Trie.Make(PathStringElementMap);; *) - module OrderedPosEquality = struct type t = Utils.pos * Inference.equality @@ -59,6 +57,10 @@ end module PosEqSet = Set.Make(OrderedPosEquality);; + +module PSTrie = Trie.Make(PSMap);; + +(* (* * Trie: maps over lists. * Copyright (C) 2000 Jean-Christophe FILLIATRE @@ -111,10 +113,11 @@ module PSTrie = struct traverse [] t acc end +*) let index trie equality = - let _, (_, l, r, ordering), _, _ = equality in + let _, _, (_, l, r, ordering), _, _ = equality in let psl = path_strings_of_term 0 l and psr = path_strings_of_term 0 r in let index pos trie ps = @@ -135,7 +138,7 @@ let index trie equality = let remove_index trie equality = - let _, (_, l, r, ordering), _, _ = equality in + let _, _, (_, l, r, ordering), _, _ = equality in let psl = path_strings_of_term 0 l and psr = path_strings_of_term 0 r in let remove_index pos trie ps = @@ -161,7 +164,7 @@ let remove_index trie equality = let in_index trie equality = - let _, (_, l, r, ordering), _, _ = equality in + let _, _, (_, l, r, ordering), _, _ = equality in let psl = path_strings_of_term 0 l and psr = path_strings_of_term 0 r in let meta_convertibility = Inference.meta_convertibility_eq equality in @@ -289,6 +292,12 @@ let rec retrieve_unifiables trie term = ;; +let retrieve_all trie term = + PSTrie.fold + (fun k v s -> PosEqSet.union v s) trie PosEqSet.empty +;; + + let string_of_pstrie trie = let rec to_string level = function | PSTrie.Node (v, map) ->