X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Fata.mli;h=650673eda4cc6d85c581f3db327edd5b761cd44f;hp=eada8d02a2a0fecad49284b6ec1aeb05953cf1c5;hb=c36250a4de897883d0080fc369d784abf0e2ebe8;hpb=6ca42ffbd541cede6afcc473b563e54b848ee534 diff --git a/src/ata.mli b/src/ata.mli index eada8d0..650673e 100644 --- a/src/ata.mli +++ b/src/ata.mli @@ -21,6 +21,20 @@ type move = [ `First_child | `Parent | `Previous_sibling | `Stay ] + +module Move : + sig + type t = move + type 'a table + val create_table : 'a -> 'a table + val get : 'a table -> t -> 'a + val set : 'a table -> t -> 'a -> unit + val iter : (t -> 'a -> unit) -> 'a table -> unit + val fold : (t -> 'a -> 'b -> 'b) -> 'a table -> 'b -> 'b + val for_all : (t -> 'a -> bool) -> 'a table -> bool + val exists : (t -> 'a -> bool) -> 'a table -> bool + end + (** Type of moves an automaton can perform *) type predicate = @@ -65,6 +79,7 @@ module Formula : particular kind *) val get_states : t -> StateSet.t (** [get_state f] retrieves all the states occuring in [move] predicates in [f] *) + val get_states_by_move : t -> StateSet.t Move.table end (** Modules representing the Boolean formulae used in transitions *) @@ -98,11 +113,16 @@ val get_selecting_states : t -> StateSet.t (** return the set of selecting states of the automaton *) val get_trans : t -> QNameSet.elt -> StateSet.t -> TransList.t -(** [get_trans auto l q] return the list of transitions taken by [auto] +(** [get_trans auto l q] returns the list of transitions taken by [auto] for label [l] in state [q]. Takes time proportional to the number of transitions in the automaton. *) +val get_form : t -> QNameSet.elt -> State.t -> Formula.t +(** [get_form auto l q] returns a single formula for label [l] in state [q]. + Takes time proportional to the number of transitions in the automaton. + *) + val print : Format.formatter -> t -> unit (** Pretty printing of the automaton *) @@ -121,6 +141,26 @@ val merge : t -> t -> t in parallel *) +val union : t -> t -> t +(** [union a a'] creates a new automaton [a''] that selects node + selected by either [a] or [a'] +*) + +val inter : t -> t -> t +(** [inter a a'] creates a new automaton [a''] that selects node + selected by both [a] and [a'] +*) + +val neg : t -> t +(** [neg a] creates a new automaton [a'] that selects the nodes not + selected by [a] +*) + +val diff : t -> t -> t +(** [diff a a'] creates a new automaton [a''] that select nodes selected + by [a] but not selected by [a'] +*) + module Builder : sig type auto = t