fixed typo in print_xml_fast
[SXSI/xpathcomp.git] / ata.mli
1 module TS : sig
2   type t
3   val empty : t
4   val cons : Tree.t -> t -> t
5   val append : Tree.t -> t -> t
6   val concat : t -> t -> t
7   val length  : t -> int
8   val iter : (Tree.t -> unit) -> t -> unit
9 end
10
11 type state = int
12 val mk_state : unit -> state
13
14 type formula_expr =
15     False
16   | True
17   | Or of formula * formula
18   | And of formula * formula
19   | Atom of ([ `Left | `Right | `LLeft | `RRight ] * bool * state)
20 and formula = { fid : int; fkey : int; pos : formula_expr; neg : formula; st : (Ptset.t*Ptset.t*Ptset.t)*(Ptset.t*Ptset.t*Ptset.t); size: int;}
21 val true_ : formula
22 val false_ : formula
23 val atom_ : [`Left | `Right | `LLeft | `RRight ] -> bool -> state -> formula
24 val and_ : formula -> formula -> formula
25 val or_ : formula -> formula -> formula
26 val not_ : formula -> formula 
27 (*val equal_form : formula -> formula -> bool *)
28 val pr_frm : Format.formatter -> formula -> unit
29
30
31 module HTagSet : Hashtbl.S with type key = Ptset.t*Tag.t
32
33 type dispatch = { first : Tree.t -> Tree.t;
34                   flabel : string;
35                   next : Tree.t -> Tree.t -> Tree.t;    
36                   nlabel : string;
37                 }
38 type t = { 
39     id : int;
40     mutable states : Ptset.t;
41     init : Ptset.t;
42     mutable final : Ptset.t;
43     universal : Ptset.t;
44     (* Transitions of the Alternating automaton *)
45     phi : (state,(TagSet.t*(bool*formula*bool)) list) Hashtbl.t;
46     sigma : (dispatch*bool*formula) HTagSet.t;
47 }
48 val dump : Format.formatter -> t -> unit
49     
50 module Transitions : sig
51 type t = state*TagSet.t*bool*formula*bool
52 (* Doing this avoid the parenthesis *)
53 val ( ?< ) : state -> state 
54 val ( >< ) : state -> TagSet.t*bool -> state*(TagSet.t*bool*bool)
55 val ( ><@ ) : state -> TagSet.t*bool -> state*(TagSet.t*bool*bool)
56 val ( >=> ) : state*(TagSet.t*bool*bool) -> formula -> t
57 val ( +| ) : formula -> formula -> formula
58 val ( *& ) : formula -> formula -> formula
59 val ( ** ) : [`Left | `Right | `LLeft | `RRight ] -> state -> formula
60
61 end
62 type transition = Transitions.t
63 val equal_trans : transition -> transition -> bool 
64
65
66
67 (*module BottomUpJumpNew : 
68 sig *)
69   val run : t -> Tree.t -> TS.t*int
70   val run_count : t -> Tree.t -> int
71   val run_time :  t -> Tree.t -> TS.t*int
72 (*end *)
73