Module Wto_utils.Make

Parameters

module N : Node

Signature

val map : (N.t -> bool -> 'a) -> N.t Wto.partition -> 'a Wto.partition

map f wto applies f to every element of wto while conserving the w.t.o. structure. The second argument of f is true if the argument of f is a head.

val iter : (N.t -> bool -> unit) -> N.t Wto.partition -> unit

iter f wto applies f to every element of wto. The second argument of f is true if the argument of f is a head.

val is_head_of : N.t Wto.partition -> N.t -> N.t -> bool

head_of wto h n returns whether n is inside the component of head h. h must be a head. Returns true also if n = h. Complexity: linear in the number of nodes.

val depth : N.t Wto.partition -> int

Maximum number of heads among all nodes, i.e. maximum number of nested components.