X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic%2Fdiscrimination_tree.mli;h=a311293068247737d0c0232e7c5dae0722e6ce8b;hb=b378b7f4f2a3a897c4b69f44d4d1d54cc4d0aa56;hp=94c51ec576ee4b1184da5889d8d926683ad90866;hpb=f24441c88f3ba0c7870646fc2cfd1cbdf6517178;p=helm.git diff --git a/helm/software/components/cic/discrimination_tree.mli b/helm/software/components/cic/discrimination_tree.mli index 94c51ec57..a31129306 100644 --- a/helm/software/components/cic/discrimination_tree.mli +++ b/helm/software/components/cic/discrimination_tree.mli @@ -23,19 +23,52 @@ * http://cs.unibo.it/helm/. *) -module DiscriminationTreeIndexing : - functor (A : Set.S) -> + +type 'a path_string_elem = + | Constant of 'a * int (* name, arity *) + | Bound of int * int (* rel, arity *) + | Variable (* arity is 0 *) + | Proposition (* arity is 0 *) + | Datatype (* arity is 0 *) + | Dead (* arity is 0 *) +;; + +type 'a path = ('a path_string_elem) list;; + +module type Indexable = sig + type input + type constant_name + val compare: + constant_name path_string_elem -> + constant_name path_string_elem -> int + val string_of_path : constant_name path -> string + val path_string_of : input -> constant_name path +end + +module CicIndexable : Indexable +with type input = Cic.term and type constant_name = UriManager.uri + +module type DiscriminationTree = sig - type t - val iter : t -> (A.t -> unit) -> unit + type input + type data + type dataset + type constant_name + type t + + val iter : t -> (constant_name path -> dataset -> unit) -> unit val empty : t - val index : t -> Cic.term -> A.elt -> t - val remove_index : t -> Cic.term -> A.elt -> t - val in_index : t -> Cic.term -> (A.elt -> bool) -> bool - val retrieve_generalizations : t -> Cic.term -> A.t - val retrieve_unifiables : t -> Cic.term -> A.t + val index : t -> input -> data -> t + val remove_index : t -> input -> data -> t + val in_index : t -> input -> (data -> bool) -> bool + val retrieve_generalizations : t -> input -> dataset + val retrieve_unifiables : t -> input -> dataset end +module Make (I : Indexable) (A : Set.S) : DiscriminationTree +with type constant_name = I.constant_name and type input = I.input +and type data = A.elt and type dataset = A.t +