module type S = sig type t type elt = Tree.node val empty : t val var : (int*State.t) -> t val close : ((int*State.t), t) Hashtbl.t -> t -> t val is_open : t -> bool val singleton : elt -> t val cons : elt -> t -> t val snoc : t -> elt -> t val concat : t -> t -> t val concat3 : t -> t -> t -> t val concat4 : t -> t -> t -> t -> t val conscat : elt -> t -> t -> t val conscat3 : elt -> t -> t -> t -> t val conscat4 : elt -> t -> t -> t -> t -> t val subtree_tags : Tree.t -> elt -> Tag.t -> t val subtree_elements : Tree.t -> elt -> t val iter : ( elt -> unit) -> t -> unit val fold : ( elt -> 'a -> 'a) -> t -> 'a -> 'a val length : t -> int val serialize : string -> bool -> Tree.t -> t -> unit end module Count : S with type t = int type clist = | Nil | Cons of Tree.node * clist | Concat of clist * clist | ConsCat of Tree.node * clist * clist | SubtreeTags of Tree.t * Tree.node * Tag.t | SubtreeElts of Tree.t * Tree.node type 'a mat = { mutable clist : clist; mutable length : int } module Mat : S with type t = Tree.node mat val debug : Tree.node mat -> unit module Partial(N : S) : S