| 1 | type 'res lookup_res = Label of 'res | Nothing | Everything |
| 2 | |
| 3 | |
| 4 | module Make : |
| 5 | functor (Y : Map.OrderedType) -> |
| 6 | functor (Z : Map.OrderedType) -> |
| 7 | sig |
| 8 | |
| 9 | type 'a decompose_fun = 'a -> (Y.t * 'a list) option |
| 10 | |
| 11 | type t |
| 12 | |
| 13 | val empty : t |
| 14 | |
| 15 | (** [add t f (tree,inf)] adds a structured object [tree] together with |
| 16 | the associated information [inf] to the table [t]; the function |
| 17 | [f] is used to translated [tree] into its prefix decomposition: [f] |
| 18 | must decompose any tree into a label characterizing its root node and |
| 19 | the list of its subtree *) |
| 20 | |
| 21 | type pattern |
| 22 | |
| 23 | val pattern : 'a decompose_fun -> 'a -> pattern |
| 24 | |
| 25 | val add : t -> pattern -> Z.t -> t |
| 26 | |
| 27 | val rmv : t -> pattern -> Z.t -> t |
| 28 | |
| 29 | type 'tree lookup_fun = 'tree -> (Y.t * 'tree list) lookup_res |
| 30 | |
| 31 | |
| 32 | (** [lookup t f tree] looks for trees (and their associated |
| 33 | information) in table [t] such that the structured object [tree] |
| 34 | matches against them; [f] is used to translated [tree] into its |
| 35 | prefix decomposition: [f] must decompose any tree into a label |
| 36 | characterizing its root node and the list of its subtree *) |
| 37 | |
| 38 | val lookup : t -> 'term lookup_fun -> 'term |
| 39 | -> Z.t list |
| 40 | |
| 41 | end |