From 9043add656177eeac1491a73d2f3ab92bec0013c Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 29 Dec 2018 14:31:27 -0500 Subject: Imported Upstream version 8.8.2 --- clib/trie.mli | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 clib/trie.mli (limited to 'clib/trie.mli') diff --git a/clib/trie.mli b/clib/trie.mli new file mode 100644 index 00000000..dae346d3 --- /dev/null +++ b/clib/trie.mli @@ -0,0 +1,63 @@ +(************************************************************************) +(* * The Coq Proof Assistant / The Coq Development Team *) +(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) +(* data + (** Get the data at the current node. *) + + val next : t -> label -> t + (** [next t lbl] returns the subtrie of [t] pointed by [lbl]. + @raise Not_found if there is none. *) + + val labels : t -> label list + (** Get the list of defined labels at the current node. *) + + val add : label list -> data -> t -> t + (** [add t path v] adds [v] at path [path] in [t]. *) + + val remove : label list -> data -> t -> t + (** [remove t path v] removes [v] from path [path] in [t]. *) + + val iter : (label list -> data -> unit) -> t -> unit + (** Apply a function to all contents. *) + +end + +module type Grp = +sig + type t + val nil : t + val is_nil : t -> bool + val add : t -> t -> t + val sub : t -> t -> t +end + +module Make (Label : Set.OrderedType) (Data : Grp) : S + with type label = Label.t and type data = Data.t +(** Generating functor, for a given type of labels and data. *) -- cgit v1.2.3