X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=ata.mli;h=362bfa826ea00d5b55ccdca3640ba3078e9cc4bd;hb=82361b41bedcd7726f2601111a9591318079a120;hp=cd6610b37873ca945894467ee1b5105a87a772d4;hpb=7489c542a7b7357a1c2bbc436d1d77c601833d3b;p=SXSI%2Fxpathcomp.git diff --git a/ata.mli b/ata.mli index cd6610b..362bfa8 100644 --- a/ata.mli +++ b/ata.mli @@ -1,13 +1,3 @@ -module TS : sig - type t - val empty : t - val cons : Tree.t -> t -> t - val append : Tree.t -> t -> t - val concat : t -> t -> t - val length : t -> int - val iter : (Tree.t -> unit) -> t -> unit -end - type state = int val mk_state : unit -> state @@ -30,22 +20,20 @@ val pr_frm : Format.formatter -> formula -> unit module HTagSet : Hashtbl.S with type key = Ptset.t*Tag.t -type dispatch = { first : Tree.t -> Tree.t; - flabel : string; - next : Tree.t -> Tree.t -> Tree.t; - nlabel : string; - } -type t = { - id : int; - mutable states : Ptset.t; - init : Ptset.t; - mutable final : Ptset.t; - universal : Ptset.t; - (* Transitions of the Alternating automaton *) - phi : (state,(TagSet.t*(bool*formula*bool)) list) Hashtbl.t; - sigma : (dispatch*bool*formula) HTagSet.t; + +type 'a t = { + id : int; + mutable states : Ptset.t; + init : Ptset.t; + mutable final : Ptset.t; + universal : Ptset.t; + starstate : Ptset.t option; + (* Transitions of the Alternating automaton *) + phi : (state,(TagSet.t*(bool*formula*bool)) list) Hashtbl.t; + sigma : (int,('a t -> Tree.t -> Tree.t -> Ptset.t*'a)) Hashtbl.t; } -val dump : Format.formatter -> t -> unit + +val dump : Format.formatter -> 'a t -> unit module Transitions : sig type t = state*TagSet.t*bool*formula*bool @@ -63,11 +51,22 @@ type transition = Transitions.t val equal_trans : transition -> transition -> bool + module type ResultSet = + sig + type t + val empty : t + val cons : Tree.t -> t -> t + val concat : t -> t -> t + val iter : (Tree.t -> unit) -> t -> unit + val fold : (Tree.t -> 'a -> 'a) -> t -> 'a -> 'a + val map : (Tree.t -> Tree.t) -> t -> t + val length : t -> int + end + + module IdSet : ResultSet -(*module BottomUpJumpNew : -sig *) - val run : t -> Tree.t -> TS.t*int - val run_count : t -> Tree.t -> int - val run_time : t -> Tree.t -> TS.t*int -(*end *) + val top_down_count : 'a t -> Tree.t -> int + val top_down : 'a t -> Tree.t -> IdSet.t + type jump_kind = [ `TAG of Tag.t | `CONTAINS of string | `NOTHING ] + val bottom_up_count : 'a t -> Tree.t -> jump_kind -> int