Change the logging infrastructure:
[SXSI/xpathcomp.git] / src / ata.ml
index 5287ed5..b24fd6b 100644 (file)
@@ -120,9 +120,8 @@ let compute_jump auto tree states l marking =
 
     | _ ->
       if Ptset.Int.mem Tag.pcdata rel_labels then begin
-       LOG("top-down-approx", 3, __ "Computed rel_labels: %a\n"
-         TagSet.print
-         (TagSet.inj_positive rel_labels));
+       LOG(__ "top-down-approx"  3  "Computed rel_labels: %a@\n"
+              TagSet.print (TagSet.inj_positive rel_labels));
        NODE
       end else STAR
 
@@ -210,41 +209,40 @@ let top_down_approx auto states tree =
        (List.sort by_states uniq_states_trs)
     in
     LOG(
-      "top-down-approx", 2,
-        let is_pairwise_disjoint l =
-          List.for_all (fun ((ts, _) as tr) ->
-            List.for_all (fun ((ts', _) as tr') ->
-              (ts == ts' && (by_states tr tr' == 0)) ||
-                TagSet.is_empty (TagSet.cap ts ts')) l) l
-        in
-        let is_complete l = TagSet.positive
-          (List.fold_left (fun acc (ts, _) -> TagSet.cup acc ts)
-             TagSet.empty l)
-          ==
-          (Tree.node_tags tree)
-        in
-        let pr_td_approx fmt td_approx =
-          List.iter (fun (ts,(l,r, m)) ->
-            let ts = if TagSet.cardinal ts >10
-              then TagSet.diff TagSet.any
-                (TagSet.diff
-                   (TagSet.inj_positive (Tree.node_tags tree))
-                   ts)
-              else ts
-            in
-            fprintf fmt "\t%a, %a, %b -> %a, %a\n%!"
-              StateSet.print states
-              TagSet.print ts
-              m
-              StateSet.print l
-              StateSet.print r
-          ) td_approx;
-          fprintf fmt "\n%!"
-        in
-        __ " pairwise-disjoint:%b, complete:%b:\n%a"
-          (is_pairwise_disjoint td_approx)
-          (is_complete td_approx)
-          pr_td_approx td_approx
+      let is_pairwise_disjoint l =
+       List.for_all (fun ((ts, _) as tr) ->
+         List.for_all (fun ((ts', _) as tr') ->
+           (ts == ts' && (by_states tr tr' == 0)) ||
+             TagSet.is_empty (TagSet.cap ts ts')) l) l
+      in
+      let is_complete l = TagSet.positive
+       (List.fold_left (fun acc (ts, _) -> TagSet.cup acc ts)
+          TagSet.empty l)
+       ==
+       (Tree.node_tags tree)
+      in
+      let pr_td_approx fmt td_approx =
+       List.iter (fun (ts,(l,r, m)) ->
+         let ts = if TagSet.cardinal ts >10
+           then TagSet.diff TagSet.any
+             (TagSet.diff
+                (TagSet.inj_positive (Tree.node_tags tree))
+                ts)
+           else ts
+         in
+         fprintf fmt "%a, %a, %b -> %a, %a@\n"
+           StateSet.print states
+           TagSet.print ts
+           m
+           StateSet.print l
+           StateSet.print r
+       ) td_approx;
+       fprintf fmt "\n%!"
+      in
+      __ "top-down-approx" 2 " pairwise-disjoint:%b, complete:%b:@\n%a"
+       (is_pairwise_disjoint td_approx)
+       (is_complete td_approx)
+       pr_td_approx td_approx
     );
     let jump =
       compute_jump
@@ -261,11 +259,10 @@ let get_trans ?(attributes=TagSet.empty) auto states tag =
       let ts = if ts == TagSet.star then TagSet.diff ts attributes else ts
       in
       let b = TagSet.mem tag ts in
-      let () = LOG("transition", 3, __ "Transition: %a, tag=%s, %s\n%!"
-       Transition.print
-       tr
+      let () = LOG(__ "transition" 3 "tag=<%s>, %s: %a7C"
        (Tag.to_string tag)
-       (if b then "selected" else "not selected"))
+       (if b then "    taking" else "not taking")
+       Transition.print tr)
       in
       if b then
        let _, _, _, f = Transition.node tr in