]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/basic_rg/brgOutput.ml
autItem : the uris of the objects involved in the implicit coercions
[helm.git] / helm / software / lambda-delta / basic_rg / brgOutput.ml
index 958408303f6e72af13e3aadcb6b43f75e7441ce0..66c7ed3d87a980350f00e2532ca5992e276fb841 100644 (file)
@@ -29,6 +29,8 @@ type counters = {
    tabbrs: int
 }
 
+let indexes = ref false
+
 let initial_counters = {
    eabsts = 0; eabbrs = 0; tsorts = 0; tlrefs = 0; tgrefs = 0;
    tcasts = 0; tappls = 0; tabsts = 0; tabbrs = 0
@@ -110,7 +112,7 @@ let rec pp_term c frm = function
          | Some (id, _) -> F.fprintf frm "@[%s@]" id
          | None         -> F.fprintf frm "@[#%u@]" i
       in
-      B.get f c i
+      if !indexes then f None else B.get f c i
    | B.GRef s                 -> F.fprintf frm "@[$%s@]" (U.string_of_uri s)
    | B.Cast (u, t)            ->
       F.fprintf frm "@[{%a}.%a@]" (pp_term c) u (pp_term c) t
@@ -131,20 +133,18 @@ let rec pp_term c frm = function
       B.push f c id B.Void
 
 let pp_context frm c =
-   let pp_entry f = function
+   let pp_entry frm = function
       | id, B.Abst w -> 
-         F.fprintf frm "%s : %a\n%!" id (pp_term c) w; f ()
+         F.fprintf frm "@,@[%s : %a@]" id (pp_term c) w
       | id, B.Abbr v -> 
-         F.fprintf frm "%s = %a\n%!" id (pp_term c) v; f ()
+         F.fprintf frm "@,@[%s = %a@]" id (pp_term c) v
       | id, B.Void   -> 
-         F.fprintf frm "%s\n%!" id; f ()
+         F.fprintf frm "@,%s" id
    in
-   let f _ es = C.list_iter C.start pp_entry (List.rev es) in
+   let iter map frm l = List.iter (map frm) l in
+   let f _ es = F.fprintf frm "%a" (iter pp_entry) (List.rev es) in
    B.contents f c
 
-let pp_term frm c t = 
-   F.fprintf frm "%a\n%!" (pp_term c) t
-
 let specs = {
    L.pp_term = pp_term; L.pp_context = pp_context
 }