removed cruft, fixed ptset.ml
[SXSI/xpathcomp.git] / ata.mli
1 type jump_kind = [ `CONTAINS of string | `NOTHING | `TAG of Tag.t ]
2 module State : 
3 sig 
4   include Sigs.T with type t = int
5   val make : unit -> t 
6 end
7
8 module StateSet :
9   sig
10     include Ptset.S with type elt = int
11     val print : Format.formatter -> t -> unit
12   end
13
14 module Formula :
15   sig
16     type 'a expr =
17         False
18       | True
19       | Or of 'a * 'a
20       | And of 'a * 'a
21       | Atom of ([ `LLeft | `Left | `RRight | `Right ] * bool * State.t)
22
23     type t
24     val hash : t -> int
25     val uid : t -> int
26     val equal : t -> t -> bool
27     val expr : t -> t expr
28     val st :
29       t ->
30       (StateSet.t * StateSet.t * StateSet.t) *
31       (StateSet.t * StateSet.t * StateSet.t)
32     val size : t -> int
33     val print : Format.formatter -> t -> unit
34     val is_true : t -> bool
35     val is_false : t -> bool
36     val true_ : t
37     val false_ : t
38     val atom_ :
39       [ `LLeft | `Left | `RRight | `Right ] ->
40       bool -> StateSet.elt -> t
41     val not_ : t -> t
42     val or_ : t -> t -> t
43     val and_ : t -> t -> t
44     module Infix : sig
45     val ( +| ) : t -> t -> t
46     val ( *& ) : t -> t -> t
47     val ( *+ ) :
48       [ `LLeft | `Left | `RRight | `Right ] -> StateSet.elt -> t
49     val ( *- ) :
50       [ `LLeft | `Left | `RRight | `Right ] -> StateSet.elt -> t
51     end
52   end
53 module Transition :
54   sig
55     type node = State.t * bool * Formula.t * bool
56     type data = node
57     type t
58     val make : data -> t
59     val node : t -> data
60     val hash : t -> int
61     val uid : t -> int
62     val equal : t -> t -> bool
63     module Infix : sig
64     val ( ?< ) : State.t -> State.t
65     val ( >< ) : State.t -> TagSet.t * bool -> State.t*(TagSet.t*bool*bool)
66     val ( ><@ ) : State.t -> TagSet.t * bool -> State.t*(TagSet.t*bool*bool)
67     val ( >=> ) : State.t *(TagSet.t*bool*bool) -> Formula.t -> (State.t*TagSet.t*t)
68     end
69     val print : Format.formatter -> t -> unit
70   end
71
72 module SetTagKey : Hashtbl.HashedType with type t = StateSet.t*Tag.t
73
74 module CachedTransTable : Hashtbl.S with type key = SetTagKey.t
75  
76 module Formlist : Ptset.S with type elt = Transition.t
77
78 type 'a t = {
79   id : int;
80   mutable states : StateSet.t;
81   init : StateSet.t;
82   starstate : StateSet.t option;
83   trans : (State.t, (TagSet.t * Transition.t) list) Hashtbl.t;
84   query_string : string;
85 }
86 val dump : Format.formatter -> 'a t -> unit
87
88 module type ResultSet =
89   sig
90     type t
91     val empty : t
92     val cons : Tree.t -> t -> t
93     val concat : t -> t -> t
94     val iter : (Tree.t -> unit) -> t -> unit
95     val fold : (Tree.t -> 'a -> 'a) -> t -> 'a -> 'a
96     val map : (Tree.t -> Tree.t) -> t -> t
97     val length : t -> int
98   end
99
100 module IdSet : ResultSet
101
102 val top_down_count : 'a t -> Tree.t -> int
103 val top_down : 'a t -> Tree.t -> IdSet.t
104 val bottom_up_count :
105   'a t -> Tree.t -> [> `CONTAINS of 'b | `TAG of Tag.t ] -> int