Module Dnet.Make
Parameters
Signature
type t
type ident
= Ident.t
provided identifier type
type meta
= Meta.t
provided metavariable type
type 'a structure
= 'a T.t
provided parametrized datastructure
type term_pattern
=
|
Term of term_pattern structure
|
Meta of meta
a pattern is a term where each node can be a unification variable
val empty : t
val add : t -> term_pattern -> ident -> t
add t w i
adds a new association (w,i) in t.
val fold_pattern : ('a -> (Idset.t * meta * t) -> 'a) -> 'a -> term_pattern -> t -> Idset.t option * 'a
fold_pattern f acc p dn
folds f on each meta of p, passing the meta and the sub-dnet under it. The result includes:- Some set if identifiers were gathered on the leafs of the term
- None if the pattern contains no leaf (only Metas at the leafs).
val find_match : term_pattern -> t -> Idset.t
find_match p t
returns identifiers of all terms matching p in t.