3f25edc981d11a9457e32af3506b28e65947b2d5
[tatoo.git] / src / asta.mli
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                  Lucca Hirschi, ?                                   *)
6 (*                  ?                                                  *)
7 (*                                                                     *)
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   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15
16 (** Implementation of alternating selecting tree automata (ASTA) *)
17
18
19 type state = State.t
20 (** The type of states *)
21
22 type label = QNameSet.t
23 (** The type of labels of the transitions *)
24
25 type formula = Formula.t
26 (** The type of transition formulae *)
27
28 type transition = (state*label*formula)
29 (** The type of transitions *)
30
31 type t
32 (** The type of ASTAs *)
33
34 val transition : t -> state -> label -> formula
35 (** Give the formula which must hold for a current state and label *)
36
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 *)
40
41 val empty : t
42 (** The empty automaton *)
43
44 val any_label : label
45 (** Set of all labels which can occur in a tree *)
46
47 val new_state : unit -> state
48 (** Give a new state (different from all others states) *)
49
50 val add_tr : t -> transition -> bool -> unit
51 (** Add a query transition (recognizing transition if flag=false) to an asta *) 
52
53 val add_reco : t -> state -> unit
54 (** Add a state to the recognizing states of an asta *)
55
56 val add_quer : t -> state -> unit
57 (** Add a state to the query states of an asta *)
58
59 val add_selec : t -> state -> unit
60 (** Add a state to the selecting states of an asta *)
61
62 val add_bot : t -> state -> unit
63 (** Add a state to the bottom states of an asta *)
64
65 val add_top : t -> state -> unit
66 (** Add a state to the top states of an asta *)
67
68 val init_top : t -> unit
69 (** Remove all top states *)
70
71 val top_states : t -> state list
72 (** Give the list of top states of an ASTA *)
73
74 val print : Format.formatter -> t -> unit
75 (** Describe the automaton as text *)
76
77 val to_file : out_channel -> t -> unit
78 (** Outputs the description of the automaton on the given out_channel *)