1 (***********************************************************************)
5 (* Lucca Hirschi, LRI UMR8623 *)
6 (* Université Paris-Sud & CNRS *)
8 (* Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (* Recherche Scientifique. All rights reserved. This file is *)
10 (* distributed under the terms of the GNU Lesser General Public *)
11 (* License, with the special exception on linking described in file *)
14 (***********************************************************************)
16 (** Implementation of alternating selecting tree automata (ASTA) *)
20 (** The type of states *)
22 type label = QNameSet.t
23 (** The type of labels of the transitions *)
25 type formula = Formula.t
26 (** The type of transition formulae *)
28 type transition = (state*label*formula)
29 (** The type of transitions *)
32 (** The type of ASTAs *)
34 val transition : t -> state -> label -> formula
35 (** Give the formula which must hold for a current state and label *)
37 val transitions : t -> state -> (label*formula) list * (label*formula) list
38 (** Give the list of labels and formulae from queries and recognizing
39 transitions for a given state *)
41 val transitions_lab : t -> QName.t -> (state*formula) list *(state*formula) list
42 (** Give the list of states and formulae from queries and recognizing
43 transitions for a given tag *)
45 val transitions_st_lab : t -> state -> QName.t -> formula list * formula list
46 (** Give the list of formulae from queries and recognizing transitions for a
47 given state and tag *)
50 (** The empty automaton *)
53 (** Set of all labels which can occur in a tree *)
55 val new_state : unit -> state
56 (** Give a new state (different from all others states) *)
58 val add_tr : t -> transition -> bool -> unit
59 (** Add a query transition (recognizing transition if flag=false) to an asta *)
61 val add_reco : t -> state -> unit
62 (** Add a state to the recognizing states of an asta *)
64 val add_quer : t -> state -> unit
65 (** Add a state to the query states of an asta *)
67 val add_selec : t -> state -> unit
68 (** Add a state to the selecting states of an asta *)
70 val add_bot : t -> state -> unit
71 (** Add a state to the bottom states of an asta *)
73 val add_top : t -> state -> unit
74 (** Add a state to the top states of an asta *)
76 val init_top : t -> unit
77 (** Remove all top states *)
79 val top_states : t -> state list
80 (** Give the list of top states of an ASTA *)
82 val top_states_s : t -> StateSet.t
83 (** Give the set of top states of an ASTA *)
85 val bot_states_s : t -> StateSet.t
86 (** Give the set of bottom states of an ASTA *)
88 val selec_states : t -> StateSet.t
89 (** Give the list of selecting states of an ASTA *)
91 val print : Format.formatter -> t -> unit
94 val to_file : out_channel -> t -> unit
95 (** Outputs the description of the automaton on the given out_channel *)