Module Rtree.Automaton

type 'a rtree = 'a t
type state
type 'a t
val make : 'a rtree -> 'a t

Compile a regular tree into an automaton, not necessarily minimal

val initial : 'a t -> state

Get the initial state of the automaton

val data : 'a t -> state -> 'a

Get the data associated to a given state in the automaton

val transitions : 'a t -> state -> state array array

Get the transitions of the automaton from a given state

val move : 'a t -> state -> 'a t

Move the automaton into the given state

val compact : ('a -> 'a -> int) -> 'a t -> 'a t

Given a comparison function on the data, produce a minimal automaton

val inter : ('a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t

Intersection of two automata given an intersection on data. Does not produce a minimal automaton on general.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

Equality of minimal automata, i.e. only valid after compaction

val map : ('a -> 'b) -> 'a t -> 'b t

Map the data of each node