License
[tatoo.git] / src / asta.ml
index 2f40836..19fe29f 100644 (file)
@@ -2,8 +2,8 @@
 (*                                                                     *)
 (*                               TAToo                                 *)
 (*                                                                     *)
-(*                  Lucca Hirschi, ?   *)
-(*                  ?   *)
+(*                   Lucca Hirschi, LRI UMR8623                        *)
+(*                   Université Paris-Sud & CNRS                       *)
 (*                                                                     *)
 (*  Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
 (*  Recherche Scientifique. All rights reserved.  This file is         *)
@@ -13,6 +13,8 @@
 (*                                                                     *)
 (***********************************************************************)
 
+(* utils.ml-> INCLUDE "utils.ml" HASHINT2 () *)
+
 type state = State.t
 
 type label = QNameSet.t
@@ -114,24 +116,27 @@ let top_states ast = StateSet.elements ast.top
 let print fmt asta =
   let print_box fmt flag = 
     let pp = Format.fprintf fmt in
-    Format.fprintf fmt "@[<v 0># Query states: %a@ @]"
+    pp "@[<v 0># Query states: %a@ @]"
       StateSet.print asta.quer;
-    Format.fprintf fmt "@[<v 0># Recognizing states: %a@ @]"
+    pp "@[<v 0># Recognizing states: %a@ @]"
       StateSet.print asta.reco;
-    Format.fprintf fmt "@[<v 0># Selecting states: %a@ @]"
+    pp "@[<v 0># Selecting states: %a@ @]"
       StateSet.print asta.selec;
-    Format.fprintf fmt "@[<v 0># Bottom states: %a@ @]"
+    pp "@[<v 0># Bottom states: %a@ @]"
       StateSet.print asta.bottom;
-    Format.fprintf fmt "@[<v 0># Tom states: %a@ @]"
+    pp "@[<v 0># Top states: %a@ @]"
       StateSet.print asta.top;
-    let print_list_tr fmt z=
-      SetT.iter (fun x -> Format.fprintf fmt "|  %a@ "  Transition.print x) z in
-    let print_box_list fmt trans  =
+    let print_list_tr fmt z =
+      if SetT.is_empty z 
+      then Format.fprintf fmt "ø"
+      else
+       SetT.iter (fun x -> Format.fprintf fmt "|  %a  @ "  Transition.print x) z in
+    let print_box_list fmt trans =
       Format.fprintf fmt "  @[<hov 0>%a @]" print_list_tr trans in
     Format.fprintf fmt "@[<v 0># Queries transitions:@ %a@ @]"
       print_box_list asta.trans_q;
-    Format.fprintf fmt "@[<v 0># Recognizing transitions:@ %a@ @]"
+    Format.fprintf fmt "@[<v 0># Recognizing transitions:@ %a@]"
       print_box_list asta.trans_r in
-  Format.fprintf fmt "@[<v 0> ##### ASTA #####@. %a@ @]@ " print_box 0
+  Format.fprintf fmt "@[<v 1>##### ASTA #####@, %a@ @]@." print_box 0
 
 let to_file out asta = ()