X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fata.ml;h=3c27ae822656a608ce842882de066d3539403724;hb=a145e1cff02534a93be2544303551c7ea94f0083;hp=b24fd6b70256b430f0cb489f90f5143dd7840136;hpb=a127ef55715b51a4e8b943104af2ebdc60733f0c;p=SXSI%2Fxpathcomp.git diff --git a/src/ata.ml b/src/ata.ml index b24fd6b..3c27ae8 100644 --- a/src/ata.ml +++ b/src/ata.ml @@ -9,25 +9,24 @@ type t = { states : StateSet.t; init : StateSet.t; last : State.t; - - (* Transitions of the Alternating automaton *) + (* Transitions of the Alternating automaton *) trans : (State.t, (TagSet.t * Transition.t) list) Hashtbl.t; marking_states : StateSet.t; topdown_marking_states : StateSet.t; bottom_states : StateSet.t; true_states : StateSet.t - } +} let print ppf a = fprintf ppf - "Automaton (%i) : -States %a -Initial states: %a -Marking states: %a -Topdown marking states: %a -Bottom states: %a -True states: %a -Alternating transitions\n" + "Automaton (%i) :@\n\ + States %a@\n\ + Initial states: %a@\n\ + Marking states: %a@\n\ + Topdown marking states: %a@\n\ + Bottom states: %a@\n\ + True states: %a@\n\ + Alternating transitions:@\n" a.id StateSet.print a.states StateSet.print a.init @@ -37,18 +36,19 @@ Alternating transitions\n" StateSet.print a.true_states; let trs = Hashtbl.fold - (fun _ t acc -> - List.fold_left (fun acc (_, tr) -> tr::acc) acc t) a.trans [] + (fun _ t acc -> List.fold_left (fun acc (_, tr) -> tr::acc) acc t) + a.trans + [] in let sorted_trs = List.stable_sort Transition.compare trs in let strings = Transition.format_list sorted_trs in match strings with - [] -> () - | line::_ -> + | [] -> () + | line::_ -> let sline = Pretty.line (Pretty.length line) in - fprintf ppf "%s\n%!" sline; - List.iter (fun s -> fprintf ppf "%s\n%!" s) strings; - fprintf ppf "%s\n%!" sline + fprintf ppf "%s@\n" sline; + List.iter (fun s -> fprintf ppf "%s@\n" s) strings; + fprintf ppf "%s@\n" sline type jump_kind =